gnome-subtitles r1001 - in trunk/src/GnomeSubtitles: Commands Core Dialogs



Author: pcastro
Date: Sun Jun  8 01:04:38 2008
New Revision: 1001
URL: http://svn.gnome.org/viewvc/gnome-subtitles?rev=1001&view=rev

Log:
Code cleanup.


Modified:
   trunk/src/GnomeSubtitles/Commands/ChangeFrameRateCommand.cs
   trunk/src/GnomeSubtitles/Core/Clipboards.cs
   trunk/src/GnomeSubtitles/Core/EventHandlers.cs
   trunk/src/GnomeSubtitles/Core/GUI.cs
   trunk/src/GnomeSubtitles/Core/Menus.cs
   trunk/src/GnomeSubtitles/Core/Search.cs
   trunk/src/GnomeSubtitles/Dialogs/AboutDialog.cs
   trunk/src/GnomeSubtitles/Dialogs/EncodingsDialog.cs
   trunk/src/GnomeSubtitles/Dialogs/FileOpenDialog.cs
   trunk/src/GnomeSubtitles/Dialogs/FilePropertiesDialog.cs
   trunk/src/GnomeSubtitles/Dialogs/FileSaveAsDialog.cs
   trunk/src/GnomeSubtitles/Dialogs/HeadersDialog.cs
   trunk/src/GnomeSubtitles/Dialogs/PreferencesDialog.cs
   trunk/src/GnomeSubtitles/Dialogs/ReportBugWindow.cs
   trunk/src/GnomeSubtitles/Dialogs/SaveConfirmationDialog.cs
   trunk/src/GnomeSubtitles/Dialogs/SearchDialog.cs
   trunk/src/GnomeSubtitles/Dialogs/SetLanguageDialog.cs
   trunk/src/GnomeSubtitles/Dialogs/SubtitleFileChooserDialog.cs
   trunk/src/GnomeSubtitles/Dialogs/TimingsAdjustDialog.cs
   trunk/src/GnomeSubtitles/Dialogs/TimingsShiftDialog.cs

Modified: trunk/src/GnomeSubtitles/Commands/ChangeFrameRateCommand.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Commands/ChangeFrameRateCommand.cs	(original)
+++ trunk/src/GnomeSubtitles/Commands/ChangeFrameRateCommand.cs	Sun Jun  8 01:04:38 2008
@@ -33,7 +33,7 @@
 		SetFrameRate(storedFrameRate);
 		storedFrameRate = previousFrameRate;
 		
-		UpdateMenuItem(); //TODO: is this needed? Need to refactor this
+		UpdateMenuItem();
 		return true;
 	}
 	

