[Xfce4-commits] <ristretto:ristretto-0.0> Show messagebar when opening a single image from the cli

Stephan Arts noreply at xfce.org
Sun Oct 23 19:17:51 CEST 2011


Updating branch refs/heads/ristretto-0.0
         to 128725dbd7d62d490c823c673db859aa85d537e6 (commit)
       from 79277392c9dd1e1ae4a493a54b001dbcdf980efd (commit)

commit 128725dbd7d62d490c823c673db859aa85d537e6
Author: Stephan Arts <stephan at xfce.org>
Date:   Sat Sep 5 12:15:59 2009 +0200

    Show messagebar when opening a single image from the cli

 ChangeLog         |    6 ++++++
 src/main.c        |    6 ++++++
 src/main_window.c |   18 +++++++++++++++++-
 src/main_window.h |    1 +
 4 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8730756..7578ada 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-09-05  Stephan Arts <stephan at xfce.org>
 
+	* src/main.c,
+	  src/main_window.c,
+	  src/main_window.h: Show messagebar when opening a single image from the cli
+
+2009-09-05  Stephan Arts <stephan at xfce.org>
+
 	* src/preferences_dialog.c,
 	  src/settings.c,
 	  src/main_window.c: Implement option to hide thumbnail-bar when fullscreen
diff --git a/src/main.c b/src/main.c
index 1a98148..e4ca8b0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -46,6 +46,7 @@ typedef struct {
     gint argc;
     gchar **argv;
     gint iter;
+    RsttoMainWindow *window;
 } RsttoOpenFiles;
 
 static gboolean
@@ -114,6 +115,7 @@ main(int argc, char **argv)
         rof.argc = argc;
         rof.argv = argv;
     	rof.iter = 1;
+        rof.window = RSTTO_MAIN_WINDOW (window);
 
         g_idle_add ((GSourceFunc )cb_rstto_open_files, &rof);
 
@@ -150,6 +152,10 @@ cb_rstto_open_files (RsttoOpenFiles *rof)
                 if (strncmp (content_type, "image/", 6) == 0)
                 {
                     rstto_image_list_add_file (rof->image_list, file, NULL);
+                    if (rof->argc == 2)
+                    {
+                        rstto_main_window_show_messagebar (rof->window, file);
+                    }
                 }
             }
         }
diff --git a/src/main_window.c b/src/main_window.c
index 5c6f5fd..5764efa 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -1192,7 +1192,6 @@ cb_rstto_main_window_message_bar_open (GtkWidget *widget, RsttoMainWindow *windo
 
     gtk_widget_hide (window->priv->message_bar);
 
-
     file_enumarator = g_file_enumerate_children (window->priv->message_bar_file, "standard::*", 0, NULL, NULL);
     for(file_info = g_file_enumerator_next_file (file_enumarator, NULL, NULL); file_info != NULL; file_info = g_file_enumerator_next_file (file_enumarator, NULL, NULL))
     {
@@ -2381,3 +2380,20 @@ cb_rstto_main_window_toggle_show_thumbnailbar (GtkWidget *widget, RsttoMainWindo
     }
 }
 
+
+void
+rstto_main_window_show_messagebar (RsttoMainWindow *window, GFile *file)
+{
+    if (window->priv->message_bar_file)
+    {
+        g_object_unref (window->priv->message_bar_file);
+        window->priv->message_bar_file = NULL;
+    }
+
+    window->priv->message_bar_file = g_file_get_parent (file);
+
+    gtk_widget_show (window->priv->message_bar);
+    gtk_widget_show (window->priv->message_bar_label);
+    gtk_widget_show (window->priv->message_bar_button_cancel);
+    gtk_widget_show (window->priv->message_bar_button_open);
+}
diff --git a/src/main_window.h b/src/main_window.h
index e70768f..6fc8d6a 100644
--- a/src/main_window.h
+++ b/src/main_window.h
@@ -68,6 +68,7 @@ typedef enum {
 GType      rstto_main_window_get_type();
 
 GtkWidget *rstto_main_window_new (RsttoImageList *, gboolean);
+void       rstto_main_window_show_messagebar (RsttoMainWindow *, GFile *);
 
 G_END_DECLS
 


More information about the Xfce4-commits mailing list