From 024e25a62f643da9919c8979a1d0b7de58cfda8d Mon Sep 17 00:00:00 2001 From: Mirko Lindner Date: Sat, 20 Feb 2010 21:10:35 +0100 Subject: [PATCH] create "loading" message Signed-off-by: Mirko Lindner --- src/vido.cc | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/vido.cc b/src/vido.cc index 6757280..b178c3a 100644 --- a/src/vido.cc +++ b/src/vido.cc @@ -74,6 +74,21 @@ const zim::File& get_file() return zimFile; } + +void screenblock(int val){ + + if (val == 1){ + scrolled_window2->remove(); + scrolled_window2->add_label("loading"); + }else if(val == 0){ + scrolled_window2->remove(); + scrolled_window2->add(*html); + } + while( Gtk::Main::events_pending() ){ + Gtk::Main::iteration(); + } +} + // display message in gtk window void show_message(std::string title, std::string txt) { @@ -100,10 +115,10 @@ void show_help() // fill gtkhtml widget with new content -void fill_gtkhtml(std::string& html, std::string url, std::string title){ +void fill_gtkhtml(std::string& html_str, std::string url, std::string title){ log_debug("fill gtkhtml called with " << url << " and " << title); std::string ccontent; - ccontent = "" + html; + ccontent = "" + html_str; gtk_html_flush(GTK_HTML(html_wg)); gtk_html_load_from_string(GTK_HTML(html_wg), ccontent.c_str(), -1); current_url = url; @@ -131,12 +146,15 @@ void fill_gtkhtml(std::string& html, std::string url, std::string title){ while( Gtk::Main::events_pending() ){ Gtk::Main::iteration(); } + screenblock(0); + window2->connect_all(); } void show_history() { + screenblock(1); std::string res, url, title; res += "