[Xfce4-commits] <ristretto:master> Add edit-button
Stephan Arts
noreply at xfce.org
Fri Mar 30 20:32:01 CEST 2012
Updating branch refs/heads/master
to ecd7144ac6e13fcfc4beb49518018bcea130547f (commit)
from fce0d6e6a5aeecbe1a798227821dafded7a5efc5 (commit)
commit ecd7144ac6e13fcfc4beb49518018bcea130547f
Author: Stephan Arts <stephan at xfce.org>
Date: Fri Jan 27 22:29:45 2012 +0100
Add edit-button
src/main_window.c | 36 +++++++++++++++++++++++++++++++++---
src/main_window_ui.xml | 3 ++-
2 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/src/main_window.c b/src/main_window.c
index 7aae06d..cfb410f 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -193,6 +193,8 @@ cb_rstto_main_window_properties (GtkWidget *widget, RsttoMainWindow *window);
static void
cb_rstto_main_window_close (GtkWidget *widget, RsttoMainWindow *window);
static void
+cb_rstto_main_window_edit (GtkWidget *widget, RsttoMainWindow *window);
+static void
cb_rstto_main_window_save_copy (GtkWidget *widget, RsttoMainWindow *window);
static void
cb_rstto_main_window_delete (GtkWidget *widget, RsttoMainWindow *window);
@@ -335,6 +337,7 @@ static GtkActionEntry action_entries[] =
{ "open", "document-open", N_ ("_Open"), "<control>O", N_ ("Open an image"), G_CALLBACK (cb_rstto_main_window_open_image), },
{ "save-copy", GTK_STOCK_SAVE_AS, N_ ("_Save copy"), "<control>s", N_ ("Save a copy of the image"), G_CALLBACK (cb_rstto_main_window_save_copy), },
{ "properties", GTK_STOCK_PROPERTIES, N_ ("_Properties"), NULL, N_ ("Show file properties"), G_CALLBACK (cb_rstto_main_window_properties), },
+ { "edit", GTK_STOCK_EDIT, N_ ("_Edit"), NULL, N_ ("Edit this image"), G_CALLBACK (cb_rstto_main_window_edit), },
{ "close", GTK_STOCK_CLOSE, N_ ("_Close"), "<control>W", N_ ("Close this image"), G_CALLBACK (cb_rstto_main_window_close), },
{ "quit", GTK_STOCK_QUIT, N_ ("_Quit"), "<control>Q", N_ ("Quit Ristretto"), G_CALLBACK (cb_rstto_main_window_quit), },
/* Edit Menu */
@@ -1308,7 +1311,7 @@ rstto_main_window_update_buttons (RsttoMainWindow *window)
/* Toolbar */
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/save-copy"), FALSE);
- gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/close"), FALSE);
+ gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/edit"), FALSE);
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/delete"), FALSE);
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/forward"), FALSE);
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/back"), FALSE);
@@ -1439,7 +1442,7 @@ rstto_main_window_update_buttons (RsttoMainWindow *window)
/* Toolbar */
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/save-copy"), TRUE);
- gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/close"), TRUE);
+ gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/edit"), TRUE);
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/delete"), TRUE);
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/forward"), FALSE);
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/back"), FALSE);
@@ -1542,7 +1545,7 @@ rstto_main_window_update_buttons (RsttoMainWindow *window)
/* Toolbar */
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/save-copy"), TRUE);
- gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/close"), TRUE);
+ gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/edit"), TRUE);
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/delete"), TRUE);
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/zoom-in"), TRUE);
gtk_widget_set_sensitive (gtk_ui_manager_get_widget (window->priv->ui_manager, "/file-toolbar/zoom-out"), TRUE);
@@ -3264,6 +3267,33 @@ cb_rstto_main_window_close (
}
/**
+ * cb_rstto_main_window_edit:
+ * @widget:
+ * @window:
+ *
+ * Edit images.
+ *
+ */
+static void
+cb_rstto_main_window_edit (
+ GtkWidget *widget,
+ RsttoMainWindow *window)
+{
+ RsttoFile *r_file = rstto_image_list_iter_get_file(window->priv->iter);
+ gchar *content_type = rstto_file_get_content_type (r_file);
+ GList *app_infos = g_app_info_get_all_for_type (content_type);
+ GList *iter = app_infos;
+
+ while (iter)
+ {
+ g_debug("N: %s", g_app_info_get_name (iter->data));
+ g_debug("DN:%s", g_app_info_get_display_name (iter->data));
+ g_debug("D: %s", g_app_info_get_description (iter->data));
+ iter = g_list_next (iter);
+ }
+}
+
+/**
* cb_rstto_main_window_delete:
* @widget:
* @window:
diff --git a/src/main_window_ui.xml b/src/main_window_ui.xml
index a9d9e45..0f0b727 100644
--- a/src/main_window_ui.xml
+++ b/src/main_window_ui.xml
@@ -127,8 +127,9 @@
<toolitem action="open"/>
<separator />
<toolitem action="save-copy"/>
- <toolitem action="close"/>
<toolitem action="delete"/>
+ <separator />
+ <toolitem action="edit"/>
<separator name="separator-1"/>
<toolitem action="back"/>
<placeholder name="placeholder-slideshow" />
More information about the Xfce4-commits
mailing list