Modified: trunk/src/GnomeSubtitles/Core/Clipboards.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Core/Clipboards.cs	(original)
+++ trunk/src/GnomeSubtitles/Core/Clipboards.cs	Sun Jun  8 01:04:38 2008
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2006 Pedro Castro
+ * Copyright (C) 2006,2008 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -23,7 +23,6 @@
 
 namespace GnomeSubtitles {
 
-//TODO maybe this can be optimized (not tracking owner changes to primary)
 public class Clipboards {
 	private Clipboard clipboard = null;
 	private Clipboard primary = null;

Modified: trunk/src/GnomeSubtitles/Core/EventHandlers.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Core/EventHandlers.cs	(original)
+++ trunk/src/GnomeSubtitles/Core/EventHandlers.cs	Sun Jun  8 01:04:38 2008
@@ -25,7 +25,6 @@
 
 namespace GnomeSubtitles {
 
-/* TODO: Think about splitting this and using different methods in glade */
 public class EventHandlers {
 
 	public EventHandlers () {
@@ -173,7 +172,6 @@
 	
 	/* Search Menu */
 	
-		
 	public void OnSearchFind (object o, EventArgs args) {
 		Global.GUI.View.Search.ShowFind();
 	}

Modified: trunk/src/GnomeSubtitles/Core/GUI.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Core/GUI.cs	(original)
+++ trunk/src/GnomeSubtitles/Core/GUI.cs	Sun Jun  8 01:04:38 2008
@@ -51,7 +51,7 @@
 		menus = new Menus();
 		status = new Status();
 
-		glade.Autoconnect(handlers); //TODO think about using separate connections for different parts of the GUI
+		glade.Autoconnect(handlers);
 		
 		window.Visible = true;
     }
@@ -307,7 +307,7 @@
     	try {
     		Encoding encoding =  CodePageToEncoding(codePage);
     		Global.CreateDocumentOpen(path, encoding);
-			view.Selection.SelectFirst(); //TODO is this needed?
+			view.Selection.SelectFirst();
 		
 			if (videoFilename != String.Empty)
 				OpenVideo(videoFilename);

Modified: trunk/src/GnomeSubtitles/Core/Menus.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Core/Menus.cs	(original)
+++ trunk/src/GnomeSubtitles/Core/Menus.cs	Sun Jun  8 01:04:38 2008
@@ -26,7 +26,8 @@
 namespace GnomeSubtitles {
 
 public class Menus {
-	private Tooltips tooltips = new Tooltips(); //TODO Deprecated class, scheduled for substitution when gtk# 2.12 is available in all major distros (use SVN revision 968)
+	#pragma warning disable 612 //TODO Tooltips has been deprecated
+	private Tooltips tooltips = new Tooltips(); //TODO Tooltips has been deprecated, scheduled for substitution when gtk# 2.12 is available in all major distros (use SVN revision 968)
 
 	/* Constant strings */
 	private string videoTagText = Catalog.GetString("Video");

Modified: trunk/src/GnomeSubtitles/Core/Search.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Core/Search.cs	(original)
+++ trunk/src/GnomeSubtitles/Core/Search.cs	Sun Jun  8 01:04:38 2008
@@ -91,8 +91,7 @@
 	private void InitDialog (bool showReplace) {
 		dialog = Global.Dialogs.SearchDialog;
 	
-		dialog.ShowReplace = showReplace;
-		dialog.Show();
+		dialog.Show(showReplace);
 	}
 
 	/// <summary>Finds text in the subtitles using the specified direction and the options set in the Find dialog.</summary>

Modified: trunk/src/GnomeSubtitles/Dialogs/AboutDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/AboutDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/AboutDialog.cs	Sun Jun  8 01:04:38 2008
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2006-2007 Pedro Castro
+ * Copyright (C) 2006-2008 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -53,7 +53,8 @@
 	private void AboutDialogOpenEmail (Gtk.AboutDialog about, string email) {
 		Util.OpenSendEmail(email);
 	}
-		
+	
+	#pragma warning disable 618 //TODO Name has been deprecated
 	private void SetInfo () {
 		dialog.Name = "Gnome Subtitles"; //TODO Deprecated property, need to change to ProgramName. Scheduled for substitution when gtk# 2.12 is available in all major distros. 
 		dialog.Comments += "\n\nUsing SubLib " + Global.Execution.SubLibVersion;

Modified: trunk/src/GnomeSubtitles/Dialogs/EncodingsDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/EncodingsDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/EncodingsDialog.cs	Sun Jun  8 01:04:38 2008
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2007 Pedro Castro
+ * Copyright (C) 2007-2008 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,11 +36,10 @@
 
 	/* Widgets */
 	
-	[WidgetAttribute] private TreeView availableTreeView;
-	[WidgetAttribute] private TreeView shownTreeView;
-	[WidgetAttribute] private Button buttonAdd;
-	[WidgetAttribute] private Button buttonRemove;
-
+	[WidgetAttribute] private TreeView availableTreeView = null;
+	[WidgetAttribute] private TreeView shownTreeView = null;
+	[WidgetAttribute] private Button buttonAdd = null;
+	[WidgetAttribute] private Button buttonRemove = null;
 
 	public EncodingsDialog () : base(gladeFilename) {
 		FillAvailableEncodings();

Modified: trunk/src/GnomeSubtitles/Dialogs/FileOpenDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/FileOpenDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/FileOpenDialog.cs	Sun Jun  8 01:04:38 2008
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2006-2007 Pedro Castro
+ * Copyright (C) 2006-2008 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -40,9 +40,8 @@
 	private const string gladeFilename = "FileOpenDialog.glade";
 
 	/* Widgets */
-	[WidgetAttribute] private ComboBox videoComboBox;
-	[WidgetAttribute] private Label videoLabel;
-	
+	[WidgetAttribute] private ComboBox videoComboBox = null;
+	[WidgetAttribute] private Label videoLabel = null;
 	
 	public FileOpenDialog () : this(true, Catalog.GetString("Open File")) {
 	}

Modified: trunk/src/GnomeSubtitles/Dialogs/FilePropertiesDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/FilePropertiesDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/FilePropertiesDialog.cs	Sun Jun  8 01:04:38 2008
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2007 Pedro Castro
+ * Copyright (C) 2007-2008 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -33,11 +33,11 @@
 
 	/* Widgets */
 
-	[WidgetAttribute] private Label nameValueLabel;
-	[WidgetAttribute] private Label pathValueLabel;
-	[WidgetAttribute] private Label encodingValueLabel;
-	[WidgetAttribute] private Label subtitleFormatValueLabel;
-	[WidgetAttribute] private Label timingModeValueLabel;
+	[WidgetAttribute] private Label nameValueLabel = null;
+	[WidgetAttribute] private Label pathValueLabel = null;
+	[WidgetAttribute] private Label encodingValueLabel = null;
+	[WidgetAttribute] private Label subtitleFormatValueLabel = null;
+	[WidgetAttribute] private Label timingModeValueLabel = null;
 	
 	public FilePropertiesDialog () : base(gladeFilename) {
 		FillLabelValues();

Modified: trunk/src/GnomeSubtitles/Dialogs/FileSaveAsDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/FileSaveAsDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/FileSaveAsDialog.cs	Sun Jun  8 01:04:38 2008
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2006-2007 Pedro Castro
+ * Copyright (C) 2006-2008 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -38,8 +38,8 @@
 	
 	/* Widgets */
 	
-	[WidgetAttribute] private ComboBox formatComboBox;
-	[WidgetAttribute] private ComboBox newlineTypeComboBox;
+	[WidgetAttribute] private ComboBox formatComboBox = null;
+	[WidgetAttribute] private ComboBox newlineTypeComboBox = null;
 
 	public FileSaveAsDialog (SubtitleTextType textType) : base(gladeFilename, true) {
 		this.textType = textType;

Modified: trunk/src/GnomeSubtitles/Dialogs/HeadersDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/HeadersDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/HeadersDialog.cs	Sun Jun  8 01:04:38 2008
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2006-2007 Pedro Castro
+ * Copyright (C) 2006-2008 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,63 +36,63 @@
 	/* Widgets */
 	
 	/* KaraokeLyricsLRC fields */
-	[WidgetAttribute] private Entry entryKaraokeLRCTitle;
-	[WidgetAttribute] private Entry entryKaraokeLRCAuthor;
-	[WidgetAttribute] private Entry entryKaraokeLRCArtist;
-	[WidgetAttribute] private Entry entryKaraokeLRCAlbum;
-	[WidgetAttribute] private Entry entryKaraokeLRCMaker;
-	[WidgetAttribute] private Entry entryKaraokeLRCVersion;
-	[WidgetAttribute] private Entry entryKaraokeLRCProgram;
+	[WidgetAttribute] private Entry entryKaraokeLRCTitle = null;
+	[WidgetAttribute] private Entry entryKaraokeLRCAuthor = null;
+	[WidgetAttribute] private Entry entryKaraokeLRCArtist = null;
+	[WidgetAttribute] private Entry entryKaraokeLRCAlbum = null;
+	[WidgetAttribute] private Entry entryKaraokeLRCMaker = null;
+	[WidgetAttribute] private Entry entryKaraokeLRCVersion = null;
+	[WidgetAttribute] private Entry entryKaraokeLRCProgram = null;
 
 	/* KaraokeLyricsVKT fields */
-	[WidgetAttribute] private Entry entryKaraokeVKTFrameRate;
-	[WidgetAttribute] private Entry entryKaraokeVKTAuthor;
-	[WidgetAttribute] private Entry entryKaraokeVKTSource;
-	[WidgetAttribute] private Entry entryKaraokeVKTDate;
+	[WidgetAttribute] private Entry entryKaraokeVKTFrameRate = null;
+	[WidgetAttribute] private Entry entryKaraokeVKTAuthor = null;
+	[WidgetAttribute] private Entry entryKaraokeVKTSource = null;
+	[WidgetAttribute] private Entry entryKaraokeVKTDate = null;
 
 	/* MPSub fields */
-	[WidgetAttribute] private Entry entryMPSubTitle;
-	[WidgetAttribute] private Entry entryMPSubFile;
-	[WidgetAttribute] private Entry entryMPSubAuthor;
-	[WidgetAttribute] private Entry entryMPSubNote;
-	[WidgetAttribute] private ComboBox comboBoxMPSubType;
+	[WidgetAttribute] private Entry entryMPSubTitle = null;
+	[WidgetAttribute] private Entry entryMPSubFile = null;
+	[WidgetAttribute] private Entry entryMPSubAuthor = null;
+	[WidgetAttribute] private Entry entryMPSubNote = null;
+	[WidgetAttribute] private ComboBox comboBoxMPSubType = null;
 
 	/* SubStationAlphaASS fields */
-	[WidgetAttribute] private Entry entrySSAASSTitle;
-	[WidgetAttribute] private Entry entrySSAASSOriginalScript;
-	[WidgetAttribute] private Entry entrySSAASSOriginalTranslation;
-	[WidgetAttribute] private Entry entrySSAASSOriginalEditing;
-	[WidgetAttribute] private Entry entrySSAASSOriginalTiming;
-	[WidgetAttribute] private Entry entrySSAASSOriginalScriptChecking;
-	[WidgetAttribute] private Entry entrySSAASSScriptUpdatedBy;
-	[WidgetAttribute] private Entry entrySSAASSCollisions;
-	[WidgetAttribute] private Entry entrySSAASSTimer;
-	[WidgetAttribute] private SpinButton spinButtonSSAASSPlayResX;
-	[WidgetAttribute] private SpinButton spinButtonSSAASSPlayResY;
-	[WidgetAttribute] private SpinButton spinButtonSSAASSPlayDepth;
+	[WidgetAttribute] private Entry entrySSAASSTitle = null;
+	[WidgetAttribute] private Entry entrySSAASSOriginalScript = null;
+	[WidgetAttribute] private Entry entrySSAASSOriginalTranslation = null;
+	[WidgetAttribute] private Entry entrySSAASSOriginalEditing = null;
+	[WidgetAttribute] private Entry entrySSAASSOriginalTiming = null;
+	[WidgetAttribute] private Entry entrySSAASSOriginalScriptChecking = null;
+	[WidgetAttribute] private Entry entrySSAASSScriptUpdatedBy = null;
+	[WidgetAttribute] private Entry entrySSAASSCollisions = null;
+	[WidgetAttribute] private Entry entrySSAASSTimer = null;
+	[WidgetAttribute] private SpinButton spinButtonSSAASSPlayResX = null;
+	[WidgetAttribute] private SpinButton spinButtonSSAASSPlayResY = null;
+	[WidgetAttribute] private SpinButton spinButtonSSAASSPlayDepth = null;
 	
 	/* SubViewer1 fields */
-	[WidgetAttribute] private Entry entrySubViewer1Title;
-	[WidgetAttribute] private Entry entrySubViewer1Author;
-	[WidgetAttribute] private Entry entrySubViewer1Source;
-	[WidgetAttribute] private Entry entrySubViewer1Program;
-	[WidgetAttribute] private Entry entrySubViewer1FilePath;
-	[WidgetAttribute] private SpinButton spinButtonSubViewer1Delay;
-	[WidgetAttribute] private SpinButton spinButtonSubViewer1CDTrack;
+	[WidgetAttribute] private Entry entrySubViewer1Title = null;
+	[WidgetAttribute] private Entry entrySubViewer1Author = null;
+	[WidgetAttribute] private Entry entrySubViewer1Source = null;
+	[WidgetAttribute] private Entry entrySubViewer1Program = null;
+	[WidgetAttribute] private Entry entrySubViewer1FilePath = null;
+	[WidgetAttribute] private SpinButton spinButtonSubViewer1Delay = null;
+	[WidgetAttribute] private SpinButton spinButtonSubViewer1CDTrack = null;
 	
 	/* SubViewer2 fields */
-	[WidgetAttribute] private Entry entrySubViewer2Title;
-	[WidgetAttribute] private Entry entrySubViewer2Author;
-	[WidgetAttribute] private Entry entrySubViewer2Source;
-	[WidgetAttribute] private Entry entrySubViewer2Program;
-	[WidgetAttribute] private Entry entrySubViewer2FilePath;
-	[WidgetAttribute] private Entry entrySubViewer2Comment;
-	[WidgetAttribute] private Entry entrySubViewer2FontName;
-	[WidgetAttribute] private Entry entrySubViewer2FontColor;
-	[WidgetAttribute] private Entry entrySubViewer2FontStyle;
-	[WidgetAttribute] private SpinButton spinButtonSubViewer2Delay;
-	[WidgetAttribute] private SpinButton spinButtonSubViewer2CDTrack;
-	[WidgetAttribute] private SpinButton spinButtonSubViewer2FontSize;
+	[WidgetAttribute] private Entry entrySubViewer2Title = null;
+	[WidgetAttribute] private Entry entrySubViewer2Author = null;
+	[WidgetAttribute] private Entry entrySubViewer2Source = null;
+	[WidgetAttribute] private Entry entrySubViewer2Program = null;
+	[WidgetAttribute] private Entry entrySubViewer2FilePath = null;
+	[WidgetAttribute] private Entry entrySubViewer2Comment = null;
+	[WidgetAttribute] private Entry entrySubViewer2FontName = null;
+	[WidgetAttribute] private Entry entrySubViewer2FontColor = null;
+	[WidgetAttribute] private Entry entrySubViewer2FontStyle = null;
+	[WidgetAttribute] private SpinButton spinButtonSubViewer2Delay = null;
+	[WidgetAttribute] private SpinButton spinButtonSubViewer2CDTrack = null;
+	[WidgetAttribute] private SpinButton spinButtonSubViewer2FontSize = null;
 	
 	
 	public HeadersDialog () : base(gladeFilename) {

Modified: trunk/src/GnomeSubtitles/Dialogs/PreferencesDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/PreferencesDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/PreferencesDialog.cs	Sun Jun  8 01:04:38 2008
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2007 Pedro Castro
+ * Copyright (C) 2007-2008 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
 
 	/* Widgets */
 	
-	[WidgetAttribute] private CheckButton videoAutoChooseFileCheckButton;
+	[WidgetAttribute] private CheckButton videoAutoChooseFileCheckButton = null;
 
 
 	public PreferencesDialog () : base(gladeFilename, false, false) {

Modified: trunk/src/GnomeSubtitles/Dialogs/ReportBugWindow.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/ReportBugWindow.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/ReportBugWindow.cs	Sun Jun  8 01:04:38 2008
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2006-2007 Pedro Castro
+ * Copyright (C) 2006-2008 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,8 +31,8 @@
 	private const string gladeFilename = "ReportBugWindow.glade";
 
 	/* Widgets */
-	[WidgetAttribute] private Window window;
-	[WidgetAttribute] private TextView bugTextView;
+	[WidgetAttribute] private Window window = null;
+	[WidgetAttribute] private TextView bugTextView = null;
 	
 	public BugReportWindow (Exception exception, string bugInfo) {
 		Application.Init();

Modified: trunk/src/GnomeSubtitles/Dialogs/SaveConfirmationDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/SaveConfirmationDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/SaveConfirmationDialog.cs	Sun Jun  8 01:04:38 2008
@@ -38,7 +38,7 @@
 		this.textType = textType;
 	
 		string message = "<span weight=\"bold\" size=\"larger\">" + primaryText + "</span>\n\n" + secondaryText;
-		string fileName = (textType == SubtitleTextType.Text ? Global.Document.TextFile.Filename : Global.Document.TranslationFile.Filename); //TODO problem here
+		string fileName = (textType == SubtitleTextType.Text ? Global.Document.TextFile.Filename : Global.Document.TranslationFile.Filename);
 		dialog = new MessageDialog(Global.GUI.Window, DialogFlags.Modal, MessageType.Warning,
 			ButtonsType.None, message, fileName);
 	

Modified: trunk/src/GnomeSubtitles/Dialogs/SearchDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/SearchDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/SearchDialog.cs	Sun Jun  8 01:04:38 2008
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2006-2007 Pedro Castro
+ * Copyright (C) 2006-2008 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -43,24 +43,24 @@
 
 	/* Widgets */
 	
-	[WidgetAttribute] private Entry findEntry;
-	[WidgetAttribute] private Entry replaceEntry;
-	[WidgetAttribute] private Label replaceLabel;
-	[WidgetAttribute] private Table table;
-	
-	[WidgetAttribute] private CheckButton matchCaseCheckButton;	
-	[WidgetAttribute] private CheckButton backwardsCheckButton;
-	[WidgetAttribute] private CheckButton regexCheckButton;
-	[WidgetAttribute] private CheckButton wrapCheckButton;
-	
-	[WidgetAttribute] private Button buttonReplaceAll;
-	[WidgetAttribute] private Button buttonReplace;
-	[WidgetAttribute] private Button buttonFind;
+	[WidgetAttribute] private Entry findEntry = null;
+	[WidgetAttribute] private Entry replaceEntry = null;
+	[WidgetAttribute] private Label replaceLabel = null;
+	[WidgetAttribute] private Table table = null;
+	
+	[WidgetAttribute] private CheckButton matchCaseCheckButton = null;	
+	[WidgetAttribute] private CheckButton backwardsCheckButton = null;
+	[WidgetAttribute] private CheckButton regexCheckButton = null;
+	[WidgetAttribute] private CheckButton wrapCheckButton = null;
+	
+	[WidgetAttribute] private Button buttonReplaceAll = null;
+	[WidgetAttribute] private Button buttonReplace = null;
+	[WidgetAttribute] private Button buttonFind = null;
 
 	public SearchDialog () : base(gladeFilename, true, true) {
 	}
 	
-	public bool ShowReplace {
+	public bool ShowReplace2 {
 		set {
 			if (value == true) {
 				dialog.Title = Catalog.GetString("Replace");
@@ -107,7 +107,26 @@
 		get { return wrapCheckButton.Active; }
 	}
 	
-	public override void Show() { //TODO add ShowReplace here?
+	public override void Show () {
+		Show(false);
+	}
+	
+	public void Show (bool useReplace) {
+		if (useReplace) {
+			dialog.Title = Catalog.GetString("Replace");
+			table.RowSpacing = 12;
+		}
+		else {
+			dialog.Title = Catalog.GetString("Find");
+			table.RowSpacing = 0;
+		}
+		
+		replaceEntry.Visible = useReplace;
+		replaceLabel.Visible = useReplace;
+		
+		buttonReplaceAll.Visible = useReplace;
+		buttonReplace.Visible = useReplace;
+		
 		LoadDialogValues();
 		base.Show();
 	}

Modified: trunk/src/GnomeSubtitles/Dialogs/SetLanguageDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/SetLanguageDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/SetLanguageDialog.cs	Sun Jun  8 01:04:38 2008
@@ -41,8 +41,8 @@
 
 	/* Widgets */
 	
-	[WidgetAttribute] private TreeView languagesTreeView;
-	[WidgetAttribute] private Label introLabel;
+	[WidgetAttribute] private TreeView languagesTreeView = null;
+	[WidgetAttribute] private Label introLabel = null;
 
 
 	public SetLanguageDialog (SubtitleTextType textType) : base(gladeFilename) {

Modified: trunk/src/GnomeSubtitles/Dialogs/SubtitleFileChooserDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/SubtitleFileChooserDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/SubtitleFileChooserDialog.cs	Sun Jun  8 01:04:38 2008
@@ -41,7 +41,7 @@
 
 	/* Widgets */
 	
-	[WidgetAttribute] private ComboBox encodingComboBox;
+	[WidgetAttribute] private ComboBox encodingComboBox = null;
 
 	protected SubtitleFileChooserDialog (string filename, bool persistent) : base(filename, persistent, true) {
 		dialog = base.dialog as FileChooserDialog;

Modified: trunk/src/GnomeSubtitles/Dialogs/TimingsAdjustDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/TimingsAdjustDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/TimingsAdjustDialog.cs	Sun Jun  8 01:04:38 2008
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2006-2007 Pedro Castro
+ * Copyright (C) 2006-2008 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -34,16 +34,16 @@
 	
 	/* Widgets */
 	
-	[WidgetAttribute] private Label firstSubtitleStartLabel;
-	[WidgetAttribute] private Label firstSubtitleNoInputLabel;
-	[WidgetAttribute] private Label firstSubtitleStartInputLabel;
-	[WidgetAttribute] private SpinButton firstSubtitleNewStartSpinButton;
-	[WidgetAttribute] private Label lastSubtitleStartLabel;
-	[WidgetAttribute] private Label lastSubtitleNoInputLabel;
-	[WidgetAttribute] private Label lastSubtitleStartInputLabel;
-	[WidgetAttribute] private SpinButton lastSubtitleNewStartSpinButton;
-	[WidgetAttribute] private RadioButton allSubtitlesRadioButton;	
-	[WidgetAttribute] private RadioButton selectedSubtitlesRadioButton;
+	[WidgetAttribute] private Label firstSubtitleStartLabel = null;
+	[WidgetAttribute] private Label firstSubtitleNoInputLabel = null;
+	[WidgetAttribute] private Label firstSubtitleStartInputLabel = null;
+	[WidgetAttribute] private SpinButton firstSubtitleNewStartSpinButton = null;
+	[WidgetAttribute] private Label lastSubtitleStartLabel = null;
+	[WidgetAttribute] private Label lastSubtitleNoInputLabel = null;
+	[WidgetAttribute] private Label lastSubtitleStartInputLabel = null;
+	[WidgetAttribute] private SpinButton lastSubtitleNewStartSpinButton = null;
+	[WidgetAttribute] private RadioButton allSubtitlesRadioButton = null;	
+	[WidgetAttribute] private RadioButton selectedSubtitlesRadioButton = null;
 	
 
 	public TimingsAdjustDialog () : base(gladeFilename){

Modified: trunk/src/GnomeSubtitles/Dialogs/TimingsShiftDialog.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialogs/TimingsShiftDialog.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialogs/TimingsShiftDialog.cs	Sun Jun  8 01:04:38 2008
@@ -32,12 +32,12 @@
 	private const string gladeFilename = "TimingsShiftDialog.glade";
 
 	/* Widgets */
-	[WidgetAttribute] private Label timingModeLabel;
-	[WidgetAttribute] private SpinButton spinButton;
-	[WidgetAttribute] private RadioButton allSubtitlesRadioButton;
-	[WidgetAttribute] private RadioButton selectedSubtitlesRadioButton;
-	[WidgetAttribute] private RadioButton fromFirstSubtitleToSelectionRadioButton;
-	[WidgetAttribute] private RadioButton fromSelectionToLastSubtitleRadioButton;
+	[WidgetAttribute] private Label timingModeLabel = null;
+	[WidgetAttribute] private SpinButton spinButton = null;
+	[WidgetAttribute] private RadioButton allSubtitlesRadioButton = null;
+	[WidgetAttribute] private RadioButton selectedSubtitlesRadioButton = null;
+	[WidgetAttribute] private RadioButton fromFirstSubtitleToSelectionRadioButton = null;
+	[WidgetAttribute] private RadioButton fromSelectionToLastSubtitleRadioButton = null;
 
 	public TimingsShiftDialog () : base(gladeFilename, true, true){
 		InitSpinButton();



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