[gnome-subtitles] Always use Selected Subtitles as the default selection mode
- From: Pedro Daniel da Rocha Melo e Castro <pcastro src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-subtitles] Always use Selected Subtitles as the default selection mode
- Date: Sun, 28 Jun 2009 22:01:46 +0000 (UTC)
commit 51c8a56eb007c67a806fe15b1d262f4b16846e2b
Author: Pedro Castro <mail pedrocastro org>
Date: Sun Jun 28 22:53:43 2009 +0100
Always use Selected Subtitles as the default selection mode
src/Glade/TimingsShiftDialog.glade | 8 ++++----
src/GnomeSubtitles/Dialog/TimingsShiftDialog.cs | 20 +++++++-------------
2 files changed, 11 insertions(+), 17 deletions(-)
---
diff --git a/src/Glade/TimingsShiftDialog.glade b/src/Glade/TimingsShiftDialog.glade
index 9b182e6..2c1675e 100644
--- a/src/Glade/TimingsShiftDialog.glade
+++ b/src/Glade/TimingsShiftDialog.glade
@@ -110,8 +110,8 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="active">True</property>
<property name="draw_indicator">True</property>
+ <property name="group">selectedSubtitlesRadioButton</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -126,8 +126,8 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
+ <property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">allSubtitlesRadioButton</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -143,7 +143,7 @@
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- <property name="group">allSubtitlesRadioButton</property>
+ <property name="group">selectedSubtitlesRadioButton</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -159,7 +159,7 @@
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- <property name="group">allSubtitlesRadioButton</property>
+ <property name="group">selectedSubtitlesRadioButton</property>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/src/GnomeSubtitles/Dialog/TimingsShiftDialog.cs b/src/GnomeSubtitles/Dialog/TimingsShiftDialog.cs
index 8201228..1c705d3 100644
--- a/src/GnomeSubtitles/Dialog/TimingsShiftDialog.cs
+++ b/src/GnomeSubtitles/Dialog/TimingsShiftDialog.cs
@@ -48,11 +48,6 @@ public class TimingsShiftDialog : GladeDialog {
UpdateContents(true);
}
- /* Overriden members */
-
- public override DialogScope Scope {
- get { return DialogScope.Document; }
- }
/* Methods */
@@ -66,7 +61,7 @@ public class TimingsShiftDialog : GladeDialog {
private void UpdateContents (bool initializing) {
UpdateFromTimingMode(Base.TimingMode, initializing);
UpdateFromSelection();
- UpdateSpinButtonValue();
+ UpdateSpinButtonValue(initializing);
}
private void InitSpinButton () {
@@ -88,15 +83,14 @@ public class TimingsShiftDialog : GladeDialog {
}
private void UpdateFromSelection () {
- bool sensitive = (Core.Base.Ui.View.Selection.Count == 1);
- fromFirstSubtitleToSelectionRadioButton.Sensitive = sensitive;
- fromSelectionToLastSubtitleRadioButton.Sensitive = sensitive;
-
- if ((!sensitive) && (!allSubtitlesRadioButton.Active) && (!selectedSubtitlesRadioButton.Active))
- selectedSubtitlesRadioButton.Active = true;
+ int selectionCount = Core.Base.Ui.View.Selection.Count;
+ fromFirstSubtitleToSelectionRadioButton.Sensitive = (selectionCount == 1);
+ fromSelectionToLastSubtitleRadioButton.Sensitive = (selectionCount == 1);
+
+ selectedSubtitlesRadioButton.Active = true;
}
- private void UpdateSpinButtonValue () {
+ private void UpdateSpinButtonValue (bool initializing) {
if (!Core.Base.Ui.Video.IsLoaded) {
SetSpinButtonValue(0);
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]