diff options
author | George Hazan <ghazan@miranda.im> | 2018-10-17 20:05:11 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-10-17 20:05:11 +0300 |
commit | d33534078fedb39d64edb6fad02caab675d09a42 (patch) | |
tree | 3e0461e74cc3fd0c774474323249bc7ad18b0fd8 /src | |
parent | 55bc7336d19d39861d57fd8fc1923a28cd300247 (diff) |
fixes #1624 (Add checkbox for service mode)
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/res/resource.rc | 76 | ||||
-rw-r--r-- | src/mir_app/src/profilemanager.cpp | 29 | ||||
-rw-r--r-- | src/mir_app/src/resource.h | 6 |
3 files changed, 62 insertions, 49 deletions
diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc index d0aaf166d0..5cc29b0ed6 100644 --- a/src/mir_app/res/resource.rc +++ b/src/mir_app/res/resource.rc @@ -82,7 +82,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN
GROUPBOX "Contact display options",IDC_STATIC,7,7,299,228
CTEXT "Instead of displaying contacts by their nickname,\ndrag to choose another order:",IDC_STATIC,64,39,181,32
- CONTROL "Tree1",IDC_NAMEORDER,"SysTreeView32",TVS_NOHSCROLL | TVS_NOTOOLTIPS | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP,65,78,182,93
+ CONTROL "Tree1",IDC_NAMEORDER,"SysTreeView32",TVS_NOTOOLTIPS | TVS_FULLROWSELECT | TVS_NOHSCROLL | WS_BORDER | WS_TABSTOP,65,78,182,93
END
IDD_PROFILEMANAGER DIALOGEX 0, 0, 219, 211
@@ -94,7 +94,7 @@ BEGIN CONTROL "Tab1",IDC_TABS,"SysTabControl32",TCS_HOTTRACK,2,31,215,137
PUSHBUTTON "&Run",IDOK,169,195,48,14
PUSHBUTTON "&Exit",IDCANCEL,112,195,48,14
- RTEXT "Start in service mode with",IDC_SM_LABEL,10,178,106,10
+ CONTROL "Start in service mode with",IDC_SM_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,176,107,12
COMBOBOX IDC_SM_COMBO,118,176,98,12,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END
@@ -370,15 +370,15 @@ BEGIN END
IDD_PROFILE_SELECTION DIALOGEX 0, 0, 208, 122
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | DS_CONTROL
+STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "List1",IDC_PROFILELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,0,3,207,117
+ CONTROL "List1",IDC_PROFILELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,0,3,207,117
END
IDD_PROFILE_NEW DIALOGEX 0, 0, 208, 122
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | DS_CONTROL
+STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
LTEXT "Please complete the following form to create a new user profile",IDC_STATIC,4,3,205,16
@@ -605,7 +605,7 @@ EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
LTEXT "Select the extra icons to be shown in the contact list:",IDC_STATIC,1,9,274,13
- CONTROL "",IDC_EXTRAORDER,"SysTreeView32",TVS_NOTOOLTIPS | TVS_NOHSCROLL | TVS_CHECKBOXES | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP,1,24,274,160
+ CONTROL "",IDC_EXTRAORDER,"SysTreeView32",TVS_NOTOOLTIPS | TVS_CHECKBOXES | TVS_FULLROWSELECT | TVS_NOHSCROLL | WS_BORDER | WS_TABSTOP,1,24,274,160
LTEXT "*only the first %d icons will be shown",IDC_MAX_ICONS_L,1,190,274,13,NOT WS_VISIBLE
LTEXT "You can group/ungroup icons by selecting them (Ctrl+left click) and using the popup menu (right click)",IDC_STATIC,1,208,274,20
END
@@ -710,7 +710,7 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "",IDC_TOOLBARTREE,"SysTreeView32",TVS_SHOWSELALWAYS | TVS_NOTOOLTIPS | TVS_NOHSCROLL | TVS_CHECKBOXES | TVS_FULLROWSELECT | WS_HSCROLL | WS_TABSTOP,1,4,301,171,WS_EX_CLIENTEDGE
+ CONTROL "",IDC_TOOLBARTREE,"SysTreeView32",TVS_SHOWSELALWAYS | TVS_NOTOOLTIPS | TVS_CHECKBOXES | TVS_FULLROWSELECT | TVS_NOHSCROLL | WS_HSCROLL | WS_TABSTOP,1,4,301,171,WS_EX_CLIENTEDGE
PUSHBUTTON "Reset",IDC_BBRESET,250,211,53,15
CONTROL "Show in IM chats",IDC_IMCHECK,"Button",BS_AUTOCHECKBOX | BS_VCENTER | BS_MULTILINE | WS_TABSTOP,4,181,127,12
CONTROL "Show in chat rooms",IDC_CHATCHECK,"Button",BS_AUTOCHECKBOX | BS_VCENTER | BS_MULTILINE | WS_TABSTOP,4,196,127,12
@@ -803,6 +803,10 @@ BEGIN BOTTOMMARGIN, 235
END
+ IDD_PROFILEMANAGER, DIALOG
+ BEGIN
+ END
+
IDD_FINDADD, DIALOG
BEGIN
LEFTMARGIN, 5
@@ -876,16 +880,6 @@ BEGIN BOTTOMMARGIN, 236
END
- IDD_OPT_ICONS, DIALOG
- BEGIN
- LEFTMARGIN, 4
- RIGHTMARGIN, 253
- VERTGUIDE, 12
- VERTGUIDE, 200
- TOPMARGIN, 4
- BOTTOMMARGIN, 189
- END
-
IDD_OPT_IGNORE, DIALOG
BEGIN
VERTGUIDE, 8
@@ -1092,6 +1086,12 @@ END #endif // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXT
+//
+
IDR_CREDITS TEXT "../../docs/contributors.txt"
/////////////////////////////////////////////////////////////////////////////
@@ -1298,26 +1298,28 @@ BEGIN END
END
-IDR_CLISTMENU MENU
-BEGIN
- POPUP "&Main menu"
- BEGIN
- MENUITEM SEPARATOR
- MENUITEM "E&xit", ID_ICQ_EXIT
- END
- POPUP "&Status"
- BEGIN
- MENUITEM "&Offline\tCtrl+0", ID_STATUS_OFFLINE, CHECKED
- MENUITEM "On&line\tCtrl+1", ID_STATUS_ONLINE
- MENUITEM "&Away\tCtrl+2", ID_STATUS_AWAY
- MENUITEM "&Not available\tCtrl+3", ID_STATUS_NA
- MENUITEM "Occ&upied\tCtrl+4", ID_STATUS_OCCUPIED
- MENUITEM "&Do not disturb\tCtrl+5", ID_STATUS_DND
- MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT
- MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE
- MENUITEM "On the &phone\tCtrl+8", ID_STATUS_ONTHEPHONE
- MENUITEM "Out to &lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH
- END
+IDR_CLISTMENU MENU
+BEGIN
+ POPUP "&Main menu"
+ BEGIN
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", ID_ICQ_EXIT
+ END
+ POPUP "&Status"
+ BEGIN
+ MENUITEM "&Offline\tCtrl+0", ID_STATUS_OFFLINE, CHECKED
+ MENUITEM "On&line\tCtrl+1", ID_STATUS_ONLINE
+ MENUITEM "&Away\tCtrl+2", ID_STATUS_AWAY
+ MENUITEM "&Not available\tCtrl+3", ID_STATUS_NA
+ MENUITEM "Occ&upied\tCtrl+4", ID_STATUS_OCCUPIED
+ MENUITEM "&Do not disturb\tCtrl+5", ID_STATUS_DND
+ MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT
+ MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE
+ MENUITEM "On the &phone\tCtrl+8", ID_STATUS_ONTHEPHONE
+ MENUITEM "Out to &lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH
+ END
+END
+
END
#endif // English (United States) resources
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index 8d287abc17..2148375f67 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -574,6 +574,7 @@ class CProfileManager : public CDlgBase CCtrlPages m_tab; CCtrlButton m_btnOk; + CCtrlCheck m_chkSmEnabled; CCtrlCombo m_servicePlugs; CCtrlBase m_warning; @@ -583,10 +584,12 @@ public: m_btnOk(this, IDOK), m_pd(_pd), m_tab(this, IDC_TABS), + m_warning(this, IDC_SM_LABEL), m_servicePlugs(this, IDC_SM_COMBO), - m_warning(this, IDC_SM_LABEL) + m_chkSmEnabled(this, IDC_SM_ENABLED) { m_btnOk.OnClick = Callback(this, &CProfileManager::onOk); + m_chkSmEnabled.OnChange = Callback(this, &CProfileManager::onChanged); m_tab.AddPage(LPGENW("My profiles"), nullptr, new CChooseProfileDlg(m_btnOk, m_pd)); m_tab.AddPage(LPGENW("New profile"), nullptr, new CCreateProfileDlg(m_btnOk, m_pd)); @@ -604,27 +607,30 @@ public: // service mode combobox if (servicePlugins.getCount() == 0) { ShowWindow(m_warning.GetHwnd(), FALSE); + ShowWindow(m_chkSmEnabled.GetHwnd(), FALSE); ShowWindow(m_servicePlugs.GetHwnd(), FALSE); } else { - m_servicePlugs.AddStringA("", -1); - m_servicePlugs.SetCurSel(0); - for (int i = 0; i < servicePlugins.getCount(); i++) { pluginEntry *p = servicePlugins[i]; m_servicePlugs.AddString(TranslateW(p->pluginname), i); } + + m_servicePlugs.Disable(); + m_servicePlugs.SetCurSel(0); } return true; } void OnDestroy() { - LRESULT curSel = m_servicePlugs.GetCurSel(); - if (curSel != -1) { - int idx = m_servicePlugs.GetItemData(curSel); - if (idx != -1) - plugin_service = servicePlugins[idx]; + if (m_chkSmEnabled.GetState()) { + LRESULT curSel = m_servicePlugs.GetCurSel(); + if (curSel != -1) { + int idx = m_servicePlugs.GetItemData(curSel); + if (idx != -1) + plugin_service = servicePlugins[idx]; + } } DestroyIcon((HICON)SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, 0)); @@ -635,6 +641,11 @@ public: { EndDialog(m_hwnd, 1); } + + void onChanged(CCtrlCheck*) + { + m_servicePlugs.Enable(m_chkSmEnabled.GetState()); + } }; int getProfileManager(PROFILEMANAGERDATA *pd) diff --git a/src/mir_app/src/resource.h b/src/mir_app/src/resource.h index 04055d5116..3900899fbd 100644 --- a/src/mir_app/src/resource.h +++ b/src/mir_app/src/resource.h @@ -544,9 +544,9 @@ #define IDC_ADDCHECK 1742
#define IDC_GETMOREPLUGINS 1744
#define IDC_DISABLEMENUICONS 1745
-#define IDC_COMBO1 1746
-#define IDC_LANGUAGES 1746
-#define IDC_GENMENU_MODULE 1747
+#define IDC_SM_ENABLED 1746
+#define IDC_LANGUAGES 1747
+#define IDC_GENMENU_MODULE 1748
#define IDC_EFFECT_COLOUR_TEXT1 1853
#define IDC_EFFECT_COLOUR_SPIN1 1854
#define IDC_EXTRAORDER 1889
|