From 7e0f9f7347ca4a778d1a6167a878de12fd4baa03 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Tue, 20 Aug 2013 11:05:02 +0000 Subject: profile manager redesigned git-svn-id: http://svn.miranda-ng.org/main/trunk@5753 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/database/profilemanager.cpp | 43 +++++++++++++++------------------ src/resource.rc | 36 +++++++++++++-------------- 2 files changed, 38 insertions(+), 41 deletions(-) diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp index 267fcde3f3..2dcea188d7 100644 --- a/src/modules/database/profilemanager.cpp +++ b/src/modules/database/profilemanager.cpp @@ -316,14 +316,6 @@ BOOL EnumProfilesForList(TCHAR *fullpath, TCHAR *profile, LPARAM lParam) SendMessage(hwndList, LVM_SETITEMTEXT, iItem, (LPARAM)&item); } } - - item2.iSubItem = 3; - item2.pszText = rtrimt(_tctime(&statbuf.st_ctime)); - SendMessage(hwndList, LVM_SETITEMTEXT, iItem, (LPARAM)&item2); - - item2.iSubItem = 4; - item2.pszText = rtrimt(_tctime(&statbuf.st_mtime)); - SendMessage(hwndList, LVM_SETITEMTEXT, iItem, (LPARAM)&item2); } return TRUE; } @@ -393,25 +385,17 @@ static INT_PTR CALLBACK DlgProfileSelect(HWND hwndDlg, UINT msg, WPARAM wParam, LVCOLUMN col; col.mask = LVCF_TEXT | LVCF_WIDTH; col.pszText = TranslateT("Profile"); - col.cx = 122; + col.cx = 100; ListView_InsertColumn(hwndList, 0, &col); col.pszText = TranslateT("Driver"); - col.cx = 100; + col.cx = 150; ListView_InsertColumn(hwndList, 1, &col); col.pszText = TranslateT("Size"); col.cx = 60; ListView_InsertColumn(hwndList, 2, &col); - col.pszText = TranslateT("Created"); - col.cx = 145; - ListView_InsertColumn(hwndList, 3, &col); - - col.pszText = TranslateT("Modified"); - col.cx = 145; - ListView_InsertColumn(hwndList, 4, &col); - // icons HIMAGELIST hImgList = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 2, 1); ImageList_AddIcon_NotShared(hImgList, MAKEINTRESOURCE(IDI_USERDETAILS)); @@ -421,7 +405,7 @@ static INT_PTR CALLBACK DlgProfileSelect(HWND hwndDlg, UINT msg, WPARAM wParam, SetWindowLongPtr(hwndList, GWL_STYLE, GetWindowLongPtr(hwndList, GWL_STYLE) | LVS_SORTASCENDING); ListView_SetImageList(hwndList, hImgList, LVSIL_SMALL); ListView_SetExtendedListViewStyle(hwndList, - ListView_GetExtendedListViewStyle(hwndList) | LVS_EX_DOUBLEBUFFER | LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT); + ListView_GetExtendedListViewStyle(hwndList) | LVS_EX_DOUBLEBUFFER | LVS_EX_INFOTIP | LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT); // find all the profiles ProfileEnumData ped = { hwndDlg, dat->pd->szProfile }; @@ -543,6 +527,20 @@ static INT_PTR CALLBACK DlgProfileSelect(HWND hwndDlg, UINT msg, WPARAM wParam, DeleteProfile(hwndList, ListView_GetNextItem(hwndList, -1, LVNI_SELECTED | LVNI_ALL), dat); break; } + case LVN_GETINFOTIP: + { + NMLVGETINFOTIP *pInfoTip = (NMLVGETINFOTIP *)lParam; + if (pInfoTip != NULL) + { + TCHAR profilename[MAX_PATH], fullpath[MAX_PATH]; + struct _stat statbuf; + ListView_GetItemText(hwndList, pInfoTip->iItem, 0, profilename, MAX_PATH); + mir_sntprintf(fullpath, SIZEOF(fullpath), _T("%s\\%s\\%s.dat"), dat->pd->szProfileDir, profilename, profilename); + _tstat(fullpath, &statbuf); + mir_sntprintf(pInfoTip->pszText, pInfoTip->cchTextMax, _T("%s\n%s: %s\n%s: %s"), fullpath, TranslateT("Created"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_ctime))), TranslateT("Modified"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_mtime)))); + } + } + break; } } break; @@ -562,8 +560,8 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam, { struct DlgProfData * prof = (struct DlgProfData *)lParam; PROPSHEETHEADER *psh = prof->psh; - SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_USERDETAILS), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)); - SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_USERDETAILS), IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0)); + SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_DETAILSLOGO), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)); + SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_DETAILSLOGO), IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0)); dat = (struct DetailsData*)mir_alloc(sizeof(struct DetailsData)); dat->prof = prof; prof->hwndOK = GetDlgItem(hwndDlg, IDOK); @@ -572,8 +570,7 @@ static INT_PTR CALLBACK DlgProfileManager(HWND hwndDlg, UINT msg, WPARAM wParam, SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat); TCHAR buf[512]; - mir_sntprintf(buf, SIZEOF(buf), _T("%s: %s\n%s"), TranslateT("Miranda Profiles from"), prof->pd->szProfileDir, - TranslateT("Select or create your Miranda NG user profile")); + mir_sntprintf(buf, SIZEOF(buf), _T("%s\n%s"), TranslateT("Miranda NG Profile Manager"), TranslateT("Manage your Miranda NG profile")); SetDlgItemText(hwndDlg, IDC_NAME, buf); dat->currentPage = 0; diff --git a/src/resource.rc b/src/resource.rc index c1c3e5e57d..5a6a2dc702 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -85,17 +85,17 @@ BEGIN CONTROL "Tree1",IDC_NAMEORDER,"SysTreeView32",TVS_NOTOOLTIPS | TVS_FULLROWSELECT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,65,78,182,93 END -IDD_PROFILEMANAGER DIALOGEX 0, 0, 400, 211 +IDD_PROFILEMANAGER DIALOGEX 0, 0, 219, 211 STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Miranda NG Profile Manager" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - CONTROL "",IDC_NAME,"MHeaderbarCtrl",0x0,0,0,400,25 - CONTROL "Tab1",IDC_TABS,"SysTabControl32",TCS_HOTTRACK | WS_TABSTOP,4,31,393,160 - PUSHBUTTON "&Run",IDOK,298,194,48,14 - PUSHBUTTON "&Exit",IDCANCEL,348,194,48,14 - RTEXT "Start in Service Mode with",IDC_SM_LABEL,10,196,106,10 - COMBOBOX IDC_SM_COMBO,120,195,123,72,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_NAME,"MHeaderbarCtrl",0x0,0,0,220,25 + CONTROL "Tab1",IDC_TABS,"SysTabControl32",TCS_HOTTRACK | WS_TABSTOP,2,31,215,137 + PUSHBUTTON "&Run",IDOK,169,195,48,14 + PUSHBUTTON "&Exit",IDCANCEL,112,195,48,14 + RTEXT "Start in Service Mode with",IDC_SM_LABEL,10,178,106,10 + COMBOBOX IDC_SM_COMBO,118,176,98,12,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END IDD_FINDADD DIALOGEX 0, 0, 427, 257 @@ -387,28 +387,28 @@ BEGIN CTEXT "You will need to reconnect for the changes you have made on this page to take effect.",IDC_RECONNECTREQD,4,224,307,8,NOT WS_VISIBLE END -IDD_PROFILE_SELECTION DIALOGEX 0, 0, 386, 142 +IDD_PROFILE_SELECTION DIALOGEX 0, 0, 208, 122 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - CONTROL "List1",IDC_PROFILELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_TABSTOP,3,2,382,137 + CONTROL "List1",IDC_PROFILELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_TABSTOP,0,3,365,138 END -IDD_PROFILE_NEW DIALOGEX 0, 0, 386, 142 +IDD_PROFILE_NEW DIALOGEX 0, 0, 208, 122 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN LTEXT "Please complete the following form to create a new user profile",IDC_STATIC,4,3,205,16 - EDITTEXT IDC_PROFILENAME,67,27,75,12,ES_AUTOHSCROLL - COMBOBOX IDC_PROFILEDRIVERS,67,72,75,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Profile",IDC_STATIC,20,28,40,9 - LTEXT "e.g. Workplace",IDC_STATIC,161,28,77,11 - LTEXT "You can select a different profile driver from the default, it may offer more features or abilities, if in doubt use the default.",IDC_STATIC,7,49,231,17 - LTEXT "e.g. Miranda Database",IDC_STATIC,154,73,84,11 - LTEXT "Driver",IDC_STATIC,20,74,43,9 - LTEXT "Problem: Unable to find any database drivers, this means you can not create a new profile, you need to get dbx_mmap.dll",IDC_NODBDRIVERS,7,113,231,22,NOT WS_VISIBLE + EDITTEXT IDC_PROFILENAME,61,13,105,12,ES_AUTOHSCROLL + COMBOBOX IDC_PROFILEDRIVERS,58,75,105,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Profile",IDC_STATIC,20,14,38,9 + LTEXT "e.g. Workplace",IDC_STATIC,71,27,77,11 + LTEXT "You can select a different profile driver from the default, it may offer more features or abilities, if in doubt use the default.",IDC_STATIC,4,46,207,24 + LTEXT "e.g. Miranda Database",IDC_STATIC,62,91,84,11 + LTEXT "Driver",IDC_STATIC,20,77,37,9 + LTEXT "Problem: Unable to find any database drivers, this means you can not create a new profile, you need to get dbx_mmap.dll",IDC_NODBDRIVERS,4,104,203,22,NOT WS_VISIBLE END IDD_OPT_PLUGINS DIALOGEX 0, 0, 315, 252 -- cgit v1.2.3