aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/attachment-reminder
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-25 06:04:36 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-11-17 08:33:32 +0800
commit054c0881696a85f537e93b4950a28f505a3dc0f7 (patch)
treee63cfece426e2de5898c926eb6737cff229bb38b /plugins/attachment-reminder
parent6348266ee635db59a12d75497f980dd85d0fcf58 (diff)
downloadgsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.gz
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.bz2
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.lz
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.xz
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.zst
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.zip
BugĀ 589153 - Use GtkBuilder instead of libglade
Diffstat (limited to 'plugins/attachment-reminder')
-rw-r--r--plugins/attachment-reminder/Makefile.am6
-rw-r--r--plugins/attachment-reminder/attachment-reminder.c67
-rw-r--r--plugins/attachment-reminder/attachment-reminder.glade85
3 files changed, 55 insertions, 103 deletions
diff --git a/plugins/attachment-reminder/Makefile.am b/plugins/attachment-reminder/Makefile.am
index 1db3b79dad..66725b0de4 100644
--- a/plugins/attachment-reminder/Makefile.am
+++ b/plugins/attachment-reminder/Makefile.am
@@ -5,8 +5,7 @@ error_DATA = org-gnome-attachment-reminder.error
errordir = $(privdatadir)/errors
plugin_DATA = \
- org-gnome-evolution-attachment-reminder.eplug \
- attachment-reminder.glade
+ org-gnome-evolution-attachment-reminder.eplug
plugin_LTLIBRARIES = liborg-gnome-evolution-attachment-reminder.la
@@ -62,8 +61,7 @@ endif
EXTRA_DIST = org-gnome-evolution-attachment-reminder.eplug.xml \
org-gnome-attachment-reminder.error.xml \
- $(schema_in_files) \
- attachment-reminder.glade
+ $(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 330fd5df8f..7ed74678f5 100644
--- a/plugins/attachment-reminder/attachment-reminder.c
+++ b/plugins/attachment-reminder/attachment-reminder.c
@@ -27,6 +27,7 @@
#include <glade/glade-xml.h>
#include <gconf/gconf-client.h>
+#include <e-util/e-util.h>
#include <e-util/e-config.h>
#include <mail/em-config.h>
#include <mail/em-event.h>
@@ -53,7 +54,6 @@
#define SIGNATURE "-- "
typedef struct {
- GladeXML *xml;
GConfClient *gconf;
GtkWidget *treeview;
GtkWidget *clue_add;
@@ -438,7 +438,6 @@ destroy_ui_data (gpointer data)
if (!ui)
return;
- g_object_unref (ui->xml);
g_object_unref (ui->gconf);
g_free (ui);
}
@@ -454,19 +453,59 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
GSList *clue_list = NULL, *list;
GtkTreeModel *model;
- UIData *ui = g_new0 (UIData, 1);
+ GtkWidget *reminder_configuration_box;
+ GtkWidget *clue_container;
+ GtkWidget *scrolledwindow1;
+ GtkWidget *clue_treeview;
+ GtkWidget *vbuttonbox2;
+ GtkWidget *clue_add;
+ GtkWidget *clue_edit;
+ GtkWidget *clue_remove;
- gchar *gladefile;
+ UIData *ui = g_new0 (UIData, 1);
- gladefile = g_build_filename (EVOLUTION_PLUGINDIR,
- "attachment-reminder.glade",
- NULL);
- ui->xml = glade_xml_new (gladefile, "reminder_configuration_box", NULL);
- g_free (gladefile);
+ 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 = glade_xml_get_widget (ui->xml, "clue_treeview");
+ ui->treeview = clue_treeview;
ui->store = gtk_list_store_new (CLUE_N_COLUMNS, G_TYPE_STRING);
@@ -483,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 = glade_xml_get_widget (ui->xml, "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 = glade_xml_get_widget (ui->xml, "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 = glade_xml_get_widget (ui->xml, "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);
@@ -514,7 +553,7 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
hbox = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), glade_xml_get_widget (ui->xml, "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/attachment-reminder/attachment-reminder.glade b/plugins/attachment-reminder/attachment-reminder.glade
deleted file mode 100644
index 720047f8c3..0000000000
--- a/plugins/attachment-reminder/attachment-reminder.glade
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--*- mode: xml -*-->
-<glade-interface>
- <widget class="GtkWindow" id="window1">
- <property name="visible">True</property>
- <property name="title">window1</property>
- <child>
- <widget class="GtkVBox" id="reminder_configuration_box">
- <property name="width_request">385</property>
- <property name="height_request">189</property>
- <property name="visible">True</property>
- <property name="spacing">5</property>
- <child>
- <widget class="GtkHBox" id="clue_container">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <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>
- <child>
- <widget class="GtkTreeView" id="clue_treeview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="border_width">1</property>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox2">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <child>
- <widget class="GtkButton" id="clue_add">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- <child>
- <widget class="GtkButton" id="clue_edit">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="label">gtk-edit</property>
- <property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="clue_remove">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
-</glade-interface>