diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-21 09:04:03 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-21 09:04:03 +0000 |
commit | f8f7f8976a4c05afb34e6b4a89116d244ce73d5f (patch) | |
tree | f41a45b181aa0b4d8212ae9562f228352c4f7c68 /plugins/NewsAggregator/Src | |
parent | 48cc535107e4d4cabbfd162a32896509df3b7ce6 (diff) |
added items for moving all feeds
git-svn-id: http://svn.miranda-ng.org/main/trunk@5438 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewsAggregator/Src')
-rw-r--r-- | plugins/NewsAggregator/Src/ExportImport.cpp | 61 | ||||
-rw-r--r-- | plugins/NewsAggregator/Src/resource.h | 3 |
2 files changed, 58 insertions, 6 deletions
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index 1a1344fc58..3aadc4f22f 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -242,9 +242,12 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
}
EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVEFEED), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVEALLFEEDS), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
- if (!SendMessage(FeedsList, LB_GETCOUNT, 0, 0))
+ if (!SendMessage(FeedsList, LB_GETCOUNT, 0, 0)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDFEED), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), FALSE);
+ }
return TRUE;
case WM_COMMAND:
@@ -340,8 +343,10 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_ADDFEED:
{
- if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_REMOVEFEED)))
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_REMOVEFEED)))
EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVEFEED), TRUE);
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_REMOVEALLFEEDS)))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVEALLFEEDS), TRUE);
if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDOK)))
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int cursel = SendMessage(FeedsList, LB_GETCURSEL, 0, 0);
@@ -349,27 +354,73 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SendMessage(FeedsList, LB_GETTEXT, cursel, (LPARAM)item);
SendMessage(FeedsExportList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsList, LB_DELETESTRING, cursel, 0);
- if (!SendMessage(FeedsList, LB_GETCOUNT, 0, 0))
+ if (!SendMessage(FeedsList, LB_GETCOUNT, 0, 0)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDFEED), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), FALSE);
+ }
}
break;
case IDC_REMOVEFEED:
{
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDFEED)))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDFEED), TRUE);
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS)))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int cursel = SendMessage(FeedsExportList, LB_GETCURSEL, 0, 0);
TCHAR item[MAX_PATH];
SendMessage(FeedsExportList, LB_GETTEXT, cursel, (LPARAM)item);
- if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDFEED)))
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADDFEED), TRUE);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsExportList, LB_DELETESTRING, cursel, 0);
if (!SendMessage(FeedsExportList, LB_GETCOUNT, 0, 0))
{
EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVEFEED), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVEALLFEEDS), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
}
}
break;
+
+ case IDC_ADDALLFEEDS:
+ {
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_REMOVEFEED)))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVEFEED), TRUE);
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_REMOVEALLFEEDS)))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVEALLFEEDS), TRUE);
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDOK)))
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
+ int count = SendMessage(FeedsList, LB_GETCOUNT, 0, 0);
+ for (int i = 0; i < count; i++) {
+ TCHAR item[MAX_PATH];
+ SendMessage(FeedsList, LB_GETTEXT, i, (LPARAM)item);
+ SendMessage(FeedsExportList, LB_ADDSTRING, 0, (LPARAM)item);
+ }
+ for (int i = count - 1; i > -1; i--)
+ SendMessage(FeedsList, LB_DELETESTRING, i, 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDFEED), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), FALSE);
+ }
+ break;
+
+ case IDC_REMOVEALLFEEDS:
+ {
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDFEED)))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDFEED), TRUE);
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS)))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
+ int count = SendMessage(FeedsExportList, LB_GETCOUNT, 0, 0);
+ for (int i = 0; i < count; i++) {
+ TCHAR item[MAX_PATH];
+ SendMessage(FeedsExportList, LB_GETTEXT, i, (LPARAM)item);
+ SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
+ }
+ for (int i = count - 1; i > -1; i--)
+ SendMessage(FeedsExportList, LB_DELETESTRING, i, 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVEFEED), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVEALLFEEDS), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
+ }
+ break;
}
break;
diff --git a/plugins/NewsAggregator/Src/resource.h b/plugins/NewsAggregator/Src/resource.h index e45b33deeb..9d682755e4 100644 --- a/plugins/NewsAggregator/Src/resource.h +++ b/plugins/NewsAggregator/Src/resource.h @@ -38,9 +38,10 @@ #define IDC_FEEDSEXPORTLIST 1109
#define IDC_ADDFEED 1110
#define IDC_REMOVEFEED 1111
+#define IDC_ADDALLFEEDS 1112
+#define IDC_REMOVEALLFEEDS 1113
#define IDC_IMPORTFILEPATH 1114
#define IDC_BROWSEIMPORTFILE 1115
-#define IDC_LOADIMPORTFILE 1116
#define IDC_FEEDSIMPORTLIST 1117
#define IDC_FEEDNAME 1124
|