Author: bmotmans
Date: 2008-01-30 09:26:15 -0500 (Wed, 30 Jan 2008)
New Revision: 94375

Added:
   
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Widgets/SqliteConnectionSettingsWidget.cs
Removed:
   
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Widgets/dummy.cs
   
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/gtk-gui/MonoDevelop.Database.Sql.Sqlite.SqliteCreateDatabaseDialog.cs
Modified:
   
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/ChangeLog
   
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Dialogs/SqliteCreateDatabaseDialog.cs
   
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Dialogs/SqliteDatabaseConnectionSettingsDialog.cs
   
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Makefile.am
   
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/MonoDevelop.Database.Sql.Sqlite.mdp
   
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/SqliteGuiProvider.cs
Log:
* Dialogs/SqliteDatabaseConnectionSettingsDialog.cs,
  Widgets/SqliteConnectionSettingsWidget.cs: moved the sqlite
  connection settings widget to a separate file
* Dialogs/SqliteCreateDatabaseDialog.cs,
  gtk-gui/MonoDevelop.Database.Sql.Sqlite.SqliteCreateDatabaseDialog.cs:
  Gui changes
* SqliteGuiProvider.cs: added parameter to the ShowCreateDatabaseDialog
  method

Modified: 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/ChangeLog
===================================================================
--- 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/ChangeLog
     2008-01-30 14:23:12 UTC (rev 94374)
+++ 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/ChangeLog
     2008-01-30 14:26:15 UTC (rev 94375)
@@ -1,3 +1,14 @@
+2008-01-30  Ben Motmans <[EMAIL PROTECTED]> 
+
+       * Dialogs/SqliteDatabaseConnectionSettingsDialog.cs,
+         Widgets/SqliteConnectionSettingsWidget.cs: moved the sqlite connection
+         settings widget to a separate file
+       * Dialogs/SqliteCreateDatabaseDialog.cs,
+         gtk-gui/MonoDevelop.Database.Sql.Sqlite.SqliteCreateDatabaseDialog.cs:
+         Gui changes
+       * SqliteGuiProvider.cs: added parameter to the ShowCreateDatabaseDialog
+         method
+
 2008-01-29  Ben Motmans <[EMAIL PROTECTED]> 
 
        * SqliteSchemaProvider.cs: Removed temp log statements

Modified: 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Dialogs/SqliteCreateDatabaseDialog.cs
===================================================================
--- 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Dialogs/SqliteCreateDatabaseDialog.cs
 2008-01-30 14:23:12 UTC (rev 94374)
+++ 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Dialogs/SqliteCreateDatabaseDialog.cs
 2008-01-30 14:26:15 UTC (rev 94375)
@@ -1,16 +1,52 @@
+//
+// Authors:
+//   Ben Motmans  <[EMAIL PROTECTED]>
+//
+// Copyright (c) 2008 Ben Motmans
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to 
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
 
+using Gtk;
 using System;
+using System.Threading;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Gui;
+using MonoDevelop.Database.Sql;
+using MonoDevelop.Database.Components;
+using MonoDevelop.Database.Designer;
 
 namespace MonoDevelop.Database.Sql.Sqlite
 {
-       
-       
-       public partial class SqliteCreateDatabaseDialog : Gtk.Dialog
+       public class SqliteCreateDatabaseDialog : CreateDatabaseDialog
        {
+               public SqliteCreateDatabaseDialog (IDbFactory factory)
+                       : base (factory)
+               {
+               }
                
-               public SqliteCreateDatabaseDialog()
+               protected override ConnectionSettingsWidget 
CreateConnectionSettingsWidget (IDbFactory factory)
                {
-                       this.Build();
+                       ConnectionSettingsWidget widget = new 
SqliteConnectionSettingsWidget (factory);
+                       widget.EnableTestButton = false;
+                       return widget;
                }
        }
 }

Modified: 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Dialogs/SqliteDatabaseConnectionSettingsDialog.cs
===================================================================
--- 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Dialogs/SqliteDatabaseConnectionSettingsDialog.cs
     2008-01-30 14:23:12 UTC (rev 94374)
+++ 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Dialogs/SqliteDatabaseConnectionSettingsDialog.cs
     2008-01-30 14:26:15 UTC (rev 94375)
