summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2007-07-15 18:15:59 +0000
committerDominik Wenger <domonoky@googlemail.com>2007-07-15 18:15:59 +0000
commit1ad4b2c8091fde4f04bc88dd6d61f879658ccea5 (patch)
tree93e8c091fbf004dbe57d3d0cafd79fcdf3ee3ecb
parent798e0d552552a013cc32aca0e61e1a42827604d4 (diff)
downloadrockbox-1ad4b2c8091fde4f04bc88dd6d61f879658ccea5.tar.gz
rockbox-1ad4b2c8091fde4f04bc88dd6d61f879658ccea5.zip
rbutil: first attempt to talk file creator. also pushed version to 3.2.6
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13906 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/credits.h2
-rw-r--r--rbutil/install_dialogs.cpp279
-rw-r--r--rbutil/install_dialogs.h63
-rw-r--r--rbutil/rbutil-rc.rc8
-rw-r--r--rbutil/rbutil.cbp4
-rw-r--r--rbutil/rbutil.cpp7
-rw-r--r--rbutil/rbutil.h4
-rw-r--r--rbutil/rbutilApp.cpp5
-rw-r--r--rbutil/rbutilFrm.cpp46
-rw-r--r--rbutil/rbutilFrm.h4
10 files changed, 414 insertions, 8 deletions
diff --git a/rbutil/credits.h b/rbutil/credits.h
index 95ae4b7da3..b1246201d3 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.5" 25#define RBUTIL_VERSION "Version 0.3.2.6"
26 26
27static const wxString rbutil_developers[] = { 27static 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 b7607fa4d9..331a07df4a 100644
--- a/rbutil/install_dialogs.cpp
+++ b/rbutil/install_dialogs.cpp
@@ -148,7 +148,286 @@ bool bootloaderInstallDlg::TransferDataToWindow()
148 m_firmwarepos->setDefault(); 148 m_firmwarepos->setDefault();
149 return true; 149 return true;
150} 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{
151 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}
152 431
153//////////////////////////////////////////////// 432////////////////////////////////////////////////
154//// Font Installation 433//// Font Installation
diff --git a/rbutil/install_dialogs.h b/rbutil/install_dialogs.h
index 8b3defef1d..87c557a26f 100644
--- a/rbutil/install_dialogs.h
+++ b/rbutil/install_dialogs.h
@@ -2,6 +2,7 @@
2#define INSTALL_DIALOGS_H_INCLUDED 2#define INSTALL_DIALOGS_H_INCLUDED
3 3
4#include "rbutil.h" 4#include "rbutil.h"
5#include "talkfile.h"
5 6
6#include "rbutilCtrls.h" 7#include "rbutilCtrls.h"
7class bootloaderInstallDlg : public wxDialog 8class bootloaderInstallDlg : public wxDialog
@@ -44,6 +45,68 @@ private:
44 45
45}; 46};
46 47
48class talkInstallDlg : public wxDialog
49{
50 DECLARE_CLASS( talkInstallDlg )
51 DECLARE_EVENT_TABLE()
52public:
53enum {
54 ID_DEVICEPOS = 1002,
55 ID_BROWSE_ENC_BTN = 1003,
56 ID_BROWSE_TTS_BTN = 1004,
57 ID_TTS_CBX = 1005,
58 ID_ENC_CBX = 1006,
59 }; //End of Enum
60public:
61 talkInstallDlg(TalkFileCreator* talkcreator);
62 talkInstallDlg(TalkFileCreator* talkcreator, wxWindow* parent,
63 wxWindowID id = wxID_ANY,
64 const wxString& caption = wxT("Talk file creation"),
65 const wxPoint& pos = wxDefaultPosition,
66 const wxSize& size = wxDefaultSize,
67 long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
68 /// Member initialization
69 void Init();
70 /// Creation
71 bool Create( wxWindow* parent,
72 wxWindowID id = wxID_ANY,
73 const wxString& caption = wxT("Talk file creation"),
74 const wxPoint& pos = wxDefaultPosition,
75 const wxSize& size = wxDefaultSize,
76 long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
77 /// Creates the controls and sizers
78 void CreateControls();
79
80 void OnBrowseEncBtn(wxCommandEvent& event);
81 void OnBrowseTtsBtn(wxCommandEvent& event);
82
83 bool TransferDataFromWindow();
84 bool TransferDataToWindow();
85
86private:
87 TalkFileCreator* m_talkCreator;
88
89 DevicePositionCtrl* m_devicepos;
90
91 wxTextCtrl* m_EncExe;
92 wxButton* m_browseEncBtn;
93 wxTextCtrl* m_EncOpts;
94 wxComboBox* m_Enc;
95
96 wxTextCtrl* m_TtsExe;
97 wxButton* m_browseTtsBtn;
98 wxTextCtrl* m_TtsOpts;
99 wxComboBox* m_Tts;
100
101
102 wxCheckBox* m_OverwriteWave;
103 wxCheckBox* m_OverwriteTalk;
104 wxCheckBox* m_RemoveWave;
105 wxCheckBox* m_Recursive;
106 wxCheckBox* m_StripExtensions;
107
108};
109
47 110
48class fontInstallDlg : public wxDialog 111class fontInstallDlg : public wxDialog
49{ 112{
diff --git a/rbutil/rbutil-rc.rc b/rbutil/rbutil-rc.rc
index 91604375af..3202cefc49 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>
3RBUTIL VERSIONINFO 3RBUTIL VERSIONINFO
4FILEVERSION 0,3,2,5 4FILEVERSION 0,3,2,6
5PRODUCTVERSION 0,3,2,5 5PRODUCTVERSION 0,3,2,6
6FILEOS 0x00000004 6FILEOS 0x00000004
7FILETYPE 0x00000001 7FILETYPE 0x00000001
8BEGIN 8BEGIN
@@ -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.5\0" 13 VALUE "FileVersion", "0.3.2.6\0"
14 VALUE "ProductVersion", "0.3.2.5\0" 14 VALUE "ProductVersion", "0.3.2.6\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 b1cadf4165..58b2a35190 100644
--- a/rbutil/rbutil.cbp
+++ b/rbutil/rbutil.cbp
@@ -178,6 +178,10 @@
178 <Unit filename="sansapatcher\sansapatcher.h" /> 178 <Unit filename="sansapatcher\sansapatcher.h" />
179 <Unit filename="themes_3d.xpm" /> 179 <Unit filename="themes_3d.xpm" />
180 <Unit filename="tools2_3d.xpm" /> 180 <Unit filename="tools2_3d.xpm" />
181 <Unit filename="tts.cpp">
182 <Option compiler="gcc" use="0" buildCommand="gcc -Wall -g tts.cpp -I$FLITEDIR/include -L$FLITEDIR/lib \n -lflite_cmu_us_kal -lflite_usenglish -lflite_cmulex -lflite -lm" />
183 </Unit>
184 <Unit filename="tts.h" />
181 <Unit filename="uninstall_3d.xpm" /> 185 <Unit filename="uninstall_3d.xpm" />
182 <Unit filename="untools2_3d.xpm" /> 186 <Unit filename="untools2_3d.xpm" />
183 <Unit filename="wizard.xpm" /> 187 <Unit filename="wizard.xpm" />
diff --git a/rbutil/rbutil.cpp b/rbutil/rbutil.cpp
index 0f58c09707..058ca10a27 100644
--- a/rbutil/rbutil.cpp
+++ b/rbutil/rbutil.cpp
@@ -101,6 +101,7 @@ bool InstallTheme(wxString Themesrc)
101 101
102bool checkZip(wxString zipname) 102bool checkZip(wxString zipname)
103{ 103{
104
104 wxZipEntryPtr entry; 105 wxZipEntryPtr entry;
105 106
106 wxFFileInputStream* in_file = new wxFFileInputStream(zipname); 107 wxFFileInputStream* in_file = new wxFFileInputStream(zipname);
@@ -124,6 +125,7 @@ bool checkZip(wxString zipname)
124 } 125 }
125 126
126 return false; 127 return false;
128
127} 129}
128 130
129int DownloadURL(wxString src, wxString dest) 131int DownloadURL(wxString src, wxString dest)
@@ -267,6 +269,7 @@ int DownloadURL(wxString src, wxString dest)
267 269
268int UnzipFile(wxString src, wxString destdir, bool isInstall) 270int UnzipFile(wxString src, wxString destdir, bool isInstall)
269{ 271{
272
270 wxZipEntryPtr entry; 273 wxZipEntryPtr entry;
271 wxString in_str, progress_msg, buf,subdir; 274 wxString in_str, progress_msg, buf,subdir;
272 int errnum = 0, curfile = 0, totalfiles = 0; 275 int errnum = 0, curfile = 0, totalfiles = 0;
@@ -328,8 +331,10 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
328 (entry.reset(in_zip->GetNextEntry()), entry.get() != NULL) ) 331 (entry.reset(in_zip->GetNextEntry()), entry.get() != NULL) )
329 { 332 {
330 333
334
331 curfile++; 335 curfile++;
332 wxString name = entry->GetName(); 336 wxString name = entry->GetName();
337 // set progress
333 progress_msg = wxT("Unpacking ") + name; 338 progress_msg = wxT("Unpacking ") + name;
334 if (! progress->Update(curfile, progress_msg) ) 339 if (! progress->Update(curfile, progress_msg) )
335 { 340 {
@@ -367,6 +372,7 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
367 continue; // this is just a directory, nothing else to do 372 continue; // this is just a directory, nothing else to do
368 } 373 }
369 374
375 // its a file, copy it
370 wxFFileOutputStream* out = new wxFFileOutputStream(in_str); 376 wxFFileOutputStream* out = new wxFFileOutputStream(in_str);
371 if (! out->IsOk() ) 377 if (! out->IsOk() )
372 { 378 {
@@ -412,6 +418,7 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
412 if (log) delete log; 418 if (log) delete log;
413 wxLogVerbose(wxT("=== end UnzipFile")); 419 wxLogVerbose(wxT("=== end UnzipFile"));
414 return(errnum); 420 return(errnum);
421
415} 422}
416 423
417int Uninstall(const wxString dir, bool isFullUninstall) { 424int Uninstall(const wxString dir, bool isFullUninstall) {
diff --git a/rbutil/rbutil.h b/rbutil/rbutil.h
index cc53a80be7..eb31986ace 100644
--- a/rbutil/rbutil.h
+++ b/rbutil/rbutil.h
@@ -124,6 +124,10 @@ public:
124 bool portable; 124 bool portable;
125 wxString curresolution; 125 wxString curresolution;
126 wxArrayString themesToInstall; 126 wxArrayString themesToInstall;
127 wxString pathToTts;
128 wxString pathToEnc;
129
130
127 131
128 // Global system variables 132 // Global system variables
129 wxFFile* logfile; 133 wxFFile* logfile;
diff --git a/rbutil/rbutilApp.cpp b/rbutil/rbutilApp.cpp
index 2e84d6dad8..1901a62df1 100644
--- a/rbutil/rbutilApp.cpp
+++ b/rbutil/rbutilApp.cpp
@@ -266,6 +266,9 @@ void rbutilFrmApp::ReadUserConfig()
266 if (gv->UserConfig->Read(wxT("curplatform"), &str) ) gv->curplat = str; 266 if (gv->UserConfig->Read(wxT("curplatform"), &str) ) gv->curplat = str;
267 if (gv->UserConfig->Read(wxT("curfirmware"), &str) ) gv->curfirmware = str; 267 if (gv->UserConfig->Read(wxT("curfirmware"), &str) ) gv->curfirmware = str;
268 if (gv->UserConfig->Read(wxT("proxy_url"), &str) ) gv->proxy_url = str; 268 if (gv->UserConfig->Read(wxT("proxy_url"), &str) ) gv->proxy_url = str;
269
270 if (gv->UserConfig->Read(wxT("pathToTts"), &str) ) gv->pathToTts = str;
271 if (gv->UserConfig->Read(wxT("pathToEnc"), &str) ) gv->pathToEnc = str;
269 gv->UserConfig->SetPath(stack); 272 gv->UserConfig->SetPath(stack);
270} 273}
271 274
@@ -276,6 +279,8 @@ void rbutilFrmApp::WriteUserConfig()
276 gv->UserConfig->Write(wxT("curplatform"), gv->curplat); 279 gv->UserConfig->Write(wxT("curplatform"), gv->curplat);
277 gv->UserConfig->Write(wxT("curfirmware"), gv->curfirmware); 280 gv->UserConfig->Write(wxT("curfirmware"), gv->curfirmware);
278 gv->UserConfig->Write(wxT("proxy_url"), gv->proxy_url); 281 gv->UserConfig->Write(wxT("proxy_url"), gv->proxy_url);
282 gv->UserConfig->Write(wxT("pathToTts"), gv->pathToTts);
283 gv->UserConfig->Write(wxT("pathToEnc"), gv->pathToEnc);
279 284
280 delete gv->UserConfig; 285 delete gv->UserConfig;
281 286
diff --git a/rbutil/rbutilFrm.cpp b/rbutil/rbutilFrm.cpp
index 46d91745d1..80742693b2 100644
--- a/rbutil/rbutilFrm.cpp
+++ b/rbutil/rbutilFrm.cpp
@@ -49,7 +49,7 @@ BEGIN_EVENT_TABLE(rbutilFrm,wxFrame)
49 EVT_BUTTON (ID_BOOTLOADER_BTN, rbutilFrm::OnBootloaderBtn) 49 EVT_BUTTON (ID_BOOTLOADER_BTN, rbutilFrm::OnBootloaderBtn)
50 EVT_BUTTON (ID_BOOTLOADERREMOVE_BTN, rbutilFrm::OnBootloaderRemoveBtn) 50 EVT_BUTTON (ID_BOOTLOADERREMOVE_BTN, rbutilFrm::OnBootloaderRemoveBtn)
51 EVT_BUTTON (ID_DOOM_BTN, rbutilFrm::OnDoomBtn) 51 EVT_BUTTON (ID_DOOM_BTN, rbutilFrm::OnDoomBtn)
52 52 EVT_BUTTON (ID_TALK_BTN, rbutilFrm::OnTalkBtn)
53 53
54 EVT_CLOSE(rbutilFrm::rbutilFrmClose) 54 EVT_CLOSE(rbutilFrm::rbutilFrmClose)
55 EVT_MENU(ID_FILE_EXIT, rbutilFrm::OnFileExit) 55 EVT_MENU(ID_FILE_EXIT, rbutilFrm::OnFileExit)
@@ -207,7 +207,6 @@ void rbutilFrm::CreateGUIControls(void)
207 WxFlexGridSizer2->Add(WxStaticText6, 0, 207 WxFlexGridSizer2->Add(WxStaticText6, 0,
208 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); 208 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
209 209
210
211 wxBitmap DoomInstallButton (wxGetBitmapFromMemory(doom_btn_png,doom_btn_png_length)); 210 wxBitmap DoomInstallButton (wxGetBitmapFromMemory(doom_btn_png,doom_btn_png_length));
212 WxBitmapButton6 = new wxBitmapButton(themepage, ID_DOOM_BTN, 211 WxBitmapButton6 = new wxBitmapButton(themepage, ID_DOOM_BTN,
213 DoomInstallButton, wxPoint(0,0), wxSize(64,54), 212 DoomInstallButton, wxPoint(0,0), wxSize(64,54),
@@ -221,6 +220,21 @@ void rbutilFrm::CreateGUIControls(void)
221 WxFlexGridSizer2->Add(WxStaticText7, 0, 220 WxFlexGridSizer2->Add(WxStaticText7, 0,
222 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5); 221 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
223 222
223 wxBitmap TalkInstallButton (wxGetBitmapFromMemory(doom_btn_png,doom_btn_png_length));
224 WxBitmapButton7 = new wxBitmapButton(themepage, ID_TALK_BTN,
225 TalkInstallButton, wxPoint(0,0), wxSize(64,54),
226 wxRAISED_BORDER | wxBU_AUTODRAW,wxDefaultValidator, wxT("Create Talk Files"));
227 WxBitmapButton7->SetToolTip(wxT("Click here to create Talk files."));
228 WxFlexGridSizer2->Add(WxBitmapButton7, 0,
229 wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
230
231 wxStaticText* WxStaticText8 = new wxStaticText(themepage, wxID_ANY,
232 wxT("Create Talk Files.\n\n"));
233 WxFlexGridSizer2->Add(WxStaticText8, 0,
234 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
235
236
237
224 /*********************+ 238 /*********************+
225 Uninstall Page 239 Uninstall Page
226 ***********************/ 240 ***********************/
@@ -1007,6 +1021,34 @@ void rbutilFrm::OnPortableInstall(wxCommandEvent& event)
1007 wxLogVerbose(wxT("=== end rbutilFrm::OnUnstallPortable")); 1021 wxLogVerbose(wxT("=== end rbutilFrm::OnUnstallPortable"));
1008} 1022}
1009 1023
1024void rbutilFrm::OnTalkBtn(wxCommandEvent& event)
1025{
1026 wxLogVerbose(wxT("=== begin rbutilFrm::OnTalkBtn(event)"));
1027
1028 TalkFileCreator talk;
1029
1030 talkInstallDlg dialog(&talk,NULL,wxID_ANY);
1031
1032 if (dialog.ShowModal() != wxID_OK)
1033 return;
1034
1035 // really install ?
1036 wxMessageDialog msg(this,wxT("Do you really want to create Talkfiles ?"),wxT("Talk file creation"),wxOK|wxCANCEL);
1037 if(msg.ShowModal() != wxID_OK )
1038 return;
1039
1040 if(talk.createTalkFiles())
1041 {
1042 MESG_DIALOG(wxT("Talk files have been successfully created."));
1043 }
1044 else
1045 {
1046 ERR_DIALOG(wxT("Talkfile creation failed"), wxT("Talk file creation"));
1047 }
1048
1049 wxLogVerbose(wxT("=== end rbutilFrm::OnTalkBtn"));
1050}
1051
1010int rbutilFrm::GetDeviceId() 1052int rbutilFrm::GetDeviceId()
1011{ 1053{
1012 int index = gv->plat_id.Index(gv->curplat); 1054 int index = gv->plat_id.Index(gv->curplat);
diff --git a/rbutil/rbutilFrm.h b/rbutil/rbutilFrm.h
index 64afe97f7a..63e1ee34dc 100644
--- a/rbutil/rbutilFrm.h
+++ b/rbutil/rbutilFrm.h
@@ -44,7 +44,6 @@
44#include "rbutilCtrls.h" 44#include "rbutilCtrls.h"
45 45
46 46
47
48class rbutilFrm : public wxFrame 47class rbutilFrm : public wxFrame
49{ 48{
50private: 49private:
@@ -72,6 +71,7 @@ public:
72 wxBitmapButton *WxBitmapButton4; 71 wxBitmapButton *WxBitmapButton4;
73 wxBitmapButton *WxBitmapButton5; 72 wxBitmapButton *WxBitmapButton5;
74 wxBitmapButton *WxBitmapButton6; 73 wxBitmapButton *WxBitmapButton6;
74 wxBitmapButton *WxBitmapButton7;
75 wxFlexGridSizer *WxFlexGridSizer1; 75 wxFlexGridSizer *WxFlexGridSizer1;
76 wxStaticBoxSizer *WxStaticBoxSizer3; 76 wxStaticBoxSizer *WxStaticBoxSizer3;
77 wxStaticBitmap *WxStaticBitmap1; 77 wxStaticBitmap *WxStaticBitmap1;
@@ -96,6 +96,7 @@ public:
96 ID_FONT_BTN = 1128, 96 ID_FONT_BTN = 1128,
97 ID_THEMES_BTN = 1139, 97 ID_THEMES_BTN = 1139,
98 ID_DOOM_BTN = 1140, 98 ID_DOOM_BTN = 1140,
99 ID_TALK_BTN = 1141,
99 ID_BOOTLOADER_BTN = 1129, 100 ID_BOOTLOADER_BTN = 1129,
100 ID_WXPANEL1 = 1064, 101 ID_WXPANEL1 = 1064,
101 102
@@ -121,6 +122,7 @@ public:
121 void OnManualUpdate(wxUpdateUIEvent& event); 122 void OnManualUpdate(wxUpdateUIEvent& event);
122 void OnFileProxy(wxCommandEvent& event); 123 void OnFileProxy(wxCommandEvent& event);
123 void OnDoomBtn(wxCommandEvent& event); 124 void OnDoomBtn(wxCommandEvent& event);
125 void OnTalkBtn(wxCommandEvent& event);
124 126
125 int GetDeviceId(); 127 int GetDeviceId();
126 128