# HG changeset patch # User Jean-Marc Hengen # Date 1270587118 -7200 # Branch giomm # Node ID 861de503812fca23de019b199c50338600a37da0 # Parent 00162c5e9a5d5b527f09cf72d39b3f1e237e9dee Started replacing gnome-vfsmm by giomm. This commit fixes bug #401837. * src/main.C: Intialize GIO. * src/RefWindow.C: Replaced all instances of Gnome::Vfs::url_show with Gio::AppInfo::launch_default_for_uri. This also fixes bug #401837, since GIO respects the user settings. diff --git a/src/RefWindow.C b/src/RefWindow.C --- a/src/RefWindow.C +++ b/src/RefWindow.C @@ -17,6 +17,7 @@ #include #include #include +#include #include #include "ucompose.hpp" @@ -1740,11 +1741,17 @@ void RefWindow::onIntroduction () { Glib::ustring const uri = "ghelp:referencer"; - try { - Gnome::Vfs::url_show (uri); - } catch (Gnome::Vfs::exception &ex) { - Utility::exceptionDialog (&ex, - String::ucompose(_("Showing '%1'"), uri)); + if(!Gio::AppInfo::launch_default_for_uri (uri)) { + Glib::ustring message = String::ucompose ( + _("%1\n\n%2 %3."), + _("Could not open the introduction!"), + _("Sorry, I was not able to find a handler for the file"), + uri + ); + + Gtk::MessageDialog dialog (message, true, + Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true); + dialog.run (); } } @@ -2465,14 +2472,17 @@ std::vector::iterator const end = docs.end (); for (; it != end ; ++it) { if (!(*it)->getFileName().empty()) { - try { - Gnome::Vfs::url_show ((*it)->getFileName()); - } catch (const Gnome::Vfs::exception ex) { - Utility::exceptionDialog (&ex, - String::ucompose ( - _("Trying to open file '%1'"), - Gnome::Vfs::unescape_string ((*it)->getFileName()))); - return; + if(!Gio::AppInfo::launch_default_for_uri ((*it)->getFileName())) { + Glib::ustring message = String::ucompose ( + _("%1\n\n%2 %3."), + _("Could not open the document!"), + _("Sorry, I was not able to find a handler for the file"), + Gnome::Vfs::unescape_string ((*it)->getFileName()) + ); + + Gtk::MessageDialog dialog (message, true, + Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true); + dialog.run (); } } } diff --git a/src/main.C b/src/main.C --- a/src/main.C +++ b/src/main.C @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -34,6 +35,7 @@ Gnome::UI::module_info_get(), argc, argv); Gnome::Vfs::init (); + Gio::init (); gdk_threads_init ();