// Copyright 2006 Ben Hutchings <ben@decadent.org.uk>.
// See the file "COPYING" for licence details.
+#include <new>
#include <string>
#include <langinfo.h>
if (!iid.Equals(prompt_service_iid))
return NS_ERROR_NO_INTERFACE;
- try
+ if (null_prompt_service * service =
+ new (std::nothrow) null_prompt_service)
{
- *result = new null_prompt_service;
+ service->AddRef();
+ *result = service;
return NS_OK;
}
- catch (std::bad_alloc &)
+ else
{
return NS_ERROR_OUT_OF_MEMORY;
}
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
{
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
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)
{
// 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