diff options
author | Rob Kendrick <rjek@netsurf-browser.org> | 2007-05-06 16:39:34 +0000 |
---|---|---|
committer | Rob Kendrick <rjek@netsurf-browser.org> | 2007-05-06 16:39:34 +0000 |
commit | dbf2c37f8976ea988eb2cd4d76130091879cb787 (patch) | |
tree | df5d55bf72124331e1373b953baf7330be2c483d /gtk/gtk_gui.c | |
parent | 73281a7addc59a652860d2c0fb0c0c156b52ef3b (diff) | |
download | netsurf-dbf2c37f8976ea988eb2cd4d76130091879cb787.tar.gz netsurf-dbf2c37f8976ea988eb2cd4d76130091879cb787.tar.bz2 |
GTK warn_user() implementation
svn path=/trunk/netsurf/; revision=3269
Diffstat (limited to 'gtk/gtk_gui.c')
-rw-r--r-- | gtk/gtk_gui.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gtk/gtk_gui.c b/gtk/gtk_gui.c index ec52d735e..b706b9d4a 100644 --- a/gtk/gtk_gui.c +++ b/gtk/gtk_gui.c @@ -57,7 +57,7 @@ char *glade_file_location; struct gui_window *search_current_window = 0; GtkWindow *wndAbout; - +GtkWindow *wndWarning; GladeXML *gladeWindows; GtkWindow *wndTooltip; GtkLabel *labelTooltip; @@ -234,6 +234,9 @@ void gui_init(int argc, char** argv) fontdesc = pango_font_description_from_string("Monospace 8"); gtk_widget_modify_font(GTK_WIDGET( glade_xml_get_widget(gladeWindows, "textviewGPL")), fontdesc); + + wndWarning = GTK_WINDOW(glade_xml_get_widget(gladeWindows, "wndWarning")); + nsgtk_history_init(); } @@ -382,6 +385,18 @@ bool gui_search_term_highlighted(struct gui_window *g, void warn_user(const char *warning, const char *detail) { + char buf[300]; /* 300 is the size the RISC OS GUI uses */ + + LOG(("%s %s", warning, detail)); + fflush(stderr); + + snprintf(buf, sizeof(buf), "%s %s", messages_get(warning), + detail ? detail : ""); + buf[sizeof(buf) - 1] = 0; + + gtk_label_set_text(GTK_LABEL(glade_xml_get_widget(gladeWindows, "labelWarning")), buf); + + gtk_widget_show_all(GTK_WIDGET(wndWarning)); } void die(const char * const error) |