]> git.decadent.org.uk Git - videolink.git/blobdiff - videolink.cpp
Changed informational, warning and error messages to use standard prefixes.
[videolink.git] / videolink.cpp
index ca4193370fae8d379ec326b9f5504eb9d37dfd26..b4210a181dbbac5c8c0cf9f2ce95d079ee2becb9 100644 (file)
@@ -121,6 +121,7 @@ namespace
            {".vob",     video_format_mpeg2_ps},
            {".mpeg",    video_format_mpeg2_ps},
            {".mpeg2",   video_format_mpeg2_ps},
+           {".mpg",     video_format_mpeg2_ps},
            {".voblist", video_format_vob_list}
        };
        for (std::size_t i = 0;
@@ -160,7 +161,8 @@ namespace
        add(browser_widget_);
        browser_widget_.show();
 
-       Glib::signal_idle().connect(SigC::slot(*this, &base_window::on_idle));
+       Glib::signal_idle().connect(
+           sigc::mem_fun(this, &base_window::on_idle));
     }
 
     bool base_window::on_idle()
@@ -187,7 +189,8 @@ namespace
        : base_window(frame_params),
          main_page_uri_(main_page_uri)
     {
-       signal_key_press_event().connect(SigC::slot(*this, &preview_window::on_key_press));
+       signal_key_press_event().connect(
+           sigc::mem_fun(this, &preview_window::on_key_press));
     }
 
     void preview_window::do_late_initialisation()
@@ -276,7 +279,7 @@ namespace
          finished_(false)
     {
        browser_widget_.signal_net_state().connect(
-           SigC::slot(*this, &conversion_window::on_net_state_change));
+           sigc::mem_fun(this, &conversion_window::on_net_state_change));
 
        add_menu(main_page_uri);
     }
@@ -340,7 +343,7 @@ namespace
     {
        assert(!page_queue_.empty());
        const std::string & uri = page_queue_.front();
-       std::cout << "loading " << uri << std::endl;
+       std::cout << "INFO: Loading " << uri << std::endl;
 
        browser_widget_.load_uri(uri);
     }
@@ -438,20 +441,18 @@ namespace
            }
            catch (std::exception & e)
            {
-               std::cerr << "Fatal error";
                if (!page_queue_.empty())
-                   std::cerr << " while processing <" << page_queue_.front()
-                             << ">";
-               std::cerr << ": " << e.what() << "\n";
+                   std::cerr << "ERROR: While processing <"
+                             << page_queue_.front() << ">:\n";
+               std::cerr << "ERROR: " << e.what() << "\n";
                Gtk::Main::quit();
            }
            catch (Glib::Exception & e)
            {
-               std::cerr << "Fatal error";
                if (!page_queue_.empty())
-                   std::cerr << " while processing <" << page_queue_.front()
-                             << ">";
-               std::cerr << ": " << e.what() << "\n";
+                   std::cerr << "ERROR: While processing <"
+                             << page_queue_.front() << ">:\n";
+               std::cerr << "ERROR: " << e.what() << "\n";
                Gtk::Main::quit();
            }
        }
@@ -616,7 +617,7 @@ namespace
 
                if (state->link_rect.empty())
                {
-                   std::cerr << "Ignoring invisible link to "
+                   std::cerr << "WARN: Ignoring invisible link to "
                              << uri_and_fragment << "\n";
                    continue;
                }
@@ -632,8 +633,8 @@ namespace
                    check(uri_iface->SchemeIs("file", &is_file));
                    if (!is_file)
                    {
-                       std::cerr << "Links to video must use the file:"
-                                 << " scheme\n";
+                       std::cerr << "WARN: Ignoring non-file link to "
+                                 << uri_and_fragment << "\n";
                        continue;
                    }
                    target = add_title(uri, format);
@@ -794,7 +795,7 @@ namespace
 
 void fatal_error(const std::string & message)
 {
-    std::cerr << "Fatal error: " << message << "\n";
+    std::cerr << "ERROR: " << message << "\n";
     Gtk::Main::quit();
 }
 
@@ -963,7 +964,7 @@ int main(int argc, char ** argv)
        {
            preview_window window(frame_params, menu_url);
            window.show();
-           window.signal_hide().connect(SigC::slot(&Gtk::Main::quit));
+           window.signal_hide().connect(sigc::ptr_fun(Gtk::Main::quit));
            Gtk::Main::run();
            return EXIT_SUCCESS;
        }
@@ -971,14 +972,14 @@ int main(int argc, char ** argv)
        {
            conversion_window window(frame_params, menu_url, output_dir, encoder);
            window.show();
-           window.signal_hide().connect(SigC::slot(&Gtk::Main::quit));
+           window.signal_hide().connect(sigc::ptr_fun(Gtk::Main::quit));
            Gtk::Main::run();
            return window.is_finished() ? EXIT_SUCCESS  : EXIT_FAILURE;
        }
     }
     catch (std::exception & e)
     {
-       std::cerr << "Fatal error: " << e.what() << "\n";
+       std::cerr << "ERROR: " << e.what() << "\n";
        return EXIT_FAILURE;
     }
 }