diff options
-rw-r--r-- | rbutil/credits.h | 2 | ||||
-rw-r--r-- | rbutil/install_dialogs.cpp | 107 | ||||
-rw-r--r-- | rbutil/install_dialogs.h | 38 | ||||
-rw-r--r-- | rbutil/rbutil-rc.rc | 8 | ||||
-rw-r--r-- | rbutil/rbutil.cbp | 4 | ||||
-rw-r--r-- | rbutil/rbutilFrm.cpp | 656 |
6 files changed, 373 insertions, 442 deletions
diff --git a/rbutil/credits.h b/rbutil/credits.h index 84f38f8fcb..1d6542bfbf 100644 --- a/rbutil/credits.h +++ b/rbutil/credits.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #define CREDITS_H_INCLUDED | 22 | #define CREDITS_H_INCLUDED |
23 | 23 | ||
24 | #define RBUTIL_FULLNAME "The Rockbox Utility" | 24 | #define RBUTIL_FULLNAME "The Rockbox Utility" |
25 | #define RBUTIL_VERSION "Version 0.3.2.0" | 25 | #define RBUTIL_VERSION "Version 0.3.2.1" |
26 | 26 | ||
27 | static const wxString rbutil_developers[] = { | 27 | static const wxString rbutil_developers[] = { |
28 | wxT("Christi Alice Scarborough"), | 28 | wxT("Christi Alice Scarborough"), |
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 | ||
diff --git a/rbutil/install_dialogs.h b/rbutil/install_dialogs.h index 4ed1f5eeee..8b3defef1d 100644 --- a/rbutil/install_dialogs.h +++ b/rbutil/install_dialogs.h | |||
@@ -32,7 +32,7 @@ public: | |||
32 | long style = wxDEFAULT_DIALOG_STYLE |wxRESIZE_BORDER ); | 32 | long style = wxDEFAULT_DIALOG_STYLE |wxRESIZE_BORDER ); |
33 | // Creates the controls and sizers | 33 | // Creates the controls and sizers |
34 | void CreateControls(); | 34 | void CreateControls(); |
35 | 35 | ||
36 | bool TransferDataFromWindow(); | 36 | bool TransferDataFromWindow(); |
37 | bool TransferDataToWindow(); | 37 | bool TransferDataToWindow(); |
38 | 38 | ||
@@ -44,42 +44,6 @@ private: | |||
44 | 44 | ||
45 | }; | 45 | }; |
46 | 46 | ||
47 | class bootloaderDeInstallDlg : public wxDialog | ||
48 | { | ||
49 | DECLARE_CLASS( bootloaderDeInstallDlg ) | ||
50 | DECLARE_EVENT_TABLE() | ||
51 | public: | ||
52 | enum { | ||
53 | ID_DEVICE = 1001, | ||
54 | |||
55 | }; //End of Enum | ||
56 | public: | ||
57 | bootloaderDeInstallDlg( ); | ||
58 | bootloaderDeInstallDlg( wxWindow* parent, | ||
59 | wxWindowID id = wxID_ANY, | ||
60 | const wxString& caption = wxT("Bootloader Deinstallation"), | ||
61 | const wxPoint& pos = wxDefaultPosition, | ||
62 | const wxSize& size = wxDefaultSize, | ||
63 | long style = wxDEFAULT_DIALOG_STYLE |wxRESIZE_BORDER ); | ||
64 | /// Member initialization | ||
65 | void Init(); | ||
66 | /// Creation | ||
67 | bool Create( wxWindow* parent, | ||
68 | wxWindowID id = wxID_ANY, | ||
69 | const wxString& caption = wxT("Bootloader Deinstallation"), | ||
70 | const wxPoint& pos = wxDefaultPosition, | ||
71 | const wxSize& size = wxDefaultSize, | ||
72 | long style =wxDEFAULT_DIALOG_STYLE |wxRESIZE_BORDER ); | ||
73 | /// Creates the controls and sizers | ||
74 | void CreateControls(); | ||
75 | |||
76 | bool TransferDataFromWindow(); | ||
77 | bool TransferDataToWindow(); | ||
78 | |||
79 | private: | ||
80 | DeviceSelectorCtrl* m_deviceselector; | ||
81 | }; | ||
82 | |||
83 | 47 | ||
84 | class fontInstallDlg : public wxDialog | 48 | class fontInstallDlg : public wxDialog |
85 | { | 49 | { |
diff --git a/rbutil/rbutil-rc.rc b/rbutil/rbutil-rc.rc index 51f33468f7..d76ef0f045 100644 --- a/rbutil/rbutil-rc.rc +++ b/rbutil/rbutil-rc.rc | |||
@@ -1,8 +1,8 @@ | |||
1 | #define RBUTIL 1 | 1 | #define RBUTIL 1 |
2 | #include <wx/msw/wx.rc> | 2 | #include <wx/msw/wx.rc> |
3 | RBUTIL VERSIONINFO | 3 | RBUTIL VERSIONINFO |
4 | FILEVERSION 0,3,2,0 | 4 | FILEVERSION 0,3,2,1 |
5 | PRODUCTVERSION 0,3,2,0 | 5 | PRODUCTVERSION 0,3,2,1 |
6 | FILEOS 0x00000004 | 6 | FILEOS 0x00000004 |
7 | FILETYPE 0x00000001 | 7 | FILETYPE 0x00000001 |
8 | BEGIN | 8 | BEGIN |
@@ -10,8 +10,8 @@ BEGIN | |||
10 | BEGIN | 10 | BEGIN |
11 | BLOCK "FFFF0000" | 11 | BLOCK "FFFF0000" |
12 | BEGIN | 12 | BEGIN |
13 | VALUE "FileVersion", "0.3.2.0\0" | 13 | VALUE "FileVersion", "0.3.2.1\0" |
14 | VALUE "ProductVersion", "0.3.2.0\0" | 14 | VALUE "ProductVersion", "0.3.2.1\0" |
15 | VALUE "CompanyName", "Rockbox Team\0" | 15 | VALUE "CompanyName", "Rockbox Team\0" |
16 | VALUE "FileDescription", "Rockbox Utility\0" | 16 | VALUE "FileDescription", "Rockbox Utility\0" |
17 | VALUE "InternalName", "rbutil\0" | 17 | VALUE "InternalName", "rbutil\0" |
diff --git a/rbutil/rbutil.cbp b/rbutil/rbutil.cbp index aebf2173b1..55e4ea72b1 100644 --- a/rbutil/rbutil.cbp +++ b/rbutil/rbutil.cbp | |||
@@ -139,12 +139,12 @@ | |||
139 | <Unit filename="sansapatcher\parttypes.h" /> | 139 | <Unit filename="sansapatcher\parttypes.h" /> |
140 | <Unit filename="sansapatcher\sansaio-win32.c"> | 140 | <Unit filename="sansapatcher\sansaio-win32.c"> |
141 | <Option compilerVar="CC" /> | 141 | <Option compilerVar="CC" /> |
142 | <Option compiler="gcc" use="1" buildCommand="mingw32-gcc.exe -W -g -pipe -mthreads -Winvalid-pch -D__GNUWIN32__ -D__WXMSW__ -DUSE_PCH -g -I.\ -IC:\Dev-Cpp\include -c $file -o .objs\sansapatcher\sansaio-win32.o" /> | 142 | <Option compiler="gcc" use="1" buildCommand="mingw32-gcc.exe -W -g -pipe -mthreads -Winvalid-pch -D__GNUWIN32__ -D__WXMSW__ -DUSE_PCH -DRBUTIL -g -I.\ -IC:\Dev-Cpp\include -c $file -o .objs\sansapatcher\sansaio-win32.o" /> |
143 | </Unit> | 143 | </Unit> |
144 | <Unit filename="sansapatcher\sansaio.h" /> | 144 | <Unit filename="sansapatcher\sansaio.h" /> |
145 | <Unit filename="sansapatcher\sansapatcher.c"> | 145 | <Unit filename="sansapatcher\sansapatcher.c"> |
146 | <Option compilerVar="CC" /> | 146 | <Option compilerVar="CC" /> |
147 | <Option compiler="gcc" use="1" buildCommand="mingw32-gcc.exe -W -g -pipe -mthreads -Winvalid-pch -D__GNUWIN32__ -D__WXMSW__ -DUSE_PCH -g -I.\ -IC:\Dev-Cpp\include -c $file -o .objs\sansapatcher\sansapatcher.o" /> | 147 | <Option compiler="gcc" use="1" buildCommand="mingw32-gcc.exe -W -g -pipe -mthreads -Winvalid-pch -D__GNUWIN32__ -D__WXMSW__ -DUSE_PCH -g -DRBUTIL -I.\ -IC:\Dev-Cpp\include -c $file -o .objs\sansapatcher\sansapatcher.o" /> |
148 | </Unit> | 148 | </Unit> |
149 | <Unit filename="sansapatcher\sansapatcher.h" /> | 149 | <Unit filename="sansapatcher\sansapatcher.h" /> |
150 | <Unit filename="themes_3d.xpm" /> | 150 | <Unit filename="themes_3d.xpm" /> |
diff --git a/rbutil/rbutilFrm.cpp b/rbutil/rbutilFrm.cpp index 78408d184d..d46352c307 100644 --- a/rbutil/rbutilFrm.cpp +++ b/rbutil/rbutilFrm.cpp | |||
@@ -109,7 +109,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
109 | wxID_ANY, wxT("Please choose an option")); | 109 | wxID_ANY, wxT("Please choose an option")); |
110 | wxStaticBoxSizer* WxStaticBoxSizer3 = | 110 | wxStaticBoxSizer* WxStaticBoxSizer3 = |
111 | new wxStaticBoxSizer(WxStaticBoxSizer3_StaticBoxObj,wxHORIZONTAL); | 111 | new wxStaticBoxSizer(WxStaticBoxSizer3_StaticBoxObj,wxHORIZONTAL); |
112 | WxBoxSizer2->Add(WxStaticBoxSizer3,1,wxALIGN_CENTER_HORIZONTAL | wxALL, 5); | 112 | WxBoxSizer2->Add(WxStaticBoxSizer3,1,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5); |
113 | 113 | ||
114 | wxFlexGridSizer* WxFlexGridSizer1 = new wxFlexGridSizer(2,2,0,0); | 114 | wxFlexGridSizer* WxFlexGridSizer1 = new wxFlexGridSizer(2,2,0,0); |
115 | WxStaticBoxSizer3->Add(WxFlexGridSizer1,0,wxGROW | wxALL,0); | 115 | WxStaticBoxSizer3->Add(WxFlexGridSizer1,0,wxGROW | wxALL,0); |
@@ -146,7 +146,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
146 | WxFlexGridSizer1->Add(WxStaticText2,0, | 146 | WxFlexGridSizer1->Add(WxStaticText2,0, |
147 | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); | 147 | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); |
148 | 148 | ||
149 | /* ********************+ | 149 | /*********************+ |
150 | Theme Page | 150 | Theme Page |
151 | ***********************/ | 151 | ***********************/ |
152 | 152 | ||
@@ -158,7 +158,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
158 | wxID_ANY, wxT("Please choose an option")); | 158 | wxID_ANY, wxT("Please choose an option")); |
159 | wxStaticBoxSizer* WxStaticBoxSizer4 = | 159 | wxStaticBoxSizer* WxStaticBoxSizer4 = |
160 | new wxStaticBoxSizer(WxStaticBoxSizer4_StaticBoxObj,wxHORIZONTAL); | 160 | new wxStaticBoxSizer(WxStaticBoxSizer4_StaticBoxObj,wxHORIZONTAL); |
161 | WxBoxSizer3->Add(WxStaticBoxSizer4,1,wxALIGN_CENTER_HORIZONTAL | wxALL, 5); | 161 | WxBoxSizer3->Add(WxStaticBoxSizer4,1,wxALIGN_CENTER_HORIZONTAL |wxGROW| wxALL, 5); |
162 | 162 | ||
163 | wxFlexGridSizer* WxFlexGridSizer2 = new wxFlexGridSizer(2,2,0,0); | 163 | wxFlexGridSizer* WxFlexGridSizer2 = new wxFlexGridSizer(2,2,0,0); |
164 | WxStaticBoxSizer4->Add(WxFlexGridSizer2,0,wxGROW | wxALL,0); | 164 | WxStaticBoxSizer4->Add(WxFlexGridSizer2,0,wxGROW | wxALL,0); |
@@ -194,7 +194,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
194 | WxFlexGridSizer2->Add(WxStaticText6, 0, | 194 | WxFlexGridSizer2->Add(WxStaticText6, 0, |
195 | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); | 195 | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); |
196 | 196 | ||
197 | /* ********************+ | 197 | /*********************+ |
198 | Uninstall Page | 198 | Uninstall Page |
199 | ***********************/ | 199 | ***********************/ |
200 | 200 | ||
@@ -206,7 +206,7 @@ void rbutilFrm::CreateGUIControls(void) | |||
206 | wxID_ANY, wxT("Please choose an option")); | 206 | wxID_ANY, wxT("Please choose an option")); |
207 | wxStaticBoxSizer* WxStaticBoxSizer5 = | 207 | wxStaticBoxSizer* WxStaticBoxSizer5 = |
208 | new wxStaticBoxSizer(WxStaticBoxSizer5_StaticBoxObj,wxHORIZONTAL); | 208 | new wxStaticBoxSizer(WxStaticBoxSizer5_StaticBoxObj,wxHORIZONTAL); |
209 | WxBoxSizer4->Add(WxStaticBoxSizer5,1,wxALIGN_CENTER_HORIZONTAL | wxALL, 5); | 209 | WxBoxSizer4->Add(WxStaticBoxSizer5,1,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5); |
210 | 210 | ||
211 | wxFlexGridSizer* WxFlexGridSizer3 = new wxFlexGridSizer(2,2,0,0); | 211 | wxFlexGridSizer* WxFlexGridSizer3 = new wxFlexGridSizer(2,2,0,0); |
212 | WxStaticBoxSizer5->Add(WxFlexGridSizer3,0,wxGROW | wxALL,0); | 212 | WxStaticBoxSizer5->Add(WxFlexGridSizer3,0,wxGROW | wxALL,0); |
@@ -353,74 +353,80 @@ void rbutilFrm::OnBootloaderRemoveBtn(wxCommandEvent& event) | |||
353 | { | 353 | { |
354 | wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderRemoveBtn(event)")); | 354 | wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderRemoveBtn(event)")); |
355 | 355 | ||
356 | bootloaderDeInstallDlg dialog(NULL, wxID_ANY, | 356 | int index = gv->plat_id.Index(gv->curplat); |
357 | wxT("Bootloader Deinstallation")); | 357 | wxString bootloadermethod = gv->plat_bootloadermethod[index]; |
358 | 358 | ||
359 | if (dialog.ShowModal() == wxID_OK) | 359 | if(!gv->plat_needsbootloader[index]) |
360 | { | 360 | { |
361 | int index = gv->plat_id.Index(gv->curplat); | 361 | WARN_DIALOG(wxT("This Device doesnt need a Bootloader"), |
362 | wxString bootloadermethod = gv->plat_bootloadermethod[index]; | 362 | wxT("Bootloader")); |
363 | return; | ||
364 | } | ||
365 | |||
366 | // really deinstall ? | ||
367 | wxMessageDialog msg(this,wxT("Do you really want to deinstall the Bootloader ?"),wxT("Bootloader deinstallation"),wxOK|wxCANCEL); | ||
368 | if(msg.ShowModal() != wxID_OK ) | ||
369 | return; | ||
370 | |||
363 | 371 | ||
364 | if(bootloadermethod == wxT("ipodpatcher")) | 372 | if(bootloadermethod == wxT("ipodpatcher")) |
373 | { | ||
374 | wxString bootloadername = wxT("bootloader-"); | ||
375 | bootloadername.Append(gv->plat_bootloadername[index] ); | ||
376 | if(ipodpatcher(BOOTLOADER_REM,bootloadername)) | ||
365 | { | 377 | { |
366 | wxString bootloadername = wxT("bootloader-"); | 378 | MESG_DIALOG(wxT("The Bootloader has been uninstalled.") ); |
367 | bootloadername.Append(gv->plat_bootloadername[index] ); | ||
368 | if(ipodpatcher(BOOTLOADER_REM,bootloadername)) | ||
369 | { | ||
370 | MESG_DIALOG(wxT("The Bootloader has been uninstalled.") ); | ||
371 | } | ||
372 | else | ||
373 | { | ||
374 | MESG_DIALOG(wxT("The Uninstallation failed.") ); | ||
375 | } | ||
376 | } | 379 | } |
377 | if(bootloadermethod == wxT("sansapatcher")) | 380 | else |
378 | { | ||
379 | if(sansapatcher(BOOTLOADER_REM,gv->plat_bootloadername[index])) | ||
380 | { | ||
381 | MESG_DIALOG(wxT("The Bootloader has been uninstalled.") ); | ||
382 | } | ||
383 | else | ||
384 | { | ||
385 | MESG_DIALOG(wxT("The Uninstallation failed.") ); | ||
386 | } | ||
387 | } | ||
388 | else if(bootloadermethod== wxT("gigabeatf")) | ||
389 | { | 381 | { |
390 | 382 | MESG_DIALOG(wxT("The Uninstallation failed.") ); | |
391 | if(gigabeatf(BOOTLOADER_REM,gv->plat_bootloadername[index],gv->curdestdir)) | ||
392 | { | ||
393 | MESG_DIALOG(wxT("The Bootloader has been uninstalled.")); | ||
394 | } | ||
395 | else | ||
396 | MESG_DIALOG(wxT("The Uninstallation failed.") ); | ||
397 | } | 383 | } |
398 | else if(bootloadermethod == wxT("iaudio") ) | 384 | } |
385 | if(bootloadermethod == wxT("sansapatcher")) | ||
386 | { | ||
387 | if(sansapatcher(BOOTLOADER_REM,gv->plat_bootloadername[index])) | ||
399 | { | 388 | { |
400 | MESG_DIALOG(wxT("To uninstall the Bootloader on this Device,\n" | 389 | MESG_DIALOG(wxT("The Bootloader has been uninstalled.") ); |
401 | "you need to download and install an Original Firmware from the Manufacturer.")); | ||
402 | } | 390 | } |
403 | else if(bootloadermethod == wxT("fwpatcher")) | 391 | else |
404 | { | 392 | { |
405 | MESG_DIALOG(wxT("To uninstall the Bootloader on this Device,\n" | 393 | MESG_DIALOG(wxT("The Uninstallation failed.") ); |
406 | "you need to download and install an original Firmware from the Manufacturer.\n" | ||
407 | "To do this, you need to boot into the original Firmware.")); | ||
408 | } | 394 | } |
409 | else if(bootloadermethod == wxT("h10")) | 395 | } |
396 | else if(bootloadermethod== wxT("gigabeatf")) | ||
397 | { | ||
398 | |||
399 | if(gigabeatf(BOOTLOADER_REM,gv->plat_bootloadername[index],gv->curdestdir)) | ||
410 | { | 400 | { |
411 | if(h10(BOOTLOADER_REM,gv->plat_bootloadername[index],gv->curdestdir)) | 401 | MESG_DIALOG(wxT("The Bootloader has been uninstalled.")); |
412 | { | ||
413 | MESG_DIALOG(wxT("The Bootloader has been uninstalled.")); | ||
414 | } | ||
415 | else | ||
416 | MESG_DIALOG(wxT("The Uninstallation failed.") ); | ||
417 | } | 402 | } |
418 | else | 403 | else |
404 | MESG_DIALOG(wxT("The Uninstallation failed.") ); | ||
405 | } | ||
406 | else if(bootloadermethod == wxT("iaudio") ) | ||
407 | { | ||
408 | MESG_DIALOG(wxT("To uninstall the Bootloader on this Device,\n" | ||
409 | "you need to download and install an Original Firmware from the Manufacturer.")); | ||
410 | } | ||
411 | else if(bootloadermethod == wxT("fwpatcher")) | ||
412 | { | ||
413 | MESG_DIALOG(wxT("To uninstall the Bootloader on this Device,\n" | ||
414 | "you need to download and install an original Firmware from the Manufacturer.\n" | ||
415 | "To do this, you need to boot into the original Firmware.")); | ||
416 | } | ||
417 | else if(bootloadermethod == wxT("h10")) | ||
418 | { | ||
419 | if(h10(BOOTLOADER_REM,gv->plat_bootloadername[index],gv->curdestdir)) | ||
419 | { | 420 | { |
420 | MESG_DIALOG(wxT("Unsupported Bootloader Uninstall method.") ); | 421 | MESG_DIALOG(wxT("The Bootloader has been uninstalled.")); |
421 | } | 422 | } |
423 | else | ||
424 | MESG_DIALOG(wxT("The Uninstallation failed.") ); | ||
425 | } | ||
426 | else | ||
427 | { | ||
428 | MESG_DIALOG(wxT("Unsupported Bootloader Uninstall method.") ); | ||
422 | } | 429 | } |
423 | |||
424 | 430 | ||
425 | wxLogVerbose(wxT("=== end rbutilFrm::OnBootloaderRemoveBtn")); | 431 | wxLogVerbose(wxT("=== end rbutilFrm::OnBootloaderRemoveBtn")); |
426 | } | 432 | } |
@@ -429,84 +435,100 @@ void rbutilFrm::OnBootloaderBtn(wxCommandEvent& event) | |||
429 | { | 435 | { |
430 | wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderBtn(event)")); | 436 | wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderBtn(event)")); |
431 | 437 | ||
432 | bootloaderInstallDlg dialog(NULL, wxID_ANY, | 438 | int index = gv->plat_id.Index(gv->curplat); |
433 | wxT("Bootloader Installation")); | 439 | wxString bootloadermethod = gv->plat_bootloadermethod[index]; |
434 | 440 | ||
435 | if (dialog.ShowModal() == wxID_OK) | 441 | if(!gv->plat_needsbootloader[index]) |
436 | { | 442 | { |
437 | int index = gv->plat_id.Index(gv->curplat); | 443 | WARN_DIALOG(wxT("This Device doesnt need a Bootloader"), |
438 | wxString bootloadermethod = gv->plat_bootloadermethod[index]; | 444 | wxT("Bootloader")); |
445 | return; | ||
446 | } | ||
439 | 447 | ||
440 | if(bootloadermethod == wxT("ipodpatcher")) | 448 | // Bootloader dialog |
441 | { | 449 | if(bootloadermethod != wxT("ipodpatcher") && bootloadermethod != wxT("sansapatcher") ) |
442 | wxString bootloadername = wxT("bootloader-"); | 450 | { |
443 | bootloadername.Append(gv->plat_bootloadername[index] ); | 451 | bootloaderInstallDlg dialog(NULL, wxID_ANY,wxT("Bootloader Installation")); |
444 | if(ipodpatcher(BOOTLOADER_ADD,bootloadername)) | 452 | if (dialog.ShowModal() != wxID_OK) |
445 | { | 453 | return; |
446 | MESG_DIALOG(wxT("The Bootloader has been installed on your device.") ); | 454 | } |
447 | } | ||
448 | else | ||
449 | { | ||
450 | MESG_DIALOG(wxT("The installation has failed.") ); | ||
451 | } | ||
452 | } | ||
453 | if(bootloadermethod == wxT("sansapatcher")) | ||
454 | { | ||
455 | if(sansapatcher(BOOTLOADER_ADD,gv->plat_bootloadername[index])) | ||
456 | { | ||
457 | MESG_DIALOG(wxT("The Bootloader has been installed on your device.") ); | ||
458 | } | ||
459 | else | ||
460 | { | ||
461 | MESG_DIALOG(wxT("The installation has failed.") ); | ||
462 | } | ||
463 | 455 | ||
464 | } | 456 | // really install ? |
465 | else if(bootloadermethod== wxT("gigabeatf")) | 457 | wxMessageDialog msg(this,wxT("Do you really want to install the Bootloader ?"),wxT("Bootloader installation"),wxOK|wxCANCEL); |
466 | { | 458 | if(msg.ShowModal() != wxID_OK ) |
459 | return; | ||
467 | 460 | ||
468 | if(gigabeatf(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir)) | 461 | |
469 | { | 462 | if(bootloadermethod == wxT("ipodpatcher")) |
470 | MESG_DIALOG(wxT("The Bootloader has been installed on your device.")); | 463 | { |
471 | } | 464 | wxString bootloadername = wxT("bootloader-"); |
472 | else | 465 | bootloadername.Append(gv->plat_bootloadername[index] ); |
473 | MESG_DIALOG(wxT("The installation has failed.") ); | 466 | if(ipodpatcher(BOOTLOADER_ADD,bootloadername)) |
474 | } | 467 | { |
475 | else if(bootloadermethod == wxT("iaudio") ) | 468 | MESG_DIALOG(wxT("The Bootloader has been installed on your device.") ); |
476 | { | 469 | } |
477 | if(iaudiox5(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir)) | 470 | else |
478 | { | 471 | { |
479 | MESG_DIALOG(wxT("The Bootloader has been installed on your device.\n" | 472 | MESG_DIALOG(wxT("The installation has failed.") ); |
480 | "Now turn OFF your Device, unplug USB,and insert Charger\n" | 473 | } |
481 | "Your Device will automatically upgrade the flash with the Rockbox bootloader")); | 474 | } |
482 | } | 475 | if(bootloadermethod == wxT("sansapatcher")) |
483 | else | 476 | { |
484 | MESG_DIALOG(wxT("The installation has failed.") ); | 477 | if(sansapatcher(BOOTLOADER_ADD,gv->plat_bootloadername[index])) |
485 | } | 478 | { |
486 | else if(bootloadermethod == wxT("fwpatcher")) | 479 | MESG_DIALOG(wxT("The Bootloader has been installed on your device.") ); |
487 | { | 480 | } |
488 | if(fwpatcher(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir,gv->curfirmware)) | 481 | else |
489 | { | 482 | { |
490 | MESG_DIALOG(wxT("The Bootloader has been patched and copied on your device.\n" | 483 | MESG_DIALOG(wxT("The installation has failed.") ); |
491 | "Now use the Firmware upgrade option of your Device\n")); | 484 | } |
492 | } | 485 | |
493 | else | 486 | } |
494 | MESG_DIALOG(wxT("The installation has failed.") ); | 487 | else if(bootloadermethod== wxT("gigabeatf")) |
495 | } | 488 | { |
496 | else if(bootloadermethod == wxT("h10")) | 489 | |
497 | { | 490 | if(gigabeatf(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir)) |
498 | if(h10(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir)) | 491 | { |
499 | { | 492 | MESG_DIALOG(wxT("The Bootloader has been installed on your device.")); |
500 | MESG_DIALOG(wxT("The Bootloader has been patched and copied on your device.\n")); | 493 | } |
501 | } | 494 | else |
502 | else | 495 | MESG_DIALOG(wxT("The installation has failed.") ); |
503 | MESG_DIALOG(wxT("The installation has failed.") ); | 496 | } |
504 | } | 497 | else if(bootloadermethod == wxT("iaudio") ) |
505 | else | 498 | { |
506 | { | 499 | if(iaudiox5(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir)) |
507 | MESG_DIALOG(wxT("Unsupported Bootloader Install method.") ); | 500 | { |
508 | } | 501 | MESG_DIALOG(wxT("The Bootloader has been installed on your device.\n" |
502 | "Now turn OFF your Device, unplug USB,and insert Charger\n" | ||
503 | "Your Device will automatically upgrade the flash with the Rockbox bootloader")); | ||
504 | } | ||
505 | else | ||
506 | MESG_DIALOG(wxT("The installation has failed.") ); | ||
507 | } | ||
508 | else if(bootloadermethod == wxT("fwpatcher")) | ||
509 | { | ||
510 | if(fwpatcher(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir,gv->curfirmware)) | ||
511 | { | ||
512 | MESG_DIALOG(wxT("The Bootloader has been patched and copied on your device.\n" | ||
513 | "Now use the Firmware upgrade option of your Device\n")); | ||
514 | } | ||
515 | else | ||
516 | MESG_DIALOG(wxT("The installation has failed.") ); | ||
509 | } | 517 | } |
518 | else if(bootloadermethod == wxT("h10")) | ||
519 | { | ||
520 | if(h10(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir)) | ||
521 | { | ||
522 | MESG_DIALOG(wxT("The Bootloader has been patched and copied on your device.\n")); | ||
523 | } | ||
524 | else | ||
525 | MESG_DIALOG(wxT("The installation has failed.") ); | ||
526 | } | ||
527 | else | ||
528 | { | ||
529 | MESG_DIALOG(wxT("Unsupported Bootloader Install method.") ); | ||
530 | } | ||
531 | |||
510 | 532 | ||
511 | 533 | ||
512 | wxLogVerbose(wxT("=== end rbutilFrm::OnBootloaderBtn")); | 534 | wxLogVerbose(wxT("=== end rbutilFrm::OnBootloaderBtn")); |
@@ -523,102 +545,109 @@ void rbutilFrm::OnInstallBtn(wxCommandEvent& event) | |||
523 | wxFileConfig* buildinfo; | 545 | wxFileConfig* buildinfo; |
524 | wxDateSpan oneday; | 546 | wxDateSpan oneday; |
525 | 547 | ||
548 | // rockbox install dialog | ||
526 | rockboxInstallDlg dialog(NULL, wxID_ANY, | 549 | rockboxInstallDlg dialog(NULL, wxID_ANY, |
527 | wxT("Rockbox Installation")); | 550 | wxT("Rockbox Installation")); |
551 | if (dialog.ShowModal() != wxID_OK) | ||
552 | return; | ||
553 | |||
554 | // really install | ||
555 | wxMessageDialog msg(this,wxT("Do you really want to install Rockbox ?"),wxT("rockbox installation"),wxOK|wxCANCEL); | ||
556 | if(msg.ShowModal() != wxID_OK ) | ||
557 | return; | ||
528 | 558 | ||
529 | if (dialog.ShowModal() == wxID_OK) | 559 | |
560 | switch (gv->curbuild) | ||
530 | { | 561 | { |
531 | switch (gv->curbuild) | 562 | case BUILD_RELEASE: |
532 | { | 563 | // This is a URL - don't use PATH_SEP |
533 | case BUILD_RELEASE: | 564 | src.Printf(wxT("%s%s-%s-%s.zip"), |
534 | // This is a URL - don't use PATH_SEP | 565 | gv->download_url.c_str(), gv->prog_name.c_str(), |
535 | src.Printf(wxT("%s%s-%s-%s.zip"), | 566 | gv->last_release.c_str(), gv->curplat.c_str()); |
536 | gv->download_url.c_str(), gv->prog_name.c_str(), | 567 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s-%s-%s.zip"), |
537 | gv->last_release.c_str(), gv->curplat.c_str()); | 568 | gv->stdpaths->GetUserDataDir().c_str(), |
538 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s-%s-%s.zip"), | 569 | gv->prog_name.c_str(), gv->last_release.c_str(), |
539 | gv->stdpaths->GetUserDataDir().c_str(), | 570 | gv->curplat.c_str()); |
540 | gv->prog_name.c_str(), gv->last_release.c_str(), | 571 | break; |
541 | gv->curplat.c_str()); | 572 | case BUILD_DAILY: |
542 | break; | 573 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "build-info"), |
543 | case BUILD_DAILY: | 574 | gv->stdpaths->GetUserDataDir().c_str()); |
544 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "build-info"), | 575 | if (DownloadURL(gv->server_conf_url, dest)) { |
545 | gv->stdpaths->GetUserDataDir().c_str()); | 576 | WARN_DIALOG(wxT("Unable to download build status."), |
546 | if (DownloadURL(gv->server_conf_url, dest)) { | 577 | wxT("Install")); |
547 | WARN_DIALOG(wxT("Unable to download build status."), | 578 | buf = wxT(""); |
548 | wxT("Install")); | 579 | } else |
549 | buf = wxT(""); | 580 | { |
550 | } else | 581 | buildinfo = new wxFileConfig(wxEmptyString, |
551 | { | 582 | wxEmptyString, dest); |
552 | buildinfo = new wxFileConfig(wxEmptyString, | 583 | buf = buildinfo->Read(wxT("/dailies/date")); |
553 | wxEmptyString, dest); | 584 | buildinfo->DeleteAll(); |
554 | buf = buildinfo->Read(wxT("/dailies/date")); | ||
555 | buildinfo->DeleteAll(); | ||
556 | |||
557 | if (buf.Len() != 8) { | ||
558 | dest.Printf(wxT("Invalid build date: %s"), buf.c_str()); | ||
559 | WARN_DIALOG(dest, wxT("Install")); | ||
560 | buf = wxT(""); | ||
561 | } | ||
562 | } | ||
563 | 585 | ||
564 | if (buf == wxT("")) { | 586 | if (buf.Len() != 8) { |
565 | WARN_DIALOG(wxT("Can't get date of latest build from " | 587 | dest.Printf(wxT("Invalid build date: %s"), buf.c_str()); |
566 | "server. Using yesterday's date."), wxT("Install") ); | 588 | WARN_DIALOG(dest, wxT("Install")); |
567 | date = wxDateTime::Now(); | 589 | buf = wxT(""); |
568 | date.Subtract(oneday.Day()); | ||
569 | buf = date.Format(wxT("%Y%m%d")); // yes, we want UTC | ||
570 | } | 590 | } |
591 | } | ||
571 | 592 | ||
572 | src.Printf(wxT("%s%s/%s-%s-%s.zip"), | 593 | if (buf == wxT("")) { |
573 | gv->daily_url.c_str(), gv->curplat.c_str(), | 594 | WARN_DIALOG(wxT("Can't get date of latest build from " |
574 | gv->prog_name.c_str(), gv->curplat.c_str(), | 595 | "server. Using yesterday's date."), wxT("Install") ); |
575 | buf.c_str() ); | 596 | date = wxDateTime::Now(); |
576 | 597 | date.Subtract(oneday.Day()); | |
577 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s-%s-%s.zip"), | 598 | buf = date.Format(wxT("%Y%m%d")); // yes, we want UTC |
578 | gv->stdpaths->GetUserDataDir().c_str(), | ||
579 | gv->prog_name.c_str(), | ||
580 | gv->curplat.c_str(), buf.c_str() ); | ||
581 | break; | ||
582 | case BUILD_BLEEDING: | ||
583 | src.Printf(wxT("%s%s/%s.zip"), | ||
584 | gv->bleeding_url.c_str(), gv->curplat.c_str(), | ||
585 | gv->prog_name.c_str() ); | ||
586 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s.zip"), | ||
587 | gv->stdpaths->GetUserDataDir().c_str(), | ||
588 | gv->prog_name.c_str() ); | ||
589 | break; | ||
590 | default: | ||
591 | ERR_DIALOG(wxT("Something seriously odd has happened."), | ||
592 | wxT("Install")); | ||
593 | return; | ||
594 | break; | ||
595 | } | ||
596 | |||
597 | if (gv->nocache || ( ! wxFileExists(dest) ) ) | ||
598 | { | ||
599 | if ( DownloadURL(src, dest) ) | ||
600 | { | ||
601 | wxRemoveFile(dest); | ||
602 | buf.Printf(wxT("Unable to download %s"), src.c_str() ); | ||
603 | ERR_DIALOG(buf, wxT("Install")); | ||
604 | return; | ||
605 | } | 599 | } |
606 | } | ||
607 | 600 | ||
608 | if ( !UnzipFile(dest, gv->curdestdir, true) ) | 601 | src.Printf(wxT("%s%s/%s-%s-%s.zip"), |
609 | { | 602 | gv->daily_url.c_str(), gv->curplat.c_str(), |
610 | wxMessageDialog* msg = new wxMessageDialog(this, wxT("Rockbox has been installed on your device.") | 603 | gv->prog_name.c_str(), gv->curplat.c_str(), |
611 | ,wxT("Installation"), wxOK |wxICON_INFORMATION); | 604 | buf.c_str() ); |
612 | msg->ShowModal(); | 605 | |
613 | delete msg; | 606 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s-%s-%s.zip"), |
614 | } else | 607 | gv->stdpaths->GetUserDataDir().c_str(), |
608 | gv->prog_name.c_str(), | ||
609 | gv->curplat.c_str(), buf.c_str() ); | ||
610 | break; | ||
611 | case BUILD_BLEEDING: | ||
612 | src.Printf(wxT("%s%s/%s.zip"), | ||
613 | gv->bleeding_url.c_str(), gv->curplat.c_str(), | ||
614 | gv->prog_name.c_str() ); | ||
615 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s.zip"), | ||
616 | gv->stdpaths->GetUserDataDir().c_str(), | ||
617 | gv->prog_name.c_str() ); | ||
618 | break; | ||
619 | default: | ||
620 | ERR_DIALOG(wxT("Something seriously odd has happened."), | ||
621 | wxT("Install")); | ||
622 | return; | ||
623 | break; | ||
624 | } | ||
625 | |||
626 | if (gv->nocache || ( ! wxFileExists(dest) ) ) | ||
627 | { | ||
628 | if ( DownloadURL(src, dest) ) | ||
615 | { | 629 | { |
616 | wxRemoveFile(dest); | 630 | wxRemoveFile(dest); |
617 | buf.Printf(wxT("Unable to unzip %s"), dest.c_str() ); | 631 | buf.Printf(wxT("Unable to download %s"), src.c_str() ); |
618 | ERR_DIALOG(buf, wxT("Install")); | 632 | ERR_DIALOG(buf, wxT("Install")); |
633 | return; | ||
619 | } | 634 | } |
620 | } | 635 | } |
621 | 636 | ||
637 | if ( !UnzipFile(dest, gv->curdestdir, true) ) | ||
638 | { | ||
639 | wxMessageDialog* msg = new wxMessageDialog(this, wxT("Rockbox has been installed on your device.") | ||
640 | ,wxT("Installation"), wxOK |wxICON_INFORMATION); | ||
641 | msg->ShowModal(); | ||
642 | delete msg; | ||
643 | } else | ||
644 | { | ||
645 | wxRemoveFile(dest); | ||
646 | buf.Printf(wxT("Unable to unzip %s"), dest.c_str() ); | ||
647 | ERR_DIALOG(buf, wxT("Install")); | ||
648 | } | ||
649 | |||
650 | |||
622 | wxLogVerbose(wxT("=== end rbutilFrm::OnInstallBtn")); | 651 | wxLogVerbose(wxT("=== end rbutilFrm::OnInstallBtn")); |
623 | } | 652 | } |
624 | 653 | ||
@@ -632,81 +661,87 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event) | |||
632 | wxFileConfig* buildinfo; | 661 | wxFileConfig* buildinfo; |
633 | wxDateSpan oneday; | 662 | wxDateSpan oneday; |
634 | 663 | ||
664 | // font install dialog | ||
635 | fontInstallDlg dialog(NULL, wxID_ANY, | 665 | fontInstallDlg dialog(NULL, wxID_ANY, |
636 | wxT("Font Installation")); | 666 | wxT("Font Installation")); |
667 | if (dialog.ShowModal() != wxID_OK) | ||
668 | return; | ||
637 | 669 | ||
638 | if (dialog.ShowModal() == wxID_OK) | 670 | // really install ? |
639 | { | 671 | wxMessageDialog msg(this,wxT("Do you really want to install the Fonts ?"),wxT("Font installation"),wxOK|wxCANCEL); |
640 | 672 | if(msg.ShowModal() != wxID_OK ) | |
641 | buf.Printf(wxT("%s" PATH_SEP ".rockbox"), gv->curdestdir.c_str()) ; | 673 | return; |
642 | if (! wxDirExists(buf) ) | ||
643 | { | ||
644 | buf.Printf(wxT("Rockbox is not yet installed on %s - install " | ||
645 | "Rockbox first."), buf.c_str() ); | ||
646 | WARN_DIALOG(buf, wxT("Can't install fonts") ); | ||
647 | return; | ||
648 | } | ||
649 | 674 | ||
650 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "build-info"), | ||
651 | gv->stdpaths->GetUserDataDir().c_str()); | ||
652 | if (DownloadURL(gv->server_conf_url, dest)) | ||
653 | { | ||
654 | WARN_DIALOG(wxT("Unable to download build status."), | ||
655 | wxT("Font Install")); | ||
656 | buf = wxT(""); | ||
657 | } else | ||
658 | { | ||
659 | buildinfo = new wxFileConfig(wxEmptyString, | ||
660 | wxEmptyString, dest); | ||
661 | buf = buildinfo->Read(wxT("/dailies/date")); | ||
662 | buildinfo->DeleteAll(); | ||
663 | 675 | ||
664 | if (buf.Len() != 8) { | 676 | buf.Printf(wxT("%s" PATH_SEP ".rockbox"), gv->curdestdir.c_str()) ; |
665 | dest.Printf(wxT("Invalid build date: %s"), buf.c_str()); | 677 | if (! wxDirExists(buf) ) |
666 | WARN_DIALOG(dest, wxT("Font Install")); | 678 | { |
667 | buf = wxT(""); | 679 | buf.Printf(wxT("Rockbox is not yet installed on %s - install " |
668 | } | 680 | "Rockbox first."), buf.c_str() ); |
669 | } | 681 | WARN_DIALOG(buf, wxT("Can't install fonts") ); |
682 | return; | ||
683 | } | ||
670 | 684 | ||
671 | if (buf == wxT("")) { | 685 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "build-info"), |
672 | WARN_DIALOG(wxT("Can't get date of latest build from " | 686 | gv->stdpaths->GetUserDataDir().c_str()); |
673 | "server. Using yesterday's date."), | 687 | if (DownloadURL(gv->server_conf_url, dest)) |
674 | wxT("Font Install") ); | 688 | { |
675 | date = wxDateTime::Now(); | 689 | WARN_DIALOG(wxT("Unable to download build status."), |
676 | date.Subtract(oneday.Day()); | 690 | wxT("Font Install")); |
677 | buf = date.Format(wxT("%Y%m%d")); // yes, we want UTC | 691 | buf = wxT(""); |
692 | } else | ||
693 | { | ||
694 | buildinfo = new wxFileConfig(wxEmptyString, | ||
695 | wxEmptyString, dest); | ||
696 | buf = buildinfo->Read(wxT("/dailies/date")); | ||
697 | buildinfo->DeleteAll(); | ||
698 | |||
699 | if (buf.Len() != 8) { | ||
700 | dest.Printf(wxT("Invalid build date: %s"), buf.c_str()); | ||
701 | WARN_DIALOG(dest, wxT("Font Install")); | ||
702 | buf = wxT(""); | ||
678 | } | 703 | } |
704 | } | ||
679 | 705 | ||
680 | src.Printf(wxT("%s%s.zip"), gv->font_url.c_str(), buf.c_str() ); | 706 | if (buf == wxT("")) { |
707 | WARN_DIALOG(wxT("Can't get date of latest build from " | ||
708 | "server. Using yesterday's date."), | ||
709 | wxT("Font Install") ); | ||
710 | date = wxDateTime::Now(); | ||
711 | date.Subtract(oneday.Day()); | ||
712 | buf = date.Format(wxT("%Y%m%d")); // yes, we want UTC | ||
713 | } | ||
681 | 714 | ||
682 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP | 715 | src.Printf(wxT("%s%s.zip"), gv->font_url.c_str(), buf.c_str() ); |
683 | "rockbox-fonts-%s.zip"), gv->stdpaths->GetUserDataDir().c_str(), | ||
684 | buf.c_str() ); | ||
685 | 716 | ||
686 | if ( ! wxFileExists(dest) ) | 717 | dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP |
687 | { | 718 | "rockbox-fonts-%s.zip"), gv->stdpaths->GetUserDataDir().c_str(), |
688 | if ( DownloadURL(src, dest) ) | 719 | buf.c_str() ); |
689 | { | ||
690 | wxRemoveFile(dest); | ||
691 | buf.Printf(wxT("Unable to download %s"), src.c_str() ); | ||
692 | ERR_DIALOG(buf, wxT("Font Install")); | ||
693 | return; | ||
694 | } | ||
695 | } | ||
696 | 720 | ||
697 | if ( !UnzipFile(dest, gv->curdestdir, true) ) | 721 | if ( ! wxFileExists(dest) ) |
698 | { | 722 | { |
699 | wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Rockbox fonts have been installed on your device.") | 723 | if ( DownloadURL(src, dest) ) |
700 | ,wxT("Installation"), wxOK |wxICON_INFORMATION); | ||
701 | msg->ShowModal(); | ||
702 | delete msg; | ||
703 | } else | ||
704 | { | 724 | { |
705 | wxRemoveFile(dest); | 725 | wxRemoveFile(dest); |
706 | buf.Printf(wxT("Unable to unzip %s"), dest.c_str() ); | 726 | buf.Printf(wxT("Unable to download %s"), src.c_str() ); |
707 | ERR_DIALOG(buf, wxT("Font Install")); | 727 | ERR_DIALOG(buf, wxT("Font Install")); |
728 | return; | ||
708 | } | 729 | } |
709 | } | 730 | } |
731 | |||
732 | if ( !UnzipFile(dest, gv->curdestdir, true) ) | ||
733 | { | ||
734 | wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Rockbox fonts have been installed on your device.") | ||
735 | ,wxT("Installation"), wxOK |wxICON_INFORMATION); | ||
736 | msg->ShowModal(); | ||
737 | delete msg; | ||
738 | } else | ||
739 | { | ||
740 | wxRemoveFile(dest); | ||
741 | buf.Printf(wxT("Unable to unzip %s"), dest.c_str() ); | ||
742 | ERR_DIALOG(buf, wxT("Font Install")); | ||
743 | } | ||
744 | |||
710 | wxLogVerbose(wxT("=== end rbutilFrm::OnFontBtn")); | 745 | wxLogVerbose(wxT("=== end rbutilFrm::OnFontBtn")); |
711 | } | 746 | } |
712 | 747 | ||
@@ -716,27 +751,31 @@ void rbutilFrm::OnThemesBtn(wxCommandEvent& event) | |||
716 | wxString src, dest, buf; | 751 | wxString src, dest, buf; |
717 | wxLogVerbose(wxT("=== begin rbutilFrm::OnThemesBtn(event)")); | 752 | wxLogVerbose(wxT("=== begin rbutilFrm::OnThemesBtn(event)")); |
718 | 753 | ||
719 | 754 | // Theme install dialog | |
720 | themesInstallDlg dialog(NULL, wxID_ANY, | 755 | themesInstallDlg dialog(NULL, wxID_ANY, |
721 | wxT("Theme Installation")); | 756 | wxT("Theme Installation")); |
757 | if (dialog.ShowModal() != wxID_OK) | ||
758 | return; | ||
722 | 759 | ||
723 | if (dialog.ShowModal() == wxID_OK) | 760 | // really install ? |
761 | wxMessageDialog msg(this,wxT("Do you really want to install the selected Themes ?"),wxT("Theme installation"),wxOK|wxCANCEL); | ||
762 | if(msg.ShowModal() != wxID_OK ) | ||
763 | return; | ||
764 | |||
765 | bool success=true; | ||
766 | for(unsigned int i=0 ;i < gv->themesToInstall.GetCount();i++) | ||
724 | { | 767 | { |
725 | bool success=true; | 768 | if(!InstallTheme(gv->themesToInstall[i])) |
726 | for(unsigned int i=0 ;i < gv->themesToInstall.GetCount();i++) | ||
727 | { | ||
728 | if(!InstallTheme(gv->themesToInstall[i])) | ||
729 | { | ||
730 | MESG_DIALOG(wxT("The Themes installation has failed") ); | ||
731 | success=false; | ||
732 | break; | ||
733 | } | ||
734 | } | ||
735 | if(success) | ||
736 | { | 769 | { |
737 | MESG_DIALOG(wxT("The Theme installation completed successfully.") ); | 770 | MESG_DIALOG(wxT("The Themes installation has failed") ); |
771 | success=false; | ||
772 | break; | ||
738 | } | 773 | } |
739 | } | 774 | } |
775 | if(success) | ||
776 | { | ||
777 | MESG_DIALOG(wxT("The Theme installation completed successfully.") ); | ||
778 | } | ||
740 | 779 | ||
741 | 780 | ||
742 | wxLogVerbose(wxT("=== end rbutilFrm::OnThemesBtn(event)")); | 781 | wxLogVerbose(wxT("=== end rbutilFrm::OnThemesBtn(event)")); |
@@ -747,23 +786,29 @@ void rbutilFrm::OnRemoveBtn(wxCommandEvent& event) | |||
747 | { | 786 | { |
748 | wxLogVerbose(wxT("=== begin rbutilFrm::OnRemoveBtn(event)")); | 787 | wxLogVerbose(wxT("=== begin rbutilFrm::OnRemoveBtn(event)")); |
749 | 788 | ||
789 | // Rockbox deinstall dialog | ||
750 | rockboxDeInstallDlg dialog(NULL, wxID_ANY, | 790 | rockboxDeInstallDlg dialog(NULL, wxID_ANY, |
751 | wxT("Rockbox Deinstallation")); | 791 | wxT("Rockbox Deinstallation")); |
792 | if (dialog.ShowModal() != wxID_OK) | ||
793 | return; | ||
794 | |||
795 | // really install ? | ||
796 | wxMessageDialog msg(this,wxT("Do you really want to deinstall Rockbox ?"),wxT("Rockbox deinstallation"),wxOK|wxCANCEL); | ||
797 | if(msg.ShowModal() != wxID_OK ) | ||
798 | return; | ||
799 | |||
752 | 800 | ||
753 | if (dialog.ShowModal() == wxID_OK) | 801 | if (Uninstall(gv->curdestdir, gv->curisfull) ) |
754 | { | 802 | { |
755 | if (Uninstall(gv->curdestdir, gv->curisfull) ) | 803 | MESG_DIALOG( |
756 | { | 804 | wxT("The uninstallation wizard was cancelled or completed with " |
757 | MESG_DIALOG( | 805 | "some errors.") ); |
758 | wxT("The uninstallation wizard was cancelled or completed with " | 806 | } else { |
759 | "some errors.") ); | 807 | wxMessageDialog* msg = new wxMessageDialog(this, wxT("The uninstall wizard completed successfully\n" |
760 | } else { | 808 | "Depending on which Device you own, you also have to uninstall the Bootloader") |
761 | wxMessageDialog* msg = new wxMessageDialog(this, wxT("The uninstall wizard completed successfully\n" | 809 | ,wxT("Uninstallation"), wxOK |wxICON_INFORMATION); |
762 | "Depending on which Device you own, you also have to uninstall the Bootloader") | 810 | msg->ShowModal(); |
763 | ,wxT("Uninstallation"), wxOK |wxICON_INFORMATION); | 811 | delete msg; |
764 | msg->ShowModal(); | ||
765 | delete msg; | ||
766 | } | ||
767 | } | 812 | } |
768 | 813 | ||
769 | wxLogVerbose(wxT("=== end rbutilFrm::OnRemoveBtn")); | 814 | wxLogVerbose(wxT("=== end rbutilFrm::OnRemoveBtn")); |
@@ -776,19 +821,24 @@ void rbutilFrm::OnPortableInstall(wxCommandEvent& event) | |||
776 | wxFileSystem fs; | 821 | wxFileSystem fs; |
777 | wxDateSpan oneday; | 822 | wxDateSpan oneday; |
778 | 823 | ||
824 | //portable install dialog ( reused font dialog) | ||
779 | fontInstallDlg dialog(NULL, wxID_ANY, | 825 | fontInstallDlg dialog(NULL, wxID_ANY, |
780 | wxT("Rockbox Utility Portable Installation")); | 826 | wxT("Rockbox Utility Portable Installation")); |
827 | if (dialog.ShowModal() != wxID_OK) | ||
828 | return; | ||
781 | 829 | ||
782 | if (dialog.ShowModal() == wxID_OK) | 830 | // really install ? |
831 | wxMessageDialog msg(this,wxT("Do you really want a portable install of rbutil ?"),wxT("rbutil installation"),wxOK|wxCANCEL); | ||
832 | if(msg.ShowModal() != wxID_OK ) | ||
833 | return; | ||
834 | |||
835 | if ( InstallRbutil(gv->curdestdir) ) | ||
783 | { | 836 | { |
784 | if ( InstallRbutil(gv->curdestdir) ) | 837 | MESG_DIALOG(wxT("The Rockbox Utility has been installed on your device.")); |
785 | { | ||
786 | MESG_DIALOG(wxT("The Rockbox Utility has been installed on your device.")); | ||
787 | 838 | ||
788 | } else | 839 | } else |
789 | { | 840 | { |
790 | ERR_DIALOG(wxT("Installation failed"), wxT("Portable Install")); | 841 | ERR_DIALOG(wxT("Installation failed"), wxT("Portable Install")); |
791 | } | ||
792 | } | 842 | } |
793 | 843 | ||
794 | wxLogVerbose(wxT("=== end rbutilFrm::OnUnstallPortable")); | 844 | wxLogVerbose(wxT("=== end rbutilFrm::OnUnstallPortable")); |