[Xfce4-commits] <ristretto:master> Replace popup with infobar
Stephan Arts
noreply at xfce.org
Sat Mar 3 10:54:01 CET 2012
Updating branch refs/heads/master
to 750e20e65bdd0cdaade74bc94f07b9b260f9008a (commit)
from 859c31ae8f52070e8df9888a2b1a124b23ad5ccb (commit)
commit 750e20e65bdd0cdaade74bc94f07b9b260f9008a
Author: Stephan Arts <stephan at xfce.org>
Date: Sat Mar 3 10:51:06 2012 +0100
Replace popup with infobar
Conflicts:
src/settings.c
src/image_viewer.c | 52 ++++++----------------------------------------------
src/main_window.c | 17 +++++++++++++++++
src/settings.c | 29 -----------------------------
3 files changed, 23 insertions(+), 75 deletions(-)
diff --git a/src/image_viewer.c b/src/image_viewer.c
index 65fc28e..dfc1166 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -75,7 +75,6 @@ struct _RsttoImageViewerPriv
GdkColor *bg_color_fs;
GError *error;
- gboolean show_broken_image_error;
RsttoImageViewerTransaction *transaction;
GdkPixbuf *pixbuf;
@@ -289,11 +288,6 @@ rstto_image_viewer_init ( GObject *object )
viewer->priv->visual = gdk_rgb_get_visual();
viewer->priv->colormap = gdk_colormap_new (viewer->priv->visual, TRUE);
- viewer->priv->show_broken_image_error =
- rstto_settings_get_boolean_property (
- viewer->priv->settings,
- "show-error-broken-image");
-
viewer->priv->icon_theme = gtk_icon_theme_get_default ();
viewer->priv->bg_icon = gtk_icon_theme_load_icon (
viewer->priv->icon_theme,
@@ -1433,9 +1427,9 @@ rstto_image_viewer_set_file (
g_error_free (viewer->priv->error);
viewer->priv->error = NULL;
}
- viewer->priv->image_scale = 0;
- viewer->priv->image_width = 0;
- viewer->priv->image_height = 0;
+ viewer->priv->image_scale = 1.0;
+ viewer->priv->image_width = 1.0;
+ viewer->priv->image_height = 1.0;
rstto_image_viewer_load_image (
viewer,
@@ -1923,7 +1917,6 @@ cb_rstto_image_loader_closed (GdkPixbufLoader *loader, RsttoImageViewerTransacti
{
RsttoImageViewer *viewer = transaction->viewer;
GtkWidget *widget = GTK_WIDGET(viewer);
- GtkWidget *error_dialog = NULL;
GtkWidget *vbox, *do_not_show_checkbox;
if (viewer->priv->transaction == transaction)
@@ -1940,6 +1933,9 @@ cb_rstto_image_loader_closed (GdkPixbufLoader *loader, RsttoImageViewerTransacti
}
else
{
+ viewer->priv->image_scale = 1.0;
+ viewer->priv->image_width = 1.0;
+ viewer->priv->image_height = 1.0;
if (viewer->priv->pixbuf)
{
g_object_unref (viewer->priv->pixbuf);
@@ -1947,42 +1943,6 @@ cb_rstto_image_loader_closed (GdkPixbufLoader *loader, RsttoImageViewerTransacti
}
gtk_widget_set_tooltip_text (GTK_WIDGET (viewer), transaction->error->message);
- if (viewer->priv->show_broken_image_error)
- {
- GDK_THREADS_ENTER();
- error_dialog = gtk_message_dialog_new_with_markup (
- NULL,
- 0,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- transaction->error->message
- );
- vbox = gtk_message_dialog_get_message_area (
- GTK_MESSAGE_DIALOG (error_dialog));
-
- do_not_show_checkbox = gtk_check_button_new_with_mnemonic (
- _("Do _not show this message again"));
- gtk_box_pack_end (
- GTK_BOX (vbox),
- do_not_show_checkbox,
- TRUE,
- FALSE,
- 0);
- gtk_widget_show (do_not_show_checkbox);
- gtk_dialog_run (GTK_DIALOG(error_dialog));
-
- if (TRUE == gtk_toggle_button_get_active (
- GTK_TOGGLE_BUTTON (do_not_show_checkbox)))
- {
- viewer->priv->show_broken_image_error = FALSE;
- rstto_settings_set_boolean_property (
- viewer->priv->settings,
- "show-error-broken-image",
- FALSE);
- }
- gtk_widget_destroy (error_dialog);
- GDK_THREADS_LEAVE();
- }
}
diff --git a/src/main_window.c b/src/main_window.c
index 8a5bd78..936f3cd 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -83,6 +83,8 @@ struct _RsttoMainWindowPriv
GtkWidget *menubar;
GtkWidget *toolbar;
+ GtkWidget *warning;
+ GtkWidget *warning_label;
GtkWidget *image_list_toolbar;
GtkWidget *image_viewer_menu;
GtkWidget *position_menu;
@@ -617,6 +619,16 @@ rstto_main_window_init (RsttoMainWindow *window)
window->priv->image_list_toolbar = gtk_ui_manager_get_widget (window->priv->ui_manager, "/navigation-toolbar");
window->priv->image_viewer_menu = gtk_ui_manager_get_widget (window->priv->ui_manager, "/image-viewer-menu");
window->priv->position_menu = gtk_ui_manager_get_widget (window->priv->ui_manager, "/navigation-toolbar-menu");
+ window->priv->warning = gtk_info_bar_new();
+ window->priv->warning_label = gtk_label_new(NULL);
+
+ GtkWidget *info_bar_content_area = gtk_info_bar_get_content_area (
+ GTK_INFO_BAR (window->priv->warning));
+ gtk_container_add (
+ GTK_CONTAINER (info_bar_content_area),
+ window->priv->warning_label);
+ gtk_widget_show_all (info_bar_content_area);
+
/**
* Get the separator toolitem and tell it to expand
@@ -675,6 +687,7 @@ rstto_main_window_init (RsttoMainWindow *window)
gtk_container_add (GTK_CONTAINER (window), main_vbox);
gtk_box_pack_start(GTK_BOX(main_vbox), window->priv->menubar, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(main_vbox), window->priv->toolbar, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(main_vbox), window->priv->warning, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(main_vbox), window->priv->table, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(main_vbox), window->priv->statusbar, FALSE, FALSE, 0);
@@ -683,6 +696,7 @@ rstto_main_window_init (RsttoMainWindow *window)
gtk_table_attach (GTK_TABLE (window->priv->table), window->priv->p_viewer_s_window, 2, 3, 2, 3, GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
gtk_widget_set_no_show_all (window->priv->toolbar, TRUE);
+ gtk_widget_set_no_show_all (window->priv->warning, TRUE);
gtk_widget_set_no_show_all (window->priv->image_list_toolbar, TRUE);
gtk_widget_set_no_show_all (window->priv->t_bar_s_window, TRUE);
gtk_widget_set_no_show_all (window->priv->statusbar, TRUE);
@@ -1127,9 +1141,12 @@ rstto_main_window_update_statusbar (RsttoMainWindow *window)
tmp_status = g_strdup_printf ("%s\t- %s", status, error->message);
g_free (status);
status = tmp_status;
+ gtk_label_set_text (GTK_LABEL(window->priv->warning_label), error->message);
+ gtk_widget_show (window->priv->warning);
}
else
{
+ gtk_widget_hide (window->priv->warning);
if (TRUE == rstto_file_has_exif (cur_file))
{
/* Extend the status-message with exif-info */
diff --git a/src/settings.c b/src/settings.c
index 6d11c8e..0fc04fa 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -74,7 +74,6 @@ enum
PROP_MAXIMIZE_ON_STARTUP,
PROP_MERGE_TOOLBARS,
PROP_ERROR_MISSING_THUMBNAILER,
- PROP_ERROR_BROKEN_IMAGE,
PROP_SORT_TYPE,
PROP_THUMBNAIL_SIZE,
};
@@ -134,7 +133,6 @@ struct _RsttoSettingsPriv
struct {
gboolean missing_thumbnailer;
- gboolean broken_image;
} errors;
};
@@ -172,7 +170,6 @@ rstto_settings_init (GObject *object)
settings->priv->maximize_on_startup = TRUE;
settings->priv->hide_thumbnailbar_fullscreen = TRUE;
settings->priv->errors.missing_thumbnailer = TRUE;
- settings->priv->errors.broken_image = TRUE;
settings->priv->thumbnail_size = THUMBNAIL_SIZE_NORMAL;
xfconf_g_property_bind (
@@ -320,13 +317,6 @@ rstto_settings_init (GObject *object)
xfconf_g_property_bind (
settings->priv->channel,
- "/errors/broken-image",
- G_TYPE_BOOLEAN,
- settings,
- "show-error-broken-image");
-
- xfconf_g_property_bind (
- settings->priv->channel,
"/desktop/type",
G_TYPE_STRING,
settings,
@@ -576,17 +566,6 @@ rstto_settings_class_init (GObjectClass *object_class)
PROP_ERROR_MISSING_THUMBNAILER,
pspec);
- pspec = g_param_spec_boolean (
- "show-error-broken-image",
- "",
- "",
- TRUE,
- G_PARAM_READWRITE);
- g_object_class_install_property (
- object_class,
- PROP_ERROR_BROKEN_IMAGE,
- pspec);
-
pspec = g_param_spec_uint (
"sort-type",
"",
@@ -774,9 +753,6 @@ rstto_settings_set_property (GObject *object,
case PROP_ERROR_MISSING_THUMBNAILER:
settings->priv->errors.missing_thumbnailer = g_value_get_boolean (value);
break;
- case PROP_ERROR_BROKEN_IMAGE:
- settings->priv->errors.broken_image = g_value_get_boolean (value);
- break;
case PROP_SORT_TYPE:
settings->priv->sort_type = g_value_get_uint ( value );
break;
@@ -861,11 +837,6 @@ rstto_settings_get_property (GObject *object,
value,
settings->priv->errors.missing_thumbnailer);
break;
- case PROP_ERROR_BROKEN_IMAGE:
- g_value_set_boolean (
- value,
- settings->priv->errors.broken_image);
- break;
case PROP_SORT_TYPE:
g_value_set_uint (
value,
More information about the Xfce4-commits
mailing list