summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/CrashDumper/src/crshdmp.cpp13
-rw-r--r--plugins/CrashDumper/src/stdafx.h17
-rw-r--r--plugins/CrashDumper/src/ui.cpp153
3 files changed, 91 insertions, 92 deletions
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp
index 7305b25612..8c76065ec6 100644
--- a/plugins/CrashDumper/src/crshdmp.cpp
+++ b/plugins/CrashDumper/src/crshdmp.cpp
@@ -18,6 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
+int OptionsInit(WPARAM wParam, LPARAM);
+
CMPlugin g_plugin;
LCID packlcid;
@@ -197,17 +199,6 @@ static int FoldersPathChanged(WPARAM, LPARAM)
return 0;
}
-int OptionsInit(WPARAM wParam, LPARAM)
-{
- OPTIONSDIALOGPAGE odp = {};
- odp.szTitle.a = MODULENAME;
- odp.szGroup.a = LPGEN("Services");
- odp.flags = ODPF_BOLDGROUPS;
- odp.pDialog = new COptDialog;
- g_plugin.addOptions(wParam, &odp);
- return 0;
-}
-
static int ToolbarModulesLoaded(WPARAM, LPARAM)
{
TTBButton ttb = {};
diff --git a/plugins/CrashDumper/src/stdafx.h b/plugins/CrashDumper/src/stdafx.h
index 7a2db71c67..51c44fa0e4 100644
--- a/plugins/CrashDumper/src/stdafx.h
+++ b/plugins/CrashDumper/src/stdafx.h
@@ -158,23 +158,6 @@ HICON LoadIconEx(int iconId, bool big = false);
void ReleaseIconEx(int iconId);
HANDLE GetIconHandle(int iconId);
-class COptDialog : public CDlgBase
-{
-private:
- CCtrlEdit m_edtUserName, m_edtPass;
- CCtrlCheck m_chkAutoUpload, m_chkClassicDates, m_chkRepSubfolder, m_chkCatchCrashes;
- CCtrlLabel m_lblRestart;
-
-protected:
- bool OnInitDialog() override;
- bool OnApply() override;
-
- void OnCatchCrashesChange(CCtrlCheck*);
-
-public:
- COptDialog();
-};
-
class CViewVersionInfo : public CDlgBase
{
private:
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp
index 7422264d55..13ba7a5b1c 100644
--- a/plugins/CrashDumper/src/ui.cpp
+++ b/plugins/CrashDumper/src/ui.cpp
@@ -194,80 +194,105 @@ void DestroyAllWindows(void)
}
}
-COptDialog::COptDialog() :
- CDlgBase(g_plugin, IDD_OPTIONS),
- m_edtUserName(this, IDC_USERNAME),
- m_edtPass(this, IDC_PASSWORD),
- m_chkAutoUpload(this, IDC_UPLOADCHN),
- m_chkClassicDates(this, IDC_CLASSICDATES),
- m_chkRepSubfolder(this, IDC_DATESUBFOLDER),
- m_chkCatchCrashes(this, IDC_CATCHCRASHES),
- m_lblRestart(this, IDC_RESTARTNOTE)
-{
- CreateLink(m_chkAutoUpload, "UploadChanged", DBVT_BYTE, 0);
- m_chkCatchCrashes.OnChange = Callback(this, &COptDialog::OnCatchCrashesChange);
-}
+/////////////////////////////////////////////////////////////////////////////////////////
+// options
-bool COptDialog::OnInitDialog()
+class COptDialog : public CDlgBase
{
- CDlgBase::OnInitDialog();
- DBVARIANT dbv;
- if (g_plugin.getString("Username", &dbv) == 0) {
- m_edtUserName.SetTextA(dbv.pszVal);
- db_free(&dbv);
+ CCtrlEdit m_edtUserName, m_edtPass;
+ CCtrlCheck m_chkAutoUpload, m_chkClassicDates, m_chkRepSubfolder, m_chkCatchCrashes;
+ CCtrlLabel m_lblRestart;
+
+ void COptDialog::OnCatchCrashesChange(CCtrlCheck*)
+ {
+ m_chkClassicDates.Enable(m_chkCatchCrashes.GetState());
+ m_chkRepSubfolder.Enable(m_chkCatchCrashes.GetState());
+ m_lblRestart.Show();
+ needrestart = 1;
}
- if (g_plugin.getString("Password", &dbv) == 0) {
- m_edtPass.SetTextA(dbv.pszVal);
- db_free(&dbv);
+
+public:
+ COptDialog() :
+ CDlgBase(g_plugin, IDD_OPTIONS),
+ m_edtUserName(this, IDC_USERNAME),
+ m_edtPass(this, IDC_PASSWORD),
+ m_chkAutoUpload(this, IDC_UPLOADCHN),
+ m_chkClassicDates(this, IDC_CLASSICDATES),
+ m_chkRepSubfolder(this, IDC_DATESUBFOLDER),
+ m_chkCatchCrashes(this, IDC_CATCHCRASHES),
+ m_lblRestart(this, IDC_RESTARTNOTE)
+ {
+ CreateLink(m_chkAutoUpload, "UploadChanged", DBVT_BYTE, 0);
+ m_chkCatchCrashes.OnChange = Callback(this, &COptDialog::OnCatchCrashesChange);
}
- m_chkClassicDates.SetState(clsdates);
- m_chkRepSubfolder.SetState(dtsubfldr);
- m_chkCatchCrashes.SetState(catchcrashes);
- if (!catchcrashes) {
- m_chkClassicDates.Disable();
- m_chkRepSubfolder.Disable();
+
+ bool COptDialog::OnInitDialog()
+ {
+ CDlgBase::OnInitDialog();
+ DBVARIANT dbv;
+ if (g_plugin.getString("Username", &dbv) == 0) {
+ m_edtUserName.SetTextA(dbv.pszVal);
+ db_free(&dbv);
+ }
+ if (g_plugin.getString("Password", &dbv) == 0) {
+ m_edtPass.SetTextA(dbv.pszVal);
+ db_free(&dbv);
+ }
+ m_chkClassicDates.SetState(clsdates);
+ m_chkRepSubfolder.SetState(dtsubfldr);
+ m_chkCatchCrashes.SetState(catchcrashes);
+ if (!catchcrashes) {
+ m_chkClassicDates.Disable();
+ m_chkRepSubfolder.Disable();
+ }
+ if (needrestart)
+ m_lblRestart.Show();
+ return true;
}
- if (needrestart)
- m_lblRestart.Show();
- return true;
-}
-void COptDialog::OnCatchCrashesChange(CCtrlCheck*)
-{
- m_chkClassicDates.Enable(m_chkCatchCrashes.GetState());
- m_chkRepSubfolder.Enable(m_chkCatchCrashes.GetState());
- m_lblRestart.Show();
- needrestart = 1;
-}
+ bool COptDialog::OnApply()
+ {
+ char szSetting[100];
+ m_edtUserName.GetTextA(szSetting, _countof(szSetting));
+ g_plugin.setString("Username", szSetting);
+
+ m_edtPass.GetTextA(szSetting, _countof(szSetting));
+ g_plugin.setString("Password", szSetting);
+
+ clsdates = m_chkClassicDates.GetState();
+ if (clsdates)
+ g_plugin.setByte("ClassicDates", 1);
+ else
+ g_plugin.setByte("ClassicDates", 0);
+ dtsubfldr = m_chkRepSubfolder.GetState();
+ if (dtsubfldr)
+ g_plugin.setByte("SubFolders", 1);
+ else
+ g_plugin.setByte("SubFolders", 0);
+ catchcrashes = m_chkCatchCrashes.GetState();
+ if (catchcrashes)
+ g_plugin.setByte("CatchCrashes", 1);
+ else
+ g_plugin.setByte("CatchCrashes", 0);
+
+ return true;
+ }
+};
-bool COptDialog::OnApply()
+int OptionsInit(WPARAM wParam, LPARAM)
{
- char szSetting[100];
- m_edtUserName.GetTextA(szSetting, _countof(szSetting));
- g_plugin.setString("Username", szSetting);
-
- m_edtPass.GetTextA(szSetting, _countof(szSetting));
- g_plugin.setString("Password", szSetting);
-
- clsdates = m_chkClassicDates.GetState();
- if (clsdates)
- g_plugin.setByte("ClassicDates", 1);
- else
- g_plugin.setByte("ClassicDates", 0);
- dtsubfldr = m_chkRepSubfolder.GetState();
- if (dtsubfldr)
- g_plugin.setByte("SubFolders", 1);
- else
- g_plugin.setByte("SubFolders", 0);
- catchcrashes = m_chkCatchCrashes.GetState();
- if (catchcrashes)
- g_plugin.setByte("CatchCrashes", 1);
- else
- g_plugin.setByte("CatchCrashes", 0);
-
- return true;
+ OPTIONSDIALOGPAGE odp = {};
+ odp.szTitle.a = MODULENAME;
+ odp.szGroup.a = LPGEN("Services");
+ odp.flags = ODPF_BOLDGROUPS;
+ odp.pDialog = new COptDialog;
+ g_plugin.addOptions(wParam, &odp);
+ return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// popups
+
LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {