[gnome-subtitles] Set selection type according to the selected subtitles



commit 94a85835f810839e0de4a32c82fcc57bcc10846d
Author: Pedro Castro <mail pedrocastro org>
Date:   Sun Jun 28 23:01:10 2009 +0100

    Set selection type according to the selected subtitles

 src/Glade/TimingsAdjustDialog.glade              |    4 ++--
 src/GnomeSubtitles/Dialog/TimingsAdjustDialog.cs |    8 +++-----
 2 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/Glade/TimingsAdjustDialog.glade b/src/Glade/TimingsAdjustDialog.glade
index bb26b0a..50d5698 100644
--- a/src/Glade/TimingsAdjustDialog.glade
+++ b/src/Glade/TimingsAdjustDialog.glade
@@ -286,8 +286,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">selectedRangeRadioButton</property>
                         <signal name="toggled" handler="OnToggleAllSubtitles"/>
                       </widget>
                       <packing>
@@ -303,8 +303,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>
                         <signal name="toggled" handler="OnToggleSelectedSubtitles"/>
                       </widget>
                       <packing>
diff --git a/src/GnomeSubtitles/Dialog/TimingsAdjustDialog.cs b/src/GnomeSubtitles/Dialog/TimingsAdjustDialog.cs
index 8587824..5f307dc 100644
--- a/src/GnomeSubtitles/Dialog/TimingsAdjustDialog.cs
+++ b/src/GnomeSubtitles/Dialog/TimingsAdjustDialog.cs
@@ -76,12 +76,10 @@ public class TimingsAdjustDialog : GladeDialog {
 	}
 
 	private void SetSelectionType () {
-		int selectionCount = Core.Base.Ui.View.Selection.Count;
-		int subtitleCount = Core.Base.Document.Subtitles.Count;
-		if ((selectionCount >= 2) && (selectionCount < subtitleCount))
-			selectedRangeRadioButton.Active = true;
+		if (Core.Base.Ui.View.Selection.Count < 2)
+			allSubtitlesRadioButton.Active = true;
 		else
-			SetApplyToAll(); //It's already selected by default, only need to set values
+			SetApplyToSelection(); //It's already selected by default, only need to set values
 	}
 
 	private void SetApplyToAll () {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]