aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/templates
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/templates
parent6348266ee635db59a12d75497f980dd85d0fcf58 (diff)
downloadgsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.gz
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.zst
gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.zip
BugĀ 589153 - Use GtkBuilder instead of libglade
Diffstat (limited to 'plugins/templates')
-rw-r--r--plugins/templates/Makefile.am9
-rw-r--r--plugins/templates/templates.c66
-rw-r--r--plugins/templates/templates.glade126
3 files changed, 54 insertions, 147 deletions
diff --git a/plugins/templates/Makefile.am b/plugins/templates/Makefile.am
index 919103c063..9a4c8ed5c0 100644
--- a/plugins/templates/Makefile.am
+++ b/plugins/templates/Makefile.am
@@ -1,8 +1,6 @@
@EVO_PLUGIN_RULE@
-plugin_DATA = \
- org-gnome-templates.eplug \
- templates.glade
+plugin_DATA = org-gnome-templates.eplug
plugin_LTLIBRARIES = liborg-gnome-templates.la
@@ -14,7 +12,7 @@ liborg_gnome_templates_la_CPPFLAGS = \
-I$(top_builddir)/composer \
$(GNOME_PLATFORM_CFLAGS) \
$(EVOLUTION_MAIL_CFLAGS) \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
+ -DEVOLUTION_UIDIR=\""$(uidir)"\" \
-DEVOLUTION_PLUGINDIR="\"$(plugindir)\""
liborg_gnome_templates_la_SOURCES = templates.c
@@ -56,8 +54,7 @@ install-data-local:
endif
EXTRA_DIST = org-gnome-templates.eplug.xml \
- $(schema_in_files) \
- templates.glade
+ $(schema_in_files)
BUILT_SOURCES = org-gnome-templates.eplug
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index 9e95b4f9dc..c3e1ff20dd 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -27,7 +27,6 @@
#include <glib/gi18n.h>
#include <string.h>
-#include <glade/glade.h>
#include <gconf/gconf-client.h>
#include <e-util/e-config.h>
@@ -53,7 +52,6 @@
#define GCONF_KEY_TEMPLATE_PLACEHOLDERS "/apps/evolution/mail/template_placeholders"
typedef struct {
- GladeXML *xml;
GConfClient *gconf;
GtkWidget *treeview;
GtkWidget *clue_add;
@@ -114,7 +112,6 @@ destroy_ui_data (gpointer data)
if (!ui)
return;
- g_object_unref (ui->xml);
g_object_unref (ui->gconf);
g_free (ui);
}
@@ -355,20 +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);
- gchar *gladefile;
-
- gladefile = g_build_filename (EVOLUTION_PLUGINDIR,
- "templates.glade",
- NULL);
- ui->xml = glade_xml_new (gladefile, "templates_configuration_box", NULL);
- g_free (gladefile);
+ 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 = glade_xml_get_widget (ui->xml, "clue_treeview");
+ ui->treeview = clue_treeview;
ui->store = gtk_list_store_new (CLUE_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
@@ -391,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 = 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);
@@ -424,7 +460,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, "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);
diff --git a/plugins/templates/templates.glade b/plugins/templates/templates.glade
deleted file mode 100644
index 60720ef3e0..0000000000
--- a/plugins/templates/templates.glade
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="window1">
- <property name="visible">True</property>
- <property name="title">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
-
- <child>
- <widget class="GtkVBox" id="templates_configuration_box">
- <property name="width_request">385</property>
- <property name="height_request">189</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">5</property>
-
- <child>
- <widget class="GtkHBox" id="clue_container">
- <property name="visible">True</property>
- <property name="homogeneous">False</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>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="clue_treeview">
- <property name="border_width">1</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="clue_add">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="clue_edit">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-edit</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="clue_remove">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>