Link to a few wiki pages directly from the Help menu.
[synfig.git] / synfig-studio / trunk / src / gtkmm / app.cpp
index d9ff579..21995a8 100644 (file)
@@ -263,6 +263,7 @@ std::list< etl::handle< studio::Module > > module_list_;
 bool studio::App::use_colorspace_gamma=true;
 bool studio::App::single_threaded=false;
 bool studio::App::restrict_radius_ducks=false;
+String studio::App::browser_command("firefox");
 
 static int max_recent_files_=25;
 int studio::App::get_max_recent_files() { return max_recent_files_; }
@@ -488,6 +489,11 @@ public:
                        value=strprintf("%i",(int)App::restrict_radius_ducks);
                        return true;
                }
+               if(key=="browser_command")
+               {
+                       value=App::browser_command;
+                       return true;
+               }
 
                return synfigapp::Settings::get_value(key,value);
        }
@@ -550,6 +556,11 @@ public:
                        App::restrict_radius_ducks=i;
                        return true;
                }
+               if(key=="browser_command")
+               {
+                       App::browser_command=value;
+                       return true;
+               }
 
                return synfigapp::Settings::set_value(key,value);
        }
@@ -565,6 +576,7 @@ public:
                ret.push_back("single_threaded");
                ret.push_back("auto_recover_backup_interval");
                ret.push_back("restrict_radius_ducks");
+               ret.push_back("browser_command");
                return ret;
        }
 };
@@ -1881,26 +1893,13 @@ App::dialog_not_implemented()
        dialog.run();
 }
 
-void
-App::dialog_help()
-{
-       if (!open_url("http://www.synfig.org/Documentation"))
-       {
-               Gtk::MessageDialog dialog(_("Documentation"), false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_CLOSE, true);
-               dialog.set_secondary_text(_("Documentation for Synfig Studio is available on the website:\n\nhttp://www.synfig.org/Documentation"));
-               dialog.set_title(_("Help"));
-               dialog.run();
-       }
-}
-
-bool
-App::open_url(const std::string &url)
+static bool
+try_open_url(const std::string &url)
 {
 #ifdef WIN32
        return ShellExecute(GetDesktopWindow(), "open", url.c_str(), NULL, NULL, SW_SHOW);
 #else  // WIN32
-       String browser_program("firefox");
-       gchar* argv[3] = {strdup(browser_program.c_str()), strdup(url.c_str()), NULL};
+       gchar* argv[3] = {strdup(App::browser_command.c_str()), strdup(url.c_str()), NULL};
 
        GError* gerror = NULL;
        gboolean retval;
@@ -1919,6 +1918,24 @@ App::open_url(const std::string &url)
 #endif  // WIN32
 }
 
+void
+App::dialog_help()
+{
+       if (!try_open_url("http://synfig.org/Documentation"))
+       {
+               Gtk::MessageDialog dialog(_("Documentation"), false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_CLOSE, true);
+               dialog.set_secondary_text(_("Documentation for Synfig Studio is available on the website:\n\nhttp://www.synfig.org/Documentation"));
+               dialog.set_title(_("Help"));
+               dialog.run();
+       }
+}
+
+void
+App::open_url(const std::string &url)
+{
+       try_open_url(url);
+}
+
 bool
 App::dialog_entry(const std::string &title, const std::string &message,std::string &text)
 {