From f6dee2a6578842772ff18eed5323b673b0d6b3c4 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sun, 17 Jun 2012 16:29:34 +0300 Subject: [PATCH] Cosmetics --- Build/Installer/Installer.nsi | 16 +++-- Language/Resource.rc | 9 +-- Library/DialogManage.cpp | 13 ++-- Library/resource.h | 122 +++++++++++++++++--------------- SkinInstaller/Application.cpp | 4 ++ SkinInstaller/DialogInstall.cpp | 2 +- SkinInstaller/DialogPackage.cpp | 6 +- 7 files changed, 98 insertions(+), 74 deletions(-) diff --git a/Build/Installer/Installer.nsi b/Build/Installer/Installer.nsi index 4a6ed52b..a124466f 100644 --- a/Build/Installer/Installer.nsi +++ b/Build/Installer/Installer.nsi @@ -760,13 +760,15 @@ SkipIniMove: WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Rainmeter" "DisplayVersion" "${VER} r${REV}" !endif - WriteRegStr HKCR ".rmskin" "" "Rainmeter skin" - WriteRegStr HKCR "Rainmeter skin" "" "Rainmeter skin file" - WriteRegStr HKCR "Rainmeter skin\shell" "" "open" - WriteRegStr HKCR "Rainmeter skin\DefaultIcon" "" "$INSTDIR\SkinInstaller.exe,0" - WriteRegStr HKCR "Rainmeter skin\shell\open\command" "" '"$INSTDIR\SkinInstaller.exe" %1' - WriteRegStr HKCR "Rainmeter skin\shell\edit" "" "Install Rainmeter skin" - WriteRegStr HKCR "Rainmeter skin\shell\edit\command" "" '"$INSTDIR\SkinInstaller.exe" %1' + ; Create .rmskin association + WriteRegStr HKCR ".rmskin" "" "Rainmeter.SkinInstaller" + DeleteRegKey HKCR "Rainmeter skin" ; Old key + WriteRegStr HKCR "Rainmeter.SkinInstaller" "" "Rainmeter Skin Installer" + WriteRegStr HKCR "Rainmeter.SkinInstaller\shell" "" "open" + WriteRegStr HKCR "Rainmeter.SkinInstaller\DefaultIcon" "" "$INSTDIR\SkinInstaller.exe,0" + WriteRegStr HKCR "Rainmeter.SkinInstaller\shell\open\command" "" '"$INSTDIR\SkinInstaller.exe" %1' + WriteRegStr HKCR "Rainmeter.SkinInstaller\shell\edit" "" "Install Rainmeter skin" + WriteRegStr HKCR "Rainmeter.SkinInstaller\shell\edit\command" "" '"$INSTDIR\SkinInstaller.exe" %1' ; Refresh shell icons if new install ${If} $0 == "" diff --git a/Language/Resource.rc b/Language/Resource.rc index 8af5737a..cd922908 100644 --- a/Language/Resource.rc +++ b/Language/Resource.rc @@ -192,9 +192,9 @@ CAPTION STR_MANAGERAINMETER FONT 8, "MS Shell Dlg 2", 0, 0, 0x0 { CONTROL "", IDC_MANAGE_TAB, "SysTabControl32", TCS_TABS | TCS_FIXEDWIDTH, 6, 6, 488, 293 - PUSHBUTTON STR_REFRESHALL, IDC_REFRESHALL_BUTTON, 5, 303, NUM_BUTTONWIDTH, 14 - PUSHBUTTON STR_EDITSETTINGS, IDC_EDITSETTINGS_BUTTON, NUM_BUTTONWIDTH + 9, 303, NUM_BUTTONWIDTH, 14 - PUSHBUTTON STR_OPENLOG, IDC_OPENLOG_BUTTON, NUM_BUTTONWIDTH + NUM_BUTTONWIDTH + 13, 303, NUM_BUTTONWIDTH, 14 + PUSHBUTTON STR_REFRESHALL, IDC_MANAGE_REFRESHALL_BUTTON, 5, 303, NUM_BUTTONWIDTH, 14 + PUSHBUTTON STR_EDITSETTINGS, IDC_MANAGE_EDITSETTINGS_BUTTON, NUM_BUTTONWIDTH + 9, 303, NUM_BUTTONWIDTH, 14 + PUSHBUTTON STR_OPENLOG, IDC_MANAGE_OPENLOG_BUTTON, NUM_BUTTONWIDTH + NUM_BUTTONWIDTH + 13, 303, NUM_BUTTONWIDTH, 14 PUSHBUTTON STR_CLOSE, IDCLOSE, 444, 303, 50, 14 } @@ -203,7 +203,8 @@ STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS FONT 8, "MS Shell Dlg 2", 0, 0, 0x0 { PUSHBUTTON STR_ACTIVESKINS, IDC_MANAGESKINS_ACTIVESKINS_BUTTON, 0, 0, 145, 14, WS_TABSTOP - CONTROL "", IDC_MANAGESKINS_SKINS_TREEVIEW, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | WS_VSCROLL, 0, 18, 145, 241 + CONTROL "", IDC_MANAGESKINS_SKINS_TREEVIEW, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | WS_VSCROLL, 0, 18, 145, 228 + CONTROL "Create .rmskin package...", IDC_MANAGESKINS_CREATEPACKAGE_LINK, "SysLink", 0x0, 0, 250, 145, 14 LTEXT "N/A", IDC_MANAGESKINS_FILE_TEXT, 165, 0, 130, 14, SS_ENDELLIPSIS | SS_NOPREFIX LTEXT "N/A", IDC_MANAGESKINS_CONFIG_TEXT, 165, 16, 130, 9, SS_ENDELLIPSIS | SS_NOPREFIX diff --git a/Library/DialogManage.cpp b/Library/DialogManage.cpp index 0afeea27..b6fe5516 100644 --- a/Library/DialogManage.cpp +++ b/Library/DialogManage.cpp @@ -256,15 +256,15 @@ INT_PTR CDialogManage::OnCommand(WPARAM wParam, LPARAM lParam) { switch (LOWORD(wParam)) { - case IDC_REFRESHALL_BUTTON: + case IDC_MANAGE_REFRESHALL_BUTTON: Rainmeter->RefreshAll(); break; - case IDC_EDITSETTINGS_BUTTON: + case IDC_MANAGE_EDITSETTINGS_BUTTON: Rainmeter->EditSettings(); break; - case IDC_OPENLOG_BUTTON: + case IDC_MANAGE_OPENLOG_BUTTON: CDialogAbout::Open(); break; @@ -1165,7 +1165,12 @@ INT_PTR CDialogManage::CTabSkins::OnNotify(WPARAM wParam, LPARAM lParam) switch (nm->code) { case NM_CLICK: - if (nm->idFrom == IDC_MANAGESKINS_ADDMETADATA_LINK) + if (nm->idFrom == IDC_MANAGESKINS_CREATEPACKAGE_LINK) + { + std::wstring file = Rainmeter->GetPath() + L"SkinInstaller.exe"; + RunFile(file.c_str(), L"/Packager"); + } + else if (nm->idFrom == IDC_MANAGESKINS_ADDMETADATA_LINK) { std::wstring file = Rainmeter->GetSkinPath() + m_SkinFolderPath; file += L'\\'; diff --git a/Library/resource.h b/Library/resource.h index fe0b07b9..7e305dec 100644 --- a/Library/resource.h +++ b/Library/resource.h @@ -21,67 +21,75 @@ #define IDC_ABOUT_TAB 1000 #define IDC_ABOUT_VERSION_TEXT 1001 -#define IDC_ABOUTLOG_ITEMS_LISTVIEW 1002 -#define IDC_ABOUTLOG_ERROR_CHECKBOX 1003 -#define IDC_ABOUTLOG_WARNING_CHECKBOX 1004 -#define IDC_ABOUTLOG_NOTICE_CHECKBOX 1005 -#define IDC_ABOUTLOG_DEBUG_CHECKBOX 1006 -#define IDC_ABOUTSKINS_ITEMS_LISTBOX 1007 -#define IDC_ABOUTSKINS_ITEMS_LISTVIEW 1008 -#define IDC_ABOUTPLUGINS_ITEMS_LISTVIEW 1009 -#define IDC_ABOUTVERSION_VERSION_TEXT 1010 -#define IDC_ABOUTVERSION_PATH_TEXT 1011 -#define IDC_ABOUTVERSION_INIFILE_TEXT 1012 -#define IDC_ABOUTVERSION_SKINPATH_TEXT 1013 -#define IDC_ABOUTVERSION_COPY_BUTTON 1014 -#define IDC_ABOUTVERSION_RAINMETER_ICON 1015 -#define IDC_MANAGE_TAB 1017 -#define IDC_REFRESHALL_BUTTON 1018 -#define IDC_EDITSETTINGS_BUTTON 1019 -#define IDC_OPENLOG_BUTTON 1020 -#define IDC_MANAGESKINS_ACTIVESKINS_BUTTON 1021 -#define IDC_MANAGESKINS_SKINS_TREEVIEW 1022 -#define IDC_MANAGESKINS_FILE_TEXT 1023 -#define IDC_MANAGESKINS_CONFIG_TEXT 1024 +#define IDC_ABOUTLOG_ITEMS_LISTVIEW 1000 +#define IDC_ABOUTLOG_ERROR_CHECKBOX 1001 +#define IDC_ABOUTLOG_WARNING_CHECKBOX 1002 +#define IDC_ABOUTLOG_NOTICE_CHECKBOX 1003 +#define IDC_ABOUTLOG_DEBUG_CHECKBOX 1004 + +#define IDC_ABOUTSKINS_ITEMS_LISTBOX 1000 +#define IDC_ABOUTSKINS_ITEMS_LISTVIEW 1001 + +#define IDC_ABOUTPLUGINS_ITEMS_LISTVIEW 1000 + +#define IDC_ABOUTVERSION_VERSION_TEXT 1000 +#define IDC_ABOUTVERSION_PATH_TEXT 1001 +#define IDC_ABOUTVERSION_INIFILE_TEXT 1002 +#define IDC_ABOUTVERSION_SKINPATH_TEXT 1003 +#define IDC_ABOUTVERSION_COPY_BUTTON 1004 +#define IDC_ABOUTVERSION_RAINMETER_ICON 1005 + +#define IDC_MANAGE_TAB 1000 +#define IDC_MANAGE_REFRESHALL_BUTTON 1001 +#define IDC_MANAGE_EDITSETTINGS_BUTTON 1002 +#define IDC_MANAGE_OPENLOG_BUTTON 1003 + +#define IDC_MANAGESKINS_ACTIVESKINS_BUTTON 1000 +#define IDC_MANAGESKINS_SKINS_TREEVIEW 1001 +#define IDC_MANAGESKINS_CREATEPACKAGE_LINK 1002 +#define IDC_MANAGESKINS_FILE_TEXT 1003 +#define IDC_MANAGESKINS_CONFIG_TEXT 1004 #define IDC_MANAGESKINS_LOAD_BUTTON 4056 // IDM_MANAGESKINSMENU_LOAD #define IDC_MANAGESKINS_REFRESH_BUTTON 4057 // IDM_MANAGESKINSMENU_REFRESH #define IDC_MANAGESKINS_EDIT_BUTTON 4058 // IDM_MANAGESKINSMENU_EDIT -#define IDC_MANAGESKINS_AUTHOR_TEXT 1025 -#define IDC_MANAGESKINS_VERSION_TEXT 1026 -#define IDC_MANAGESKINS_LICENSE_TEXT 1027 -#define IDC_MANAGESKINS_DESCRIPTION_TEXT 1028 -#define IDC_MANAGESKINS_ADDMETADATA_LINK 1029 -#define IDC_MANAGESKINS_X_TEXT 1030 -#define IDC_MANAGESKINS_Y_TEXT 1031 -#define IDC_MANAGESKINS_ZPOSITION_COMBOBOX 1032 -#define IDC_MANAGESKINS_LOADORDER_TEXT 1033 -#define IDC_MANAGESKINS_ONHOVER_COMBOBOX 1034 -#define IDC_MANAGESKINS_TRANSPARENCY_COMBOBOX 1035 -#define IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON 1036 -#define IDC_MANAGESKINS_DRAGGABLE_CHECKBOX 1037 -#define IDC_MANAGESKINS_CLICKTHROUGH_CHECKBOX 1038 -#define IDC_MANAGESKINS_KEEPONSCREEN_CHECKBOX 1039 -#define IDC_MANAGESKINS_SAVEPOSITION_CHECKBOX 1040 -#define IDC_MANAGESKINS_SNAPTOEDGES_CHECKBOX 1041 -#define IDC_MANAGETHEMES_LIST 1042 -#define IDC_MANAGETHEMES_LOAD_BUTTON 1043 -#define IDC_MANAGETHEMES_DELETE_BUTTON 1044 -#define IDC_MANAGETHEMES_EDIT_BUTTON 1045 -#define IDC_MANAGETHEMES_SAVE_BUTTON 1046 -#define IDC_MANAGETHEMES_EMPTYTHEME_CHECKBOX 1047 -#define IDC_MANAGETHEMES_UNUSEDSKINS_CHECKBOX 1048 -#define IDC_MANAGETHEMES_WALLPAPER_CHECKBOX 1049 -#define IDC_MANAGETHEMES_NAME_TEXT 1050 -#define IDC_MANAGETHEMES_BACKUP_BUTTON 1051 -#define IDC_MANAGESETTINGS_CHECKUPDATES_CHECKBOX 1052 -#define IDC_MANAGESETTINGS_LOCKSKINS_CHECKBOX 1053 -#define IDC_MANAGESETTINGS_RESETSTATISTICS_BUTTON 1054 -#define IDC_MANAGESETTINGS_LOGTOFILE_CHECKBOX 1055 -#define IDC_MANAGESETTINGS_VERBOSELOGGING_CHECKBOX 1056 -#define IDC_MANAGESETTINGS_SHOWLOGFILE_BUTTON 1057 -#define IDC_MANAGESETTINGS_DELETELOGFILE_BUTTON 1058 -#define IDC_MANAGESETTINGS_LANGUAGE_COMBOBOX 1059 +#define IDC_MANAGESKINS_AUTHOR_TEXT 1005 +#define IDC_MANAGESKINS_VERSION_TEXT 1006 +#define IDC_MANAGESKINS_LICENSE_TEXT 1007 +#define IDC_MANAGESKINS_DESCRIPTION_TEXT 1008 +#define IDC_MANAGESKINS_ADDMETADATA_LINK 1009 +#define IDC_MANAGESKINS_X_TEXT 1010 +#define IDC_MANAGESKINS_Y_TEXT 1011 +#define IDC_MANAGESKINS_ZPOSITION_COMBOBOX 1012 +#define IDC_MANAGESKINS_LOADORDER_TEXT 1013 +#define IDC_MANAGESKINS_ONHOVER_COMBOBOX 1014 +#define IDC_MANAGESKINS_TRANSPARENCY_COMBOBOX 1015 +#define IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON 1016 +#define IDC_MANAGESKINS_DRAGGABLE_CHECKBOX 1017 +#define IDC_MANAGESKINS_CLICKTHROUGH_CHECKBOX 1018 +#define IDC_MANAGESKINS_KEEPONSCREEN_CHECKBOX 1019 +#define IDC_MANAGESKINS_SAVEPOSITION_CHECKBOX 1020 +#define IDC_MANAGESKINS_SNAPTOEDGES_CHECKBOX 1021 + +#define IDC_MANAGETHEMES_LIST 1000 +#define IDC_MANAGETHEMES_LOAD_BUTTON 1001 +#define IDC_MANAGETHEMES_DELETE_BUTTON 1002 +#define IDC_MANAGETHEMES_EDIT_BUTTON 1003 +#define IDC_MANAGETHEMES_SAVE_BUTTON 1004 +#define IDC_MANAGETHEMES_EMPTYTHEME_CHECKBOX 1005 +#define IDC_MANAGETHEMES_UNUSEDSKINS_CHECKBOX 1006 +#define IDC_MANAGETHEMES_WALLPAPER_CHECKBOX 1007 +#define IDC_MANAGETHEMES_NAME_TEXT 1008 +#define IDC_MANAGETHEMES_BACKUP_BUTTON 1009 + +#define IDC_MANAGESETTINGS_CHECKUPDATES_CHECKBOX 1000 +#define IDC_MANAGESETTINGS_LOCKSKINS_CHECKBOX 1001 +#define IDC_MANAGESETTINGS_RESETSTATISTICS_BUTTON 1002 +#define IDC_MANAGESETTINGS_LOGTOFILE_CHECKBOX 1003 +#define IDC_MANAGESETTINGS_VERBOSELOGGING_CHECKBOX 1004 +#define IDC_MANAGESETTINGS_SHOWLOGFILE_BUTTON 1005 +#define IDC_MANAGESETTINGS_DELETELOGFILE_BUTTON 1006 +#define IDC_MANAGESETTINGS_LANGUAGE_COMBOBOX 1007 #define ID_STR_ISRTL 2000 #define ID_STR_UPDATEAVAILABLE 2001 diff --git a/SkinInstaller/Application.cpp b/SkinInstaller/Application.cpp index 56a50f57..24186dce 100644 --- a/SkinInstaller/Application.cpp +++ b/SkinInstaller/Application.cpp @@ -75,6 +75,10 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi if (GetPrivateProfileString(L"Rainmeter", L"SkinPath", L"", buffer, MAX_LINE_LENGTH, buffer) > 0) { g_Data.skinsPath = buffer; + if (g_Data.skinsPath.back() != L'\\' || g_Data.skinsPath.back() != L'/') + { + g_Data.skinsPath += L'\\'; + } } else { diff --git a/SkinInstaller/DialogInstall.cpp b/SkinInstaller/DialogInstall.cpp index efba81a9..1633c344 100644 --- a/SkinInstaller/DialogInstall.cpp +++ b/SkinInstaller/DialogInstall.cpp @@ -99,7 +99,7 @@ void CDialogInstall::Create(HINSTANCE hInstance, LPWSTR lpCmdLine) } HANDLE hMutex; - if (IsRunning(L"RainmeterSkinInstaller", &hMutex)) + if (IsRunning(L"Rainmeter Skin Installer", &hMutex)) { HWND hwnd = FindWindow(L"#32770", L"Rainmeter Skin Installer"); SetForegroundWindow(hwnd); diff --git a/SkinInstaller/DialogPackage.cpp b/SkinInstaller/DialogPackage.cpp index 2d62cf82..90ed0b91 100644 --- a/SkinInstaller/DialogPackage.cpp +++ b/SkinInstaller/DialogPackage.cpp @@ -48,7 +48,7 @@ CDialogPackage::~CDialogPackage() void CDialogPackage::Create(HINSTANCE hInstance, LPWSTR lpCmdLine) { HANDLE hMutex; - if (IsRunning(L"RainmeterBackup", &hMutex)) + if (IsRunning(L"Rainmeter Skin Packager", &hMutex)) { HWND hwnd = FindWindow(L"#32770", L"Rainmeter Skin Packager"); SetForegroundWindow(hwnd); @@ -552,10 +552,14 @@ INT_PTR CALLBACK CDialogPackage::SelectFolderDlgProc(HWND hWnd, UINT uMsg, WPARA { HWND item = GetDlgItem(hWnd, IDC_PACKAGESELECTFOLDER_EXISTING_COMBO); EnableWindow(item, TRUE); + int sel = ComboBox_GetCurSel(item); item = GetDlgItem(hWnd, IDC_PACKAGESELECTFOLDER_CUSTOM_EDIT); EnableWindow(item, FALSE); item = GetDlgItem(hWnd, IDC_PACKAGESELECTFOLDER_CUSTOMBROWSE_BUTTON); EnableWindow(item, FALSE); + + item = GetDlgItem(hWnd, IDCLOSE); + EnableWindow(item, sel != -1); } break;