[libgda/gtk3] Misc control center corrections



commit d506d794326d7fae0e99c1899d597f819d499b98
Author: Vivien Malerba <malerba gnome-db org>
Date:   Fri Mar 11 19:24:52 2011 +0100

    Misc control center corrections

 control-center/dsn-config.c            |   58 +++++++++++--------------------
 control-center/dsn-properties-dialog.c |    6 ++--
 control-center/gdaui-dsn-editor.c      |    4 +-
 control-center/main.c                  |    7 ++--
 control-center/provider-config.c       |   45 ++++++++-----------------
 5 files changed, 44 insertions(+), 76 deletions(-)
---
diff --git a/control-center/dsn-config.c b/control-center/dsn-config.c
index 59b954d..ed3fd97 100644
--- a/control-center/dsn-config.c
+++ b/control-center/dsn-config.c
@@ -1,6 +1,5 @@
-/* GNOME-DB Components
- *
- * Copyright (C) 2000 - 2009 The GNOME Foundation.
+/*
+ * Copyright (C) 2000 - 2011 The GNOME Foundation.
  *
  * AUTHORS:
  *      Rodrigo Moya <rodrigo gnome-db org>
@@ -103,9 +102,8 @@ dsn_config_new (void)
 {
 	DsnConfigPrivate *priv;
 	GtkWidget *dsn;
-	GtkWidget *table;
 	GtkWidget *box;
-	GtkWidget *button;
+	GtkWidget *image;
 	GtkWidget *label;
 	GtkWidget *sw;
 	gchar *title;
@@ -117,10 +115,6 @@ dsn_config_new (void)
 	g_object_set_data_full (G_OBJECT (dsn), DSN_CONFIG_DATA, priv,
 				(GDestroyNotify) free_private_data);
 
-	/* create the main table */
-	table = cc_new_table_widget (3, 1, FALSE);
-	gtk_box_pack_start (GTK_BOX (dsn), table, TRUE, TRUE, 0);
-
 	/* title */
 	title = g_strdup_printf ("<b>%s</b>\n%s", _("Data Sources"),
 				 _("Configured data sources in the system"));
@@ -131,20 +125,14 @@ dsn_config_new (void)
 	path = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "pixmaps", "gdaui-generic.png", NULL);
 	cc_gray_bar_set_icon_from_file (CC_GRAY_BAR (priv->title), path);
 	g_free (path);
-	gtk_table_attach (GTK_TABLE (table), priv->title, 0, 1, 0, 1,
-			  GTK_FILL | GTK_SHRINK,
-			  GTK_FILL | GTK_SHRINK,
-			  0, 0);
+	gtk_box_pack_start (GTK_BOX (dsn), priv->title, FALSE, FALSE, 0);
 	gtk_widget_show (priv->title);
 
 	/* create the data source list */
 	sw = gtk_scrolled_window_new (NULL, NULL);
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC,
 					GTK_POLICY_AUTOMATIC);
-	gtk_table_attach (GTK_TABLE (table), sw, 0, 1, 1, 2,
-			  GTK_FILL | GTK_SHRINK | GTK_EXPAND,
-			  GTK_FILL | GTK_SHRINK | GTK_EXPAND,
-			  0, 0);
+	gtk_box_pack_start (GTK_BOX (dsn), sw, TRUE, TRUE, 0);
 	
 	model = gda_config_list_dsn ();
 	priv->dsn_list = gdaui_raw_grid_new (model);
@@ -168,29 +156,25 @@ dsn_config_new (void)
 			  G_CALLBACK (list_popup_cb), dsn);
 
 	/* add tip */
-	box = cc_new_hbox_widget (FALSE, 6);
+	box = gtk_hbox_new (FALSE, 6);
         gtk_container_set_border_width (GTK_CONTAINER (box), 6);
-	gtk_table_attach (GTK_TABLE (table), box, 0, 1, 2, 3,
-			  GTK_FILL,
-			  GTK_FILL,
-                          0, 0);
-
-	button = gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG);
-        gtk_misc_set_alignment (GTK_MISC (button), 0.5, 0.0);
-	gtk_widget_show (button);
-	gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
-
-	label = cc_new_label_widget (
-		_("Data sources are the means by which database "
-		  "connections are identified: all "
-		  "the information needed to open a connection to "
-		  "a specific database using a 'provider' is referenced using "
-		  "a unique name."));
+	gtk_box_pack_start (GTK_BOX (dsn), box, FALSE, FALSE, 0);
+	gtk_widget_show (box);
+
+	image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG);
+        gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
+	gtk_widget_show (image);
+	gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
+
+	label = gtk_label_new (_("Data sources are the means by which database "
+				 "connections are identified: all "
+				 "the information needed to open a connection to "
+				 "a specific database using a 'provider' is referenced using "
+				 "a unique name."));
 	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-        gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
