[Goodies-commits] r4095 - ristretto/trunk/src
Stephan Arts
stephan at xfce.org
Sun Mar 23 09:49:25 CET 2008
Author: stephan
Date: 2008-03-23 08:49:25 +0000 (Sun, 23 Mar 2008)
New Revision: 4095
Modified:
ristretto/trunk/src/main.c
ristretto/trunk/src/main_window.c
ristretto/trunk/src/main_window.h
Log:
Show status-message when opening files
Modified: ristretto/trunk/src/main.c
===================================================================
--- ristretto/trunk/src/main.c 2008-03-22 14:00:30 UTC (rev 4094)
+++ ristretto/trunk/src/main.c 2008-03-23 08:49:25 UTC (rev 4095)
@@ -412,7 +412,13 @@
{
gchar *path_dir = NULL;
RsttoNavigator *navigator = rof->navigator;
+ RsttoMainWindow *window = rof->main_window;
+ GtkStatusbar *bar = rstto_main_window_get_statusbar(window);
+
+ guint context_id = gtk_statusbar_get_context_id(bar, "StatusMessages");
+ guint message_id = gtk_statusbar_push(bar, context_id, N_("Opening file(s)..."));
+
if (g_slist_length(rof->files) >= 1)
{
GSList *_iter = rof->files;
@@ -435,12 +441,16 @@
if(g_file_test(path_dir, G_FILE_TEST_IS_DIR))
{
- rstto_navigator_open_folder (navigator, path_dir, TRUE, NULL);
- rstto_navigator_jump_first(navigator);
+ if(rstto_navigator_open_folder (navigator, path_dir, TRUE, NULL) == TRUE)
+ {
+ rstto_navigator_jump_first(navigator);
+ gtk_statusbar_remove(bar, context_id, message_id);
+ }
}
else
{
rstto_navigator_open_file (navigator, path_dir, TRUE, NULL);
+ gtk_statusbar_remove(bar, context_id, message_id);
}
}
Modified: ristretto/trunk/src/main_window.c
===================================================================
--- ristretto/trunk/src/main_window.c 2008-03-22 14:00:30 UTC (rev 4094)
+++ ristretto/trunk/src/main_window.c 2008-03-23 08:49:25 UTC (rev 4095)
@@ -1406,7 +1406,7 @@
GtkStatusbar *statusbar = GTK_STATUSBAR(window->priv->statusbar);
g_object_add_weak_pointer(G_OBJECT(window), (gpointer *)&statusbar);
- gint context_id = gtk_statusbar_get_context_id(statusbar, "Describes what ristretto is doing");
+ gint context_id = gtk_statusbar_get_context_id(statusbar, "StatusMessages");
gint message_id = gtk_statusbar_push(statusbar, context_id, N_("Opening file(s)..."));
GtkWidget *dialog = gtk_file_chooser_dialog_new(_("Open image"),
@@ -1446,7 +1446,7 @@
GtkStatusbar *statusbar = GTK_STATUSBAR(window->priv->statusbar);
g_object_add_weak_pointer(G_OBJECT(window), (gpointer *)&statusbar);
- gint context_id = gtk_statusbar_get_context_id(statusbar, "Describes what ristretto is doing");
+ gint context_id = gtk_statusbar_get_context_id(statusbar, "StatusMessages");
gint message_id = gtk_statusbar_push(statusbar, context_id, N_("Opening file(s)..."));
GtkWidget *dialog = gtk_file_chooser_dialog_new(_("Open folder"),
@@ -1483,7 +1483,7 @@
GtkStatusbar *statusbar = GTK_STATUSBAR(window->priv->statusbar);
g_object_add_weak_pointer(G_OBJECT(window), (gpointer *)&statusbar);
- gint context_id = gtk_statusbar_get_context_id(statusbar, "Describes what ristretto is doing");
+ gint context_id = gtk_statusbar_get_context_id(statusbar, "StatusMessages");
gint message_id = gtk_statusbar_push(statusbar, context_id, N_("Opening file(s)..."));
gchar *uri = gtk_recent_chooser_get_current_uri(chooser);
@@ -1927,3 +1927,9 @@
gtk_widget_set_sensitive(widget, FALSE);
}
}
+
+GtkStatusbar *
+rstto_main_window_get_statusbar(RsttoMainWindow *window)
+{
+ return GTK_STATUSBAR(window->priv->statusbar);
+}
Modified: ristretto/trunk/src/main_window.h
===================================================================
--- ristretto/trunk/src/main_window.h 2008-03-22 14:00:30 UTC (rev 4094)
+++ ristretto/trunk/src/main_window.h 2008-03-23 08:49:25 UTC (rev 4095)
@@ -98,6 +98,9 @@
gboolean
rstto_main_window_get_scale_to_100 (RsttoMainWindow *window);
+GtkStatusbar *
+rstto_main_window_get_statusbar(RsttoMainWindow *window);
+
G_END_DECLS
#endif /* __RISTRETTO_MAIN_WINDOW_H__ */
More information about the Goodies-commits
mailing list