Author: mhutch
Date: 2007-09-27 18:37:36 -0400 (Thu, 27 Sep 2007)
New Revision: 86542

Modified:
   trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/ChangeLog
   
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/MultiTaskProgressDialog.cs
   trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.mdp
   
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/MessageService.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/gtk-gui/MonoDevelop.Core.Gui.Dialogs.MultiTaskProgressDialog.cs
   trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/gtk-gui/gui.stetic
Log:
* MonoDevelop.Core.Gui.mdp: Remove duplicate gtk-sharp reference.
* MonoDevelop.Core.Gui.Dialogs/MultiTaskProgressDialog.cs,
  gtk-gui/MonoDevelop.Core.Gui.Dialogs.MultiTaskProgressDialog.cs,
  gtk-gui/gui.stetic: Juggle some close/cancel event handling.
* MonoDevelop.Core.Gui/MessageService.cs: Add a method for showing
  custom GTK dialogs types in the GUI thread.

Modified: trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/ChangeLog   2007-09-27 
21:52:02 UTC (rev 86541)
+++ trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/ChangeLog   2007-09-27 
22:37:36 UTC (rev 86542)
@@ -1,5 +1,14 @@
 2007-09-27  Michael Hutchinson <[EMAIL PROTECTED]> 
 
+       * MonoDevelop.Core.Gui.mdp: Remove duplicate gtk-sharp reference.
+       * MonoDevelop.Core.Gui.Dialogs/MultiTaskProgressDialog.cs,
+         gtk-gui/MonoDevelop.Core.Gui.Dialogs.MultiTaskProgressDialog.cs,
+         gtk-gui/gui.stetic: Juggle some close/cancel event handling.
+       * MonoDevelop.Core.Gui/MessageService.cs: Add a method for showing 
custom
+         GTK dialogs types in the GUI thread.
+
+2007-09-27  Michael Hutchinson <[EMAIL PROTECTED]> 
+
        * MonoDevelop.Core.Gui.mdp, Makefile.am: Updated.
        * MonoDevelop.Core.Gui.Dialogs/MultiTaskProgressDialog.cs, gtk-gui,
          gtk-gui/generated.cs,

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/MessageService.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/MessageService.cs
      2007-09-27 21:52:02 UTC (rev 86541)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/MessageService.cs
      2007-09-27 22:37:36 UTC (rev 86542)
@@ -220,6 +220,23 @@
                        }
                }
                
+               public int ShowCustomDialog (System.Type dialogType, object[] 
args)
+               {
+                       Gtk.Dialog dialog = null;
+                       try {
+                               dialog = (Gtk.Dialog) 
System.Activator.CreateInstance (dialogType, args);
+                               dialog.Modal = true;
+                               dialog.TransientFor = rootWindow;
+                               dialog.DestroyWithParent = true;
+                               
+                               int response = dialog.Run ();
+                               return response;
+                       } finally {
+                               if (dialog != null)
+                                       dialog.Destroy ();
+                       }
+               }
+               
                public void ShowMessage(string message)
                {
                        ShowMessage(message, "MonoDevelop");

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/MultiTaskProgressDialog.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/MultiTaskProgressDialog.cs
     2007-09-27 21:52:02 UTC (rev 86541)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/MultiTaskProgressDialog.cs
     2007-09-27 22:37:36 UTC (rev 86542)
@@ -55,11 +55,13 @@
                IDictionary<string, string> taskLabelAliases = null;
                
                bool completed = false;
+               bool allowCancel;
                                                
                public MultiTaskProgressDialog (bool allowCancel, bool 
showDetails, IDictionary<string, string> taskLabelAliases)
                {
                        MonoDevelop.Core.Gui.DispatchService.AssertGuiThread ();
                        this.Build();
+                       this.allowCancel = allowCancel;
                        
                        this.taskLabelAliases = taskLabelAliases;
                        detailsScroll.Visible = showDetails;
@@ -232,12 +234,14 @@
                        }
                }
                
-               void OnCloseWindowButton (object sender, EventArgs args)
+               [GLib.ConnectBefore]
+               protected virtual void DeleteActivated (object o, 
DeleteEventArgs args)
                {
+                       args.RetVal = true;
                        if (completed)
+                               OnClose (null, null);
+                       else if (allowCancel)
                                OnCancel (null, null);
-                       else
-                               OnClose (null, null);
                }
        }
 }

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.mdp
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.mdp    
2007-09-27 21:52:02 UTC (rev 86541)
+++ trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.mdp    
2007-09-27 22:37:36 UTC (rev 86542)
@@ -195,7 +195,6 @@
     <ProjectReference type="Gac" localcopy="True" refto="atk-sharp, 
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
     <ProjectReference type="Gac" localcopy="True" refto="gdk-sharp, 
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
     <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, 
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
-    <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, 
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
   </References>
   <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" 
RelativeMakefileName="./Makefile.am" BuildTargetName="" CleanTargetName="" 
SyncReferences="True" IsAutotoolsProject="True" 
RelativeConfigureInPath="../../../">
     <ExcludedFiles>

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/gtk-gui/MonoDevelop.Core.Gui.Dialogs.MultiTaskProgressDialog.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/gtk-gui/MonoDevelop.Core.Gui.Dialogs.MultiTaskProgressDialog.cs
     2007-09-27 21:52:02 UTC (rev 86541)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/gtk-gui/MonoDevelop.Core.Gui.Dialogs.MultiTaskProgressDialog.cs
     2007-09-27 22:37:36 UTC (rev 86542)
@@ -140,9 +140,9 @@
             this.DefaultHeight = 418;
             this.title.Hide();
             this.Show();
-            this.DeleteEvent += new 
Gtk.DeleteEventHandler(this.OnCloseWindowButton);
-            this.buttonCancel.Released += new 
System.EventHandler(this.OnCancel);
-            this.buttonClose.Released += new System.EventHandler(this.OnClose);
+            this.DeleteEvent += new 
Gtk.DeleteEventHandler(this.DeleteActivated);
+            this.buttonCancel.Clicked += new 
System.EventHandler(this.OnCancel);
+            this.buttonClose.Clicked += new System.EventHandler(this.OnClose);
         }
     }
 }

Modified: trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/gtk-gui/gui.stetic
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/gtk-gui/gui.stetic  
2007-09-27 21:52:02 UTC (rev 86541)
+++ trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/gtk-gui/gui.stetic  
2007-09-27 22:37:36 UTC (rev 86542)
@@ -16,7 +16,7 @@
     <property name="Buttons">2</property>
     <property name="HelpButton">False</property>
     <property name="HasSeparator">False</property>
-    <signal name="DeleteEvent" handler="OnCloseWindowButton" />
+    <signal name="DeleteEvent" handler="DeleteActivated" />
     <child internal-child="VBox">
       <widget class="Gtk.VBox" id="dialog1_VBox">
         <property name="MemberName" />
@@ -115,7 +115,7 @@
             <property name="Type">StockItem</property>
             <property name="StockId">gtk-cancel</property>
             <property name="ResponseId">-6</property>
-            <signal name="Released" handler="OnCancel" />
+            <signal name="Clicked" handler="OnCancel" />
             <property name="label">gtk-cancel</property>
           </widget>
           <packing>
@@ -132,7 +132,7 @@
             <property name="Type">StockItem</property>
             <property name="StockId">gtk-close</property>
             <property name="ResponseId">-7</property>
-            <signal name="Released" handler="OnClose" />
+            <signal name="Clicked" handler="OnClose" />
             <property name="label">gtk-close</property>
           </widget>
           <packing>

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to