[evolution/gtk-builder] Plugins configuration widgets within .ui files dropped
- From: Milan Crha <mcrha src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution/gtk-builder] Plugins configuration widgets within .ui files dropped
- Date: Mon, 9 Nov 2009 11:51:01 +0000 (UTC)
commit e061953b34def6b0b11ddd34c948670243d877d0
Author: Milan Crha <mcrha redhat com>
Date: Mon Nov 9 12:50:10 2009 +0100
Plugins configuration widgets within .ui files dropped
plugins/attachment-reminder/Makefile.am | 5 +-
plugins/attachment-reminder/attachment-reminder.c | 61 +++++++-
plugins/attachment-reminder/attachment-reminder.ui | 81 ----------
plugins/email-custom-header/Makefile.am | 3 +-
plugins/email-custom-header/email-custom-header.c | 80 +++++++++--
plugins/email-custom-header/email-custom-header.ui | 162 --------------------
plugins/templates/Makefile.am | 5 +-
plugins/templates/templates.c | 60 ++++++-
plugins/templates/templates.ui | 115 --------------
9 files changed, 175 insertions(+), 397 deletions(-)
---
diff --git a/plugins/attachment-reminder/Makefile.am b/plugins/attachment-reminder/Makefile.am
index 22c8a7c..66725b0 100644
--- a/plugins/attachment-reminder/Makefile.am
+++ b/plugins/attachment-reminder/Makefile.am
@@ -7,8 +7,6 @@ errordir = $(privdatadir)/errors
plugin_DATA = \
org-gnome-evolution-attachment-reminder.eplug
-ui_DATA = attachment-reminder.ui
-
plugin_LTLIBRARIES = liborg-gnome-evolution-attachment-reminder.la
liborg_gnome_evolution_attachment_reminder_la_CPPFLAGS = \
@@ -63,8 +61,7 @@ endif
EXTRA_DIST = org-gnome-evolution-attachment-reminder.eplug.xml \
org-gnome-attachment-reminder.error.xml \
- $(schema_in_files) \
- attachment-reminder.ui
+ $(schema_in_files)
BUILT_SOURCES = org-gnome-evolution-attachment-reminder.eplug \
org-gnome-attachment-reminder.error
diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c
index 71137a4..7ed7467 100644
--- a/plugins/attachment-reminder/attachment-reminder.c
+++ b/plugins/attachment-reminder/attachment-reminder.c
@@ -54,7 +54,6 @@
#define SIGNATURE "-- "
typedef struct {
- GtkBuilder *builder;
GConfClient *gconf;
GtkWidget *treeview;
GtkWidget *clue_add;
@@ -439,7 +438,6 @@ destroy_ui_data (gpointer data)
if (!ui)
return;
- g_object_unref (ui->builder);
g_object_unref (ui->gconf);
g_free (ui);
}
@@ -455,14 +453,59 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
GSList *clue_list = NULL, *list;
GtkTreeModel *model;
+ GtkWidget *reminder_configuration_box;
+ GtkWidget *clue_container;
+ GtkWidget *scrolledwindow1;
+ GtkWidget *clue_treeview;
+ GtkWidget *vbuttonbox2;
+ GtkWidget *clue_add;
+ GtkWidget *clue_edit;
+ GtkWidget *clue_remove;
+
UIData *ui = g_new0 (UIData, 1);
- ui->builder = gtk_builder_new ();
- e_load_ui_builder_definition (ui->builder, "attachment-reminder.ui");
+ reminder_configuration_box = gtk_vbox_new (FALSE, 5);
+ gtk_widget_show (reminder_configuration_box);
+ gtk_widget_set_size_request (reminder_configuration_box, 385, 189);
+
+ clue_container = gtk_hbox_new (FALSE, 6);
+ gtk_widget_show (clue_container);
+ gtk_box_pack_start (GTK_BOX (reminder_configuration_box), clue_container, TRUE, TRUE, 0);
+
+ scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (scrolledwindow1);
+ gtk_box_pack_start (GTK_BOX (clue_container), scrolledwindow1, TRUE, TRUE, 0);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+ clue_treeview = gtk_tree_view_new ();
+ gtk_widget_show (clue_treeview);
+ gtk_container_add (GTK_CONTAINER (scrolledwindow1), clue_treeview);
+ gtk_container_set_border_width (GTK_CONTAINER (clue_treeview), 1);
+
+ vbuttonbox2 = gtk_vbutton_box_new ();
+ gtk_widget_show (vbuttonbox2);
+ gtk_box_pack_start (GTK_BOX (clue_container), vbuttonbox2, FALSE, TRUE, 0);
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (vbuttonbox2), GTK_BUTTONBOX_START);
+ gtk_box_set_spacing (GTK_BOX (vbuttonbox2), 6);
+
+ clue_add = gtk_button_new_from_stock ("gtk-add");
+ gtk_widget_show (clue_add);
+ gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_add);
+ GTK_WIDGET_SET_FLAGS (clue_add, GTK_CAN_DEFAULT);
+
+ clue_edit = gtk_button_new_from_stock ("gtk-edit");
+ gtk_widget_show (clue_edit);
+ gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_edit);
+ GTK_WIDGET_SET_FLAGS (clue_edit, GTK_CAN_DEFAULT);
+
+ clue_remove = gtk_button_new_from_stock ("gtk-remove");
+ gtk_widget_show (clue_remove);
+ gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_remove);
+ GTK_WIDGET_SET_FLAGS (clue_remove, GTK_CAN_DEFAULT);
ui->gconf = gconf_client_get_default ();
- ui->treeview = e_builder_get_widget (ui->builder, "clue_treeview");
+ ui->treeview = clue_treeview;
ui->store = gtk_list_store_new (CLUE_N_COLUMNS, G_TYPE_STRING);
@@ -479,14 +522,14 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (selection_changed), ui);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ui->treeview), TRUE);
- ui->clue_add = e_builder_get_widget (ui->builder, "clue_add");
+ ui->clue_add = clue_add;
g_signal_connect (G_OBJECT (ui->clue_add), "clicked", G_CALLBACK (clue_add_clicked), ui);
- ui->clue_remove = e_builder_get_widget (ui->builder, "clue_remove");
+ ui->clue_remove = clue_remove;
g_signal_connect (G_OBJECT (ui->clue_remove), "clicked", G_CALLBACK (clue_remove_clicked), ui);
gtk_widget_set_sensitive (ui->clue_remove, FALSE);
- ui->clue_edit = e_builder_get_widget (ui->builder, "clue_edit");
+ ui->clue_edit = clue_edit;
g_signal_connect (G_OBJECT (ui->clue_edit), "clicked", G_CALLBACK (clue_edit_clicked), ui);
gtk_widget_set_sensitive (ui->clue_edit, FALSE);
@@ -510,7 +553,7 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
hbox = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), e_builder_get_widget (ui->builder, "reminder_configuration_box"), TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), reminder_configuration_box, TRUE, TRUE, 0);
/* to let free data properly on destroy of configuration widget */
g_object_set_data_full (G_OBJECT (hbox), "myui-data", ui, destroy_ui_data);
diff --git a/plugins/email-custom-header/Makefile.am b/plugins/email-custom-header/Makefile.am
index aa065a6..3417de1 100644
--- a/plugins/email-custom-header/Makefile.am
+++ b/plugins/email-custom-header/Makefile.am
@@ -57,8 +57,7 @@ install-data-local:
endif
ui_DATA = \
- org-gnome-email-custom-header.ui \
- email-custom-header.ui
+ org-gnome-email-custom-header.ui
EXTRA_DIST = \
org-gnome-email-custom-header.eplug.xml \
diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c
index 85b7a8a..d30a40a 100644
--- a/plugins/email-custom-header/email-custom-header.c
+++ b/plugins/email-custom-header/email-custom-header.c
@@ -40,7 +40,6 @@
#define GCONF_KEY_CUSTOM_HEADER "/apps/evolution/eplugin/email_custom_header/customHeader"
typedef struct {
- GtkBuilder *builder;
GConfClient *gconf;
GtkWidget *treeview;
GtkWidget *header_add;
@@ -852,7 +851,6 @@ destroy_cd_data (gpointer data)
if (!cd)
return;
- g_object_unref (cd->builder);
g_object_unref (cd->gconf);
g_free (cd);
}
@@ -871,17 +869,77 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
gchar *buffer;
GtkTreeViewColumn *col;
gint col_pos;
-
GConfClient *client = gconf_client_get_default();
-
ConfigData *cd = g_new0 (ConfigData, 1);
- cd->builder = gtk_builder_new ();
- e_load_ui_builder_definition (cd->builder, "email-custom-header.ui");
+ GtkWidget *ech_configuration_box;
+ GtkWidget *vbox2;
+ GtkWidget *label1;
+ GtkWidget *header_configuration_box;
+ GtkWidget *header_container;
+ GtkWidget *scrolledwindow1;
+ GtkWidget *header_treeview;
+ GtkWidget *vbuttonbox1;
+ GtkWidget *header_add;
+ GtkWidget *header_edit;
+ GtkWidget *header_remove;
+
+ ech_configuration_box = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (ech_configuration_box);
+
+ vbox2 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox2);
+ gtk_box_pack_start (GTK_BOX (ech_configuration_box), vbox2, FALSE, FALSE, 0);
+
+ /* To translators: This string is used while adding a new message header to configuration, to specifying the format of the key values */
+ label1 = gtk_label_new (_("The format for specifying a Custom Header key value is:\nName of the Custom Header key values separated by \";\"."));
+ gtk_widget_show (label1);
+ gtk_box_pack_start (GTK_BOX (vbox2), label1, FALSE, TRUE, 0);
+ gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_CENTER);
+ gtk_label_set_line_wrap (GTK_LABEL (label1), TRUE);
+
+ header_configuration_box = gtk_vbox_new (FALSE, 5);
+ gtk_widget_show (header_configuration_box);
+ gtk_box_pack_start (GTK_BOX (ech_configuration_box), header_configuration_box, TRUE, TRUE, 0);
+
+ header_container = gtk_hbox_new (FALSE, 6);
+ gtk_widget_show (header_container);
+ gtk_box_pack_start (GTK_BOX (header_configuration_box), header_container, TRUE, TRUE, 0);
+
+ scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (scrolledwindow1);
+ gtk_box_pack_start (GTK_BOX (header_container), scrolledwindow1, TRUE, TRUE, 0);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+ header_treeview = gtk_tree_view_new ();
+ gtk_widget_show (header_treeview);
+ gtk_container_add (GTK_CONTAINER (scrolledwindow1), header_treeview);
+ gtk_container_set_border_width (GTK_CONTAINER (header_treeview), 1);
+
+ vbuttonbox1 = gtk_vbutton_box_new ();
+ gtk_widget_show (vbuttonbox1);
+ gtk_box_pack_start (GTK_BOX (header_container), vbuttonbox1, FALSE, TRUE, 0);
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (vbuttonbox1), GTK_BUTTONBOX_START);
+ gtk_box_set_spacing (GTK_BOX (vbuttonbox1), 6);
+
+ header_add = gtk_button_new_from_stock ("gtk-add");
+ gtk_widget_show (header_add);
+ gtk_container_add (GTK_CONTAINER (vbuttonbox1), header_add);
+ GTK_WIDGET_SET_FLAGS (header_add, GTK_CAN_DEFAULT);
+
+ header_edit = gtk_button_new_from_stock ("gtk-edit");
+ gtk_widget_show (header_edit);
+ gtk_container_add (GTK_CONTAINER (vbuttonbox1), header_edit);
+ GTK_WIDGET_SET_FLAGS (header_edit, GTK_CAN_DEFAULT);
+
+ header_remove = gtk_button_new_from_stock ("gtk-remove");
+ gtk_widget_show (header_remove);
+ gtk_container_add (GTK_CONTAINER (vbuttonbox1), header_remove);
+ GTK_WIDGET_SET_FLAGS (header_remove, GTK_CAN_DEFAULT);
cd->gconf = gconf_client_get_default ();
- cd->treeview = e_builder_get_widget (cd->builder, "header_treeview");
+ cd->treeview = header_treeview;
cd->store = gtk_list_store_new (HEADER_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
@@ -913,14 +971,14 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (selection_changed), cd);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (cd->treeview), TRUE);
- cd->header_add = e_builder_get_widget (cd->builder, "header_add");
+ cd->header_add = header_add;
g_signal_connect (G_OBJECT (cd->header_add), "clicked", G_CALLBACK (header_add_clicked), cd);
- cd->header_remove = e_builder_get_widget (cd->builder, "header_remove");
+ cd->header_remove = header_remove;
g_signal_connect (G_OBJECT (cd->header_remove), "clicked", G_CALLBACK (header_remove_clicked), cd);
gtk_widget_set_sensitive (cd->header_remove, FALSE);
- cd->header_edit = e_builder_get_widget (cd->builder, "header_edit");
+ cd->header_edit = header_edit;
g_signal_connect (G_OBJECT (cd->header_edit), "clicked", G_CALLBACK (header_edit_clicked), cd);
gtk_widget_set_sensitive (cd->header_edit, FALSE);
@@ -954,7 +1012,7 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
hbox = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), e_builder_get_widget (cd->builder, "ech_configuration_box"), TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), ech_configuration_box, TRUE, TRUE, 0);
/* to let free data properly on destroy of configuration widget */
g_object_set_data_full (G_OBJECT (hbox), "mycd-data", cd, destroy_cd_data);
diff --git a/plugins/templates/Makefile.am b/plugins/templates/Makefile.am
index 893f5c9..56f81be 100644
--- a/plugins/templates/Makefile.am
+++ b/plugins/templates/Makefile.am
@@ -4,8 +4,6 @@ plugin_DATA = org-gnome-templates.eplug
plugin_LTLIBRARIES = liborg-gnome-templates.la
-ui_DATA = templates.ui
-
liborg_gnome_templates_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(top_srcdir) \
@@ -55,8 +53,7 @@ install-data-local:
endif
EXTRA_DIST = org-gnome-templates.eplug.xml \
- $(schema_in_files) \
- templates.ui
+ $(schema_in_files)
BUILT_SOURCES = org-gnome-templates.eplug
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index 753dcc7..c3e1ff2 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -52,7 +52,6 @@
#define GCONF_KEY_TEMPLATE_PLACEHOLDERS "/apps/evolution/mail/template_placeholders"
typedef struct {
- GtkBuilder *builder;
GConfClient *gconf;
GtkWidget *treeview;
GtkWidget *clue_add;
@@ -113,7 +112,6 @@ destroy_ui_data (gpointer data)
if (!ui)
return;
- g_object_unref (ui->builder);
g_object_unref (ui->gconf);
g_free (ui);
}
@@ -354,15 +352,59 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
GtkWidget *hbox;
GSList *clue_list = NULL, *list;
GtkTreeModel *model;
+ GtkWidget *templates_configuration_box;
+ GtkWidget *clue_container;
+ GtkWidget *scrolledwindow1;
+ GtkWidget *clue_treeview;
+ GtkWidget *vbuttonbox2;
+ GtkWidget *clue_add;
+ GtkWidget *clue_edit;
+ GtkWidget *clue_remove;
UIData *ui = g_new0 (UIData, 1);
- ui->builder = gtk_builder_new ();
- e_load_ui_builder_definition (ui->builder, "templates.ui");
+ templates_configuration_box = gtk_vbox_new (FALSE, 5);
+ gtk_widget_show (templates_configuration_box);
+ gtk_widget_set_size_request (templates_configuration_box, 385, 189);
+
+ clue_container = gtk_hbox_new (FALSE, 6);
+ gtk_widget_show (clue_container);
+ gtk_box_pack_start (GTK_BOX (templates_configuration_box), clue_container, TRUE, TRUE, 0);
+
+ scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (scrolledwindow1);
+ gtk_box_pack_start (GTK_BOX (clue_container), scrolledwindow1, TRUE, TRUE, 0);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+ clue_treeview = gtk_tree_view_new ();
+ gtk_widget_show (clue_treeview);
+ gtk_container_add (GTK_CONTAINER (scrolledwindow1), clue_treeview);
+ gtk_container_set_border_width (GTK_CONTAINER (clue_treeview), 1);
+
+ vbuttonbox2 = gtk_vbutton_box_new ();
+ gtk_widget_show (vbuttonbox2);
+ gtk_box_pack_start (GTK_BOX (clue_container), vbuttonbox2, FALSE, TRUE, 0);
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (vbuttonbox2), GTK_BUTTONBOX_START);
+ gtk_box_set_spacing (GTK_BOX (vbuttonbox2), 6);
+
+ clue_add = gtk_button_new_from_stock ("gtk-add");
+ gtk_widget_show (clue_add);
+ gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_add);
+ GTK_WIDGET_SET_FLAGS (clue_add, GTK_CAN_DEFAULT);
+
+ clue_edit = gtk_button_new_from_stock ("gtk-edit");
+ gtk_widget_show (clue_edit);
+ gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_edit);
+ GTK_WIDGET_SET_FLAGS (clue_edit, GTK_CAN_DEFAULT);
+
+ clue_remove = gtk_button_new_from_stock ("gtk-remove");
+ gtk_widget_show (clue_remove);
+ gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_remove);
+ GTK_WIDGET_SET_FLAGS (clue_remove, GTK_CAN_DEFAULT);
ui->gconf = gconf_client_get_default ();
- ui->treeview = e_builder_get_widget (ui->builder, "clue_treeview");
+ ui->treeview = clue_treeview;
ui->store = gtk_list_store_new (CLUE_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
@@ -385,14 +427,14 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (selection_changed), ui);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ui->treeview), TRUE);
- ui->clue_add = e_builder_get_widget (ui->builder, "clue_add");
+ ui->clue_add = clue_add;
g_signal_connect (G_OBJECT (ui->clue_add), "clicked", G_CALLBACK (clue_add_clicked), ui);
- ui->clue_remove = e_builder_get_widget (ui->builder, "clue_remove");
+ ui->clue_remove = clue_remove;
g_signal_connect (G_OBJECT (ui->clue_remove), "clicked", G_CALLBACK (clue_remove_clicked), ui);
gtk_widget_set_sensitive (ui->clue_remove, FALSE);
- ui->clue_edit = e_builder_get_widget (ui->builder, "clue_edit");
+ ui->clue_edit = clue_edit;
g_signal_connect (G_OBJECT (ui->clue_edit), "clicked", G_CALLBACK (clue_edit_clicked), ui);
gtk_widget_set_sensitive (ui->clue_edit, FALSE);
@@ -418,7 +460,7 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
hbox = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), e_builder_get_widget (ui->builder, "templates_configuration_box"), TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), templates_configuration_box, TRUE, TRUE, 0);
/* to let free data properly on destroy of configuration widget */
g_object_set_data_full (G_OBJECT (hbox), "myui-data", ui, destroy_ui_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]