diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2007-05-05 16:55:04 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2007-05-05 16:55:04 +0000 |
commit | e9f08dc19393ecc737fed1abac1724fb02e804b6 (patch) | |
tree | 79fa14710838b3c6b755ab2298b2c8052a18d8f4 /rbutil/install_dialogs.cpp | |
parent | a967523b2bc3dba7b377a3b3ded1ef2e52fb8cd0 (diff) | |
download | rockbox-e9f08dc19393ecc737fed1abac1724fb02e804b6.tar.gz rockbox-e9f08dc19393ecc737fed1abac1724fb02e804b6.zip |
rbutil now ask before doing anything, plus minor gui changes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13328 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/install_dialogs.cpp')
-rw-r--r-- | rbutil/install_dialogs.cpp | 107 |
1 files changed, 12 insertions, 95 deletions
diff --git a/rbutil/install_dialogs.cpp b/rbutil/install_dialogs.cpp index 2cb754a482..6f62cac083 100644 --- a/rbutil/install_dialogs.cpp +++ b/rbutil/install_dialogs.cpp | |||
@@ -106,20 +106,21 @@ bool bootloaderInstallDlg::TransferDataFromWindow() | |||
106 | return false; | 106 | return false; |
107 | } | 107 | } |
108 | } | 108 | } |
109 | return true; | 109 | |
110 | |||
110 | } | 111 | } |
111 | 112 | ||
112 | // tranver data to the controls | 113 | // tranver data to the controls |
113 | bool bootloaderInstallDlg::TransferDataToWindow() | 114 | bool bootloaderInstallDlg::TransferDataToWindow() |
114 | { | 115 | { |
115 | if(gv->curplat == wxT("")) | 116 | if(gv->curplat == wxT("")) |
116 | { | 117 | { |
117 | WARN_DIALOG(wxT("You have not selected a audio device"), | 118 | WARN_DIALOG(wxT("You have not selected a audio device"), |
118 | wxT("Select a Device")); | 119 | wxT("Select a Device")); |
119 | return false; | 120 | return false; |
120 | } | 121 | } |
121 | int index = gv->plat_id.Index(gv->curplat); | 122 | int index = gv->plat_id.Index(gv->curplat); |
122 | 123 | ||
123 | if(!gv->plat_needsbootloader[index]) | 124 | if(!gv->plat_needsbootloader[index]) |
124 | { | 125 | { |
125 | WARN_DIALOG(wxT("This Device doesnt need a Bootloader"), | 126 | WARN_DIALOG(wxT("This Device doesnt need a Bootloader"), |
@@ -147,90 +148,6 @@ bool bootloaderInstallDlg::TransferDataToWindow() | |||
147 | return true; | 148 | return true; |
148 | } | 149 | } |
149 | 150 | ||
150 | //////////////////////////////////////////////// | ||
151 | //// Bootloader Deinstallation | ||
152 | ///////////////////////////////////////////////// | ||
153 | |||
154 | IMPLEMENT_CLASS( bootloaderDeInstallDlg, wxDialog ) | ||
155 | |||
156 | BEGIN_EVENT_TABLE( bootloaderDeInstallDlg, wxDialog ) | ||
157 | |||
158 | END_EVENT_TABLE() | ||
159 | |||
160 | bootloaderDeInstallDlg::bootloaderDeInstallDlg( ) | ||
161 | { | ||
162 | Init(); | ||
163 | } | ||
164 | |||
165 | bootloaderDeInstallDlg::bootloaderDeInstallDlg( wxWindow* parent, | ||
166 | wxWindowID id, const wxString& caption, | ||
167 | const wxPoint& pos, const wxSize& size, long style ) | ||
168 | { | ||
169 | Init(); | ||
170 | Create(parent, id, caption, pos, size, style); | ||
171 | } | ||
172 | |||
173 | void bootloaderDeInstallDlg::CreateControls() | ||
174 | { | ||
175 | // A top-level sizer | ||
176 | wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL); | ||
177 | this->SetSizer(topSizer); | ||
178 | |||
179 | wxBoxSizer* wxBoxSizer2 = new wxBoxSizer(wxHORIZONTAL); | ||
180 | topSizer->Add(wxBoxSizer2, 0, wxALIGN_LEFT|wxALL, 5); | ||
181 | |||
182 | // bitmap | ||
183 | wxBitmap sidebmp(wizard_xpm); | ||
184 | |||
185 | ImageCtrl* sideimage = new ImageCtrl(this,wxID_ANY); | ||
186 | sideimage->SetBitmap(sidebmp); | ||
187 | wxBoxSizer2->Add(sideimage,0,wxALIGN_LEFT | wxALL,5); | ||
188 | |||
189 | wxBoxSizer* wxBoxSizer3 = new wxBoxSizer(wxVERTICAL); | ||
190 | wxBoxSizer2->Add(wxBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5); | ||
191 | |||
192 | // controls at the bottom | ||
193 | OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY); | ||
194 | topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); | ||
195 | } | ||
196 | |||
197 | //init the local variables | ||
198 | void bootloaderDeInstallDlg::Init() | ||
199 | { | ||
200 | |||
201 | } | ||
202 | |||
203 | // create the window | ||
204 | bool bootloaderDeInstallDlg::Create( wxWindow* parent, | ||
205 | wxWindowID id, const wxString& caption, | ||
206 | const wxPoint& pos, const wxSize& size, long style ) | ||
207 | { | ||
208 | if (!wxDialog::Create( parent, id, caption, pos, size, style )) | ||
209 | return false; | ||
210 | CreateControls(); | ||
211 | GetSizer()->Fit(this); | ||
212 | GetSizer()->SetSizeHints(this); | ||
213 | Centre(); | ||
214 | return true; | ||
215 | } | ||
216 | |||
217 | // tranver data from the controls | ||
218 | bool bootloaderDeInstallDlg::TransferDataFromWindow() | ||
219 | { | ||
220 | return true; | ||
221 | } | ||
222 | |||
223 | // tranver data to the controls | ||
224 | bool bootloaderDeInstallDlg::TransferDataToWindow() | ||
225 | { | ||
226 | if(gv->curplat == wxT("")) | ||
227 | { | ||
228 | WARN_DIALOG(wxT("You have not selected a audio device"), | ||
229 | wxT("Select a Device")); | ||
230 | return false; | ||
231 | } | ||
232 | return true; | ||
233 | } | ||
234 | 151 | ||
235 | //////////////////////////////////////////////// | 152 | //////////////////////////////////////////////// |
236 | //// Font Installation | 153 | //// Font Installation |
@@ -451,7 +368,7 @@ bool rockboxDeInstallDlg::TransferDataToWindow() | |||
451 | IMPLEMENT_CLASS( themesInstallDlg, wxDialog ) | 368 | IMPLEMENT_CLASS( themesInstallDlg, wxDialog ) |
452 | 369 | ||
453 | BEGIN_EVENT_TABLE( themesInstallDlg, wxDialog ) | 370 | BEGIN_EVENT_TABLE( themesInstallDlg, wxDialog ) |
454 | 371 | ||
455 | END_EVENT_TABLE() | 372 | END_EVENT_TABLE() |
456 | 373 | ||
457 | themesInstallDlg::themesInstallDlg( ) | 374 | themesInstallDlg::themesInstallDlg( ) |
@@ -524,7 +441,7 @@ bool themesInstallDlg::Create( wxWindow* parent, | |||
524 | // tranver data from the controls | 441 | // tranver data from the controls |
525 | bool themesInstallDlg::TransferDataFromWindow() | 442 | bool themesInstallDlg::TransferDataFromWindow() |
526 | { | 443 | { |
527 | 444 | ||
528 | gv->curdestdir = m_devicepos->getDevicePos(); | 445 | gv->curdestdir = m_devicepos->getDevicePos(); |
529 | if(!wxDirExists(gv->curdestdir)) | 446 | if(!wxDirExists(gv->curdestdir)) |
530 | { | 447 | { |
@@ -555,7 +472,7 @@ bool themesInstallDlg::TransferDataToWindow() | |||
555 | wxT("Select a Device")); | 472 | wxT("Select a Device")); |
556 | return false; | 473 | return false; |
557 | } | 474 | } |
558 | 475 | ||
559 | m_devicepos->setDefault(); | 476 | m_devicepos->setDefault(); |
560 | m_theme->setDevice(gv->curplat); | 477 | m_theme->setDevice(gv->curplat); |
561 | return true; | 478 | return true; |
@@ -724,18 +641,18 @@ bool rockboxInstallDlg::TransferDataFromWindow() | |||
724 | bool rockboxInstallDlg::TransferDataToWindow() | 641 | bool rockboxInstallDlg::TransferDataToWindow() |
725 | { | 642 | { |
726 | m_devicepos->setDefault(); | 643 | m_devicepos->setDefault(); |
727 | 644 | ||
728 | if(gv->curplat == wxT("")) | 645 | if(gv->curplat == wxT("")) |
729 | { | 646 | { |
730 | WARN_DIALOG(wxT("You have not selected a audio device"), | 647 | WARN_DIALOG(wxT("You have not selected a audio device"), |
731 | wxT("Select a Device")); | 648 | wxT("Select a Device")); |
732 | return false; | 649 | return false; |
733 | } | 650 | } |
734 | 651 | ||
735 | wxRadioBox* BuildRadioBox = (wxRadioBox*) FindWindow(ID_BUILD_BOX); | 652 | wxRadioBox* BuildRadioBox = (wxRadioBox*) FindWindow(ID_BUILD_BOX); |
736 | 653 | ||
737 | int index =gv->plat_id.Index(gv->curplat); | 654 | int index =gv->plat_id.Index(gv->curplat); |
738 | 655 | ||
739 | wxCommandEvent updateradiobox(wxEVT_COMMAND_RADIOBOX_SELECTED, | 656 | wxCommandEvent updateradiobox(wxEVT_COMMAND_RADIOBOX_SELECTED, |
740 | ID_BUILD_BOX); | 657 | ID_BUILD_BOX); |
741 | 658 | ||