]> git.decadent.org.uk Git - videolink.git/blobdiff - webdvd.cpp
Changed video standard nomenclature to be completely pedantic.
[videolink.git] / webdvd.cpp
index 66c70caddaa5897fe5ef864d1732b40451c73c61..9063bce42befa3a31fb20abce50d029d67162484 100644 (file)
@@ -169,6 +169,7 @@ namespace
        dvd_contents::pgc_ref add_menu(const std::string & uri);
        dvd_contents::pgc_ref add_title(const std::string & uri);
        void load_next_page();
+       bool on_idle();
        void on_net_state_change(const char * uri, gint flags, guint status);
        bool browser_is_busy() const
            {
@@ -220,11 +221,12 @@ namespace
 
        add(browser_widget_);
        browser_widget_.show();
+       Glib::signal_idle().connect(
+           SigC::slot(*this, &webdvd_window::on_idle));
        browser_widget_.signal_net_state().connect(
            SigC::slot(*this, &webdvd_window::on_net_state_change));
 
        add_menu(main_page_uri);
-       load_next_page();
     }
 
     bool webdvd_window::is_finished() const
@@ -302,6 +304,12 @@ namespace
        browser_widget_.load_uri(uri);
     }
 
+    bool webdvd_window::on_idle()
+    {
+       load_next_page();
+       return false; // don't call again thankyou
+    }
+
     void webdvd_window::on_net_state_change(const char * uri,
                                           gint flags, guint status)
     {
@@ -860,9 +868,9 @@ namespace
        // ranging from 10 to 25 inches wide, for a resolution of
        // 24-60 dpi.  I therefore declare the average horizontal
        // resolution to be 40 dpi.  The vertical resolution will be
-       // slightly higher (PAL/SECAM) or lower (NTSC), but
-       // unfortunately Mozilla doesn't support non-square pixels
-       // (and neither do fontconfig or Xft anyway).
+       // slightly different but unfortunately Mozilla doesn't
+       // support non-square pixels (and neither do fontconfig or Xft
+       // anyway).
        check(pref_service->GetDefaultBranch("browser.display",
                                             getter_AddRefs(pref_branch)));
        check(pref_branch->SetIntPref("screen_resolution", 40));
@@ -1033,7 +1041,9 @@ int main(int argc, char ** argv)
 
        // Run the browser/converter
        webdvd_window window(frame_params, menu_url, output_dir, encoder);
-       Gtk::Main::run(window);
+       window.show();
+       window.signal_hide().connect(SigC::slot(&Gtk::Main::quit));
+       Gtk::Main::run();
 
        return ((preview_mode || window.is_finished())
                ? EXIT_SUCCESS