summaryrefslogtreecommitdiff
path: root/rbutil/rbutilCtrls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilCtrls.cpp')
-rw-r--r--rbutil/rbutilCtrls.cpp34
1 files changed, 25 insertions, 9 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
55BEGIN_EVENT_TABLE(ThemeCtrl, wxPanel) 55BEGIN_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)
57END_EVENT_TABLE() 58END_EVENT_TABLE()
58 59
59IMPLEMENT_DYNAMIC_CLASS(ThemeCtrl, wxPanel) 60IMPLEMENT_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
223void ThemeCtrl::OnThemesLst(wxCommandEvent& event) 228void ThemeCtrl::OnThemesLst(wxCommandEvent& event)
224{ 229{
230 ThemePreview();
231}
232
233void 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
285void 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() 292wxArrayString 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];