[Monodevelop-patches-list] r624 - in trunk/MonoDevelop: data/resources/glade src/Main/Base/Commands src/Main/Base/Gui/Dialogs

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Fri Jan 23 21:29:00 EST 2004


Author: dkor
Date: 2004-01-23 21:29:00 -0500 (Fri, 23 Jan 2004)
New Revision: 624

Modified:
   trunk/MonoDevelop/data/resources/glade/Base.glade
   trunk/MonoDevelop/src/Main/Base/Commands/HelpCommands.cs
   trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ViewGPLDialog.cs
Log:
Ported GPLDialog to glade.


Modified: trunk/MonoDevelop/data/resources/glade/Base.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/Base.glade	2004-01-24 00:16:08 UTC (rev 623)
+++ trunk/MonoDevelop/data/resources/glade/Base.glade	2004-01-24 02:29:00 UTC (rev 624)
@@ -1170,4 +1170,88 @@
   </child>
 </widget>
 
+<widget class="GtkDialog" id="GPLDialog">
+  <property name="border_width">6</property>
+  <property name="visible">True</property>
+  <property name="can_default">True</property>
+  <property name="has_default">True</property>
+  <property name="title" translatable="yes">GNU GENERAL PUBLIC LICENSE</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="default_width">600</property>
+  <property name="default_height">400</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="has_separator">False</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox1">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area1">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="closebutton1">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-close</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="response_id">-7</property>
+	      <signal name="clicked" handler="OnCloseButtonClicked" last_modification_time="Sat, 24 Jan 2004 01:26:19 GMT"/>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkScrolledWindow" id="scrolledwindow1">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+	  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+	  <property name="shadow_type">GTK_SHADOW_NONE</property>
+	  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+	  <child>
+	    <widget class="GtkTextView" id="view">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="editable">False</property>
+	      <property name="justification">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap_mode">GTK_WRAP_NONE</property>
+	      <property name="cursor_visible">False</property>
+	      <property name="pixels_above_lines">0</property>
+	      <property name="pixels_below_lines">0</property>
+	      <property name="pixels_inside_wrap">0</property>
+	      <property name="left_margin">0</property>
+	      <property name="right_margin">0</property>
+	      <property name="indent">0</property>
+	      <property name="text" translatable="yes"></property>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
 </glade-interface>

Modified: trunk/MonoDevelop/src/Main/Base/Commands/HelpCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/HelpCommands.cs	2004-01-24 00:16:08 UTC (rev 623)
+++ trunk/MonoDevelop/src/Main/Base/Commands/HelpCommands.cs	2004-01-24 02:29:00 UTC (rev 624)
@@ -41,8 +41,6 @@
 		public override void Run()
 		{
 			ViewGPLDialog vgd = new ViewGPLDialog();
-			vgd.Run ();
-			vgd.Hide ();
 		}
 	}
 	

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ViewGPLDialog.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ViewGPLDialog.cs	2004-01-24 00:16:08 UTC (rev 623)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ViewGPLDialog.cs	2004-01-24 02:29:00 UTC (rev 624)
@@ -15,9 +15,12 @@
 
 namespace ICSharpCode.SharpDevelop.Gui.Dialogs
 {
-	public class ViewGPLDialog : Dialog 
+	public class ViewGPLDialog 
 	{
-		public ViewGPLDialog () : base ("GNU GENERAL PUBLIC LICENSE", (Window) WorkbenchSingleton.Workbench, DialogFlags.DestroyWithParent)
+		[Glade.Widget] Gtk.TextView  view;
+		[Glade.Widget] Gtk.Dialog  GPLDialog;
+
+		public ViewGPLDialog () 
 		{
 			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
 			string filename = fileUtilityService.SharpDevelopRootPath + 
@@ -25,25 +28,18 @@
 			System.IO.Path.DirectorySeparatorChar + "license.txt";
 			
 			if (fileUtilityService.TestFileExists(filename)) {
-				this.BorderWidth = 6;
-				this.DefaultResponse = (int) ResponseType.Close;
-				this.HasSeparator = false;	
-				this.SetDefaultSize (600, 400);
-				this.AddButton (Stock.Close, (int) ResponseType.Close);
-				
-				ScrolledWindow sw = new  ScrolledWindow ();
-				sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
-				
-				TextView view = new TextView ();
-				view.Editable = false;
-				view.CursorVisible = false;
-				StreamReader streamReader = new StreamReader (filename);
-				view.Buffer.Text = streamReader.ReadToEnd ();
-
-				sw.Add (view);
-				this.VBox.PackStart(sw);
-				this.ShowAll ();
+				Glade.XML gplDialog = new Glade.XML (null, "Base.glade", "GPLDialog", null);
+				gplDialog.Autoconnect (this);
+				GPLDialog.DefaultResponse = (int) ResponseType.Close;
+ 				StreamReader streamReader = new StreamReader (filename);
+ 				view.Buffer.Text = streamReader.ReadToEnd ();
 			}
 		}
+
+		protected void OnCloseButtonClicked(object sender, EventArgs e)
+		{
+			GPLDialog.Hide();	
+		}
+
 	}
 }




More information about the Monodevelop-patches-list mailing list