@@ -51,61 +51,5 @@
                {
                        return new SqliteConnectionSettingsWidget (factory);
                }
-               
-               internal class SqliteConnectionSettingsWidget : 
ConnectionSettingsWidget
-               {
-                       internal SqliteConnectionSettingsWidget (IDbFactory 
factory)
-                               : base (factory)
-                       {
-                               EnableServerEntry = false;
-                               EnablePortEntry = false;
-                               EnableUsernameEntry = false;
-                               EnablePasswordEntry = false;
-                               EnableRefreshButton = false;
-                               EnableOpenButton = true;
-                       }
-                       
-                       protected override void OpenClicked (object sender, 
System.EventArgs e)
-                       {
-                               string database = null;
-                               if (ShowSelectDatabaseDialog (out database))
-                                       ComboDatabase.Entry.Text = database;
-                       }
-                       
-                       private bool ShowSelectDatabaseDialog (out string 
database)
-                       {
-                               FileChooserDialog dlg = new FileChooserDialog (
-                                       AddinCatalog.GetString ("Open 
Database"), null, FileChooserAction.Open,
-                                       "gtk-cancel", ResponseType.Cancel,
-                                       "gtk-open", ResponseType.Accept
-                               );
-                               dlg.SelectMultiple = false;
-                               dlg.LocalOnly = true;
-                               dlg.Modal = true;
-                       
-                               FileFilter filter = new FileFilter ();
-                               filter.AddMimeType ("application/x-sqlite2");
-                               filter.AddMimeType ("application/x-sqlite3");
-                               filter.AddPattern ("*.db");
-                               filter.Name = AddinCatalog.GetString ("SQLite 
databases");
-                               FileFilter filterAll = new FileFilter ();
-                               filterAll.AddPattern ("*");
-                               filterAll.Name = AddinCatalog.GetString ("All 
files");
-                               dlg.AddFilter (filter);
-                               dlg.AddFilter (filterAll);
-
-                               database = null;
-                               bool result = false;
-                               try {
-                                       if (dlg.Run () == 
(int)ResponseType.Accept) {
-                                               database = dlg.Filename;
-                                               result = true;
-                                       }
-                               } finally {
-                                       dlg.Destroy ();                         
        
-                               }
-                               return result;
-                       }
-               }
        }
 }

Modified: 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Makefile.am
===================================================================
--- 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Makefile.am
   2008-01-30 14:23:12 UTC (rev 94374)
+++ 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Makefile.am
   2008-01-30 14:26:15 UTC (rev 94375)
@@ -17,7 +17,6 @@
        Dialogs/SqliteDatabaseConnectionSettingsDialog.cs \
        Dialogs/SqliteTableEditorDialog.cs \
        gtk-gui/generated.cs \
-       gtk-gui/MonoDevelop.Database.Sql.Sqlite.SqliteCreateDatabaseDialog.cs \
        Schema/dummy.cs \
        SqliteConnectionProvider.cs \
        SqliteDbFactory.cs \
@@ -25,7 +24,7 @@
        SqliteGuiProvider.cs \
        SqlitePooledDbConnection.cs \
        SqliteSchemaProvider.cs \
-       Widgets/dummy.cs
+       Widgets/SqliteConnectionSettingsWidget.cs
 
 RES =  \
        gtk-gui/gui.stetic \

Modified: 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/MonoDevelop.Database.Sql.Sqlite.mdp
===================================================================
--- 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/MonoDevelop.Database.Sql.Sqlite.mdp
   2008-01-30 14:23:12 UTC (rev 94374)
+++ 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/MonoDevelop.Database.Sql.Sqlite.mdp
   2008-01-30 14:26:15 UTC (rev 94375)
@@ -27,9 +27,8 @@
     <File name="gtk-gui/generated.cs" subtype="Code" buildaction="Compile" />
     <File name="Dialogs/SqliteDatabaseConnectionSettingsDialog.cs" 
subtype="Code" buildaction="Compile" />
     <File name="Schema/dummy.cs" subtype="Code" buildaction="Compile" />
-    <File name="Widgets/dummy.cs" subtype="Code" buildaction="Compile" />
     <File name="Dialogs/SqliteCreateDatabaseDialog.cs" subtype="Code" 
buildaction="Compile" />
-    <File 
name="gtk-gui/MonoDevelop.Database.Sql.Sqlite.SqliteCreateDatabaseDialog.cs" 
subtype="Code" buildaction="Compile" />
+    <File name="Widgets/SqliteConnectionSettingsWidget.cs" subtype="Code" 
buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="System.Data, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
@@ -47,11 +46,11 @@
     <ProjectReference type="Gac" localcopy="True" refto="NRefactory, 
Version=0.0.0.0, Culture=neutral" />
     <ProjectReference type="Gac" localcopy="True" refto="Mono.Cecil, 
Version=0.6.8.8607, Culture=neutral" />
     <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
-    <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, 
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+    <ProjectReference type="Gac" localcopy="True" refto="Mono.Data.Sqlite, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
     <ProjectReference type="Gac" localcopy="True" refto="pango-sharp, 
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
     <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="Mono.Data.Sqlite, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
+    <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, 
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
   </References>
   <Deployment.LinuxDeployData generatePcFile="False" />
   <GtkDesignInfo gettextClass="AddinCatalog" gtkVersion="2.8.3" />

Modified: 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/SqliteGuiProvider.cs
===================================================================
--- 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/SqliteGuiProvider.cs
  2008-01-30 14:23:12 UTC (rev 94374)
+++ 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/SqliteGuiProvider.cs
  2008-01-30 14:26:15 UTC (rev 94375)
@@ -76,9 +76,9 @@
 //                     }
 //             }
                
-               public bool ShowCreateDatabaseDialog ()
+               public bool ShowCreateDatabaseDialog (IDbFactory factory)
                {
-                       return false;
+                       return RunDialog (new SqliteCreateDatabaseDialog 
(factory));
                }
                
                public bool ShowAddConnectionDialog (IDbFactory factory)

Added: 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Widgets/SqliteConnectionSettingsWidget.cs
===================================================================
--- 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Widgets/SqliteConnectionSettingsWidget.cs
     2008-01-30 14:23:12 UTC (rev 94374)
+++ 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Widgets/SqliteConnectionSettingsWidget.cs
     2008-01-30 14:26:15 UTC (rev 94375)
@@ -0,0 +1,93 @@
+//
+// Authors:
+//   Ben Motmans  <[EMAIL PROTECTED]>
+//
+// Copyright (c) 2008 Ben Motmans
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to 
deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using Gtk;
+using System;
+using System.Threading;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Gui;
+using MonoDevelop.Database.Sql;
+using MonoDevelop.Database.Components;
+using MonoDevelop.Database.Designer;
+
+namespace MonoDevelop.Database.Sql.Sqlite
+{
+       internal class SqliteConnectionSettingsWidget : ConnectionSettingsWidget
+       {
+               internal SqliteConnectionSettingsWidget (IDbFactory factory)
+                       : base (factory)
+               {
+                       EnableServerEntry = false;
+                       EnablePortEntry = false;
+                       EnableUsernameEntry = false;
+                       EnablePasswordEntry = false;
+                       EnableRefreshButton = false;
+                       EnableOpenButton = true;
+               }
+               
+               protected override void OpenClicked (object sender, EventArgs e)
+               {
+                       string database = null;
+                       if (ShowSelectDatabaseDialog (out database))
+                               ComboDatabase.Entry.Text = database;
+               }
+               
+               private bool ShowSelectDatabaseDialog (out string database)
+               {
+                       FileChooserDialog dlg = new FileChooserDialog (
+                               AddinCatalog.GetString ("Open Database"), null, 
FileChooserAction.Open,
+                               "gtk-cancel", ResponseType.Cancel,
+                               "gtk-open", ResponseType.Accept
+                       );
+                       dlg.SelectMultiple = false;
+                       dlg.LocalOnly = true;
+                       dlg.Modal = true;
+               
+                       FileFilter filter = new FileFilter ();
+                       filter.AddMimeType ("application/x-sqlite2");
+                       filter.AddMimeType ("application/x-sqlite3");
+                       filter.AddPattern ("*.db");
+                       filter.Name = AddinCatalog.GetString ("SQLite 
databases");
+                       FileFilter filterAll = new FileFilter ();
+                       filterAll.AddPattern ("*");
+                       filterAll.Name = AddinCatalog.GetString ("All files");
+                       dlg.AddFilter (filter);
+                       dlg.AddFilter (filterAll);
+
+                       database = null;
+                       bool result = false;
+                       try {
+                               if (dlg.Run () == (int)ResponseType.Accept) {
+                                       database = dlg.Filename;
+                                       result = true;
+                               }
+                       } finally {
+                               dlg.Destroy ();                                 
+                       }
+                       return result;
+               }
+       }
+}
\ No newline at end of file

Deleted: 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/Widgets/dummy.cs
===================================================================

Deleted: 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/gtk-gui/MonoDevelop.Database.Sql.Sqlite.SqliteCreateDatabaseDialog.cs
===================================================================
--- 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/gtk-gui/MonoDevelop.Database.Sql.Sqlite.SqliteCreateDatabaseDialog.cs
 2008-01-30 14:23:12 UTC (rev 94374)
+++ 
trunk/monodevelop/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.Sqlite/gtk-gui/MonoDevelop.Database.Sql.Sqlite.SqliteCreateDatabaseDialog.cs
 2008-01-30 14:26:15 UTC (rev 94375)
@@ -1,69 +0,0 @@
-// 
------------------------------------------------------------------------------
-//  <autogenerated>
-//      This code was generated by a tool.
-//      Mono Runtime Version: 2.0.50727.42
-// 
-//      Changes to this file may cause incorrect behavior and will be lost if 
-//      the code is regenerated.
-//  </autogenerated>
-// 
------------------------------------------------------------------------------
-
-namespace MonoDevelop.Database.Sql.Sqlite {
-    
-    
-    public partial class SqliteCreateDatabaseDialog {
-        
-        private Gtk.Button buttonCancel;
-        
-        private Gtk.Button buttonOk;
-        
-        protected virtual void Build() {
-            Stetic.Gui.Initialize(this);
-            // Widget 
MonoDevelop.Database.Sql.Sqlite.SqliteCreateDatabaseDialog
-            this.Name = 
"MonoDevelop.Database.Sql.Sqlite.SqliteCreateDatabaseDialog";
-            this.WindowPosition = ((Gtk.WindowPosition)(4));
-            this.HasSeparator = false;
-            // Internal child 
MonoDevelop.Database.Sql.Sqlite.SqliteCreateDatabaseDialog.VBox
-            Gtk.VBox w1 = this.VBox;
-            w1.Name = "dialog1_VBox";
-            w1.BorderWidth = ((uint)(2));
-            // Internal child 
MonoDevelop.Database.Sql.Sqlite.SqliteCreateDatabaseDialog.ActionArea
-            Gtk.HButtonBox w2 = this.ActionArea;
-            w2.Name = "dialog1_ActionArea";
-            w2.Spacing = 6;
-            w2.BorderWidth = ((uint)(5));
-            w2.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
-            // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
-            this.buttonCancel = new Gtk.Button();
-            this.buttonCancel.CanDefault = true;
-            this.buttonCancel.CanFocus = true;
-            this.buttonCancel.Name = "buttonCancel";
-            this.buttonCancel.UseStock = true;
-            this.buttonCancel.UseUnderline = true;
-            this.buttonCancel.Label = "gtk-cancel";
-            this.AddActionWidget(this.buttonCancel, -6);
-            Gtk.ButtonBox.ButtonBoxChild w3 = 
((Gtk.ButtonBox.ButtonBoxChild)(w2[this.buttonCancel]));
-            w3.Expand = false;
-            w3.Fill = false;
-            // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
-            this.buttonOk = new Gtk.Button();
-            this.buttonOk.CanDefault = true;
-            this.buttonOk.CanFocus = true;
-            this.buttonOk.Name = "buttonOk";
-            this.buttonOk.UseStock = true;
-            this.buttonOk.UseUnderline = true;
-            this.buttonOk.Label = "gtk-ok";
-            this.AddActionWidget(this.buttonOk, -5);
-            Gtk.ButtonBox.ButtonBoxChild w4 = 
((Gtk.ButtonBox.ButtonBoxChild)(w2[this.buttonOk]));
-            w4.Position = 1;
-            w4.Expand = false;
-            w4.Fill = false;
-            if ((this.Child != null)) {
-                this.Child.ShowAll();
-            }
-            this.DefaultWidth = 400;
-            this.DefaultHeight = 300;
-            this.Show();
-        }
-    }
-}

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

Reply via email to