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/rbutilCtrls.cpp | |
parent | 2cda994431174ab809143761a3c72412acc54dc3 (diff) |
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/rbutilCtrls.cpp')
-rw-r--r-- | rbutil/rbutilCtrls.cpp | 34 |
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 BEGIN_EVENT_TABLE(ThemeCtrl, wxPanel) EVT_LISTBOX(ID_THEME_LST, ThemeCtrl::OnThemesLst) + EVT_BUTTON(ID_THEME_SELECT_ALL, ThemeCtrl::OnSelectAll) END_EVENT_TABLE() IMPLEMENT_DYNAMIC_CLASS(ThemeCtrl, wxPanel) @@ -82,7 +83,7 @@ void ThemeCtrl::CreateControls() topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5); //Device Selection - wxBoxSizer* wxBoxSizer7 = new wxBoxSizer(wxVERTICAL); + wxBoxSizer* wxBoxSizer7 = new wxBoxSizer(wxVERTICAL); horizontalSizer->Add(wxBoxSizer7,0,wxGROW | wxALL,0); wxStaticText* m_desc = new wxStaticText( this, wxID_STATIC, @@ -94,6 +95,10 @@ void ThemeCtrl::CreateControls() wxDefaultSize,0,NULL,wxLB_EXTENDED); wxBoxSizer7->Add(m_themeList, 0, wxALIGN_LEFT|wxALL, 5); + m_selectAllThemes = new wxButton(this, ID_THEME_SELECT_ALL, + wxT("Select All")); + wxBoxSizer7->Add(m_selectAllThemes, 0, wxALIGN_LEFT|wxALL, 5); + // Preview Picture wxBoxSizer* wxBoxSizer9 = new wxBoxSizer(wxVERTICAL); horizontalSizer->Add(wxBoxSizer9,0,wxGROW | wxALL,0); @@ -222,6 +227,11 @@ void ThemeCtrl::setDevice(wxString device) void ThemeCtrl::OnThemesLst(wxCommandEvent& event) { + ThemePreview(); +} + +void ThemeCtrl::ThemePreview() +{ // wxCriticalSectionLocker locker(m_ThemeSelectSection); wxArrayInt selected; @@ -261,7 +271,7 @@ void ThemeCtrl::OnThemesLst(wxCommandEvent& event) bmp.LoadFile(m_currentimage,wxBITMAP_TYPE_PNG); m_PreviewBitmap->SetBitmap(bmp); - Refresh(); + Refresh(); this->GetSizer()->Layout(); this->GetSizer()->Fit(this); this->GetSizer()->SetSizeHints(this); @@ -272,9 +282,15 @@ void ThemeCtrl::OnThemesLst(wxCommandEvent& event) } +void ThemeCtrl::OnSelectAll(wxCommandEvent& event) +{ + for(unsigned int i=0; i < m_themeList->GetCount(); i++) + m_themeList->Select(i); + ThemePreview(); +} - wxArrayString ThemeCtrl::getThemesToInstall() - { +wxArrayString ThemeCtrl::getThemesToInstall() +{ wxArrayString themes; wxArrayInt selected; int numSelected = m_themeList->GetSelections(selected); @@ -361,7 +377,7 @@ void DeviceSelectorCtrl::CreateControls() //Device Selection wxBoxSizer* horizontalSizer = new wxBoxSizer(wxHORIZONTAL); topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5); - m_desc = new wxStaticText( this, wxID_STATIC, + m_desc = new wxStaticText( this, wxID_STATIC, wxT("Device:"), wxDefaultPosition, wxDefaultSize, 0 ); horizontalSizer->Add(m_desc, 0, wxALIGN_LEFT|wxALL, 5); @@ -405,9 +421,9 @@ void DeviceSelectorCtrl::OnComboBox(wxCommandEvent& event) if(index == -1) { - m_currentDevice = wxT(""); - return; - } + m_currentDevice = wxT(""); + return; + } gv->curplat = gv->plat_id[index]; } @@ -418,7 +434,7 @@ void DeviceSelectorCtrl::OnAutoDetect(wxCommandEvent& event) int n = ipod_scan(&ipod); if(n == 1) { - wxString temp(ipod.targetname,wxConvUTF8); + wxString temp(ipod.targetname,wxConvUTF8); int index = gv->plat_bootloadername.Index(temp); // use the bootloader names.. m_deviceCbx->SetValue(gv->plat_name[index]); gv->curplat=gv->plat_id[index]; |