Skip to content

Commit

Permalink
+ Read/Write FreeCAD website urls from/to user.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jan 7, 2014
1 parent 4cd8cb6 commit c19e42c
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions src/Gui/CommandStd.cpp
Expand Up @@ -450,8 +450,9 @@ StdCmdOnlineHelpWebsite::StdCmdOnlineHelpWebsite()

void StdCmdOnlineHelpWebsite::activated(int iMsg)
{
ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/OnlineHelp");
std::string url = hURLGrp->GetASCII("DownloadURL", "http://www.freecadweb.org/wiki/index.php?title=Online_Help_Toc");
ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites");
std::string url = hURLGrp->GetASCII("OnlineHelp", "http://www.freecadweb.org/wiki/index.php?title=Online_Help_Toc");
hURLGrp->SetASCII("OnlineHelp", url.c_str());
OpenURLInBrowser(url.c_str());
}

Expand All @@ -475,7 +476,10 @@ StdCmdFreeCADWebsite::StdCmdFreeCADWebsite()

void StdCmdFreeCADWebsite::activated(int iMsg)
{
OpenURLInBrowser("http://www.freecadweb.org");
ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites");
std::string url = hURLGrp->GetASCII("WebPage", "http://www.freecadweb.org");
hURLGrp->SetASCII("WebPage", url.c_str());
OpenURLInBrowser(url.c_str());
}

//===========================================================================
Expand All @@ -498,7 +502,10 @@ StdCmdFreeCADUserHub::StdCmdFreeCADUserHub()

void StdCmdFreeCADUserHub::activated(int iMsg)
{
OpenURLInBrowser("http://www.freecadweb.org/wiki/index.php?title=User_hub");
ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites");
std::string url = hURLGrp->GetASCII("Documentation", "http://www.freecadweb.org/wiki/index.php?title=User_hub");
hURLGrp->SetASCII("Documentation", url.c_str());
OpenURLInBrowser(url.c_str());
}

//===========================================================================
Expand All @@ -521,7 +528,10 @@ StdCmdFreeCADPowerUserHub::StdCmdFreeCADPowerUserHub()

void StdCmdFreeCADPowerUserHub::activated(int iMsg)
{
OpenURLInBrowser("http://www.freecadweb.org/wiki/index.php?title=Power_users_hub");
ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites");
std::string url = hURLGrp->GetASCII("PowerUsers", "http://www.freecadweb.org/wiki/index.php?title=Power_users_hub");
hURLGrp->SetASCII("PowerUsers", url.c_str());
OpenURLInBrowser(url.c_str());
}

//===========================================================================
Expand All @@ -544,7 +554,10 @@ StdCmdFreeCADForum::StdCmdFreeCADForum()

void StdCmdFreeCADForum::activated(int iMsg)
{
OpenURLInBrowser("http://forum.freecadweb.org/");
ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites");
std::string url = hURLGrp->GetASCII("UserForum", "http://forum.freecadweb.org/");
hURLGrp->SetASCII("UserForum", url.c_str());
OpenURLInBrowser(url.c_str());
}

//===========================================================================
Expand All @@ -567,7 +580,10 @@ StdCmdFreeCADFAQ::StdCmdFreeCADFAQ()

void StdCmdFreeCADFAQ::activated(int iMsg)
{
OpenURLInBrowser("http://www.freecadweb.org/wiki/index.php?title=FAQ");
ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites");
std::string url = hURLGrp->GetASCII("FAQ", "http://www.freecadweb.org/wiki/index.php?title=FAQ");
hURLGrp->SetASCII("FAQ", url.c_str());
OpenURLInBrowser(url.c_str());
}

//===========================================================================
Expand Down

0 comments on commit c19e42c

Please sign in to comment.