summaryrefslogtreecommitdiff
path: root/rbutil/install_dialogs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/install_dialogs.cpp')
-rw-r--r--rbutil/install_dialogs.cpp948
1 files changed, 0 insertions, 948 deletions
diff --git a/rbutil/install_dialogs.cpp b/rbutil/install_dialogs.cpp
deleted file mode 100644
index 331a07df4a..0000000000
--- a/rbutil/install_dialogs.cpp
+++ /dev/null
@@ -1,948 +0,0 @@
1
2#include "install_dialogs.h"
3#include "wizard.xpm"
4
5
6
7////////////////////////////////////////////////
8//// Bootloader Installation
9/////////////////////////////////////////////////
10
11IMPLEMENT_CLASS( bootloaderInstallDlg, wxDialog )
12
13BEGIN_EVENT_TABLE( bootloaderInstallDlg, wxDialog )
14
15END_EVENT_TABLE()
16
17bootloaderInstallDlg::bootloaderInstallDlg( )
18{
19 Init();
20}
21
22bootloaderInstallDlg::bootloaderInstallDlg( wxWindow* parent,
23 wxWindowID id, const wxString& caption,
24 const wxPoint& pos, const wxSize& size, long style )
25{
26 Init();
27 Create(parent, id, caption, pos, size, style);
28}
29
30void bootloaderInstallDlg::CreateControls()
31{
32 // A top-level sizer
33 wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
34 this->SetSizer(topSizer);
35
36 wxBoxSizer* wxBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
37 topSizer->Add(wxBoxSizer2, 0, wxALIGN_LEFT|wxALL, 5);
38
39 // bitmap
40 wxBitmap sidebmp(wizard_xpm);
41 ImageCtrl* sideimage = new ImageCtrl(this,wxID_ANY);
42 sideimage->SetBitmap(sidebmp);
43 wxBoxSizer2->Add(sideimage,0,wxALIGN_LEFT | wxALL,5);
44
45 wxBoxSizer* wxBoxSizer3 = new wxBoxSizer(wxVERTICAL);
46 wxBoxSizer2->Add(wxBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
47
48 m_devicepos = new DevicePositionCtrl(this,ID_DEVICEPOS);
49 wxBoxSizer3->Add(m_devicepos, 0, wxALIGN_LEFT|wxALL, 5);
50
51 m_firmwarepos = new FirmwarePositionCtrl(this,ID_FIRMWARE);
52 wxBoxSizer3->Add(m_firmwarepos, 0, wxALIGN_LEFT|wxALL, 5);
53
54 OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
55 topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
56
57}
58
59//init the local variables
60void bootloaderInstallDlg::Init()
61{
62
63}
64
65// create the window
66bool bootloaderInstallDlg::Create( wxWindow* parent,
67 wxWindowID id, const wxString& caption,
68 const wxPoint& pos, const wxSize& size, long style )
69{
70
71 if (!wxDialog::Create( parent, id, caption, pos, size, style ))
72 return false;
73 CreateControls();
74 GetSizer()->Fit(this);
75 GetSizer()->SetSizeHints(this);
76 Centre();
77 return true;
78}
79
80
81
82// tranver data from the controls
83bool bootloaderInstallDlg::TransferDataFromWindow()
84{
85
86 if( m_devicepos->IsShown())
87 {
88 gv->curdestdir = m_devicepos->getDevicePos();
89 if(!wxDirExists(gv->curdestdir))
90 {
91 WARN_DIALOG(wxT("The Devicepostion is not valid"),
92 wxT("Select a Deviceposition"));
93 gv->curdestdir = wxT("");
94 return false;
95 }
96 }
97
98 if(m_firmwarepos->IsShown())
99 {
100 gv->curfirmware = m_firmwarepos->getFirmwarePos();
101 if(!wxFileExists(gv->curfirmware))
102 {
103 WARN_DIALOG(wxT("The Firmware position is not valid"),
104 wxT("Select a original Firmware"));
105 gv->curfirmware = wxT("");
106 return false;
107 }
108 }
109
110 return true;
111
112}
113
114// tranver data to the controls
115bool bootloaderInstallDlg::TransferDataToWindow()
116{
117 if(gv->curplat == wxT(""))
118 {
119 WARN_DIALOG(wxT("You have not selected a audio device"),
120 wxT("Select a Device"));
121 return false;
122 }
123 int index = gv->plat_id.Index(gv->curplat);
124
125 if(!gv->plat_needsbootloader[index])
126 {
127 WARN_DIALOG(wxT("This Device doesnt need a Bootloader"),
128 wxT("Bootloader"));
129 return false;
130 }
131
132 if(gv->plat_bootloadermethod[index] != wxT("ipodpatcher") && gv->plat_bootloadermethod[index] != wxT("sansapatcher"))
133 {
134 m_devicepos->Show(true);
135 }else
136 {
137 m_devicepos->Show(false);
138 }
139 if(gv->plat_bootloadermethod[index] == wxT("fwpatcher"))
140 {
141 m_firmwarepos->Show(true);
142 }else
143 {
144 m_firmwarepos->Show(false);
145 }
146
147 m_devicepos->setDefault();
148 m_firmwarepos->setDefault();
149 return true;
150}
151////////////////////////////////////////////////
152//// Talk file creation
153/////////////////////////////////////////////////
154
155
156IMPLEMENT_CLASS( talkInstallDlg, wxDialog )
157
158BEGIN_EVENT_TABLE( talkInstallDlg, wxDialog )
159 EVT_BUTTON(ID_BROWSE_ENC_BTN, talkInstallDlg::OnBrowseEncBtn)
160 EVT_BUTTON(ID_BROWSE_TTS_BTN, talkInstallDlg::OnBrowseTtsBtn)
161END_EVENT_TABLE()
162
163talkInstallDlg::talkInstallDlg(TalkFileCreator* talkcreator )
164{
165 m_talkCreator = talkcreator;
166 Init();
167}
168
169talkInstallDlg::talkInstallDlg(TalkFileCreator* talkcreator, wxWindow* parent,
170 wxWindowID id, const wxString& caption,
171 const wxPoint& pos, const wxSize& size, long style )
172{
173 m_talkCreator = talkcreator;
174 Init();
175 Create(parent, id, caption, pos, size, style);
176}
177
178void talkInstallDlg::CreateControls()
179{
180 // A top-level sizer
181 wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
182 this->SetSizer(topSizer);
183
184 wxBoxSizer* wxBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
185 topSizer->Add(wxBoxSizer2, 0, wxALIGN_LEFT|wxALL, 5);
186
187 // bitmap
188 wxBitmap sidebmp(wizard_xpm);
189
190 ImageCtrl* sideimage = new ImageCtrl(this,wxID_ANY);
191 sideimage->SetBitmap(sidebmp);
192 wxBoxSizer2->Add(sideimage,0,wxALIGN_LEFT | wxALL,5);
193
194 wxBoxSizer* wxBoxSizer3 = new wxBoxSizer(wxVERTICAL);
195 wxBoxSizer2->Add(wxBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
196
197 // Device position
198 m_devicepos = new DevicePositionCtrl(this,ID_DEVICEPOS);
199 wxBoxSizer3->Add(m_devicepos, 0, wxALIGN_LEFT|wxALL, 5);
200
201 // Encoder
202 wxStaticBox* WxStaticBoxSizer2_StaticBoxObj = new wxStaticBox(this,
203 wxID_ANY, wxT("Encoder"));
204 wxStaticBoxSizer* WxStaticBoxSizer2 =
205 new wxStaticBoxSizer(WxStaticBoxSizer2_StaticBoxObj,wxVERTICAL);
206 wxBoxSizer3->Add(WxStaticBoxSizer2,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
207
208 m_Enc = new wxComboBox(this,ID_ENC_CBX,wxT("lame"),
209 wxDefaultPosition,wxDefaultSize,m_talkCreator->getSupportedEnc(),wxCB_READONLY);
210 m_Enc->SetToolTip(wxT("Select your Encoder."));
211 m_Enc->SetHelpText(wxT("Select your Encoder."));
212 WxStaticBoxSizer2->Add(m_Enc,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
213
214 wxStaticText* enc_desc = new wxStaticText( this, wxID_STATIC,
215 wxT("Select the Encoder executable"), wxDefaultPosition,
216 wxDefaultSize, 0 );
217 WxStaticBoxSizer2->Add(enc_desc, 0, wxALIGN_LEFT|wxALL, 5);
218
219 wxBoxSizer* horizontalSizer = new wxBoxSizer(wxHORIZONTAL);
220 WxStaticBoxSizer2->Add(horizontalSizer, 0, wxGROW|wxALL, 5);
221
222 m_EncExe = new wxTextCtrl(this,wxID_ANY,gv->pathToEnc);
223 m_EncExe->SetToolTip(wxT("Type the folder where your Encoder exe is"));
224 m_EncExe->SetHelpText(wxT("Type the folder where your Encoder exe is"));
225 horizontalSizer->Add(m_EncExe,0,wxGROW | wxALL,5);
226
227 m_browseEncBtn = new wxButton(this, ID_BROWSE_ENC_BTN, wxT("Browse"),
228 wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
229 wxT("BrowseEncBtn"));
230 m_browseEncBtn->SetToolTip(wxT("Browse for your Encoder Exe"));
231 m_browseEncBtn->SetHelpText(wxT("Browse for your Encoder exe"));
232 horizontalSizer->Add(m_browseEncBtn,0,wxGROW | wxALL,5);
233
234 wxStaticText* enc_desc_opt = new wxStaticText( this, wxID_STATIC,
235 wxT("Encoder Options"), wxDefaultPosition,
236 wxDefaultSize, 0 );
237 WxStaticBoxSizer2->Add(enc_desc_opt, 0, wxALIGN_LEFT|wxALL, 5);
238
239 m_EncOpts = new wxTextCtrl(this,wxID_ANY,m_talkCreator->getEncOpts(wxT("lame")));
240 m_EncOpts->SetToolTip(wxT("Encoder Options"));
241 m_EncOpts->SetHelpText(wxT("Encoder Options"));
242 WxStaticBoxSizer2->Add(m_EncOpts, 0, wxALIGN_LEFT|wxALL, 5);
243
244 // TTS
245 wxStaticBox* WxStaticBoxSizer3_StaticBoxObj = new wxStaticBox(this,
246 wxID_ANY, wxT("Text to Speach"));
247 wxStaticBoxSizer* WxStaticBoxSizer3 =
248 new wxStaticBoxSizer(WxStaticBoxSizer3_StaticBoxObj,wxVERTICAL);
249 wxBoxSizer3->Add(WxStaticBoxSizer3,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
250
251 m_Tts = new wxComboBox(this,ID_TTS_CBX,wxT("espeak"),
252 wxDefaultPosition,wxDefaultSize,m_talkCreator->getSupportedTTS(),wxCB_READONLY);
253 m_Tts->SetToolTip(wxT("Select your TTS."));
254 m_Tts->SetHelpText(wxT("Select your TTS."));
255 WxStaticBoxSizer3->Add(m_Tts,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
256
257 wxStaticText* tts_desc = new wxStaticText( this, wxID_STATIC,
258 wxT("Select the TTS executable"), wxDefaultPosition,
259 wxDefaultSize, 0 );
260 WxStaticBoxSizer3->Add(tts_desc, 0, wxALIGN_LEFT|wxALL, 5);
261
262 wxBoxSizer* horizontalSizer2 = new wxBoxSizer(wxHORIZONTAL);
263 WxStaticBoxSizer3->Add(horizontalSizer2, 0, wxGROW|wxALL, 5);
264
265 m_TtsExe = new wxTextCtrl(this,wxID_ANY,gv->pathToTts);
266 m_TtsExe->SetToolTip(wxT("Type the folder where your TTS exe is"));
267 m_TtsExe->SetHelpText(wxT("Type the folder where your TTS exe is"));
268 horizontalSizer2->Add(m_TtsExe,0,wxGROW | wxALL,5);
269
270 m_browseTtsBtn = new wxButton(this, ID_BROWSE_TTS_BTN, wxT("Browse"),
271 wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
272 wxT("BrowseEncBtn"));
273 m_browseTtsBtn->SetToolTip(wxT("Browse for your Encoder Exe"));
274 m_browseTtsBtn->SetHelpText(wxT("Browse for your Encoder exe"));
275 horizontalSizer2->Add(m_browseTtsBtn,0,wxGROW | wxALL,5);
276
277 wxStaticText* tts_desc_opt = new wxStaticText( this, wxID_STATIC,
278 wxT("TTS Options"), wxDefaultPosition,
279 wxDefaultSize, 0 );
280 WxStaticBoxSizer3->Add(tts_desc_opt, 0, wxALIGN_LEFT|wxALL, 5);
281
282 m_TtsOpts = new wxTextCtrl(this,wxID_ANY,m_talkCreator->getTTsOpts(wxT("espeak")));
283 m_TtsOpts->SetToolTip(wxT("TTS Options"));
284 m_TtsOpts->SetHelpText(wxT("TTS Options"));
285 WxStaticBoxSizer3->Add(m_TtsOpts, 0, wxALIGN_LEFT|wxALL, 5);
286
287 m_OverwriteWave = new wxCheckBox(this,wxID_ANY,wxT("Overwrite Wav"));
288 m_OverwriteWave->SetToolTip(wxT("Overwrite Wavefiles"));
289 m_OverwriteWave->SetHelpText(wxT("Overwrite Wavefiles"));
290 wxBoxSizer3->Add(m_OverwriteWave,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
291
292 m_OverwriteTalk = new wxCheckBox(this,wxID_ANY,wxT("Overwrite Talk"));
293 m_OverwriteTalk->SetToolTip(wxT("Overwrite Talkfiles"));
294 m_OverwriteTalk->SetHelpText(wxT("Overwrite Talkfiles"));
295 wxBoxSizer3->Add(m_OverwriteTalk,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
296
297 m_RemoveWave = new wxCheckBox(this,wxID_ANY,wxT("Remove Wav"));
298 m_RemoveWave->SetToolTip(wxT("Remove Wavfiles"));
299 m_RemoveWave->SetHelpText(wxT("Remove Wavfiles"));
300 wxBoxSizer3->Add(m_RemoveWave,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
301
302 m_Recursive = new wxCheckBox(this,wxID_ANY,wxT("Recursive"));
303 m_Recursive->SetToolTip(wxT("Recursive"));
304 m_Recursive->SetHelpText(wxT("Recursive"));
305 wxBoxSizer3->Add(m_Recursive,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
306
307 m_StripExtensions = new wxCheckBox(this,wxID_ANY,wxT("Strip Extensions"));
308 m_StripExtensions->SetToolTip(wxT("Strip Extensions"));
309 m_StripExtensions->SetHelpText(wxT("Strip Extensions"));
310 wxBoxSizer3->Add(m_StripExtensions,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
311
312 OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
313 topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
314
315 // controls at the bottom
316 wxBoxSizer* wxBoxSizer7 = new wxBoxSizer(wxVERTICAL);
317 topSizer->Add(wxBoxSizer7, 0, wxGROW | wxALL, 5);
318
319}
320
321//init the local variables
322void talkInstallDlg::Init()
323{
324
325}
326
327// create the window
328bool talkInstallDlg::Create( wxWindow* parent,
329 wxWindowID id, const wxString& caption,
330 const wxPoint& pos, const wxSize& size, long style )
331{
332
333 if (!wxDialog::Create( parent, id, caption, pos, size, style ))
334 return false;
335 CreateControls();
336 GetSizer()->Fit(this);
337 GetSizer()->SetSizeHints(this);
338 Centre();
339 return true;
340}
341
342void talkInstallDlg::OnBrowseEncBtn(wxCommandEvent& event)
343{
344 const wxString& temp = wxFileSelector(
345 wxT("Please select the location of your encoder"), wxT(""),
346 wxT(""),wxT(""),wxT("*.*"),0, this);
347
348 if (!temp.empty())
349 {
350 m_EncExe->SetValue(temp);
351 }
352}
353
354void talkInstallDlg::OnBrowseTtsBtn(wxCommandEvent& event)
355{
356 const wxString& temp = wxFileSelector(
357 wxT("Please select the location of your TTS engine"), wxT(""),
358 wxT(""),wxT(""),wxT("*.*"),0, this);
359
360
361 if (!temp.empty())
362 {
363 m_TtsExe->SetValue(temp);
364 }
365}
366
367// tranver data from the controls
368bool talkInstallDlg::TransferDataFromWindow()
369{
370 gv->curdestdir = m_devicepos->getDevicePos();
371 if(!wxDirExists(gv->curdestdir))
372 {
373 WARN_DIALOG(wxT("The Devicepostion is not valid"),
374 wxT("Select a Deviceposition"));
375 gv->curdestdir = wxT("");
376 return false;
377 }
378 m_talkCreator->setDir(gv->curdestdir);
379
380 gv->pathToEnc = m_EncExe->GetValue();
381 if(!wxFileExists(gv->pathToEnc))
382 {
383 WARN_DIALOG(wxT("The Encoder exe is not valid"),
384 wxT("Select an Encoder"));
385 gv->pathToEnc = wxT("");
386 return false;
387 }
388 m_talkCreator->setEncexe(gv->pathToEnc);
389
390 gv->pathToTts = m_TtsExe->GetValue();
391 if(!wxFileExists(gv->pathToTts))
392 {
393 WARN_DIALOG(wxT("The TTs exe is not valid"),
394 wxT("Select an TTS engine"));
395 gv->pathToTts = wxT("");
396 return false;
397 }
398 m_talkCreator->setTTSexe(gv->pathToTts);
399
400 m_talkCreator->setTTsType(m_Tts->GetValue());
401 m_talkCreator->setEncType(m_Enc->GetValue());
402
403
404 m_talkCreator->setOverwriteTalk(m_OverwriteWave->IsChecked());
405 m_talkCreator->setOverwriteWav(m_OverwriteTalk->IsChecked());
406 m_talkCreator->setRemoveWav(m_RemoveWave->IsChecked());
407 m_talkCreator->setRecursive(m_Recursive->IsChecked());
408 m_talkCreator->setStripExtensions(m_StripExtensions->IsChecked());
409
410 m_talkCreator->setEncOpts(m_EncOpts->GetValue());
411 m_talkCreator->setTTsOpts(m_TtsOpts->GetValue());
412
413 return true;
414}
415
416// tranver data to the controls
417bool talkInstallDlg::TransferDataToWindow()
418{
419 m_devicepos->setDefault();
420
421 m_OverwriteWave->SetValue(true);
422 m_OverwriteTalk->SetValue(true);
423 m_RemoveWave->SetValue(true);
424 m_Recursive->SetValue(true);
425 m_StripExtensions->SetValue(false);
426
427
428
429 return true;
430}
431
432////////////////////////////////////////////////
433//// Font Installation
434/////////////////////////////////////////////////
435
436
437IMPLEMENT_CLASS( fontInstallDlg, wxDialog )
438
439BEGIN_EVENT_TABLE( fontInstallDlg, wxDialog )
440
441END_EVENT_TABLE()
442
443fontInstallDlg::fontInstallDlg( )
444{
445 Init();
446}
447
448fontInstallDlg::fontInstallDlg( wxWindow* parent,
449 wxWindowID id, const wxString& caption,
450 const wxPoint& pos, const wxSize& size, long style )
451{
452 Init();
453 Create(parent, id, caption, pos, size, style);
454}
455
456void fontInstallDlg::CreateControls()
457{
458 // A top-level sizer
459 wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
460 this->SetSizer(topSizer);
461
462 wxBoxSizer* wxBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
463 topSizer->Add(wxBoxSizer2, 0, wxALIGN_LEFT|wxALL, 5);
464
465 // bitmap
466 wxBitmap sidebmp(wizard_xpm);
467
468 ImageCtrl* sideimage = new ImageCtrl(this,wxID_ANY);
469 sideimage->SetBitmap(sidebmp);
470 wxBoxSizer2->Add(sideimage,0,wxALIGN_LEFT | wxALL,5);
471
472 wxBoxSizer* wxBoxSizer3 = new wxBoxSizer(wxVERTICAL);
473 wxBoxSizer2->Add(wxBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
474
475 m_devicepos = new DevicePositionCtrl(this,ID_DEVICEPOS);
476 wxBoxSizer3->Add(m_devicepos, 0, wxALIGN_LEFT|wxALL, 5);
477
478
479 OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
480 topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
481
482 // controls at the bottom
483 wxBoxSizer* wxBoxSizer7 = new wxBoxSizer(wxVERTICAL);
484 topSizer->Add(wxBoxSizer7, 0, wxGROW | wxALL, 5);
485
486}
487
488//init the local variables
489void fontInstallDlg::Init()
490{
491
492}
493
494// create the window
495bool fontInstallDlg::Create( wxWindow* parent,
496 wxWindowID id, const wxString& caption,
497 const wxPoint& pos, const wxSize& size, long style )
498{
499
500 if (!wxDialog::Create( parent, id, caption, pos, size, style ))
501 return false;
502 CreateControls();
503 GetSizer()->Fit(this);
504 GetSizer()->SetSizeHints(this);
505 Centre();
506 return true;
507}
508
509
510// tranver data from the controls
511bool fontInstallDlg::TransferDataFromWindow()
512{
513 gv->curdestdir = m_devicepos->getDevicePos();
514 if(!wxDirExists(gv->curdestdir))
515 {
516 WARN_DIALOG(wxT("The Devicepostion is not valid"),
517 wxT("Select a Deviceposition"));
518 gv->curdestdir = wxT("");
519 return false;
520 }
521
522 return true;
523}
524
525// tranver data to the controls
526bool fontInstallDlg::TransferDataToWindow()
527{
528 m_devicepos->setDefault();
529 return true;
530}
531
532////////////////////////////////////////////////
533//// Rockbox DeInstallation
534/////////////////////////////////////////////////
535
536IMPLEMENT_CLASS( rockboxDeInstallDlg, wxDialog )
537
538BEGIN_EVENT_TABLE( rockboxDeInstallDlg, wxDialog )
539
540END_EVENT_TABLE()
541
542rockboxDeInstallDlg::rockboxDeInstallDlg( )
543{
544 Init();
545}
546
547rockboxDeInstallDlg::rockboxDeInstallDlg( wxWindow* parent,
548 wxWindowID id, const wxString& caption,
549 const wxPoint& pos, const wxSize& size, long style )
550{
551 Init();
552 Create(parent, id, caption, pos, size, style);
553}
554
555void rockboxDeInstallDlg::CreateControls()
556{
557 // A top-level sizer
558 wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
559 this->SetSizer(topSizer);
560
561 wxBoxSizer* wxBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
562 topSizer->Add(wxBoxSizer2, 0, wxALIGN_LEFT|wxALL, 5);
563
564 // bitmap
565 wxBitmap sidebmp(wizard_xpm);
566
567 ImageCtrl* sideimage = new ImageCtrl(this,wxID_ANY);
568 sideimage->SetBitmap(sidebmp);
569 wxBoxSizer2->Add(sideimage,0,wxALIGN_LEFT | wxALL,5);
570
571 wxBoxSizer* wxBoxSizer3 = new wxBoxSizer(wxVERTICAL);
572 wxBoxSizer2->Add(wxBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
573
574 m_devicepos = new DevicePositionCtrl(this,ID_DEVICEPOS);
575 wxBoxSizer3->Add(m_devicepos, 0, wxALIGN_LEFT|wxALL, 5);
576
577 // Full deinstallation ?
578 wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
579 wxT("Rockbox Utility normally uninstalls Rockbox using an uninstall\n"
580 "file created during installation. This means that when Rockbox is\n"
581 "uninstalled all your configuration files are preserved. However,\n"
582 "you can also perform a full uninstall, which will completely\n"
583 "remove all traces of Rockbox from your system, and can be used\n"
584 "even if Rockbox was previously installed manually."));
585 wxBoxSizer3->Add(WxStaticText1,0,wxGROW | wxALL,5);
586
587 wxCheckBox* FullCheckBox = new wxCheckBox(this, ID_FULL_CHCKBX,
588 wxT("Perform a full uninstall"));
589 wxBoxSizer3->Add(FullCheckBox, 0, wxALL, 5);
590
591 // controls at the bottom
592 OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
593 topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
594
595}
596
597//init the local variables
598void rockboxDeInstallDlg::Init()
599{
600
601}
602
603// create the window
604bool rockboxDeInstallDlg::Create( wxWindow* parent,
605 wxWindowID id, const wxString& caption,
606 const wxPoint& pos, const wxSize& size, long style )
607{
608 if (!wxDialog::Create( parent, id, caption, pos, size, style ))
609 return false;
610 CreateControls();
611 GetSizer()->Fit(this);
612 GetSizer()->SetSizeHints(this);
613 Centre();
614 return true;
615}
616
617
618// tranver data from the controls
619bool rockboxDeInstallDlg::TransferDataFromWindow()
620{
621
622 gv->curdestdir = m_devicepos->getDevicePos();
623 if(!wxDirExists(gv->curdestdir))
624 {
625 WARN_DIALOG(wxT("The Devicepostion is not valid"),
626 wxT("Select a Deviceposition"));
627 gv->curdestdir = wxT("");
628 return false;
629 }
630
631 wxCheckBox* fullchkbx = (wxCheckBox*) FindWindow(ID_FULL_CHCKBX);
632 gv->curisfull = fullchkbx->IsChecked();
633
634 return true;
635}
636
637// tranver data to the controls
638bool rockboxDeInstallDlg::TransferDataToWindow()
639{
640 m_devicepos->setDefault();
641 return true;
642}
643
644////////////////////////////////////////////////
645//// Themes Installation
646/////////////////////////////////////////////////
647
648IMPLEMENT_CLASS( themesInstallDlg, wxDialog )
649
650BEGIN_EVENT_TABLE( themesInstallDlg, wxDialog )
651
652END_EVENT_TABLE()
653
654themesInstallDlg::themesInstallDlg( )
655{
656
657}
658
659themesInstallDlg::themesInstallDlg( wxWindow* parent,
660 wxWindowID id, const wxString& caption,
661 const wxPoint& pos, const wxSize& size, long style )
662{
663 Create(parent, id, caption, pos, size, style);
664}
665
666void themesInstallDlg::CreateControls()
667{
668 // A top-level sizer
669 wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
670 this->SetSizer(topSizer);
671
672 wxBoxSizer* topHoriSizer = new wxBoxSizer(wxHORIZONTAL);
673 topSizer->Add(topHoriSizer, 0, wxALIGN_LEFT|wxALL, 5);
674
675 // bitmap
676 wxBitmap sidebmp(wizard_xpm);
677
678 ImageCtrl* sideimage = new ImageCtrl(this,wxID_ANY);
679 sideimage->SetBitmap(sidebmp);
680 topHoriSizer->Add(sideimage,0,wxALIGN_LEFT | wxALL,5);
681
682 wxBoxSizer* mainVertiSizer = new wxBoxSizer(wxVERTICAL);
683 topHoriSizer->Add(mainVertiSizer, 0, wxGROW|wxALL, 5);
684
685 wxBoxSizer* wxBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
686 mainVertiSizer->Add(wxBoxSizer4, 0, wxGROW|wxALL, 0);
687
688 wxBoxSizer* wxBoxSizer5 = new wxBoxSizer(wxVERTICAL);
689 wxBoxSizer4->Add(wxBoxSizer5, 0, wxGROW|wxALL, 0);
690
691 m_devicepos = new DevicePositionCtrl(this,ID_DEVICEPOS);
692 wxBoxSizer5->Add(m_devicepos, 0, wxALIGN_LEFT|wxALL, 5);
693
694 m_theme = new ThemeCtrl(this,ID_THEME);
695 wxBoxSizer5->Add(m_theme, 0, wxALIGN_LEFT|wxALL, 5);
696
697 // controls at the bottom
698 OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
699 topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
700
701
702}
703
704
705// create the window
706bool themesInstallDlg::Create( wxWindow* parent,
707 wxWindowID id, const wxString& caption,
708 const wxPoint& pos, const wxSize& size, long style )
709{
710
711 if (!wxDialog::Create( parent, id, caption, pos, size, style ))
712 return false;
713 CreateControls();
714 GetSizer()->Fit(this);
715 GetSizer()->SetSizeHints(this);
716 Centre();
717 return true;
718}
719
720
721// tranver data from the controls
722bool themesInstallDlg::TransferDataFromWindow()
723{
724
725 gv->curdestdir = m_devicepos->getDevicePos();
726 if(!wxDirExists(gv->curdestdir))
727 {
728 WARN_DIALOG(wxT("The Devicepostion is not valid"),
729 wxT("Select a Deviceposition"));
730 gv->curdestdir = wxT("");
731 return false;
732 }
733
734 gv->themesToInstall.Clear();
735 gv->themesToInstall = m_theme->getThemesToInstall();
736
737 if(gv->themesToInstall.GetCount() == 0)
738 {
739 WARN_DIALOG(wxT("You have not selected a Theme to Install"), wxT("Select a Theme"));
740 return false;
741 }
742
743 return true;
744}
745
746// tranver data to the controls
747bool themesInstallDlg::TransferDataToWindow()
748{
749 if(gv->curplat == wxT(""))
750 {
751 WARN_DIALOG(wxT("You have not selected a audio device"),
752 wxT("Select a Device"));
753 return false;
754 }
755
756 m_devicepos->setDefault();
757 m_theme->setDevice(gv->curplat);
758 return true;
759}
760////////////////////////////////////////////////
761//// Rockbox Installation
762/////////////////////////////////////////////////
763
764IMPLEMENT_CLASS( rockboxInstallDlg, wxDialog )
765
766BEGIN_EVENT_TABLE( rockboxInstallDlg, wxDialog )
767 EVT_RADIOBOX(ID_BUILD_BOX, rockboxInstallDlg::OnBuildBox)
768END_EVENT_TABLE()
769
770rockboxInstallDlg::rockboxInstallDlg( )
771{
772}
773
774rockboxInstallDlg::rockboxInstallDlg( wxWindow* parent,
775 wxWindowID id, const wxString& caption,
776 const wxPoint& pos, const wxSize& size, long style )
777{
778 Create(parent, id, caption, pos, size, style);
779}
780
781void rockboxInstallDlg::CreateControls()
782{
783 // A top-level sizer
784 wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
785 this->SetSizer(topSizer);
786
787 wxBoxSizer* wxBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
788 topSizer->Add(wxBoxSizer2, 0, wxALIGN_LEFT|wxALL, 5);
789
790 // bitmap
791 wxBitmap sidebmp(wizard_xpm);
792
793 ImageCtrl* sideimage = new ImageCtrl(this,wxID_ANY);
794 sideimage->SetBitmap(sidebmp);
795 wxBoxSizer2->Add(sideimage,0,wxALIGN_LEFT | wxALL,5);
796
797 wxBoxSizer* wxBoxSizer3 = new wxBoxSizer(wxVERTICAL);
798 wxBoxSizer2->Add(wxBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
799
800 m_devicepos = new DevicePositionCtrl(this,ID_DEVICEPOS);
801 wxBoxSizer3->Add(m_devicepos, 0, wxALIGN_LEFT|wxALL, 5);
802
803 // Build information
804 wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
805 wxT("Please select the Rockbox version you would like "
806 "to install on your audio\ndevice:"));
807 wxBoxSizer3->Add(WxStaticText1,0,wxGROW | wxALL,5);
808
809 wxArrayString array;
810 array.Add(wxT("Rockbox stable version (") + gv->last_release + wxT(")"));
811 array.Add(wxT("Archived Build"));
812 array.Add(wxT("Current Build "));
813
814 wxRadioBox* BuildRadioBox = new wxRadioBox(this, ID_BUILD_BOX, wxT("Version"),
815 wxDefaultPosition, wxDefaultSize, array, 0, wxRA_SPECIFY_ROWS);
816 wxBoxSizer3->Add(BuildRadioBox, 0, wxGROW | wxALL, 5);
817
818 wxStaticBox* WxStaticBox1 = new wxStaticBox(this, wxID_ANY, wxT("Details:"));
819 wxStaticBoxSizer* WxStaticBoxSizer2 = new wxStaticBoxSizer(WxStaticBox1,
820 wxVERTICAL);
821 wxStaticText* DetailText = new wxStaticText(this, ID_DETAIL_TXT, wxT(""));
822 wxBoxSizer3->Add(WxStaticBoxSizer2, 1, wxGROW | wxALL, 5);
823 WxStaticBoxSizer2->Add(DetailText, 1, wxGROW | wxALL, 5);
824
825 wxStaticText* WxStaticText2 = new wxStaticText(this, wxID_ANY,
826 wxT("Rockbox Utility stores copies of Rockbox it has downloaded on the\n"
827 "local hard disk to save network traffic. If your local copy is\n"
828 "no longer working, tick this box to download a fresh copy.") );
829 wxBoxSizer3->Add(WxStaticText2, 0 , wxALL, 5);
830
831 wxCheckBox* NoCacheCheckBox = new wxCheckBox(this, ID_NOCACHE_CHCKBX,
832 wxT("Don't use locally cached copies of Rockbox") );
833 wxBoxSizer3->Add(NoCacheCheckBox, 0, wxALL, 5);
834 // controls at the bottom
835 OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
836 topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
837
838}
839
840// create the window
841bool rockboxInstallDlg::Create( wxWindow* parent,
842 wxWindowID id, const wxString& caption,
843 const wxPoint& pos, const wxSize& size, long style )
844{
845
846 if (!wxDialog::Create( parent, id, caption, pos, size, style ))
847 return false;
848 CreateControls();
849 GetSizer()->Fit(this);
850 GetSizer()->SetSizeHints(this);
851 Centre();
852 return true;
853}
854
855void rockboxInstallDlg::OnBuildBox(wxCommandEvent& event)
856{
857 wxString str;
858 wxRadioBox* BuildRadioBox = (wxRadioBox*) FindWindow(ID_BUILD_BOX);
859 wxCheckBox* NoCacheCheckBox = (wxCheckBox*) FindWindow(ID_NOCACHE_CHCKBX);
860 wxStaticText* DetailText = (wxStaticText*)FindWindow(ID_DETAIL_TXT);
861
862 switch(BuildRadioBox->GetSelection() )
863 {
864 case BUILD_RELEASE:
865 str = _("This is the last released version of Rockbox, and is the\n"
866 "recommended version to install.");
867 NoCacheCheckBox->Enable();
868 break;
869 case BUILD_DAILY:
870 str = _("These are automatically built each day from the current\n"
871 "development source code. This generally has more features\n"
872 "than the last release but may be much less stable. Features\n"
873 "may change regularly.");
874 NoCacheCheckBox->Enable();
875 break;
876 case BUILD_BLEEDING:
877 str = _("This is the absolute up to the minute Rockbox built after\n"
878 "the last change was made.\n\n"
879 "Note: This option will always download a fresh copy from the\n"
880 "web server.\n");
881 NoCacheCheckBox->Enable(false);
882 break;
883 default:
884 break;
885 }
886
887 DetailText->SetLabel(str);
888
889 this->GetSizer()->Layout();
890 this->GetSizer()->Fit(this);
891 this->GetSizer()->SetSizeHints(this);
892 Refresh();
893}
894
895
896// tranver data from the controls
897bool rockboxInstallDlg::TransferDataFromWindow()
898{
899 wxRadioBox* BuildRadioBox = (wxRadioBox*) FindWindow(ID_BUILD_BOX);
900 wxCheckBox* NoCacheCheckBox = (wxCheckBox*) FindWindow(ID_NOCACHE_CHCKBX);
901
902 gv->curdestdir = m_devicepos->getDevicePos();
903 if(!wxDirExists(gv->curdestdir))
904 {
905 WARN_DIALOG(wxT("The Devicepostion is not valid"),
906 wxT("Select a Deviceposition"));
907 gv->curdestdir = wxT("");
908 return false;
909 }
910
911 gv->curbuild = BuildRadioBox->GetSelection();
912 gv->nocache = (gv->curbuild == BUILD_BLEEDING) ? true :
913 NoCacheCheckBox->IsChecked();
914
915 return true;
916}
917
918// tranver data to the controls
919bool rockboxInstallDlg::TransferDataToWindow()
920{
921 m_devicepos->setDefault();
922
923 if(gv->curplat == wxT(""))
924 {
925 WARN_DIALOG(wxT("You have not selected a audio device"),
926 wxT("Select a Device"));
927 return false;
928 }
929
930 wxRadioBox* BuildRadioBox = (wxRadioBox*) FindWindow(ID_BUILD_BOX);
931
932 int index =gv->plat_id.Index(gv->curplat);
933
934 wxCommandEvent updateradiobox(wxEVT_COMMAND_RADIOBOX_SELECTED,
935 ID_BUILD_BOX);
936
937 if (gv->plat_released[index] )
938 {
939 BuildRadioBox->Enable(BUILD_RELEASE, true);
940 BuildRadioBox->SetSelection(BUILD_RELEASE);
941 } else {
942 BuildRadioBox->Enable(BUILD_RELEASE, false);
943 BuildRadioBox->SetSelection(BUILD_BLEEDING);
944
945 }
946 wxPostEvent(this, updateradiobox);
947 return true;
948}