From: dooglus Date: Sun, 17 Feb 2008 11:46:26 +0000 (+0000) Subject: Add an option "Browser Command" to allow the user to specify which web browser to... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=fedae32634321129077b5e05c49ee066e9c61d4d;p=synfig.git Add an option "Browser Command" to allow the user to specify which web browser to use to view the help. git-svn-id: http://svn.voria.com/code@1727 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index d9ff579..d0ebe92 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -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; } }; @@ -1899,8 +1911,7 @@ App::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(browser_command.c_str()), strdup(url.c_str()), NULL}; GError* gerror = NULL; gboolean retval; diff --git a/synfig-studio/trunk/src/gtkmm/app.h b/synfig-studio/trunk/src/gtkmm/app.h index 65a737e..27eeada 100644 --- a/synfig-studio/trunk/src/gtkmm/app.h +++ b/synfig-studio/trunk/src/gtkmm/app.h @@ -195,6 +195,8 @@ public: static bool restrict_radius_ducks; + static synfig::String browser_command; + /* -- ** -- S I G N A L S ------------------------------------------------------- */ diff --git a/synfig-studio/trunk/src/gtkmm/dialog_setup.cpp b/synfig-studio/trunk/src/gtkmm/dialog_setup.cpp index 27c018a..2894dda 100644 --- a/synfig-studio/trunk/src/gtkmm/dialog_setup.cpp +++ b/synfig-studio/trunk/src/gtkmm/dialog_setup.cpp @@ -195,6 +195,10 @@ Dialog_Setup::Dialog_Setup(): // Misc - restrict_radius_ducks misc_table->attach(toggle_restrict_radius_ducks, 0, 2, 6, 7, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0); + // Misc - browser_command + misc_table->attach(*manage(new Gtk::Label(_("Browser Command"))), 0, 1, 7, 8, Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0); + misc_table->attach(textbox_browser_command, 1, 2, 7, 8, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0); + show_all_children(); } @@ -233,6 +237,9 @@ Dialog_Setup::on_apply_pressed() // Set the restrict_radius_ducks flag App::restrict_radius_ducks=toggle_restrict_radius_ducks.get_active(); + // Set the browser_command textbox + App::browser_command=textbox_browser_command.get_text(); + App::save_settings(); } @@ -314,6 +321,9 @@ Dialog_Setup::refresh() // Refresh the status of the restrict_radius_ducks flag toggle_restrict_radius_ducks.set_active(App::restrict_radius_ducks); + + // Refresh the browser_command textbox + textbox_browser_command.set_text(App::browser_command); } GammaPattern::GammaPattern(): diff --git a/synfig-studio/trunk/src/gtkmm/dialog_setup.h b/synfig-studio/trunk/src/gtkmm/dialog_setup.h index 6e79190..1c5338c 100644 --- a/synfig-studio/trunk/src/gtkmm/dialog_setup.h +++ b/synfig-studio/trunk/src/gtkmm/dialog_setup.h @@ -174,6 +174,8 @@ class Dialog_Setup : public Gtk::Dialog Widget_Time auto_backup_interval; Gtk::CheckButton toggle_restrict_radius_ducks; + + Gtk::Entry textbox_browser_command; public: void set_time_format(synfig::Time::Format time_format);