Link to a few wiki pages directly from the Help menu.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 17 Feb 2008 16:46:58 +0000 (16:46 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 17 Feb 2008 16:46:58 +0000 (16:46 +0000)
git-svn-id: http://svn.voria.com/code@1737 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/app.cpp
synfig-studio/trunk/src/gtkmm/app.h
synfig-studio/trunk/src/gtkmm/toolbox.cpp

index d0ebe92..21995a8 100644 (file)
@@ -1893,25 +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
-       gchar* argv[3] = {strdup(browser_command.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;
@@ -1930,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)
 {
index 27eeada..103ce0d 100644 (file)
@@ -336,7 +336,7 @@ public:
 
        static void dialog_help();
 
-       static bool open_url(const std::string &url);
+       static void open_url(const std::string &url);
 
        static synfig::String get_user_app_directory();
        static synfig::String get_config_file(const synfig::String& file);
index 617e2ee..79373c9 100644 (file)
@@ -257,9 +257,22 @@ Toolbox::Toolbox():
        filemenu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID(Gtk::Stock::QUIT),
                sigc::ptr_fun(studio::App::quit)));
 
+#define WIKI(title,page)                                                                                       \
+       helpmenu->items().push_back(Gtk::Menu_Helpers::MenuElem(title,  \
+               sigc::bind(sigc::ptr_fun(&studio::App::open_url),String("http://synfig.org")+page)))
+
        Gtk::Menu       *helpmenu = manage(new class Gtk::Menu());
-       helpmenu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::Stock::HELP,
-               sigc::ptr_fun(studio::App::dialog_help)));
+       helpmenu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::Stock::HELP, sigc::ptr_fun(studio::App::dialog_help)));
+       helpmenu->items().push_back(Gtk::Menu_Helpers::SeparatorElem());
+
+       /* TRANSLATORS: Help menu entry */ WIKI(_("Synfig Wiki"),                               /* TRANSLATORS: a wiki page */ _("/Main_Page")                          );
+       /* TRANSLATORS: Help menu entry */ WIKI(_("Tutorials"),                                 /* TRANSLATORS: a wiki page */ _("/Tutorials")                          );
+       /* TRANSLATORS: Help menu entry */ WIKI(_("Frequently Asked Questions"),/* TRANSLATORS: a wiki page */ _("/FAQ")                                        );
+       /* TRANSLATORS: Help menu entry */ WIKI(_("Get Support"),                               /* TRANSLATORS: a wiki page */ _("/Communication")                      );
+       /* TRANSLATORS: Help menu entry */ WIKI(_("Keyboard Shortcuts"),                /* TRANSLATORS: a wiki page */ _("/Keyboard_Shortcuts")         );
+       /* TRANSLATORS: Help menu entry */ WIKI(_("Mouse Shortcuts"),                   /* TRANSLATORS: a wiki page */ _("/Mouse_Shortcuts")            );
+       /* TRANSLATORS: Help menu entry */ WIKI(_("All Pages"),                                 /* TRANSLATORS: a wiki page */ _("/Special:Allpages")           );
+
        helpmenu->items().push_back(Gtk::Menu_Helpers::SeparatorElem());
        helpmenu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("synfig-about"),
                sigc::ptr_fun(studio::App::dialog_about)));