From: <arn...@us...> - 2008-03-26 13:41:31
|
Revision: 1056 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1056&view=rev Author: arnetheduck Date: 2008-03-26 06:41:27 -0700 (Wed, 26 Mar 2008) Log Message: ----------- cshelp in the user command dialog, moved setHelpIds in WinUtil Modified Paths: -------------- dcplusplus/trunk/help/cshelp.h dcplusplus/trunk/help/cshelp.txt dcplusplus/trunk/help/dialog_user_command.html dcplusplus/trunk/win32/Advanced3Page.cpp dcplusplus/trunk/win32/Advanced3Page.h dcplusplus/trunk/win32/Appearance2Page.cpp dcplusplus/trunk/win32/Appearance2Page.h dcplusplus/trunk/win32/AppearancePage.cpp dcplusplus/trunk/win32/AppearancePage.h dcplusplus/trunk/win32/CertificatesPage.cpp dcplusplus/trunk/win32/CertificatesPage.h dcplusplus/trunk/win32/CommandDlg.cpp dcplusplus/trunk/win32/DCPlusPlus.rc dcplusplus/trunk/win32/DownloadPage.cpp dcplusplus/trunk/win32/DownloadPage.h dcplusplus/trunk/win32/FavoriteDirsPage.cpp dcplusplus/trunk/win32/FavoriteDirsPage.h dcplusplus/trunk/win32/GeneralPage.cpp dcplusplus/trunk/win32/GeneralPage.h dcplusplus/trunk/win32/LogPage.cpp dcplusplus/trunk/win32/LogPage.h dcplusplus/trunk/win32/NetworkPage.cpp dcplusplus/trunk/win32/NetworkPage.h dcplusplus/trunk/win32/PropPage.cpp dcplusplus/trunk/win32/PropPage.h dcplusplus/trunk/win32/QueuePage.cpp dcplusplus/trunk/win32/QueuePage.h dcplusplus/trunk/win32/SettingsDialog.cpp dcplusplus/trunk/win32/UCPage.cpp dcplusplus/trunk/win32/UCPage.h dcplusplus/trunk/win32/UploadPage.cpp dcplusplus/trunk/win32/UploadPage.h dcplusplus/trunk/win32/WinUtil.cpp dcplusplus/trunk/win32/WinUtil.h Property Changed: ---------------- dcplusplus/trunk/ Property changes on: dcplusplus/trunk ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-03-24 15:06:23.664999962 +0100 committer: Jacek Sieka <arn...@gm...> properties: branch-nick: dcplusplus + timestamp: 2008-03-24 15:19:33.282999992 +0100 committer: zouzou123gen properties: branch-nick: bzr Name: bzr:revision-id:v3-trunk1 - 1027 arn...@gm...-20080323183926-schknwnkgeo7ivdn 1028 zouzou123gen-20080323220411-r8usuc3qxwuh7zsn 1029 zouzou123gen-20080323221249-0su72zaj13e706mk 1030 arn...@gm...-20080324140623-muba1dl46m000o8c + 1027 arn...@gm...-20080323183926-schknwnkgeo7ivdn 1028 zouzou123gen-20080323220411-r8usuc3qxwuh7zsn 1029 zouzou123gen-20080323221249-0su72zaj13e706mk 1030 arn...@gm...-20080324140623-muba1dl46m000o8c 1031 zouzou123gen-20080324141933-qbgr93ugpe0297m6 Modified: dcplusplus/trunk/help/cshelp.h =================================================================== --- dcplusplus/trunk/help/cshelp.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/help/cshelp.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -3,10 +3,10 @@ #ifndef DCPLUSPLUS_HELP_CSHELP_H #define DCPLUSPLUS_HELP_CSHELP_H -#define IDH_SETTINGS_TREE 11000 -#define IDH_SETTINGS_OK 11001 -#define IDH_SETTINGS_CANCEL 11002 -#define IDH_SETTINGS_HELP 11003 +#define IDH_DCPP_OK 11000 +#define IDH_DCPP_CANCEL 11001 +#define IDH_DCPP_HELP 11002 +#define IDH_SETTINGS_TREE 11003 #define IDH_SETTINGS_GENERAL_PERSONAL_INFORMATION 11004 #define IDH_SETTINGS_GENERAL_NICK 11005 #define IDH_SETTINGS_GENERAL_EMAIL 11006 @@ -91,5 +91,19 @@ #define IDH_SETTINGS_CERTIFICATES_PRIVATE_KEY_FILE 11085 #define IDH_SETTINGS_CERTIFICATES_CERTIFICATE_FILE 11086 #define IDH_SETTINGS_CERTIFICATES_TRUSTED_CERTIFICATES_PATH 11087 +#define IDH_USER_COMMAND_SEPARATOR 11088 +#define IDH_USER_COMMAND_RAW 11089 +#define IDH_USER_COMMAND_CHAT 11090 +#define IDH_USER_COMMAND_PM 11091 +#define IDH_USER_COMMAND_CONTEXT 11092 +#define IDH_USER_COMMAND_HUB_MENU 11093 +#define IDH_USER_COMMAND_USER_MENU 11094 +#define IDH_USER_COMMAND_SEARCH_MENU 11095 +#define IDH_USER_COMMAND_FILELIST_MENU 11096 +#define IDH_USER_COMMAND_NAME 11097 +#define IDH_USER_COMMAND_COMMAND 11098 +#define IDH_USER_COMMAND_HUB 11099 +#define IDH_USER_COMMAND_NICK 11100 +#define IDH_USER_COMMAND_ONCE 11101 #endif Modified: dcplusplus/trunk/help/cshelp.txt =================================================================== --- dcplusplus/trunk/help/cshelp.txt 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/help/cshelp.txt 2008-03-26 13:41:27 UTC (rev 1056) @@ -1,11 +1,11 @@ -.topic IDH_SETTINGS_TREE -Choose a settings category here. -.topic IDH_SETTINGS_OK +.topic IDH_DCPP_OK Press this button to save your changes and close this dialog. -.topic IDH_SETTINGS_CANCEL +.topic IDH_DCPP_CANCEL Press this button to close this dialog without saving your changes. -.topic IDH_SETTINGS_HELP +.topic IDH_DCPP_HELP Press this button to launch the help file. +.topic IDH_SETTINGS_TREE +Choose a settings category here. .topic IDH_SETTINGS_GENERAL_PERSONAL_INFORMATION This is general information about yourself. The nick is required, though it's suggested that you pick the correct connection type as well. .topic IDH_SETTINGS_GENERAL_NICK @@ -174,3 +174,31 @@ This file is the certificate file you should give to other users and hubs that you want to consider "trusted". .topic IDH_SETTINGS_CERTIFICATES_TRUSTED_CERTIFICATES_PATH Where trusted certificates from users or hubs will be stored. (default: the "Certificates\" subdirectory of where you've installed the application.) +.topic IDH_USER_COMMAND_SEPARATOR +Adds a separator to the menu +.topic IDH_USER_COMMAND_RAW +Sends raw command to the hub (experts only, end it with '|' in NMDC hubs and '\n' in ADC hubs!) +.topic IDH_USER_COMMAND_CHAT +Sends command as if you were typing it in the chat +.topic IDH_USER_COMMAND_PM +Sends command as if you sent it by PM +.topic IDH_USER_COMMAND_CONTEXT +Contexts determine where the command is shown. +.topic IDH_USER_COMMAND_HUB_MENU +Hub tab (at the bottom of the screen) right-click menu +.topic IDH_USER_COMMAND_USER_MENU +User right-click menu in chat and PM tab menu +.topic IDH_USER_COMMAND_SEARCH_MENU +Search right-click menu +.topic IDH_USER_COMMAND_FILELIST_MENU +File list right-click menu +.topic IDH_USER_COMMAND_NAME +Name (use '\' to create submenus) +.topic IDH_USER_COMMAND_COMMAND +Command text (may contain any of the variables listed below). Use Ctrl + Enter to create a new line. +.topic IDH_USER_COMMAND_HUB +Hub ip as typed when connecting (empty = all NMDC hubs, "op" = NMDC hubs where you're an operator, "adc://" = all ADC hubs, "adc://op" = ADC hubs where you're an operator, "adcs://" = all TLS enabled hubs) +.topic IDH_USER_COMMAND_NICK +Private Message recipient +.topic IDH_USER_COMMAND_ONCE +Send only once per user from search frame, regardless of how many files you've selected from that user Modified: dcplusplus/trunk/help/dialog_user_command.html =================================================================== --- dcplusplus/trunk/help/dialog_user_command.html 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/help/dialog_user_command.html 2008-03-26 13:41:27 UTC (rev 1056) @@ -16,7 +16,7 @@ <dt>Chat</dt> <dd>Sends command as if you were typing it in the chat</dd> <dt>PM</dt> - <dd>Sends command as if you sent it by pm</dd> + <dd>Sends command as if you sent it by PM</dd> </dl> <h2>Context</h2> Contexts determine where the command is shown.<br> Modified: dcplusplus/trunk/win32/Advanced3Page.cpp =================================================================== --- dcplusplus/trunk/win32/Advanced3Page.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/Advanced3Page.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -23,8 +23,9 @@ #include "Advanced3Page.h" #include <dcpp/SettingsManager.h> +#include "WinUtil.h" -PropPage::HelpItem Advanced3Page::helpItems[] = { +static const WinUtil::HelpItem helpItems[] = { { IDC_SETTINGS_ROLLBACK, IDH_SETTINGS_ADVANCED3_ROLLBACK }, { IDC_ROLLBACK, IDH_SETTINGS_ADVANCED3_ROLLBACK }, { IDC_SETTINGS_B, IDH_SETTINGS_ADVANCED3_ROLLBACK }, @@ -112,7 +113,7 @@ createDialog(IDD_ADVANCED3PAGE); setHelpId(IDH_ADVANCED3PAGE); - PropPage::setHelpIds(handle(), helpItems); + WinUtil::setHelpIds(handle(), helpItems); PropPage::translate(handle(), texts); PropPage::read(handle(), items, 0, 0); Modified: dcplusplus/trunk/win32/Advanced3Page.h =================================================================== --- dcplusplus/trunk/win32/Advanced3Page.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/Advanced3Page.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -30,7 +30,6 @@ virtual void write(); private: - static HelpItem helpItems[]; static Item items[]; static TextItem texts[]; }; Modified: dcplusplus/trunk/win32/Appearance2Page.cpp =================================================================== --- dcplusplus/trunk/win32/Appearance2Page.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/Appearance2Page.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -25,7 +25,7 @@ #include <dcpp/SettingsManager.h> #include "WinUtil.h" -PropPage::HelpItem Appearance2Page::helpItems[] = { +static const WinUtil::HelpItem helpItems[] = { { IDC_SETTINGS_COLORS, IDH_SETTINGS_APPEARANCE2_COLORS }, { IDC_SELWINCOLOR, IDH_SETTINGS_APPEARANCE2_SELWINCOLOR }, { IDC_SELTEXT, IDH_SETTINGS_APPEARANCE2_SELTEXT }, @@ -66,7 +66,7 @@ createDialog(IDD_APPEARANCE2PAGE); setHelpId(IDH_APPEARANCE2PAGE); - PropPage::setHelpIds(handle(), helpItems); + WinUtil::setHelpIds(handle(), helpItems); PropPage::translate(handle(), texts); PropPage::read(handle(), items, 0, 0); Modified: dcplusplus/trunk/win32/Appearance2Page.h =================================================================== --- dcplusplus/trunk/win32/Appearance2Page.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/Appearance2Page.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -30,7 +30,6 @@ virtual void write(); private: - static HelpItem helpItems[]; static Item items[]; static TextItem texts[]; Modified: dcplusplus/trunk/win32/AppearancePage.cpp =================================================================== --- dcplusplus/trunk/win32/AppearancePage.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/AppearancePage.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -27,7 +27,7 @@ #include "WinUtil.h" -PropPage::HelpItem AppearancePage::helpItems[] = { +static const WinUtil::HelpItem helpItems[] = { { IDC_SETTINGS_DEFAULT_AWAY_MSG, IDH_SETTINGS_APPEARANCE_DEFAULT_AWAY_MESSAGE }, { IDC_DEFAULT_AWAY_MESSAGE, IDH_SETTINGS_APPEARANCE_DEFAULT_AWAY_MESSAGE }, { IDC_SETTINGS_TIME_STAMPS_FORMAT, IDH_SETTINGS_APPEARANCE_TIME_STAMPS_FORMAT }, @@ -72,7 +72,7 @@ createDialog(IDD_APPEARANCEPAGE); setHelpId(IDH_APPEARANCEPAGE); - PropPage::setHelpIds(handle(), helpItems); + WinUtil::setHelpIds(handle(), helpItems); PropPage::translate(handle(), texts); PropPage::read(handle(), items, listItems, ::GetDlgItem(handle(), IDC_APPEARANCE_BOOLEANS)); Modified: dcplusplus/trunk/win32/AppearancePage.h =================================================================== --- dcplusplus/trunk/win32/AppearancePage.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/AppearancePage.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -30,7 +30,6 @@ virtual void write(); private: - static HelpItem helpItems[]; static Item items[]; static TextItem texts[]; static ListItem listItems[]; Modified: dcplusplus/trunk/win32/CertificatesPage.cpp =================================================================== --- dcplusplus/trunk/win32/CertificatesPage.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/CertificatesPage.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -26,7 +26,7 @@ #include <dcpp/CryptoManager.h> #include "WinUtil.h" -PropPage::HelpItem CertificatesPage::helpItems[] = { +static const WinUtil::HelpItem helpItems[] = { { IDC_SETTINGS_PRIVATE_KEY_FILE, IDH_SETTINGS_CERTIFICATES_PRIVATE_KEY_FILE }, { IDC_TLS_PRIVATE_KEY_FILE, IDH_SETTINGS_CERTIFICATES_PRIVATE_KEY_FILE }, { IDC_BROWSE_PRIVATE_KEY, IDH_SETTINGS_CERTIFICATES_PRIVATE_KEY_FILE }, @@ -65,7 +65,7 @@ createDialog(IDD_CERTIFICATESPAGE); setHelpId(IDH_CERTIFICATESPAGE); - PropPage::setHelpIds(handle(), helpItems); + WinUtil::setHelpIds(handle(), helpItems); PropPage::translate(handle(), texts); PropPage::read(handle(), items, listItems, ::GetDlgItem(handle(), IDC_TLS_OPTIONS)); Modified: dcplusplus/trunk/win32/CertificatesPage.h =================================================================== --- dcplusplus/trunk/win32/CertificatesPage.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/CertificatesPage.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -30,7 +30,6 @@ virtual void write(); private: - static HelpItem helpItems[]; static Item items[]; static TextItem texts[]; static ListItem listItems[]; Modified: dcplusplus/trunk/win32/CommandDlg.cpp =================================================================== --- dcplusplus/trunk/win32/CommandDlg.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/CommandDlg.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -27,6 +27,31 @@ #include <dcpp/version.h> #include "WinUtil.h" +static const WinUtil::HelpItem helpItems[] = { + { IDC_SETTINGS_SEPARATOR, IDH_USER_COMMAND_SEPARATOR }, + { IDC_SETTINGS_RAW, IDH_USER_COMMAND_RAW }, + { IDC_SETTINGS_CHAT, IDH_USER_COMMAND_CHAT }, + { IDC_SETTINGS_PM, IDH_USER_COMMAND_PM }, + { IDC_SETTINGS_CONTEXT, IDH_USER_COMMAND_CONTEXT }, + { IDC_SETTINGS_HUB_MENU, IDH_USER_COMMAND_HUB_MENU }, + { IDC_SETTINGS_USER_MENU, IDH_USER_COMMAND_USER_MENU }, + { IDC_SETTINGS_SEARCH_MENU, IDH_USER_COMMAND_SEARCH_MENU }, + { IDC_SETTINGS_FILELIST_MENU, IDH_USER_COMMAND_FILELIST_MENU }, + { IDC_SETTINGS_NAME, IDH_USER_COMMAND_NAME }, + { IDC_NAME, IDH_USER_COMMAND_NAME }, + { IDC_SETTINGS_COMMAND, IDH_USER_COMMAND_COMMAND }, + { IDC_COMMAND, IDH_USER_COMMAND_COMMAND }, + { IDC_SETTINGS_HUB, IDH_USER_COMMAND_HUB }, + { IDC_HUB, IDH_USER_COMMAND_HUB }, + { IDC_SETTINGS_TO, IDH_USER_COMMAND_NICK }, + { IDC_NICK, IDH_USER_COMMAND_NICK }, + { IDC_SETTINGS_ONCE, IDH_USER_COMMAND_ONCE }, + { IDOK, IDH_DCPP_OK }, + { IDCANCEL, IDH_DCPP_CANCEL }, + { IDHELP, IDH_DCPP_HELP }, + { 0, 0 } +}; + CommandDlg::CommandDlg(SmartWin::Widget* parent, int type_, int ctx_, const tstring& name_, const tstring& command_, const tstring& hub_) : WidgetFactory<SmartWin::WidgetModalDialog>(parent), separator(0), @@ -61,8 +86,10 @@ bool CommandDlg::handleInitDialog() { setHelpId(IDH_USER_COMMAND); + WinUtil::setHelpIds(handle(), helpItems); + // Translate - setText(T_("Create / Modify Command")); + setText(T_("Create / Modify User Command")); ::SetDlgItemText(handle(), IDC_SETTINGS_TYPE, CT_("Command Type")); ::SetDlgItemText(handle(), IDC_SETTINGS_CONTEXT, CT_("Context")); ::SetDlgItemText(handle(), IDC_SETTINGS_PARAMETERS, CT_("Parameters")); Modified: dcplusplus/trunk/win32/DCPlusPlus.rc =================================================================== --- dcplusplus/trunk/win32/DCPlusPlus.rc 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/DCPlusPlus.rc 2008-03-26 13:41:27 UTC (rev 1056) @@ -253,7 +253,7 @@ IDD_USER_COMMAND DIALOGEX 0, 0, 195, 295 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Create / Modify Command" +CAPTION "Create / Modify User Command" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN GROUPBOX "Command Type",IDC_SETTINGS_TYPE,7,7,181,37 Modified: dcplusplus/trunk/win32/DownloadPage.cpp =================================================================== --- dcplusplus/trunk/win32/DownloadPage.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/DownloadPage.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -26,7 +26,7 @@ #include "WinUtil.h" #include "HubListsDlg.h" -PropPage::HelpItem DownloadPage::helpItems[] = { +static const WinUtil::HelpItem helpItems[] = { { IDC_SETTINGS_DOWNLOAD_DIRECTORY, IDH_SETTINGS_DOWNLOAD_DOWNLOADDIR }, { IDC_DOWNLOADDIR, IDH_SETTINGS_DOWNLOAD_DOWNLOADDIR }, { IDC_BROWSEDIR, IDH_SETTINGS_DOWNLOAD_DOWNLOADDIR }, @@ -76,7 +76,7 @@ createDialog(IDD_DOWNLOADPAGE); setHelpId(IDH_DOWNLOADPAGE); - PropPage::setHelpIds(handle(), helpItems); + WinUtil::setHelpIds(handle(), helpItems); PropPage::translate(handle(), texts); PropPage::read(handle(), items); Modified: dcplusplus/trunk/win32/DownloadPage.h =================================================================== --- dcplusplus/trunk/win32/DownloadPage.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/DownloadPage.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -30,7 +30,6 @@ virtual void write(); private: - static HelpItem helpItems[]; static Item items[]; static TextItem texts[]; Modified: dcplusplus/trunk/win32/FavoriteDirsPage.cpp =================================================================== --- dcplusplus/trunk/win32/FavoriteDirsPage.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/FavoriteDirsPage.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -28,7 +28,7 @@ #include "WinUtil.h" #include "LineDlg.h" -PropPage::HelpItem FavoriteDirsPage::helpItems[] = { +static const WinUtil::HelpItem helpItems[] = { { IDC_SETTINGS_FAVORITE_DIRECTORIES, IDH_SETTINGS_FAVORITE_DIRS_FAVORITE_DIRECTORIES }, { IDC_FAVORITE_DIRECTORIES, IDH_SETTINGS_FAVORITE_DIRS_FAVORITE_DIRECTORIES }, { IDC_RENAME, IDH_SETTINGS_FAVORITE_DIRS_RENAME }, @@ -49,7 +49,7 @@ createDialog(IDD_FAVORITE_DIRSPAGE); setHelpId(IDH_FAVORITE_DIRSPAGE); - PropPage::setHelpIds(handle(), helpItems); + WinUtil::setHelpIds(handle(), helpItems); PropPage::translate(handle(), texts); directories = attachList(IDC_FAVORITE_DIRECTORIES); Modified: dcplusplus/trunk/win32/FavoriteDirsPage.h =================================================================== --- dcplusplus/trunk/win32/FavoriteDirsPage.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/FavoriteDirsPage.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -30,7 +30,6 @@ virtual void write(); private: - static HelpItem helpItems[]; static TextItem texts[]; WidgetListViewPtr directories; Modified: dcplusplus/trunk/win32/GeneralPage.cpp =================================================================== --- dcplusplus/trunk/win32/GeneralPage.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/GeneralPage.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -23,8 +23,9 @@ #include "GeneralPage.h" #include <dcpp/SettingsManager.h> +#include "WinUtil.h" -PropPage::HelpItem GeneralPage::helpItems[] = { +static const WinUtil::HelpItem helpItems[] = { { IDC_SETTINGS_PERSONAL_INFORMATION, IDH_SETTINGS_GENERAL_PERSONAL_INFORMATION }, { IDC_SETTINGS_NICK, IDH_SETTINGS_GENERAL_NICK }, { IDC_NICK, IDH_SETTINGS_GENERAL_NICK }, @@ -60,7 +61,7 @@ createDialog(IDD_GENERALPAGE); setHelpId(IDH_GENERALPAGE); - PropPage::setHelpIds(handle(), helpItems); + WinUtil::setHelpIds(handle(), helpItems); PropPage::translate(handle(), texts); PropPage::read(handle(), items); Modified: dcplusplus/trunk/win32/GeneralPage.h =================================================================== --- dcplusplus/trunk/win32/GeneralPage.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/GeneralPage.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -30,7 +30,6 @@ virtual void write(); private: - static HelpItem helpItems[]; static Item items[]; static TextItem texts[]; Modified: dcplusplus/trunk/win32/LogPage.cpp =================================================================== --- dcplusplus/trunk/win32/LogPage.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/LogPage.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -27,7 +27,7 @@ #include <dcpp/LogManager.h> #include "WinUtil.h" -PropPage::HelpItem LogPage::helpItems[] = { +static const WinUtil::HelpItem helpItems[] = { { IDC_SETTINGS_LOG_DIR, IDH_SETTINGS_LOG_DIRECTORY }, { IDC_LOG_DIRECTORY, IDH_SETTINGS_LOG_DIRECTORY }, { IDC_BROWSE_LOG, IDH_SETTINGS_LOG_DIRECTORY }, @@ -63,7 +63,7 @@ createDialog(IDD_LOGPAGE); setHelpId(IDH_LOGPAGE); - PropPage::setHelpIds(handle(), helpItems); + WinUtil::setHelpIds(handle(), helpItems); PropPage::translate(handle(), texts); PropPage::read(handle(), items, listItems, ::GetDlgItem(handle(), IDC_LOG_OPTIONS)); Modified: dcplusplus/trunk/win32/LogPage.h =================================================================== --- dcplusplus/trunk/win32/LogPage.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/LogPage.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -31,7 +31,6 @@ virtual void write(); private: - static HelpItem helpItems[]; static Item items[]; static TextItem texts[]; static ListItem listItems[]; Modified: dcplusplus/trunk/win32/NetworkPage.cpp =================================================================== --- dcplusplus/trunk/win32/NetworkPage.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/NetworkPage.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -26,7 +26,7 @@ #include <dcpp/Socket.h> #include "WinUtil.h" -PropPage::HelpItem NetworkPage::helpItems[] = { +static const WinUtil::HelpItem helpItems[] = { { IDC_DIRECT, IDH_SETTINGS_NETWORK_DIRECT }, { IDC_FIREWALL_UPNP, IDH_SETTINGS_NETWORK_FIREWALL_UPNP }, { IDC_FIREWALL_NAT, IDH_SETTINGS_NETWORK_FIREWALL_NAT }, @@ -95,7 +95,7 @@ createDialog(IDD_NETWORKPAGE); setHelpId(IDH_NETWORKPAGE); - PropPage::setHelpIds(handle(), helpItems); + WinUtil::setHelpIds(handle(), helpItems); PropPage::translate(handle(), texts); if(!(WinUtil::getOsMajor() >= 5 && WinUtil::getOsMinor() >= 1 //WinXP & WinSvr2003 Modified: dcplusplus/trunk/win32/NetworkPage.h =================================================================== --- dcplusplus/trunk/win32/NetworkPage.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/NetworkPage.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -31,7 +31,6 @@ virtual void write(); private: - static HelpItem helpItems[]; static Item items[]; static TextItem texts[]; Modified: dcplusplus/trunk/win32/PropPage.cpp =================================================================== --- dcplusplus/trunk/win32/PropPage.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/PropPage.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -31,12 +31,6 @@ PropPage::~PropPage() { } -void PropPage::setHelpIds(HWND page, HelpItem* items) { - if(items) - for(size_t i = 0; items[i].ctrlId != 0; ++i) - ::SetWindowContextHelpId(::GetDlgItem(page, items[i].ctrlId), items[i].helpId); -} - void PropPage::read(HWND page, Item const* items, ListItem* listItems /* = NULL */, HWND list /* = 0 */) { dcassert(page != NULL); @@ -127,12 +121,9 @@ } } - if(listItems) { - int i; - for(i = 0; listItems[i].setting != 0; i++) { + if(listItems) + for(size_t i = 0; listItems[i].setting != 0; ++i) settings->set(SettingsManager::IntSetting(listItems[i].setting), ListView_GetCheckState(list, i) > 0); - } - } } void PropPage::translate(HWND page, TextItem* items) { Modified: dcplusplus/trunk/win32/PropPage.h =================================================================== --- dcplusplus/trunk/win32/PropPage.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/PropPage.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -33,11 +33,6 @@ enum Type { T_STR, T_INT, T_BOOL, T_CUSTOM, T_END }; - struct HelpItem { - unsigned ctrlId; - unsigned helpId; - }; - struct Item { WORD itemID; int setting; @@ -55,7 +50,6 @@ }; protected: - void setHelpIds(HWND page, HelpItem* items); void read(HWND page, Item const* items, ListItem* listItems = NULL, HWND list = NULL); void write(HWND page, Item const* items, ListItem* listItems = NULL, HWND list = NULL); void translate(HWND page, TextItem* items); Modified: dcplusplus/trunk/win32/QueuePage.cpp =================================================================== --- dcplusplus/trunk/win32/QueuePage.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/QueuePage.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -23,8 +23,9 @@ #include "QueuePage.h" #include <dcpp/SettingsManager.h> +#include "WinUtil.h" -PropPage::HelpItem QueuePage::helpItems[] = { +static const WinUtil::HelpItem helpItems[] = { { IDC_SETTINGS_AUTOPRIO, IDH_SETTINGS_QUEUE_AUTOPRIO }, { IDC_SETTINGS_PRIO_HIGHEST, IDH_SETTINGS_QUEUE_PRIO_HIGHEST }, { IDC_PRIO_HIGHEST_SIZE, IDH_SETTINGS_QUEUE_PRIO_HIGHEST }, @@ -117,7 +118,7 @@ createDialog(IDD_QUEUEPAGE); setHelpId(IDH_QUEUEPAGE); - PropPage::setHelpIds(handle(), helpItems); + WinUtil::setHelpIds(handle(), helpItems); PropPage::translate(handle(), texts); PropPage::read(handle(), items, 0, 0); PropPage::read(handle(), items, optionItems, ::GetDlgItem(handle(), IDC_OTHER_QUEUE_OPTIONS)); Modified: dcplusplus/trunk/win32/QueuePage.h =================================================================== --- dcplusplus/trunk/win32/QueuePage.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/QueuePage.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -31,7 +31,6 @@ virtual void write(); private: - static HelpItem helpItems[]; static Item items[]; static TextItem texts[]; static ListItem optionItems[]; Modified: dcplusplus/trunk/win32/SettingsDialog.cpp =================================================================== --- dcplusplus/trunk/win32/SettingsDialog.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/SettingsDialog.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -39,6 +39,14 @@ #include "UCPage.h" #include "CertificatesPage.h" +static const WinUtil::HelpItem helpItems[] = { + { IDC_SETTINGS_PAGES, IDH_SETTINGS_TREE }, + { IDOK, IDH_DCPP_OK }, + { IDCANCEL, IDH_DCPP_CANCEL }, + { IDHELP, IDH_DCPP_HELP }, + { 0, 0 } +}; + static const TCHAR SEPARATOR = _T('\\'); static const size_t MAX_NAME_LENGTH = 256; @@ -55,27 +63,28 @@ } bool SettingsDialog::initDialog() { + // set this to IDH_STARTPAGE so that clicking in an empty space of the dialog generates a WM_HELP message with no error; then SettingsDialog::handleHelp will convert IDH_STARTPAGE to the current page's help id + setHelpId(IDH_STARTPAGE); + + WinUtil::setHelpIds(handle(), helpItems); + setText(T_("Settings")); pageTree = attachTreeView(IDC_SETTINGS_PAGES); - pageTree->setHelpId(IDH_SETTINGS_TREE); pageTree->onSelectionChanged(std::tr1::bind(&SettingsDialog::selectionChanged, this)); { WidgetButtonPtr button = attachButton(IDOK); - button->setHelpId(IDH_SETTINGS_OK); button->setText(T_("OK")); button->onClicked(std::tr1::bind(&SettingsDialog::handleOKClicked, this)); button = attachButton(IDCANCEL); - button->setHelpId(IDH_SETTINGS_CANCEL); button->setText(T_("Cancel")); button->onClicked(std::tr1::bind(&SettingsDialog::endDialog, this, IDCANCEL)); button = attachButton(IDHELP); - button->setHelpId(IDH_SETTINGS_HELP); button->setText(T_("Help")); - button->onClicked(std::tr1::bind(&SettingsDialog::handleHelp, this, 0, handle(), 0)); + button->onClicked(std::tr1::bind(&SettingsDialog::handleHelp, this, 0, handle(), IDH_STARTPAGE)); } addPage(T_("Personal information"), new GeneralPage(this)); @@ -98,7 +107,7 @@ } void SettingsDialog::handleHelp(unsigned ctrlId, HWND hWnd, unsigned helpId) { - if(helpId == 0 && currentPage) + if(helpId == IDH_STARTPAGE && currentPage) helpId = currentPage->getHelpId(); WinUtil::help(ctrlId, hWnd, helpId); } Modified: dcplusplus/trunk/win32/UCPage.cpp =================================================================== --- dcplusplus/trunk/win32/UCPage.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/UCPage.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -26,8 +26,9 @@ #include <dcpp/FavoriteManager.h> #include "CommandDlg.h" #include "HoldRedraw.h" +#include "WinUtil.h" -PropPage::HelpItem UCPage::helpItems[] = { +static const WinUtil::HelpItem helpItems[] = { { IDC_MENU_ITEMS, IDH_SETTINGS_UC_LIST }, { IDC_ADD_MENU, IDH_SETTINGS_UC_ADD }, { IDC_CHANGE_MENU, IDH_SETTINGS_UC_CHANGE }, @@ -54,7 +55,7 @@ createDialog(IDD_UCPAGE); setHelpId(IDH_UCPAGE); - PropPage::setHelpIds(handle(), helpItems); + WinUtil::setHelpIds(handle(), helpItems); PropPage::translate(handle(), texts); PropPage::read(handle(), items); Modified: dcplusplus/trunk/win32/UCPage.h =================================================================== --- dcplusplus/trunk/win32/UCPage.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/UCPage.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -32,7 +32,6 @@ virtual void write(); private: - static HelpItem helpItems[]; static Item items[]; static TextItem texts[]; Modified: dcplusplus/trunk/win32/UploadPage.cpp =================================================================== --- dcplusplus/trunk/win32/UploadPage.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/UploadPage.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -29,7 +29,7 @@ #include "LineDlg.h" #include "HashProgressDlg.h" -PropPage::HelpItem UploadPage::helpItems[] = { +static const WinUtil::HelpItem helpItems[] = { { IDC_SETTINGS_SHARED_DIRECTORIES, IDH_SETTINGS_UPLOAD_DIRECTORIES }, { IDC_DIRECTORIES, IDH_SETTINGS_UPLOAD_DIRECTORIES }, { IDC_SETTINGS_ONLY_HASHED, IDH_SETTINGS_UPLOAD_DIRECTORIES }, @@ -74,7 +74,7 @@ createDialog(IDD_UPLOADPAGE); setHelpId(IDH_UPLOADPAGE); - PropPage::setHelpIds(handle(), helpItems); + WinUtil::setHelpIds(handle(), helpItems); PropPage::translate(handle(), texts); PropPage::read(handle(), items); Modified: dcplusplus/trunk/win32/UploadPage.h =================================================================== --- dcplusplus/trunk/win32/UploadPage.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/UploadPage.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -32,7 +32,6 @@ virtual int getHelpId() { return IDD_UPLOADPAGE; } private: - static HelpItem helpItems[]; static Item items[]; static TextItem texts[]; Modified: dcplusplus/trunk/win32/WinUtil.cpp =================================================================== --- dcplusplus/trunk/win32/WinUtil.cpp 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/WinUtil.cpp 2008-03-26 13:41:27 UTC (rev 1056) @@ -198,6 +198,12 @@ } } +void WinUtil::setHelpIds(HWND hWnd, const HelpItem* items) { + dcassert(hWnd && items); + for(size_t i = 0; items[i].ctrlId != 0; ++i) + ::SetWindowContextHelpId(::GetDlgItem(hWnd, items[i].ctrlId), items[i].helpId); +} + #define LINE2 _T("-- http://dcplusplus.sourceforge.net <DC++ ") _T(VERSIONSTRING) _T(">") const TCHAR *msgs[] = { _T("\r\n-- I'm a happy dc++ user. You could be happy too.\r\n") LINE2, _T("\r\n-- Neo-...what? Nope...never heard of it...\r\n") LINE2, @@ -577,9 +583,14 @@ void WinUtil::help(unsigned ctrlId, HWND hWnd, unsigned helpId) { dcdebug("WinUtil::help; ctrlId: %u; hWnd: %p; helpId: %u\n", ctrlId, hWnd, helpId); + + string path = Util::getDataPath() + "DCPlusPlus.chm"; + if(File::getSize(path) == -1) + return; + tstring helpFile = Text::toT(path); + if(helpId >= IDH_TOPICS_BEGIN && helpId <= IDH_TOPICS_END) ctrlId = 0; - tstring helpFile = Text::toT(Util::getDataPath() + "DCPlusPlus.chm"); if(ctrlId && helpId) { // a control ID has been given; display a toolTip DWORD ids[3]; Modified: dcplusplus/trunk/win32/WinUtil.h =================================================================== --- dcplusplus/trunk/win32/WinUtil.h 2008-03-26 13:39:40 UTC (rev 1055) +++ dcplusplus/trunk/win32/WinUtil.h 2008-03-26 13:41:27 UTC (rev 1056) @@ -75,13 +75,20 @@ static const SmartWin::WidgetTextBox::Seed textBox; static const SmartWin::WidgetTreeView::Seed treeView; }; - + + struct HelpItem { + unsigned ctrlId; + unsigned helpId; + }; + static void init(); static void uninit(); static tstring encodeFont(LOGFONT const& font); static void decodeFont(const tstring& setting, LOGFONT &dest); + static void setHelpIds(HWND hWnd, const HelpItem* items); + /** * Check if this is a common /-command. * @param cmd The whole text string, will be updated to contain only the command. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |