[Xfce4-commits] <ristretto:devel> Implement about-dialog Add callbacks for fullscreen and 'set wallpaper'
Stephan Arts
stephan at xfce.org
Tue Aug 18 08:02:02 CEST 2009
Updating branch refs/heads/devel
to 0b0f71fdcd7c78c9596027be90df4b729be732f3 (commit)
from 9a4271c192fda221b1e5238bf7d984ba9a4f6311 (commit)
commit 0b0f71fdcd7c78c9596027be90df4b729be732f3
Author: Stephan Arts <stephan at xfce.org>
Date: Tue Aug 18 07:59:42 2009 +0200
Implement about-dialog
Add callbacks for fullscreen and 'set wallpaper'
src/main.c | 26 ++++++-
src/main_window.glade | 194 ++++++++++++++++++++++++++++------------------
src/main_window.ui | 206 ++++++++++++++++++++++++++++++-------------------
3 files changed, 269 insertions(+), 157 deletions(-)
diff --git a/src/main.c b/src/main.c
index fc09e28..80407b2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -245,7 +245,7 @@ main(int argc, char **argv)
if (gtk_builder_add_from_string (builder, main_window_ui,
main_window_ui_length, &error) != 0)
{
- window = GTK_WIDGET (gtk_builder_get_object (builder, "mainwindow"));
+ window = GTK_WIDGET (gtk_builder_get_object (builder, "main_window"));
gtk_builder_connect_signals (builder, NULL);
rstto_main_window_configure_widgets (builder);
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
@@ -408,6 +408,30 @@ cb_menu_show_thumbnail_bar_toggled (GtkWidget *widget, gpointer user_data)
g_debug ("%s",__FUNCTION__);
}
+
+void
+cb_menu_fullscreen_activate (GtkWidget *widget, gpointer user_data)
+{
+ g_debug ("%s",__FUNCTION__);
+
+}
+
+void
+cb_menu_about_activate (GtkWidget *widget, gpointer user_data)
+{
+ GtkWidget *dialog = GTK_WIDGET (gtk_builder_get_object (builder, "about_dialog"));
+ gtk_dialog_run (GTK_DIALOG(dialog));
+
+ gtk_widget_hide (dialog);
+
+}
+
+void
+cb_menu_set_wallpaper_activate (GtkWidget *widget, gpointer user_data)
+{
+ g_debug ("%s",__FUNCTION__);
+
+}
/* */
void
cb_navbox_popup_context_menu (GtkWidget *widget, gpointer user_data)
diff --git a/src/main_window.glade b/src/main_window.glade
index 2c35ced..f087b45 100644
--- a/src/main_window.glade
+++ b/src/main_window.glade
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Mon Aug 17 23:08:22 2009 -->
+<!--Generated with glade3 3.4.5 on Tue Aug 18 07:46:55 2009 -->
<glade-interface>
<requires lib="xfce4"/>
- <widget class="GtkWindow" id="mainwindow">
+ <widget class="GtkWindow" id="main_window">
<property name="title" translatable="yes">Image Viewer</property>
<property name="icon_name">ristretto</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
@@ -299,18 +299,20 @@
</widget>
</child>
<child>
- <widget class="GtkImageMenuItem" id="menuitem26">
+ <widget class="GtkImageMenuItem" id="menu_fullscreen">
<property name="visible">True</property>
<property name="label" translatable="yes">gtk-fullscreen</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
+ <signal name="activate" handler="cb_menu_fullscreen_activate"/>
</widget>
</child>
<child>
- <widget class="GtkMenuItem" id="menuitem27">
+ <widget class="GtkMenuItem" id="menu_set_wallpaper">
<property name="visible">True</property>
<property name="label" translatable="yes">Set as wallpaper</property>
<property name="use_underline">True</property>
+ <signal name="activate" handler="cb_menu_set_wallpaper_activate"/>
</widget>
</child>
</widget>
@@ -390,11 +392,12 @@
<widget class="GtkMenu" id="menu3">
<property name="visible">True</property>
<child>
- <widget class="GtkImageMenuItem" id="imagemenuitem10">
+ <widget class="GtkImageMenuItem" id="menu_about">
<property name="visible">True</property>
<property name="label" translatable="yes">gtk-about</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
+ <signal name="activate" handler="cb_menu_about_activate"/>
</widget>
</child>
</widget>
@@ -497,76 +500,6 @@
<placeholder/>
</child>
<child>
- <widget class="GtkHPaned" id="hpaned1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <widget class="GtkHPaned" id="hpaned2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <widget class="GtkVPaned" id="vpaned1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <widget class="GtkVPaned" id="vpaned2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <widget class="GtkScrolledWindow" id="center_wiindow">
- <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_IN</property>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="resize">False</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="resize">False</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
<widget class="GtkToolbar" id="nav_toolbar">
<property name="visible">True</property>
<property name="no_show_all">True</property>
@@ -708,6 +641,76 @@
<property name="x_options">GTK_FILL</property>
</packing>
</child>
+ <child>
+ <widget class="GtkHPaned" id="hpaned1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <widget class="GtkHPaned" id="hpaned2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <widget class="GtkVPaned" id="vpaned1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <widget class="GtkVPaned" id="vpaned2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="center_wiindow">
+ <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_IN</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="position">2</property>
@@ -863,4 +866,45 @@
</widget>
</child>
</widget>
+ <widget class="GtkAboutDialog" id="about_dialog">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">About Ristretto</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="icon_name">ristretto</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="skip_taskbar_hint">True</property>
+ <property name="skip_pager_hint">True</property>
+ <property name="transient_for">main_window</property>
+ <property name="has_separator">False</property>
+ <property name="program_name">Ristretto</property>
+ <property name="copyright" translatable="yes">Copyright 2006-2009 Stephan Arts</property>
+ <property name="comments" translatable="yes">An image viewer for the Xfce Desktop Environment.</property>
+ <property name="website">goodies.xfce.org/projects/applications/ristretto</property>
+ <property name="website_label" translatable="yes">website</property>
+ <property name="authors">Stephan Arts <stephan at xfce.org></property>
+ <property name="logo_icon_name">ristretto</property>
+ <property name="wrap_license">True</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <placeholder/>
+ </child>
+ <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>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</glade-interface>
diff --git a/src/main_window.ui b/src/main_window.ui
index 824270c..0c9abac 100644
--- a/src/main_window.ui
+++ b/src/main_window.ui
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<!--Generated with glade3 3.4.5 on Mon Aug 17 23:04:06 2009 -->
+<!--Generated with glade3 3.4.5 on Tue Aug 18 07:46:55 2009 -->
<interface>
<object class="GtkUIManager" id="uimanager1">
<child>
@@ -163,15 +163,17 @@
</object>
</child>
<child>
- <object class="GtkAction" id="menuitem26">
+ <object class="GtkAction" id="menu_fullscreen">
<property name="stock_id" translatable="yes">gtk-fullscreen</property>
- <property name="name">menuitem26</property>
+ <property name="name">menu_fullscreen</property>
+ <signal handler="cb_menu_fullscreen_activate" name="activate"/>
</object>
</child>
<child>
- <object class="GtkAction" id="menuitem27">
- <property name="name">menuitem27</property>
+ <object class="GtkAction" id="menu_set_wallpaper">
+ <property name="name">menu_set_wallpaper</property>
<property name="label" translatable="yes">Set as wallpaper</property>
+ <signal handler="cb_menu_set_wallpaper_activate" name="activate"/>
</object>
</child>
<child>
@@ -217,9 +219,10 @@
</object>
</child>
<child>
- <object class="GtkAction" id="imagemenuitem10">
+ <object class="GtkAction" id="menu_about">
<property name="stock_id" translatable="yes">gtk-about</property>
- <property name="name">imagemenuitem10</property>
+ <property name="name">menu_about</property>
+ <signal handler="cb_menu_about_activate" name="activate"/>
</object>
</child>
</object>
@@ -262,8 +265,8 @@
<menuitem action="menuitem25"/>
</menu>
<separator/>
- <menuitem action="menuitem26"/>
- <menuitem action="menuitem27"/>
+ <menuitem action="menu_fullscreen"/>
+ <menuitem action="menu_set_wallpaper"/>
</menu>
<menu action="menuitem5">
<menuitem action="menuitem7"/>
@@ -274,7 +277,7 @@
<menuitem action="menuitem33"/>
</menu>
<menu action="menuitem4">
- <menuitem action="imagemenuitem10"/>
+ <menuitem action="menu_about"/>
</menu>
</menubar>
</ui>
@@ -333,7 +336,7 @@
</popup>
</ui>
</object>
- <object class="GtkWindow" id="mainwindow">
+ <object class="GtkWindow" id="main_window">
<property name="title" translatable="yes">Image Viewer</property>
<property name="icon_name">ristretto</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
@@ -439,76 +442,6 @@
<placeholder/>
</child>
<child>
- <object class="GtkHPaned" id="hpaned1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <object class="GtkHPaned" id="hpaned2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GtkVPaned" id="vpaned1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <object class="GtkVPaned" id="vpaned2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GtkScrolledWindow" id="center_wiindow">
- <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_IN</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="resize">False</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="resize">False</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
<object class="GtkToolbar" id="nav_toolbar">
<property name="visible">True</property>
<property name="no_show_all">True</property>
@@ -650,6 +583,76 @@
<property name="x_options">GTK_FILL</property>
</packing>
</child>
+ <child>
+ <object class="GtkHPaned" id="hpaned1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkHPaned" id="hpaned2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkVPaned" id="vpaned1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkVPaned" id="vpaned2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkScrolledWindow" id="center_wiindow">
+ <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_IN</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="position">2</property>
@@ -750,4 +753,45 @@
</object>
</child>
</object>
+ <object class="GtkAboutDialog" id="about_dialog">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">About Ristretto</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="icon_name">ristretto</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="skip_taskbar_hint">True</property>
+ <property name="skip_pager_hint">True</property>
+ <property name="transient_for">main_window</property>
+ <property name="has_separator">False</property>
+ <property name="program_name">Ristretto</property>
+ <property name="copyright" translatable="yes">Copyright 2006-2009 Stephan Arts</property>
+ <property name="comments" translatable="yes">An image viewer for the Xfce Desktop Environment.</property>
+ <property name="website">goodies.xfce.org/projects/applications/ristretto</property>
+ <property name="website_label" translatable="yes">website</property>
+ <property name="authors">Stephan Arts <stephan at xfce.org></property>
+ <property name="logo_icon_name">ristretto</property>
+ <property name="wrap_license">True</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
</interface>
More information about the Xfce4-commits
mailing list