diff options
author | Antoine Cellerier <dionoea@videolan.org> | 2007-06-10 20:13:24 +0000 |
---|---|---|
committer | Antoine Cellerier <dionoea@videolan.org> | 2007-06-10 20:13:24 +0000 |
commit | d86e1a4998fdad8b6dafc92ebb0ab85c026c9a08 (patch) | |
tree | 22aefd368c8a116d4b14f6f4d1c050062e26813f /rbutil | |
parent | 2cda994431174ab809143761a3c72412acc54dc3 (diff) | |
download | rockbox-d86e1a4998fdad8b6dafc92ebb0ab85c026c9a08.tar.gz rockbox-d86e1a4998fdad8b6dafc92ebb0ab85c026c9a08.zip |
Add "Select All" button to the themes installer.
Remove a bunch of tabs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13610 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/rbutilCtrls.cpp | 34 | ||||
-rw-r--r-- | rbutil/rbutilCtrls.h | 23 |
2 files changed, 39 insertions, 18 deletions
diff --git a/rbutil/rbutilCtrls.cpp b/rbutil/rbutilCtrls.cpp index aef37fd0d3..e8a3f9e320 100644 --- a/rbutil/rbutilCtrls.cpp +++ b/rbutil/rbutilCtrls.cpp | |||
@@ -54,6 +54,7 @@ wxSize ImageCtrl::DoGetBestSize() const | |||
54 | 54 | ||
55 | BEGIN_EVENT_TABLE(ThemeCtrl, wxPanel) | 55 | BEGIN_EVENT_TABLE(ThemeCtrl, wxPanel) |
56 | EVT_LISTBOX(ID_THEME_LST, ThemeCtrl::OnThemesLst) | 56 | EVT_LISTBOX(ID_THEME_LST, ThemeCtrl::OnThemesLst) |
57 | EVT_BUTTON(ID_THEME_SELECT_ALL, ThemeCtrl::OnSelectAll) | ||
57 | END_EVENT_TABLE() | 58 | END_EVENT_TABLE() |
58 | 59 | ||
59 | IMPLEMENT_DYNAMIC_CLASS(ThemeCtrl, wxPanel) | 60 | IMPLEMENT_DYNAMIC_CLASS(ThemeCtrl, wxPanel) |
@@ -82,7 +83,7 @@ void ThemeCtrl::CreateControls() | |||
82 | topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5); | 83 | topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5); |
83 | 84 | ||
84 | //Device Selection | 85 | //Device Selection |
85 | wxBoxSizer* wxBoxSizer7 = new wxBoxSizer(wxVERTICAL); | 86 | wxBoxSizer* wxBoxSizer7 = new wxBoxSizer(wxVERTICAL); |
86 | horizontalSizer->Add(wxBoxSizer7,0,wxGROW | wxALL,0); | 87 | horizontalSizer->Add(wxBoxSizer7,0,wxGROW | wxALL,0); |
87 | 88 | ||
88 | wxStaticText* m_desc = new wxStaticText( this, wxID_STATIC, | 89 | wxStaticText* m_desc = new wxStaticText( this, wxID_STATIC, |
@@ -94,6 +95,10 @@ void ThemeCtrl::CreateControls() | |||
94 | wxDefaultSize,0,NULL,wxLB_EXTENDED); | 95 | wxDefaultSize,0,NULL,wxLB_EXTENDED); |
95 | wxBoxSizer7->Add(m_themeList, 0, wxALIGN_LEFT|wxALL, 5); | 96 | wxBoxSizer7->Add(m_themeList, 0, wxALIGN_LEFT|wxALL, 5); |
96 | 97 | ||
98 | m_selectAllThemes = new wxButton(this, ID_THEME_SELECT_ALL, | ||
99 | wxT("Select All")); | ||
100 | wxBoxSizer7->Add(m_selectAllThemes, 0, wxALIGN_LEFT|wxALL, 5); | ||
101 | |||
97 | // Preview Picture | 102 | // Preview Picture |
98 | wxBoxSizer* wxBoxSizer9 = new wxBoxSizer(wxVERTICAL); | 103 | wxBoxSizer* wxBoxSizer9 = new wxBoxSizer(wxVERTICAL); |
99 | horizontalSizer->Add(wxBoxSizer9,0,wxGROW | wxALL,0); | 104 | horizontalSizer->Add(wxBoxSizer9,0,wxGROW | wxALL,0); |
@@ -222,6 +227,11 @@ void ThemeCtrl::setDevice(wxString device) | |||
222 | 227 | ||
223 | void ThemeCtrl::OnThemesLst(wxCommandEvent& event) | 228 | void ThemeCtrl::OnThemesLst(wxCommandEvent& event) |
224 | { | 229 | { |
230 | ThemePreview(); | ||
231 | } | ||
232 | |||
233 | void ThemeCtrl::ThemePreview() | ||
234 | { | ||
225 | // wxCriticalSectionLocker locker(m_ThemeSelectSection); | 235 | // wxCriticalSectionLocker locker(m_ThemeSelectSection); |
226 | 236 | ||
227 | wxArrayInt selected; | 237 | wxArrayInt selected; |
@@ -261,7 +271,7 @@ void ThemeCtrl::OnThemesLst(wxCommandEvent& event) | |||
261 | bmp.LoadFile(m_currentimage,wxBITMAP_TYPE_PNG); | 271 | bmp.LoadFile(m_currentimage,wxBITMAP_TYPE_PNG); |
262 | m_PreviewBitmap->SetBitmap(bmp); | 272 | m_PreviewBitmap->SetBitmap(bmp); |
263 | 273 | ||
264 | Refresh(); | 274 | Refresh(); |
265 | this->GetSizer()->Layout(); | 275 | this->GetSizer()->Layout(); |
266 | this->GetSizer()->Fit(this); | 276 | this->GetSizer()->Fit(this); |
267 | this->GetSizer()->SetSizeHints(this); | 277 | this->GetSizer()->SetSizeHints(this); |
@@ -272,9 +282,15 @@ void ThemeCtrl::OnThemesLst(wxCommandEvent& event) | |||
272 | 282 | ||
273 | } | 283 | } |
274 | 284 | ||
285 | void ThemeCtrl::OnSelectAll(wxCommandEvent& event) | ||
286 | { | ||
287 | for(unsigned int i=0; i < m_themeList->GetCount(); i++) | ||
288 | m_themeList->Select(i); | ||
289 | ThemePreview(); | ||
290 | } | ||
275 | 291 | ||
276 | wxArrayString ThemeCtrl::getThemesToInstall() | 292 | wxArrayString ThemeCtrl::getThemesToInstall() |
277 | { | 293 | { |
278 | wxArrayString themes; | 294 | wxArrayString themes; |
279 | wxArrayInt selected; | 295 | wxArrayInt selected; |
280 | int numSelected = m_themeList->GetSelections(selected); | 296 | int numSelected = m_themeList->GetSelections(selected); |
@@ -361,7 +377,7 @@ void DeviceSelectorCtrl::CreateControls() | |||
361 | //Device Selection | 377 | //Device Selection |
362 | wxBoxSizer* horizontalSizer = new wxBoxSizer(wxHORIZONTAL); | 378 | wxBoxSizer* horizontalSizer = new wxBoxSizer(wxHORIZONTAL); |
363 | topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5); | 379 | topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5); |
364 | m_desc = new wxStaticText( this, wxID_STATIC, | 380 | m_desc = new wxStaticText( this, wxID_STATIC, |
365 | wxT("Device:"), wxDefaultPosition, | 381 | wxT("Device:"), wxDefaultPosition, |
366 | wxDefaultSize, 0 ); | 382 | wxDefaultSize, 0 ); |
367 | horizontalSizer->Add(m_desc, 0, wxALIGN_LEFT|wxALL, 5); | 383 | horizontalSizer->Add(m_desc, 0, wxALIGN_LEFT|wxALL, 5); |
@@ -405,9 +421,9 @@ void DeviceSelectorCtrl::OnComboBox(wxCommandEvent& event) | |||
405 | 421 | ||
406 | if(index == -1) | 422 | if(index == -1) |
407 | { | 423 | { |
408 | m_currentDevice = wxT(""); | 424 | m_currentDevice = wxT(""); |
409 | return; | 425 | return; |
410 | } | 426 | } |
411 | 427 | ||
412 | gv->curplat = gv->plat_id[index]; | 428 | gv->curplat = gv->plat_id[index]; |
413 | } | 429 | } |
@@ -418,7 +434,7 @@ void DeviceSelectorCtrl::OnAutoDetect(wxCommandEvent& event) | |||
418 | int n = ipod_scan(&ipod); | 434 | int n = ipod_scan(&ipod); |
419 | if(n == 1) | 435 | if(n == 1) |
420 | { | 436 | { |
421 | wxString temp(ipod.targetname,wxConvUTF8); | 437 | wxString temp(ipod.targetname,wxConvUTF8); |
422 | int index = gv->plat_bootloadername.Index(temp); // use the bootloader names.. | 438 | int index = gv->plat_bootloadername.Index(temp); // use the bootloader names.. |
423 | m_deviceCbx->SetValue(gv->plat_name[index]); | 439 | m_deviceCbx->SetValue(gv->plat_name[index]); |
424 | gv->curplat=gv->plat_id[index]; | 440 | gv->curplat=gv->plat_id[index]; |
diff --git a/rbutil/rbutilCtrls.h b/rbutil/rbutilCtrls.h index 1b084a88d9..53690a251e 100644 --- a/rbutil/rbutilCtrls.h +++ b/rbutil/rbutilCtrls.h | |||
@@ -45,11 +45,12 @@ DECLARE_DYNAMIC_CLASS(ThemeCtrl) | |||
45 | DECLARE_EVENT_TABLE() | 45 | DECLARE_EVENT_TABLE() |
46 | public: | 46 | public: |
47 | enum { | 47 | enum { |
48 | ID_DESC = 10001, | 48 | ID_DESC = 10001, |
49 | ID_FILESIZE= 10002, | 49 | ID_FILESIZE= 10002, |
50 | ID_INSTALLCHECKBOX= 10003, | 50 | ID_INSTALLCHECKBOX= 10003, |
51 | ID_PREVIEW_BITMAP = 10004, | 51 | ID_PREVIEW_BITMAP = 10004, |
52 | ID_THEME_LST = 10005, | 52 | ID_THEME_LST = 10005, |
53 | ID_THEME_SELECT_ALL = 10006 | ||
53 | }; //End of Enum | 54 | }; //End of Enum |
54 | 55 | ||
55 | public: | 56 | public: |
@@ -77,17 +78,21 @@ public: | |||
77 | void Init(); | 78 | void Init(); |
78 | // Event handlers | 79 | // Event handlers |
79 | void OnThemesLst(wxCommandEvent& event); | 80 | void OnThemesLst(wxCommandEvent& event); |
81 | void OnSelectAll(wxCommandEvent& event); | ||
80 | void OnCheckBox(wxCommandEvent& event); | 82 | void OnCheckBox(wxCommandEvent& event); |
81 | 83 | ||
82 | void setDevice(wxString device); | 84 | void setDevice(wxString device); |
83 | wxArrayString getThemesToInstall(); | 85 | wxArrayString getThemesToInstall(); |
84 | 86 | ||
85 | protected: | 87 | protected: |
88 | void ThemePreview(void); | ||
89 | |||
86 | wxString m_currentimage; | 90 | wxString m_currentimage; |
87 | wxString m_currentResolution; | 91 | wxString m_currentResolution; |
88 | 92 | ||
89 | wxStaticText* m_desc; | 93 | wxStaticText* m_desc; |
90 | wxListBox* m_themeList; | 94 | wxListBox* m_themeList; |
95 | wxButton* m_selectAllThemes; | ||
91 | wxStaticText* m_size; | 96 | wxStaticText* m_size; |
92 | wxTextCtrl* m_themedesc; | 97 | wxTextCtrl* m_themedesc; |
93 | ImageCtrl* m_PreviewBitmap; | 98 | ImageCtrl* m_PreviewBitmap; |
@@ -141,8 +146,8 @@ DECLARE_DYNAMIC_CLASS(DeviceSelectorCtrl) | |||
141 | DECLARE_EVENT_TABLE() | 146 | DECLARE_EVENT_TABLE() |
142 | public: | 147 | public: |
143 | enum { | 148 | enum { |
144 | ID_DEVICE_CBX = 10001, | 149 | ID_DEVICE_CBX = 10001, |
145 | ID_AUTODETECT_BTN= 10002, | 150 | ID_AUTODETECT_BTN= 10002, |
146 | }; //End of Enum | 151 | }; //End of Enum |
147 | 152 | ||
148 | public: | 153 | public: |
@@ -187,7 +192,7 @@ DECLARE_DYNAMIC_CLASS(DevicePositionCtrl) | |||
187 | DECLARE_EVENT_TABLE() | 192 | DECLARE_EVENT_TABLE() |
188 | public: | 193 | public: |
189 | enum { | 194 | enum { |
190 | ID_BROWSE_BTN = 10003, | 195 | ID_BROWSE_BTN = 10003, |
191 | }; //End of Enum | 196 | }; //End of Enum |
192 | 197 | ||
193 | public: | 198 | public: |
@@ -234,7 +239,7 @@ DECLARE_DYNAMIC_CLASS(FirmwarePositionCtrl) | |||
234 | DECLARE_EVENT_TABLE() | 239 | DECLARE_EVENT_TABLE() |
235 | public: | 240 | public: |
236 | enum { | 241 | enum { |
237 | ID_BROWSE_BTN = 10004, | 242 | ID_BROWSE_BTN = 10004, |
238 | }; //End of Enum | 243 | }; //End of Enum |
239 | 244 | ||
240 | public: | 245 | public: |