From ae4cd75ad09d77ce4a7a4412767c23a095ff6bab Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 30 Mar 2013 18:14:09 +0000 Subject: exmort starting git-svn-id: http://svn.miranda-ng.org/main/trunk@4257 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/Common.h | 1 - plugins/NewsAggregator/Src/Options.cpp | 32 ++++++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/NewsAggregator/Src/Common.h b/plugins/NewsAggregator/Src/Common.h index dec490a958..d26aefed29 100644 --- a/plugins/NewsAggregator/Src/Common.h +++ b/plugins/NewsAggregator/Src/Common.h @@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. // Miranda header files #include #include -#include #include #include #include diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index 45df92ad59..271a3bc6d3 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -540,11 +540,6 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP return FALSE; } -void CreateCListGroup(TCHAR* szGroupName) -{ - CallService(MS_CLIST_GROUPCREATE, 0, (LPARAM)szGroupName); -} - INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { HWND hwndList = GetDlgItem(hwndDlg, IDC_FEEDLIST); @@ -757,7 +752,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA } while (group_name); if(!GroupExist) - CreateCListGroup(utfgroup); + CallService(MS_CLIST_GROUPCREATE, 0, (LPARAM)utfgroup); } if (isUTF) { @@ -796,6 +791,31 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case IDC_EXPORT: { + TCHAR FileName[MAX_PATH]; + TCHAR *tszMirDir = Utils_ReplaceVarsT(_T("%miranda_path%")); + + OPENFILENAME ofn = {0}; + ofn.lStructSize = sizeof(ofn); + TCHAR tmp[MAX_PATH]; + mir_sntprintf(tmp, SIZEOF(tmp), _T("%s (*.opml)%c*.opml%c%c"), TranslateT("OPML files"), 0, 0, 0); + ofn.lpstrFilter = tmp; + ofn.hwndOwner = 0; + ofn.lpstrFile = FileName; + ofn.nMaxFile = MAX_PATH; + ofn.nMaxFileTitle = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY; + ofn.lpstrInitialDir = tszMirDir; + *FileName = '\0'; + ofn.lpstrDefExt = _T(""); + + if (GetSaveFileName(&ofn)) + { + HXML hXML = xi.createNode(_T("opml"), NULL, FALSE); + xi.addAttr(hXML, _T("version"), _T("1.0")); + HXML head = xi.addChild(hXML, _T("head"), NULL); + HXML title = xi.addChild(head, _T("title"), _T("Miranda NG NewsAggregator plugin export")); + xi.toFile(hXML, FileName, 1); + } } return FALSE; -- cgit v1.2.3