diff options
author | George Hazan <ghazan@miranda.im> | 2022-01-09 21:35:46 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-01-09 21:35:46 +0300 |
commit | e200e1c71a5a79a08ed5770319329ff9ec93ae51 (patch) | |
tree | 4aa426f250deb12a2015280099c81fae12bad351 /src/mir_app | |
parent | f79400bdcfdade258a9070de2b9a433c86cac588 (diff) |
fix for a INI file import form
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/res/resource.rc | 2 | ||||
-rw-r--r-- | src/mir_app/src/db_ini.cpp | 49 | ||||
-rw-r--r-- | src/mir_app/src/resource.h | 1 |
3 files changed, 23 insertions, 29 deletions
diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc index b6187d3351..f8dfa40274 100644 --- a/src/mir_app/res/resource.rc +++ b/src/mir_app/res/resource.rc @@ -217,7 +217,7 @@ BEGIN PUSHBUTTON "&Delete",IDC_DELETE,68,36,50,14
EDITTEXT IDC_NEWNAME,5,55,117,12,ES_AUTOHSCROLL
PUSHBUTTON "&Move/Rename",IDC_MOVE,124,54,57,14
- PUSHBUTTON "&Leave",IDC_LEAVE,131,36,50,14
+ PUSHBUTTON "&Leave",IDCANCEL,131,36,50,14
END
IDD_NETLIBLOGOPTS DIALOGEX 0, 0, 314, 259
diff --git a/src/mir_app/src/db_ini.cpp b/src/mir_app/src/db_ini.cpp index 99096afb50..d4830ff98c 100644 --- a/src/mir_app/src/db_ini.cpp +++ b/src/mir_app/src/db_ini.cpp @@ -204,15 +204,25 @@ class CIniImportDoneDlg : public CDlgBase {
wchar_t *m_path;
- CCtrlButton m_delete;
- CCtrlButton m_leave;
- CCtrlButton m_recycle;
- CCtrlButton m_move;
+ CCtrlEdit m_iniPath, m_newPath;
+ CCtrlButton btnMove, btnDelete, btnRecycle;
- CCtrlBase m_iniPath;
- CCtrlEdit m_newPath;
+public:
+ CIniImportDoneDlg(wchar_t *path) :
+ CDlgBase(g_plugin, IDD_INIIMPORTDONE),
+ m_iniPath(this, IDC_ININAME),
+ m_newPath(this, IDC_NEWNAME),
+ btnMove(this, IDC_MOVE),
+ btnDelete(this, IDC_DELETE),
+ btnRecycle(this, IDC_RECYCLE)
+ {
+ m_path = path;
+
+ btnMove.OnClick = Callback(this, &CIniImportDoneDlg::onClick_Move);
+ btnDelete.OnClick = Callback(this, &CIniImportDoneDlg::onClick_Delete);
+ btnRecycle.OnClick = Callback(this, &CIniImportDoneDlg::onClick_Recycle);
+ }
-protected:
bool OnInitDialog() override
{
m_iniPath.SetText(m_path);
@@ -220,38 +230,23 @@ protected: return true;
}
- void Delete_OnClick(CCtrlBase*)
+ void onClick_Move(CCtrlBase *)
{
- MyDeleteFile(ptrW(m_iniPath.GetText()));
+ MyMoveFile(ptrW(m_iniPath.GetText()), ptrW(m_newPath.GetText()));
Close();
}
- void Leave_OnClick(CCtrlBase*)
+ void onClick_Delete(CCtrlBase *)
{
+ MyDeleteFile(ptrW(m_iniPath.GetText()));
Close();
}
- void Recycle_OnClick(CCtrlBase*)
+ void onClick_Recycle(CCtrlBase *)
{
ToRecycleBin(ptrW(m_iniPath.GetText()));
Close();
}
-
- void Move_OnClick(CCtrlBase*)
- {
- MyMoveFile(ptrW(m_iniPath.GetText()), ptrW(m_newPath.GetText()));
- Close();
- }
-
-public:
- CIniImportDoneDlg(wchar_t *path) :
- CDlgBase(g_plugin, IDD_INIIMPORTDONE),
- m_delete(this, IDC_DELETE), m_leave(this, IDC_LEAVE),
- m_recycle(this, IDC_RECYCLE), m_move(this, IDC_MOVE),
- m_iniPath(this, IDC_ININAME), m_newPath(this, IDC_NEWNAME)
- {
- m_path = path;
- }
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/resource.h b/src/mir_app/src/resource.h index da20388f8c..ede8012f12 100644 --- a/src/mir_app/src/resource.h +++ b/src/mir_app/src/resource.h @@ -407,7 +407,6 @@ #define IDC_RECYCLE 1340
#define IDC_NEWNAME 1341
#define IDC_MOVE 1342
-#define IDC_LEAVE 1343
#define IDC_CATEGORYLIST 1366
#define IDC_LOADICONS 1369
#define IDC_STICONSGROUP 1371
|