-        gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
 	gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
-	
+	gtk_widget_show (label);
+
 	return dsn;
 }
 
diff --git a/control-center/dsn-properties-dialog.c b/control-center/dsn-properties-dialog.c
index f37a4ef..44d9682 100644
--- a/control-center/dsn-properties-dialog.c
+++ b/control-center/dsn-properties-dialog.c
@@ -1,5 +1,5 @@
-/* GNOME-DB Components
- * Copyright (C) 2000 - 2010 The GNOME Foundation.
+/*
+ * Copyright (C) 2000 - 2011 The GNOME Foundation.
  *
  * AUTHORS:
  *      Rodrigo Moya <rodrigo gnome-db org>
@@ -113,7 +113,7 @@ dsn_properties_dialog (GtkWindow *parent, const gchar *dsn)
 					      GTK_STOCK_REVERT_TO_SAVED, REVERT_BUTTON,
 					      GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
 					      NULL);
-	gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+	gtk_window_set_default_size (GTK_WINDOW (dialog), 450, 300);
 	gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), TEST_BUTTON, pinfo ? TRUE : FALSE);
 	gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), BROWSE_BUTTON, pinfo ? TRUE : FALSE);
 	gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), REVERT_BUTTON, FALSE);
diff --git a/control-center/gdaui-dsn-editor.c b/control-center/gdaui-dsn-editor.c
index 9ed69ec..d3206a5 100644
--- a/control-center/gdaui-dsn-editor.c
+++ b/control-center/gdaui-dsn-editor.c
@@ -1,4 +1,4 @@
-/* GNOME DB library
+/*
  * Copyright (C) 1999 - 2009 The GNOME Foundation
  *
  * AUTHORS:
@@ -177,7 +177,7 @@ gdaui_dsn_editor_init (GdauiDsnEditor *config, G_GNUC_UNUSED GdauiDsnEditorClass
 	g_signal_connect (G_OBJECT (config->priv->wprovider), "changed",
 			  G_CALLBACK (field_changed_cb), config);
 	gtk_table_attach (GTK_TABLE (table), config->priv->wprovider, 1, 2, 2, 3,
-			  GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
+			  GTK_FILL|GTK_EXPAND, 0, 0, 0);
 
 	label = gtk_label_new_with_mnemonic (_("_Description:"));
 	gtk_misc_set_alignment (GTK_MISC (label), 0, -1.);
diff --git a/control-center/main.c b/control-center/main.c
index 01e2730..f0aa097 100644
--- a/control-center/main.c
+++ b/control-center/main.c
@@ -177,7 +177,7 @@ about_cb (G_GNUC_UNUSED GtkAction *action, G_GNUC_UNUSED gpointer user_data)
 	dialog = gtk_about_dialog_new ();
 	gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG (dialog), _("Database access control center"));
 	gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (dialog), PACKAGE_VERSION);
-	gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG (dialog), "(C) 1998 - 2010 GNOME Foundation");
+	gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG (dialog), "(C) 1998 - 2011 GNOME Foundation");
 	gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG (dialog), _("Database access services for the GNOME Desktop"));
 	gtk_about_dialog_set_license (GTK_ABOUT_DIALOG (dialog), "GNU Lesser General Public License");
 	gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (dialog), "http://www.gnome-db.org";);
@@ -332,10 +332,11 @@ dsn_selection_changed_cb (GdauiRawGrid *dbrawgrid, gboolean row_selected, G_GNUC
 	GtkAction *action;
 	GArray *selection;
 
+	selection = gdaui_data_selector_get_selected_rows (GDAUI_DATA_SELECTOR (dbrawgrid));
+
 	action = gtk_action_group_get_action (actions, "DatabaseProperties");
-	g_object_set (G_OBJECT (action), "sensitive", row_selected, NULL);
+	g_object_set (G_OBJECT (action), "sensitive", selection ? TRUE : FALSE, NULL);
 
-	selection = gdaui_data_selector_get_selected_rows (GDAUI_DATA_SELECTOR (dbrawgrid));
 	action = gtk_action_group_get_action (actions, "DatabaseDelete");
 	g_object_set (G_OBJECT (action), "sensitive", selection ? TRUE : FALSE, NULL);
 	if (selection)
diff --git a/control-center/provider-config.c b/control-center/provider-config.c
index b577a69..ade4637 100644
--- a/control-center/provider-config.c
+++ b/control-center/provider-config.c
@@ -1,6 +1,5 @@
-/* GNOME-DB Configurator
- *
- * Copyright (C) 2000 - 2009 The GNOME Foundation.
+/*
+ * Copyright (C) 2000 - 2011 The GNOME Foundation.
  *
  * AUTHORS:
  *      Rodrigo Moya <rodrigo gnome-db org>
@@ -46,25 +45,20 @@ provider_config_new (void)
 {
 	ProviderConfigPrivate *priv;
 	GtkWidget *provider;
-	GtkWidget *table;
 	GtkWidget *box;
-	GtkWidget *button;
+	GtkWidget *image;
 	GtkWidget *label;
 	GtkWidget *sw;
 	gchar *title;
 	GdaDataModel *model;
 
 	priv = g_new0 (ProviderConfigPrivate, 1);
-	provider = gtk_vbox_new (FALSE, 6);
+	provider = gtk_vbox_new (FALSE, 0);
 	gtk_widget_show (provider);
         gtk_container_set_border_width (GTK_CONTAINER (provider), 6);
 	g_object_set_data_full (G_OBJECT (provider), PROVIDER_CONFIG_DATA, priv,
 				(GDestroyNotify) g_free);
 
-	table = gtk_table_new (3, 1, FALSE);
-	gtk_box_pack_start (GTK_BOX (provider), table, TRUE, TRUE, 0);
-	gtk_widget_show (table);
-
 	/* title */
 	title = g_strdup_printf ("<b>%s</b>\n%s", _("Providers"),
 				 _("Installed providers"));
