aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-error.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2006-05-30 12:37:29 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2006-05-30 12:37:29 +0800
commitf45a960006121e20158cbd6de5414a2192fc0f46 (patch)
tree7516ca7b668b7a6692c806701e98b1bc327d7f34 /e-util/e-error.c
parentac76d9bc53551eb9e0b9dd18206127f7b6fe9176 (diff)
downloadgsoc2013-evolution-f45a960006121e20158cbd6de5414a2192fc0f46.tar.gz
gsoc2013-evolution-f45a960006121e20158cbd6de5414a2192fc0f46.tar.zst
gsoc2013-evolution-f45a960006121e20158cbd6de5414a2192fc0f46.zip
Fix for bug #332936
svn path=/trunk/; revision=32053
Diffstat (limited to 'e-util/e-error.c')
-rw-r--r--e-util/e-error.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/e-util/e-error.c b/e-util/e-error.c
index e8cf041310..0ad7e2e77e 100644
--- a/e-util/e-error.c
+++ b/e-util/e-error.c
@@ -35,7 +35,8 @@
#include <gtk/gtkwindow.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkimage.h>
-
+#include <gtk/gtkscrolledwindow.h>
+#include <gtk/gtkwindow.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-url.h>
@@ -62,6 +63,7 @@ struct _e_error {
char *primary;
char *secondary;
char *help_uri;
+ gboolean scroll;
struct _e_error_button *buttons;
};
@@ -215,6 +217,8 @@ ee_load(const char *path)
e = g_malloc0(sizeof(*e));
e->id = g_strdup(tmp);
+ e->scroll = FALSE;
+
xmlFree(tmp);
lastbutton = (struct _e_error_button *)&e->buttons;
@@ -235,6 +239,13 @@ ee_load(const char *path)
e->default_response = map_response(tmp);
xmlFree(tmp);
}
+
+ tmp = xmlGetProp(error, "scroll");
+ if (tmp) {
+ if (!strcmp(tmp, "yes"))
+ e->scroll = TRUE;
+ xmlFree(tmp);
+ }
for (scan = error->children;scan;scan=scan->next) {
if (!strcmp(scan->name, "primary")) {
@@ -406,7 +417,7 @@ e_error_newv(GtkWindow *parent, const char *tag, const char *arg0, va_list ap)
struct _e_error_table *table;
struct _e_error *e;
struct _e_error_button *b;
- GtkWidget *hbox, *w;
+ GtkWidget *hbox, *w, *scroll=NULL;
char *tmp, *domain, *id;
GString *out;
GPtrArray *args;
@@ -524,12 +535,22 @@ e_error_newv(GtkWindow *parent, const char *tag, const char *arg0, va_list ap)
g_ptr_array_free(args, TRUE);
+ if (e->scroll) {
+ scroll = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy ((GtkScrolledWindow *)scroll, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+ }
w = gtk_label_new(NULL);
gtk_label_set_selectable((GtkLabel *)w, TRUE);
gtk_label_set_line_wrap((GtkLabel *)w, TRUE);
gtk_label_set_markup((GtkLabel *)w, out->str);
g_string_free(out, TRUE);
- gtk_box_pack_start((GtkBox *)hbox, w, FALSE, FALSE, 0);
+ if (e->scroll) {
+ gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow *)scroll, w);
+ gtk_box_pack_start((GtkBox *)hbox, scroll, FALSE, FALSE, 0);
+ gtk_window_set_default_size ((GtkWindow *)dialog, 360, 180);
+ } else
+ gtk_box_pack_start((GtkBox *)hbox, w, FALSE, FALSE, 0);
+
gtk_widget_show_all(hbox);
gtk_box_pack_start((GtkBox *)dialog->vbox, hbox, TRUE, TRUE, 0);