Date:2010-02-20 21:10:35 (10 years 5 months ago)
Author:Mirko Lindner
Commit:024e25a62f643da9919c8979a1d0b7de58cfda8d
Message:create "loading" message

Signed-off-by: Mirko Lindner <mirko@sharism.cc>
Files: src/vido.cc (8 diffs)

Change Details

src/vido.cc
7474  return zimFile;
7575}
7676
77
78void screenblock(int val){
79
80        if (val == 1){
81                scrolled_window2->remove();
82                scrolled_window2->add_label("loading");
83        }else if(val == 0){
84                scrolled_window2->remove();
85                scrolled_window2->add(*html);
86        }
87        while( Gtk::Main::events_pending() ){
88                Gtk::Main::iteration();
89        }
90}
91
7792// display message in gtk window
7893void show_message(std::string title, std::string txt)
7994{
...... 
100115
101116// fill gtkhtml widget with new content
102117
103void fill_gtkhtml(std::string& html, std::string url, std::string title){
118void fill_gtkhtml(std::string& html_str, std::string url, std::string title){
104119    log_debug("fill gtkhtml called with " << url << " and " << title);
105120    std::string ccontent;
106    ccontent = "<a name=\"top\"></a>" + html;
121    ccontent = "<a name=\"top\"></a>" + html_str;
107122    gtk_html_flush(GTK_HTML(html_wg));
108123    gtk_html_load_from_string(GTK_HTML(html_wg), ccontent.c_str(), -1);
109124    current_url = url;
...... 
131146        while( Gtk::Main::events_pending() ){
132147                Gtk::Main::iteration();
133148        }
149        screenblock(0);
150
134151        window2->connect_all();
135152
136153}
137154
138155void show_history()
139156{
157    screenblock(1);
140158  std::string res, url, title;
141159  res += "<ul style=\"list-style-type:none;\">";
142160
...... 
189207
190208// // // externally called functions
191209
210
192211// // display random article
193212void show_random()
194213{
195214// window2->disconnect_all();
215
216        screenblock(1);
196217    log_debug("random called. window all disconnected");
197218    zim::File m = get_file();
198219        zim::Article article;
...... 
219240    position = 0;
220241    fill_gtkhtml(res, article.getUrl(), article.getTitle());
221242        log_debug("random called. window all connected");
243
222244}
223245
224246// // display search dialog
...... 
227249// html_color = html_color_new_from_rgb('255','0','0');
228250// gtk_html_set_color(GTK_HTML(html_wg),html_color);
229251    search_dialog(window_x, " ");
252
230253}
231254
232255// //
...... 
313336// // test functions
314337void getArticleFromTitle(const gchar *phrase)
315338{
316    char ns;
339    screenblock(1);
340        char ns;
317341    ns = 'A';
318342    zim::File z = get_file();
319343
...... 
326350    if( result.size() == 0)
327351    {
328352        show_message("Error", "The article you requested (" + term + ") was not found.");
329
353                screenblock(0);
330354    }else{
331355
332356      if (result.size() == 1){

Archive Download the corresponding diff file

Branches:
development
master



interactive