diff options
Diffstat (limited to 'tools/channel_changer')
-rw-r--r-- | tools/channel_changer/channel_changer.cc | 23 | ||||
-rw-r--r-- | tools/channel_changer/channel_changer.rc | 24 | ||||
-rw-r--r-- | tools/channel_changer/channel_changer.vcproj | 8 | ||||
-rw-r--r-- | tools/channel_changer/resource.h | 8 |
4 files changed, 40 insertions, 23 deletions
diff --git a/tools/channel_changer/channel_changer.cc b/tools/channel_changer/channel_changer.cc index 4f9365e..1246200 100644 --- a/tools/channel_changer/channel_changer.cc +++ b/tools/channel_changer/channel_changer.cc @@ -13,20 +13,23 @@ enum Branch { UNKNOWN_BRANCH = 0, DEV_BRANCH, BETA_BRANCH, + STABLE_BRANCH, }; // This vector of strings needs to be in sync with the Branch enum above. static const wchar_t* const kBranchStrings[] = { L"", L"1.1-dev", - L"1.1-beta" + L"1.1-beta", + L"", }; // This vector of strings needs to be in sync with the Branch enum above. static const wchar_t* const kBranchStringsReadable[] = { L"", L"Dev", - L"Beta" + L"Beta", + L"Stable", }; // The root key for Google Update. @@ -51,7 +54,7 @@ static HICON dlg_icon = NULL; void SetMainLabel(HWND dialog, Branch branch) { std::wstring main_label = L"You are currently on "; - if (branch == DEV_BRANCH || branch == BETA_BRANCH) + if (branch == DEV_BRANCH || branch == BETA_BRANCH || branch == STABLE_BRANCH) main_label += std::wstring(L"the ") + kBranchStringsReadable[branch] + std::wstring(L" channel"); else @@ -72,7 +75,7 @@ void OnInitDialog(HWND dialog) { !google_update.ReadValue(kBranchKey, &branch_string)) { // If the 'ap' value is missing, we create it, unless the key is missing. RegKey write_default(kGoogleUpdateRoot, kGoogleUpdateKey, KEY_WRITE); - branch_string = kBranchStrings[BETA_BRANCH]; + branch_string = kBranchStrings[STABLE_BRANCH]; if (!write_default.WriteValue(kBranchKey, branch_string.c_str())) branch_string = L""; // Error, show disabled UI. } @@ -90,7 +93,9 @@ void OnInitDialog(HWND dialog) { } Branch branch = UNKNOWN_BRANCH; - if (branch_string == kBranchStrings[DEV_BRANCH]) { + if (branch_string == kBranchStrings[STABLE_BRANCH]) { + branch = STABLE_BRANCH; + } else if (branch_string == kBranchStrings[DEV_BRANCH]) { branch = DEV_BRANCH; } else if (branch_string == kBranchStrings[BETA_BRANCH]) { branch = BETA_BRANCH; @@ -98,6 +103,7 @@ void OnInitDialog(HWND dialog) { // Hide the controls we can't use. EnableWindow(GetDlgItem(dialog, IDOK), false); EnableWindow(GetDlgItem(dialog, IDC_STABLE), false); + EnableWindow(GetDlgItem(dialog, IDC_BETA), false); EnableWindow(GetDlgItem(dialog, IDC_CUTTING_EDGE), false); MessageBox(dialog, L"KEY NOT FOUND\n\nChrome is not installed, or is not " @@ -109,9 +115,11 @@ void OnInitDialog(HWND dialog) { SetMainLabel(dialog, branch); CheckDlgButton(dialog, IDC_STABLE, - branch == BETA_BRANCH ? BST_CHECKED : BST_UNCHECKED); + branch == STABLE_BRANCH ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(dialog, IDC_CUTTING_EDGE, branch == DEV_BRANCH ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(dialog, IDC_BETA, + branch == BETA_BRANCH ? BST_CHECKED : BST_UNCHECKED); } INT_PTR OnCtlColorStatic(HWND dialog, WPARAM wparam, LPARAM lparam) { @@ -119,6 +127,7 @@ INT_PTR OnCtlColorStatic(HWND dialog, WPARAM wparam, LPARAM lparam) { HWND control_wnd = reinterpret_cast<HWND>(lparam); if (GetDlgItem(dialog, IDC_STABLE) == control_wnd || + GetDlgItem(dialog, IDC_BETA) == control_wnd || GetDlgItem(dialog, IDC_CUTTING_EDGE) == control_wnd || GetDlgItem(dialog, IDC_LABEL_MAIN) == control_wnd || GetDlgItem(dialog, IDC_SECONDARY_LABEL) == control_wnd) { @@ -133,6 +142,8 @@ INT_PTR OnCtlColorStatic(HWND dialog, WPARAM wparam, LPARAM lparam) { void SaveChanges(HWND dialog) { Branch branch = UNKNOWN_BRANCH; if (IsDlgButtonChecked(dialog, IDC_STABLE)) + branch = STABLE_BRANCH; + else if (IsDlgButtonChecked(dialog, IDC_BETA)) branch = BETA_BRANCH; else if (IsDlgButtonChecked(dialog, IDC_CUTTING_EDGE)) branch = DEV_BRANCH; diff --git a/tools/channel_changer/channel_changer.rc b/tools/channel_changer/channel_changer.rc index 34f5653..8e9bfc2 100644 --- a/tools/channel_changer/channel_changer.rc +++ b/tools/channel_changer/channel_changer.rc @@ -37,20 +37,22 @@ IDI_BRANCH_SWITCHER ICON "../../chrome/app/theme/google_c // Dialog // -IDD_MAIN_DIALOG DIALOGEX 0, 0, 419, 147 +IDD_MAIN_DIALOG DIALOGEX 0, 0, 419, 186 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Chrome Channel Switcher v1.1" +CAPTION "Google Chrome Channel Switcher v1.2" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - DEFPUSHBUTTON "Update",IDOK,156,127,50,14 - PUSHBUTTON "Close",IDCANCEL,212,127,50,14 + DEFPUSHBUTTON "Update",IDOK,157,153,50,14 + PUSHBUTTON "Close",IDCANCEL,213,153,50,14 LTEXT "This label will be populated programmatically.",IDC_LABEL_MAIN,47,13,322,18 - CONTROL "Beta: More stable releases, less frequently. You won't get bug fixes and new features as quickly, but what you get will have had more testing.",IDC_STABLE, - "Button",BS_AUTORADIOBUTTON | BS_MULTILINE,47,39,340,19 - CONTROL "Dev: Get the latest features and bugfixes every week. You'll be helping us improve, iterate, and make Chrome great faster. We need Dev users, and we'll give your feedback and issues higher priority.",IDC_CUTTING_EDGE, - "Button",BS_AUTORADIOBUTTON | BS_MULTILINE,47,63,355,21 - CONTROL 129,IDC_IMAGEVIEW,"Static",SS_BITMAP,7,7,35,23 - LTEXT "Note: If you switch from Dev to Beta, you'll stay on the current Chrome version until the Beta channel gets a later update. Changing channels does not change the version of Chrome you are currently using.",IDC_SECONDARY_LABEL,47,97,340,21 + CONTROL "Stable: Official Google Chrome releases (~ quarterly updates).",IDC_STABLE, + "Button",BS_AUTORADIOBUTTON | BS_MULTILINE,45,39,340,19 + CONTROL "Beta: More stable releases (~ monthly updates).",IDC_BETA, + "Button",BS_AUTORADIOBUTTON | BS_MULTILINE,45,63,340,19 + CONTROL "Dev: The latest features and bugfixes (~ weekly updates).",IDC_CUTTING_EDGE, + "Button",BS_AUTORADIOBUTTON | BS_MULTILINE,45,90,355,21 + CONTROL 129,IDC_IMAGEVIEW,"Static",SS_BITMAP,7,7,35,30 + LTEXT "Note: If you switch from Dev to Beta, you'll stay on the current Chrome version until the Beta channel gets a later update. Changing channels does not change the version of Chrome you are currently using.",IDC_SECONDARY_LABEL,44,128,340,21 END @@ -95,7 +97,7 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 412 TOPMARGIN, 7 - BOTTOMMARGIN, 140 + BOTTOMMARGIN, 179 END END #endif // APSTUDIO_INVOKED diff --git a/tools/channel_changer/channel_changer.vcproj b/tools/channel_changer/channel_changer.vcproj index e951eec..4e8590f 100644 --- a/tools/channel_changer/channel_changer.vcproj +++ b/tools/channel_changer/channel_changer.vcproj @@ -215,11 +215,15 @@ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
- RelativePath=".\channel_changer.ico"
+ RelativePath=".\channel_changer.rc"
>
</File>
<File
- RelativePath=".\channel_changer.rc"
+ RelativePath=".\chrome.bmp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\chrome\app\theme\google_chrome\chrome.ico"
>
</File>
<File
diff --git a/tools/channel_changer/resource.h b/tools/channel_changer/resource.h index 8da97a8..fe16158 100644 --- a/tools/channel_changer/resource.h +++ b/tools/channel_changer/resource.h @@ -8,9 +8,9 @@ #define IDC_IMAGEVIEW 130 #define IDC_LABEL_MAIN 1000 #define IDC_STABLE 1001 -#define IDC_CUTTING_EDGE 1002 -#define IDC_SECONDARY_LABEL 1003 - +#define IDC_BETA 1002 +#define IDC_CUTTING_EDGE 1003 +#define IDC_SECONDARY_LABEL 1004 // Next default values for new objects // #ifdef APSTUDIO_INVOKED @@ -18,7 +18,7 @@ #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 131 #define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1004 +#define _APS_NEXT_CONTROL_VALUE 1005 #define _APS_NEXT_SYMED_VALUE 102 #endif #endif |