Commit c426b198 authored by Adam Schreiber's avatar Adam Schreiber

Bug 590247 - Migrate from libglade to GtkBuilder

parent febaf6d5
gladedir = $(datadir)/seahorse-plugins/glade/
uidir = $(datadir)/seahorse-plugins/ui/
localedir = $(datadir)/locale
pixmapsdir = $(datadir)/pixmaps/
......@@ -23,8 +23,8 @@ seahorse_agent_LDADD = \
$(top_builddir)/libseahorse/libseahorse.a \
$(SEAHORSE_LIBS)
glade_DATA = \
seahorse-agent-cache.glade
ui_DATA = \
seahorse-agent-cache.xml
man_MANS = seahorse-agent.1
......
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<requires lib="gnome"/>
<widget class="GtkDialog" id="agent-cache">
<property name="visible">True</property>
<property name="title" translatable="yes">Cached Encryption Keys</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_CENTER</property>
<property name="modal">False</property>
<property name="default_width">380</property>
<property name="default_height">250</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">True</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>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="clear_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-clear</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-5</property>
<signal name="clicked" handler="clear_clicked"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="close_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-5</property>
<signal name="clicked" handler="close_clicked"/>
<accelerator key="Escape" modifiers="0" signal="clicked"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="border_width">12</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">12</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="key_list">
<property name="border_width">3</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="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="insecure_label">
<property name="can_focus">True</property>
<property name="label" translatable="yes">&lt;b&gt;Warning&lt;/b&gt;: Your system is not configured to cache passphrases in secure memory.</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkMenu" id="context-menu">
<child>
<widget class="GtkImageMenuItem" id="clear_cache">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Clear passphrase cache</property>
<property name="label" translatable="yes">_Clear Cache</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_clear_cache_activate" last_modification_time="Wed, 29 Sep 2004 17:59:24 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="stock">gtk-clear</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="show_window">
<property name="visible">True</property>
<property name="label" translatable="yes">_Show Window</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_show_window_activate" last_modification_time="Wed, 29 Sep 2004 17:59:24 GMT"/>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separator1">
<property name="visible">True</property>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="cache_settings">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Change passphrase cache settings.</property>
<property name="label" translatable="yes">Cache _Preferences</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_settings_activate" last_modification_time="Thu, 19 May 2005 04:27:55 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
</glade-interface>
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkDialog" id="agent-cache">
<property name="visible">True</property>
<property name="title" translatable="yes">Cached Encryption Keys</property>
<property name="window_position">center</property>
<property name="default_width">380</property>
<property name="default_height">250</property>
<property name="type_hint">normal</property>
<property name="skip_taskbar_hint">True</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="border_width">12</property>
<property name="spacing">12</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkTreeView" id="key_list">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">3</property>
</object>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<child>
<object class="GtkLabel" id="insecure_label">
<property name="can_focus">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Warning&lt;/b&gt;: Your system is not configured to cache passphrases in secure memory.</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="clear_button">
<property name="label">gtk-clear</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="clear_clicked"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="close_button">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
<accelerator key="Escape" signal="clicked"/>
<signal name="clicked" handler="close_clicked"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-5">clear_button</action-widget>
<action-widget response="-5">close_button</action-widget>
</action-widgets>
</object>
<object class="GtkMenu" id="context-menu">
<child>
<object class="GtkImageMenuItem" id="clear_cache">
<property name="label">_Clear Cache</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_clear_cache_activate"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="show_window">
<property name="visible">True</property>
<property name="label" translatable="yes">_Show Window</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_show_window_activate"/>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="separator1">
<property name="visible">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="cache_settings">
<property name="label">Cache _Preferences</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_settings_activate"/>
</object>
</child>
</object>
</interface>
......@@ -59,7 +59,7 @@ enum {
};
/* Called to close status window */
void
G_MODULE_EXPORT void
window_destroy ()
{
if (g_window) {
......@@ -69,7 +69,7 @@ window_destroy ()
}
/* When window close clicked we close window */
static int
G_MODULE_EXPORT static int
delete_event (GtkWidget *widget, GdkEvent *event, gpointer data)
{
window_destroy ();
......@@ -77,14 +77,14 @@ delete_event (GtkWidget *widget, GdkEvent *event, gpointer data)
}
/* When close button clicked */
static void
G_MODULE_EXPORT static void
close_clicked (GtkButton *button, SeahorseWidget *swidget)
{
window_destroy ();
}
/* Clear button, clear cache and close */
static void
G_MODULE_EXPORT static void
clear_clicked (GtkButton *button, SeahorseWidget *swidget)
{
seahorse_agent_cache_clearall ();
......@@ -124,7 +124,7 @@ window_update_keys ()
GtkTreeView *tree;
g_return_if_fail (g_window != NULL);
tree = GTK_TREE_VIEW (glade_xml_get_widget (g_window->xml, "key_list"));
tree = GTK_TREE_VIEW (seahorse_widget_get_widget (g_window, "key_list"));
g_return_if_fail (tree != NULL);
store = GTK_TREE_STORE (gtk_tree_view_get_model (tree));
......@@ -162,20 +162,21 @@ window_show ()
GtkWidget *w;
if (g_window) {
w = glade_xml_get_widget (g_window->xml, g_window->name);
w = GTK_WIDGET (seahorse_widget_get_widget (g_window, g_window->name));
gtk_window_present (GTK_WINDOW (w));
return;
}
g_window = seahorse_widget_new ("agent-cache", NULL);
w = glade_xml_get_widget (g_window->xml, g_window->name);
w = GTK_WIDGET (seahorse_widget_get_widget (g_window, g_window->name));
g_signal_connect (G_OBJECT (w), "delete_event", G_CALLBACK (delete_event), NULL);
glade_xml_signal_connect_data (g_window->xml, "close_clicked",
G_CALLBACK (close_clicked), g_window);
glade_xml_signal_connect_data (g_window->xml, "clear_clicked",
G_CALLBACK (clear_clicked), g_window);
w = GTK_WIDGET (seahorse_widget_get_widget (g_window, "close_button"));
g_signal_connect (G_OBJECT (w), "clicked", G_CALLBACK (close_clicked), g_window);
w = GTK_WIDGET (seahorse_widget_get_widget (g_window, "clear_button"));
g_signal_connect (G_OBJECT (w), "clicked", G_CALLBACK (clear_clicked), g_window);
window_update_keys ();
}
......@@ -224,7 +225,7 @@ on_settings_activate (GtkWidget *item, gpointer data)
}
/* Called when icon clicked */
static void
G_MODULE_EXPORT static void
tray_activate (GtkStatusIcon *icon, void *data)
{
if (g_window)
......@@ -234,28 +235,27 @@ tray_activate (GtkStatusIcon *icon, void *data)
}
/* Called when icon clicked */
static void
G_MODULE_EXPORT static void
tray_popup_menu (GtkStatusIcon *icon, guint button, guint32 timestamp, void *data)
{
GtkWidget *menu;
GladeXML *xml;
xml = glade_xml_new (SEAHORSE_GLADEDIR "seahorse-agent-cache.glade",
"context-menu", NULL);
menu = glade_xml_get_widget (xml, "context-menu");
glade_xml_signal_connect_data (xml, "on_clear_cache_activate",
G_CALLBACK (on_clear_cache_activate), NULL);
glade_xml_signal_connect_data (xml, "on_show_window_activate",
G_CALLBACK (on_show_window_activate), NULL);
glade_xml_signal_connect_data (xml, "on_settings_activate",
G_CALLBACK (on_settings_activate), NULL);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
GtkWidget *w;
w = GTK_WIDGET (seahorse_widget_get_widget (g_window, "clear_cache"));
g_object_connect (G_OBJECT (w), "activate", G_CALLBACK (on_clear_cache_activate), NULL);
w = GTK_WIDGET (seahorse_widget_get_widget (g_window, "show_window"));
g_object_connect (G_OBJECT (w), "activate", G_CALLBACK (on_show_window_activate), NULL);
w = GTK_WIDGET (seahorse_widget_get_widget (g_window, "cache_settings"));
g_object_connect (G_OBJECT (w), "activate", G_CALLBACK (on_settings_activate), NULL);
w = GTK_WIDGET (seahorse_widget_get_widget (g_window, "context-menu"));
gtk_menu_popup (GTK_MENU (w), NULL, NULL,
gtk_status_icon_position_menu, icon, button, timestamp);
if (button == 0)
gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE);
g_object_unref (xml);
gtk_menu_shell_select_first (GTK_MENU_SHELL (w), FALSE);
}
/* Remove tray icon */
......
gladedir = $(datadir)/seahorse-plugins/glade/
uidir = $(datadir)/seahorse-plugins/ui/
localedir = $(datadir)/locale
pixmapsdir = $(datadir)/pixmaps/seahorse-plugins/
seahorselibexecbindir = $(libdir)/seahorse-plugins/
......@@ -9,7 +9,7 @@ INCLUDES = -I$(top_builddir) \
-I$(top_srcdir)/libcryptui \
$(SEAHORSE_CFLAGS) \
-DDATA_DIR=\""$(datadir)"\" \
-DSEAHORSE_GLADEDIR=\""$(gladedir)"\" \
-DSEAHORSE_UIDIR=\""$(uidir)"\" \
-DLOCALEDIR=\"$(localedir)\" \
-DPIXMAPSDIR=\""$(pixmapsdir)"\" \
-DEXECDIR=\""$(seahorselibexecbindir)"\" \
......@@ -56,11 +56,11 @@ seahorse-marshal.c: seahorse-marshal.list $(GLIB_GENMARSHAL)
echo "#include \"seahorse-marshal.h\"" > $@ && \
$(GLIB_GENMARSHAL) $< --body --prefix=seahorse_marshal >> $@
glade_DATA = \
seahorse-notify.glade \
seahorse-prefs.glade \
seahorse-progress.glade \
seahorse-multi-encrypt.glade
ui_DATA = \
seahorse-notify.xml \
seahorse-prefs.xml \
seahorse-progress.xml \
seahorse-multi-encrypt.xml
EXTRA_DIST = $(glade_DATA) \
seahorse-marshal.list
......@@ -50,6 +50,8 @@
#define KEYSHARING_KEY SEAHORSE_SCHEMAS "/sharing/sharing_enabled"
#define WINDOW_SIZE SEAHORSE_SCHEMAS "/windows/"
void seahorse_gconf_disconnect ();
void seahorse_gconf_set_boolean (const char *key,
......
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<widget class="GtkDialog" id="multi-encrypt">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Encrypt Multiple Files</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_CENTER</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>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="helpbutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-help</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-11</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="cancelbutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-6</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="okbutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-5</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox3">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">12</property>
<child>
<widget class="GtkLabel" id="message">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;You have selected multiple files or folders&lt;/b&gt;</property>
<property name="use_underline">True</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="local-options">
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">10</property>
<child>
<widget class="GtkEntry" id="package-name">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">encrypted-package</property>
<property name="has_frame">True</property>
<property name="invisible_char"></property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>