@@ -76,20 +70,14 @@ provider_config_new (void)
 	cc_gray_bar_set_icon_from_file (CC_GRAY_BAR (priv->title), path);
 	g_free (path);
 
-	gtk_table_attach (GTK_TABLE (table), priv->title, 0, 1, 0, 1,
-			  GTK_FILL | GTK_SHRINK,
-			  GTK_FILL | GTK_SHRINK,
-			  0, 0);
+	gtk_box_pack_start (GTK_BOX (provider), priv->title, FALSE, FALSE, 0);
 	gtk_widget_show (priv->title);
 
 	/* create the provider list */
 	sw = gtk_scrolled_window_new (NULL, NULL);
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC,
-					GTK_POLICY_AUTOMATIC);	
-	gtk_table_attach (GTK_TABLE (table), sw, 0, 1, 1, 2,
-			  GTK_FILL | GTK_SHRINK | GTK_EXPAND,
-			  GTK_FILL | GTK_SHRINK | GTK_EXPAND,
-			  0, 0);
+					GTK_POLICY_AUTOMATIC);
+	gtk_box_pack_start (GTK_BOX (provider), sw, TRUE, TRUE, 0);
 
 	model = gda_config_list_providers ();
 	priv->provider_list = gdaui_raw_grid_new (model);
@@ -105,22 +93,17 @@ provider_config_new (void)
 	box = gtk_hbox_new (FALSE, 6);
 	gtk_widget_show (box);
         gtk_container_set_border_width (GTK_CONTAINER (box), 6);
-	gtk_table_attach (GTK_TABLE (table), box, 0, 1, 2, 3,
-			  GTK_FILL, GTK_FILL, 0, 0);
+	gtk_box_pack_start (GTK_BOX (provider), box, FALSE, FALSE, 0);
 
-	button = gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG);
-        gtk_misc_set_alignment (GTK_MISC (button), 0.5, 0.0);
-	gtk_widget_show (button);
-	gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
+	image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG);
+	gtk_widget_show (image);
+	gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
 
-	label = gtk_label_new_with_mnemonic (
-		_("Providers are addons that actually implement the access "
-		  "to each database using the means provided by each database vendor."));
+	label = gtk_label_new (_("Providers are addons that actually implement the access "
+				 "to each database using the means provided by each database vendor."));
 	gtk_widget_show (label);
 	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-        gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
-        gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
-	gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
+	gtk_box_pack_start (GTK_BOX (box), label, TRUE, FALSE, 0);
 
 	return provider;
 }



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