diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-19 11:22:35 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-19 11:22:35 +0000 |
commit | d910d2bc00fee19bac8524333064d36e2e5c3e9f (patch) | |
tree | 88cd4092433c172f69dc8c7671d95e59c51a568c /plugins/NewsAggregator | |
parent | 1b7d011bfcf847645b989824eff11aeb6257600d (diff) |
git-svn-id: http://svn.miranda-ng.org/main/trunk@5416 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewsAggregator')
-rw-r--r-- | plugins/NewsAggregator/Res/Resource.rc | 39 | ||||
-rw-r--r-- | plugins/NewsAggregator/Src/ExportImport.cpp | 46 | ||||
-rw-r--r-- | plugins/NewsAggregator/Src/Options.cpp | 4 |
3 files changed, 55 insertions, 34 deletions
diff --git a/plugins/NewsAggregator/Res/Resource.rc b/plugins/NewsAggregator/Res/Resource.rc index 9ff962ab51..e8aeb072e2 100644 --- a/plugins/NewsAggregator/Res/Resource.rc +++ b/plugins/NewsAggregator/Res/Resource.rc @@ -107,17 +107,17 @@ EXSTYLE WS_EX_ACCEPTFILES | WS_EX_CONTROLPARENT CAPTION "Export"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
+ LTEXT "Available feeds:",IDC_STATIC,6,6,100,8
+ LTEXT "Feeds to be exported:",IDC_STATIC,150,6,98,8
LISTBOX IDC_FEEDSLIST,6,18,120,98,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
+ LISTBOX IDC_FEEDSEXPORTLIST,150,18,120,98,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "->",IDC_ADDFEED,129,50,17,14
PUSHBUTTON "<-",IDC_REMOVEFEED,129,66,17,14
- LISTBOX IDC_FEEDSEXPORTLIST,150,18,120,98,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
+ LTEXT "Export to file:",IDC_STATIC,6,127,47,8
EDITTEXT IDC_EXPORTFILEPATH,59,124,186,14,ES_AUTOHSCROLL,WS_EX_ACCEPTFILES
PUSHBUTTON "...",IDC_BROWSEEXPORTFILE,248,124,22,14
PUSHBUTTON "&Export",IDOK,164,144,50,14
PUSHBUTTON "&Close",IDCANCEL,220,144,50,14
- LTEXT "Available feeds:",IDC_STATIC,6,6,100,8
- LTEXT "Export to file:",IDC_STATIC,6,127,47,8
- LTEXT "Feeds to be exported:",IDC_STATIC,150,6,98,8
END
IDD_FEEDIMPORT DIALOGEX 0, 0, 276, 183
@@ -126,19 +126,18 @@ EXSTYLE WS_EX_ACCEPTFILES | WS_EX_CONTROLPARENT CAPTION "Import"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
+ LTEXT "Import from:",IDC_STATIC,6,9,47,8
EDITTEXT IDC_IMPORTFILEPATH,59,7,186,14,ES_AUTOHSCROLL,WS_EX_ACCEPTFILES
PUSHBUTTON "...",IDC_BROWSEIMPORTFILE,248,7,22,14
PUSHBUTTON "Load",IDC_LOADIMPORTFILE,112,26,50,14
+ LTEXT "Available feeds:",IDC_STATIC,6,50,100,8
+ LTEXT "Feeds to be imported:",IDC_STATIC,150,50,101,8
LISTBOX IDC_FEEDSLIST,6,62,120,98,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
+ LISTBOX IDC_FEEDSIMPORTLIST,150,62,120,98,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "->",IDC_ADDFEED,129,94,17,14
PUSHBUTTON "<-",IDC_REMOVEFEED,129,110,17,14
- LISTBOX IDC_FEEDSIMPORTLIST,150,62,120,98,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "&Import",IDOK,165,165,50,14
PUSHBUTTON "&Close",IDCANCEL,220,165,50,14
- LTEXT "Available feeds:",IDC_STATIC,6,50,100,8
- LTEXT "Import from:",IDC_STATIC,6,9,47,8
- LTEXT "Feeds to be imported:",IDC_STATIC,150,50,101,8
- GROUPBOX "",IDC_STATIC,0,42,275,5
END
@@ -168,28 +167,6 @@ END #endif // APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_OPTIONS, DIALOG
- BEGIN
- BOTTOMMARGIN, 233
- END
-
- IDD_ADDFEED, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 241
- TOPMARGIN, 7
- END
-END
-#endif // APSTUDIO_INVOKED
-
#endif // Russian (Russia) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index fae8680156..ee647c0b67 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -308,11 +308,28 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
+ HWND FeedsList = GetDlgItem(hwndDlg, IDC_FEEDSLIST);
+ HWND FeedsExportList = GetDlgItem(hwndDlg, IDC_FEEDSEXPORTLIST);
+
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULE, "ExportDlg");
+ for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
+ DBVARIANT dbVar = {0};
+ if (!db_get_ts(hContact, MODULE, "Nick", &dbVar)) {
+ SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)dbVar.ptszVal);
+ db_free(&dbVar);
+ }
+ }
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVEFEED), FALSE);
+ if (SendMessage(FeedsList, LB_GETCURSEL, 0, 0))
+ {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDFEED), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSEEXPORTFILE), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_EXPORTFILEPATH), FALSE);
+ }
return TRUE;
case WM_COMMAND:
@@ -325,6 +342,33 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM DestroyWindow(hwndDlg);
break;
+ case IDC_ADDFEED:
+ {
+ if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_REMOVEFEED)))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVEFEED), TRUE);
+ int cursel = SendMessage(FeedsList, LB_GETCURSEL, 0, 0);
+ TCHAR item[MAX_PATH];
+ 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))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDFEED), FALSE);
+ }
+ break;
+
+ case IDC_REMOVEFEED:
+ {
+ 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);
+ }
+ break;
}
break;
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index fa47ec2afb..b00dfae7fb 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -529,11 +529,11 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA return FALSE;
case IDC_IMPORT:
- CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FEEDIMPORT), hwndDlg, DlgProcImportOpts, (LPARAM)hwndList);
+ CreateDialog(hInst, MAKEINTRESOURCE(IDD_FEEDIMPORT), hwndDlg, DlgProcImportOpts);
return FALSE;
case IDC_EXPORT:
- CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FEEDEXPORT), hwndDlg, DlgProcExportOpts, (LPARAM)hwndList);
+ CreateDialog(hInst, MAKEINTRESOURCE(IDD_FEEDEXPORT), hwndDlg, DlgProcExportOpts);
return FALSE;
case IDC_STARTUPRETRIEVE:
|