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.zip
rockbox-1ad4b2c8091fde4f04bc88dd6d61f879658ccea5.tar.gz
rockbox-1ad4b2c8091fde4f04bc88dd6d61f879658ccea5.tar.bz2
rockbox-1ad4b2c8091fde4f04bc88dd6d61f879658ccea5.tar.xz
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 95ae4b7..b124620 100644
--- a/rbutil/credits.h
+++ b/rbutil/credits.h
@@ -22,7 +22,7 @@
#define CREDITS_H_INCLUDED
#define RBUTIL_FULLNAME "The Rockbox Utility"
-#define RBUTIL_VERSION "Version 0.3.2.5"
+#define RBUTIL_VERSION "Version 0.3.2.6"
static const wxString rbutil_developers[] = {
wxT("Christi Alice Scarborough"),
diff --git a/rbutil/install_dialogs.cpp b/rbutil/install_dialogs.cpp
index b7607fa..331a07d 100644
--- a/rbutil/install_dialogs.cpp
+++ b/rbutil/install_dialogs.cpp
@@ -148,7 +148,286 @@ bool bootloaderInstallDlg::TransferDataToWindow()
m_firmwarepos->setDefault();
return true;
}
+////////////////////////////////////////////////
+//// Talk file creation
+/////////////////////////////////////////////////
+
+
+IMPLEMENT_CLASS( talkInstallDlg, wxDialog )
+
+BEGIN_EVENT_TABLE( talkInstallDlg, wxDialog )
+ EVT_BUTTON(ID_BROWSE_ENC_BTN, talkInstallDlg::OnBrowseEncBtn)
+ EVT_BUTTON(ID_BROWSE_TTS_BTN, talkInstallDlg::OnBrowseTtsBtn)
+END_EVENT_TABLE()
+
+talkInstallDlg::talkInstallDlg(TalkFileCreator* talkcreator )
+{
+ m_talkCreator = talkcreator;
+ Init();
+}
+
+talkInstallDlg::talkInstallDlg(TalkFileCreator* talkcreator, wxWindow* parent,
+ wxWindowID id, const wxString& caption,
+ const wxPoint& pos, const wxSize& size, long style )
+{
+ m_talkCreator = talkcreator;
+ Init();
+ Create(parent, id, caption, pos, size, style);
+}
+
+void talkInstallDlg::CreateControls()
+{
+ // A top-level sizer
+ wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
+ this->SetSizer(topSizer);
+
+ wxBoxSizer* wxBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
+ topSizer->Add(wxBoxSizer2, 0, wxALIGN_LEFT|wxALL, 5);
+
+ // bitmap
+ wxBitmap sidebmp(wizard_xpm);
+
+ ImageCtrl* sideimage = new ImageCtrl(this,wxID_ANY);
+ sideimage->SetBitmap(sidebmp);
+ wxBoxSizer2->Add(sideimage,0,wxALIGN_LEFT | wxALL,5);
+
+ wxBoxSizer* wxBoxSizer3 = new wxBoxSizer(wxVERTICAL);
+ wxBoxSizer2->Add(wxBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
+
+ // Device position
+ m_devicepos = new DevicePositionCtrl(this,ID_DEVICEPOS);
+ wxBoxSizer3->Add(m_devicepos, 0, wxALIGN_LEFT|wxALL, 5);
+
+ // Encoder
+ wxStaticBox* WxStaticBoxSizer2_StaticBoxObj = new wxStaticBox(this,
+ wxID_ANY, wxT("Encoder"));
+ wxStaticBoxSizer* WxStaticBoxSizer2 =
+ new wxStaticBoxSizer(WxStaticBoxSizer2_StaticBoxObj,wxVERTICAL);
+ wxBoxSizer3->Add(WxStaticBoxSizer2,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
+
+ m_Enc = new wxComboBox(this,ID_ENC_CBX,wxT("lame"),
+ wxDefaultPosition,wxDefaultSize,m_talkCreator->getSupportedEnc(),wxCB_READONLY);
+ m_Enc->SetToolTip(wxT("Select your Encoder."));
+ m_Enc->SetHelpText(wxT("Select your Encoder."));
+ WxStaticBoxSizer2->Add(m_Enc,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
+
+ wxStaticText* enc_desc = new wxStaticText( this, wxID_STATIC,
+ wxT("Select the Encoder executable"), wxDefaultPosition,
+ wxDefaultSize, 0 );
+ WxStaticBoxSizer2->Add(enc_desc, 0, wxALIGN_LEFT|wxALL, 5);
+
+ wxBoxSizer* horizontalSizer = new wxBoxSizer(wxHORIZONTAL);
+ WxStaticBoxSizer2->Add(horizontalSizer, 0, wxGROW|wxALL, 5);
+
+ m_EncExe = new wxTextCtrl(this,wxID_ANY,gv->pathToEnc);
+ m_EncExe->SetToolTip(wxT("Type the folder where your Encoder exe is"));
+ m_EncExe->SetHelpText(wxT("Type the folder where your Encoder exe is"));
+ horizontalSizer->Add(m_EncExe,0,wxGROW | wxALL,5);
+
+ m_browseEncBtn = new wxButton(this, ID_BROWSE_ENC_BTN, wxT("Browse"),
+ wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
+ wxT("BrowseEncBtn"));
+ m_browseEncBtn->SetToolTip(wxT("Browse for your Encoder Exe"));
+ m_browseEncBtn->SetHelpText(wxT("Browse for your Encoder exe"));
+ horizontalSizer->Add(m_browseEncBtn,0,wxGROW | wxALL,5);
+
+ wxStaticText* enc_desc_opt = new wxStaticText( this, wxID_STATIC,
+ wxT("Encoder Options"), wxDefaultPosition,
+ wxDefaultSize, 0 );
+ WxStaticBoxSizer2->Add(enc_desc_opt, 0, wxALIGN_LEFT|wxALL, 5);
+
+ m_EncOpts = new wxTextCtrl(this,wxID_ANY,m_talkCreator->getEncOpts(wxT("lame")));
+ m_EncOpts->SetToolTip(wxT("Encoder Options"));
+ m_EncOpts->SetHelpText(wxT("Encoder Options"));
+ WxStaticBoxSizer2->Add(m_EncOpts, 0, wxALIGN_LEFT|wxALL, 5);
+
+ // TTS
+ wxStaticBox* WxStaticBoxSizer3_StaticBoxObj = new wxStaticBox(this,
+ wxID_ANY, wxT("Text to Speach"));
+ wxStaticBoxSizer* WxStaticBoxSizer3 =
+ new wxStaticBoxSizer(WxStaticBoxSizer3_StaticBoxObj,wxVERTICAL);
+ wxBoxSizer3->Add(WxStaticBoxSizer3,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
+
+ m_Tts = new wxComboBox(this,ID_TTS_CBX,wxT("espeak"),
+ wxDefaultPosition,wxDefaultSize,m_talkCreator->getSupportedTTS(),wxCB_READONLY);
+ m_Tts->SetToolTip(wxT("Select your TTS."));
+ m_Tts->SetHelpText(wxT("Select your TTS."));
+ WxStaticBoxSizer3->Add(m_Tts,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
+
+ wxStaticText* tts_desc = new wxStaticText( this, wxID_STATIC,
+ wxT("Select the TTS executable"), wxDefaultPosition,
+ wxDefaultSize, 0 );
+ WxStaticBoxSizer3->Add(tts_desc, 0, wxALIGN_LEFT|wxALL, 5);
+
+ wxBoxSizer* horizontalSizer2 = new wxBoxSizer(wxHORIZONTAL);
+ WxStaticBoxSizer3->Add(horizontalSizer2, 0, wxGROW|wxALL, 5);
+
+ m_TtsExe = new wxTextCtrl(this,wxID_ANY,gv->pathToTts);
+ m_TtsExe->SetToolTip(wxT("Type the folder where your TTS exe is"));
+ m_TtsExe->SetHelpText(wxT("Type the folder where your TTS exe is"));
+ horizontalSizer2->Add(m_TtsExe,0,wxGROW | wxALL,5);
+
+ m_browseTtsBtn = new wxButton(this, ID_BROWSE_TTS_BTN, wxT("Browse"),
+ wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
+ wxT("BrowseEncBtn"));
+ m_browseTtsBtn->SetToolTip(wxT("Browse for your Encoder Exe"));
+ m_browseTtsBtn->SetHelpText(wxT("Browse for your Encoder exe"));
+ horizontalSizer2->Add(m_browseTtsBtn,0,wxGROW | wxALL,5);
+
+ wxStaticText* tts_desc_opt = new wxStaticText( this, wxID_STATIC,
+ wxT("TTS Options"), wxDefaultPosition,
+ wxDefaultSize, 0 );
+ WxStaticBoxSizer3->Add(tts_desc_opt, 0, wxALIGN_LEFT|wxALL, 5);
+
+ m_TtsOpts = new wxTextCtrl(this,wxID_ANY,m_talkCreator->getTTsOpts(wxT("espeak")));
+ m_TtsOpts->SetToolTip(wxT("TTS Options"));
+ m_TtsOpts->SetHelpText(wxT("TTS Options"));
+ WxStaticBoxSizer3->Add(m_TtsOpts, 0, wxALIGN_LEFT|wxALL, 5);
+
+ m_OverwriteWave = new wxCheckBox(this,wxID_ANY,wxT("Overwrite Wav"));
+ m_OverwriteWave->SetToolTip(wxT("Overwrite Wavefiles"));
+ m_OverwriteWave->SetHelpText(wxT("Overwrite Wavefiles"));
+ wxBoxSizer3->Add(m_OverwriteWave,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
+
+ m_OverwriteTalk = new wxCheckBox(this,wxID_ANY,wxT("Overwrite Talk"));
+ m_OverwriteTalk->SetToolTip(wxT("Overwrite Talkfiles"));
+ m_OverwriteTalk->SetHelpText(wxT("Overwrite Talkfiles"));
+ wxBoxSizer3->Add(m_OverwriteTalk,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
+
+ m_RemoveWave = new wxCheckBox(this,wxID_ANY,wxT("Remove Wav"));
+ m_RemoveWave->SetToolTip(wxT("Remove Wavfiles"));
+ m_RemoveWave->SetHelpText(wxT("Remove Wavfiles"));
+ wxBoxSizer3->Add(m_RemoveWave,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
+
+ m_Recursive = new wxCheckBox(this,wxID_ANY,wxT("Recursive"));
+ m_Recursive->SetToolTip(wxT("Recursive"));
+ m_Recursive->SetHelpText(wxT("Recursive"));
+ wxBoxSizer3->Add(m_Recursive,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
+
+ m_StripExtensions = new wxCheckBox(this,wxID_ANY,wxT("Strip Extensions"));
+ m_StripExtensions->SetToolTip(wxT("Strip Extensions"));
+ m_StripExtensions->SetHelpText(wxT("Strip Extensions"));
+ wxBoxSizer3->Add(m_StripExtensions,0,wxALIGN_CENTER_HORIZONTAL|wxGROW | wxALL, 5);
+
+ OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
+ topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+
+ // controls at the bottom
+ wxBoxSizer* wxBoxSizer7 = new wxBoxSizer(wxVERTICAL);
+ topSizer->Add(wxBoxSizer7, 0, wxGROW | wxALL, 5);
+
+}
+
+//init the local variables
+void talkInstallDlg::Init()
+{
+
+}
+
+// create the window
+bool talkInstallDlg::Create( wxWindow* parent,
+ wxWindowID id, const wxString& caption,
+ const wxPoint& pos, const wxSize& size, long style )
+{
+ if (!wxDialog::Create( parent, id, caption, pos, size, style ))
+ return false;
+ CreateControls();
+ GetSizer()->Fit(this);
+ GetSizer()->SetSizeHints(this);
+ Centre();
+ return true;
+}
+
+void talkInstallDlg::OnBrowseEncBtn(wxCommandEvent& event)
+{
+ const wxString& temp = wxFileSelector(
+ wxT("Please select the location of your encoder"), wxT(""),
+ wxT(""),wxT(""),wxT("*.*"),0, this);
+
+ if (!temp.empty())
+ {
+ m_EncExe->SetValue(temp);
+ }
+}
+
+void talkInstallDlg::OnBrowseTtsBtn(wxCommandEvent& event)
+{
+ const wxString& temp = wxFileSelector(
+ wxT("Please select the location of your TTS engine"), wxT(""),
+ wxT(""),wxT(""),wxT("*.*"),0, this);
+
+
+ if (!temp.empty())
+ {
+ m_TtsExe->SetValue(temp);
+ }
+}
+
+// tranver data from the controls
+bool talkInstallDlg::TransferDataFromWindow()
+{
+ gv->curdestdir = m_devicepos->getDevicePos();
+ if(!wxDirExists(gv->curdestdir))
+ {
+ WARN_DIALOG(wxT("The Devicepostion is not valid"),
+ wxT("Select a Deviceposition"));
+ gv->curdestdir = wxT("");
+ return false;
+ }
+ m_talkCreator->setDir(gv->curdestdir);
+
+ gv->pathToEnc = m_EncExe->GetValue();
+ if(!wxFileExists(gv->pathToEnc))
+ {
+ WARN_DIALOG(wxT("The Encoder exe is not valid"),
+ wxT("Select an Encoder"));
+ gv->pathToEnc = wxT("");
+ return false;
+ }
+ m_talkCreator->setEncexe(gv->pathToEnc);
+
+ gv->pathToTts = m_TtsExe->GetValue();
+ if(!wxFileExists(gv->pathToTts))
+ {
+ WARN_DIALOG(wxT("The TTs exe is not valid"),
+ wxT("Select an TTS engine"));
+ gv->pathToTts = wxT("");
+ return false;
+ }
+ m_talkCreator->setTTSexe(gv->pathToTts);
+
+ m_talkCreator->setTTsType(m_Tts->GetValue());
+ m_talkCreator->setEncType(m_Enc->GetValue());
+
+
+ m_talkCreator->setOverwriteTalk(m_OverwriteWave->IsChecked());
+ m_talkCreator->setOverwriteWav(m_OverwriteTalk->IsChecked());
+ m_talkCreator->setRemoveWav(m_RemoveWave->IsChecked());
+ m_talkCreator->setRecursive(m_Recursive->IsChecked());
+ m_talkCreator->setStripExtensions(m_StripExtensions->IsChecked());
+
+ m_talkCreator->setEncOpts(m_EncOpts->GetValue());
+ m_talkCreator->setTTsOpts(m_TtsOpts->GetValue());
+
+ return true;
+}
+
+// tranver data to the controls
+bool talkInstallDlg::TransferDataToWindow()
+{
+ m_devicepos->setDefault();
+
+ m_OverwriteWave->SetValue(true);
+ m_OverwriteTalk->SetValue(true);
+ m_RemoveWave->SetValue(true);
+ m_Recursive->SetValue(true);
+ m_StripExtensions->SetValue(false);
+
+
+
+ return true;
+}
////////////////////////////////////////////////
//// Font Installation
diff --git a/rbutil/install_dialogs.h b/rbutil/install_dialogs.h
index 8b3defe..87c557a 100644
--- a/rbutil/install_dialogs.h
+++ b/rbutil/install_dialogs.h
@@ -2,6 +2,7 @@
#define INSTALL_DIALOGS_H_INCLUDED
#include "rbutil.h"
+#include "talkfile.h"
#include "rbutilCtrls.h"
class bootloaderInstallDlg : public wxDialog
@@ -44,6 +45,68 @@ private:
};
+class talkInstallDlg : public wxDialog
+{
+ DECLARE_CLASS( talkInstallDlg )
+ DECLARE_EVENT_TABLE()
+public:
+enum {
+ ID_DEVICEPOS = 1002,
+ ID_BROWSE_ENC_BTN = 1003,
+ ID_BROWSE_TTS_BTN = 1004,
+ ID_TTS_CBX = 1005,
+ ID_ENC_CBX = 1006,
+ }; //End of Enum
+public:
+ talkInstallDlg(TalkFileCreator* talkcreator);
+ talkInstallDlg(TalkFileCreator* talkcreator, wxWindow* parent,
+ wxWindowID id = wxID_ANY,
+ const wxString& caption = wxT("Talk file creation"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+ /// Member initialization
+ void Init();
+ /// Creation
+ bool Create( wxWindow* parent,
+ wxWindowID id = wxID_ANY,
+ const wxString& caption = wxT("Talk file creation"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
+ /// Creates the controls and sizers
+ void CreateControls();
+
+ void OnBrowseEncBtn(wxCommandEvent& event);
+ void OnBrowseTtsBtn(wxCommandEvent& event);
+
+ bool TransferDataFromWindow();
+ bool TransferDataToWindow();
+
+private:
+ TalkFileCreator* m_talkCreator;
+
+ DevicePositionCtrl* m_devicepos;
+
+ wxTextCtrl* m_EncExe;
+ wxButton* m_browseEncBtn;
+ wxTextCtrl* m_EncOpts;
+ wxComboBox* m_Enc;
+
+ wxTextCtrl* m_TtsExe;
+ wxButton* m_browseTtsBtn;
+ wxTextCtrl* m_TtsOpts;
+ wxComboBox* m_Tts;
+
+
+ wxCheckBox* m_OverwriteWave;
+ wxCheckBox* m_OverwriteTalk;
+ wxCheckBox* m_RemoveWave;
+ wxCheckBox* m_Recursive;
+ wxCheckBox* m_StripExtensions;
+
+};
+
class fontInstallDlg : public wxDialog
{
diff --git a/rbutil/rbutil-rc.rc b/rbutil/rbutil-rc.rc
index 9160437..3202cef 100644
--- a/rbutil/rbutil-rc.rc
+++ b/rbutil/rbutil-rc.rc
@@ -1,8 +1,8 @@
#define RBUTIL 1
#include <wx/msw/wx.rc>
RBUTIL VERSIONINFO
-FILEVERSION 0,3,2,5
-PRODUCTVERSION 0,3,2,5
+FILEVERSION 0,3,2,6
+PRODUCTVERSION 0,3,2,6
FILEOS 0x00000004
FILETYPE 0x00000001
BEGIN
@@ -10,8 +10,8 @@ BEGIN
BEGIN
BLOCK "FFFF0000"
BEGIN
- VALUE "FileVersion", "0.3.2.5\0"
- VALUE "ProductVersion", "0.3.2.5\0"
+ VALUE "FileVersion", "0.3.2.6\0"
+ VALUE "ProductVersion", "0.3.2.6\0"
VALUE "CompanyName", "Rockbox Team\0"
VALUE "FileDescription", "Rockbox Utility\0"
VALUE "InternalName", "rbutil\0"
diff --git a/rbutil/rbutil.cbp b/rbutil/rbutil.cbp
index b1cadf4..58b2a35 100644
--- a/rbutil/rbutil.cbp
+++ b/rbutil/rbutil.cbp
@@ -178,6 +178,10 @@
<Unit filename="sansapatcher\sansapatcher.h" />
<Unit filename="themes_3d.xpm" />
<Unit filename="tools2_3d.xpm" />
+ <Unit filename="tts.cpp">
+ <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" />
+ </Unit>
+ <Unit filename="tts.h" />
<Unit filename="uninstall_3d.xpm" />
<Unit filename="untools2_3d.xpm" />
<Unit filename="wizard.xpm" />
diff --git a/rbutil/rbutil.cpp b/rbutil/rbutil.cpp
index 0f58c09..058ca10 100644
--- a/rbutil/rbutil.cpp
+++ b/rbutil/rbutil.cpp
@@ -101,6 +101,7 @@ bool InstallTheme(wxString Themesrc)
bool checkZip(wxString zipname)
{
+
wxZipEntryPtr entry;
wxFFileInputStream* in_file = new wxFFileInputStream(zipname);
@@ -124,6 +125,7 @@ bool checkZip(wxString zipname)
}
return false;
+
}
int DownloadURL(wxString src, wxString dest)
@@ -267,6 +269,7 @@ int DownloadURL(wxString src, wxString dest)
int UnzipFile(wxString src, wxString destdir, bool isInstall)
{
+
wxZipEntryPtr entry;
wxString in_str, progress_msg, buf,subdir;
int errnum = 0, curfile = 0, totalfiles = 0;
@@ -328,8 +331,10 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
(entry.reset(in_zip->GetNextEntry()), entry.get() != NULL) )
{
+
curfile++;
wxString name = entry->GetName();
+ // set progress
progress_msg = wxT("Unpacking ") + name;
if (! progress->Update(curfile, progress_msg) )
{
@@ -367,6 +372,7 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
continue; // this is just a directory, nothing else to do
}
+ // its a file, copy it
wxFFileOutputStream* out = new wxFFileOutputStream(in_str);
if (! out->IsOk() )
{
@@ -412,6 +418,7 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
if (log) delete log;
wxLogVerbose(wxT("=== end UnzipFile"));
return(errnum);
+
}
int Uninstall(const wxString dir, bool isFullUninstall) {
diff --git a/rbutil/rbutil.h b/rbutil/rbutil.h
index cc53a80..eb31986 100644
--- a/rbutil/rbutil.h
+++ b/rbutil/rbutil.h
@@ -124,6 +124,10 @@ public:
bool portable;
wxString curresolution;
wxArrayString themesToInstall;
+ wxString pathToTts;
+ wxString pathToEnc;
+
+
// Global system variables
wxFFile* logfile;
diff --git a/rbutil/rbutilApp.cpp b/rbutil/rbutilApp.cpp
index 2e84d6d..1901a62 100644
--- a/rbutil/rbutilApp.cpp
+++ b/rbutil/rbutilApp.cpp
@@ -266,6 +266,9 @@ void rbutilFrmApp::ReadUserConfig()
if (gv->UserConfig->Read(wxT("curplatform"), &str) ) gv->curplat = str;
if (gv->UserConfig->Read(wxT("curfirmware"), &str) ) gv->curfirmware = str;
if (gv->UserConfig->Read(wxT("proxy_url"), &str) ) gv->proxy_url = str;
+
+ if (gv->UserConfig->Read(wxT("pathToTts"), &str) ) gv->pathToTts = str;
+ if (gv->UserConfig->Read(wxT("pathToEnc"), &str) ) gv->pathToEnc = str;
gv->UserConfig->SetPath(stack);
}
@@ -276,6 +279,8 @@ void rbutilFrmApp::WriteUserConfig()
gv->UserConfig->Write(wxT("curplatform"), gv->curplat);
gv->UserConfig->Write(wxT("curfirmware"), gv->curfirmware);
gv->UserConfig->Write(wxT("proxy_url"), gv->proxy_url);
+ gv->UserConfig->Write(wxT("pathToTts"), gv->pathToTts);
+ gv->UserConfig->Write(wxT("pathToEnc"), gv->pathToEnc);
delete gv->UserConfig;
diff --git a/rbutil/rbutilFrm.cpp b/rbutil/rbutilFrm.cpp
index 46d9174..8074269 100644
--- a/rbutil/rbutilFrm.cpp
+++ b/rbutil/rbutilFrm.cpp
@@ -49,7 +49,7 @@ BEGIN_EVENT_TABLE(rbutilFrm,wxFrame)
EVT_BUTTON (ID_BOOTLOADER_BTN, rbutilFrm::OnBootloaderBtn)
EVT_BUTTON (ID_BOOTLOADERREMOVE_BTN, rbutilFrm::OnBootloaderRemoveBtn)
EVT_BUTTON (ID_DOOM_BTN, rbutilFrm::OnDoomBtn)
-
+ EVT_BUTTON (ID_TALK_BTN, rbutilFrm::OnTalkBtn)
EVT_CLOSE(rbutilFrm::rbutilFrmClose)
EVT_MENU(ID_FILE_EXIT, rbutilFrm::OnFileExit)
@@ -207,7 +207,6 @@ void rbutilFrm::CreateGUIControls(void)
WxFlexGridSizer2->Add(WxStaticText6, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
-
wxBitmap DoomInstallButton (wxGetBitmapFromMemory(doom_btn_png,doom_btn_png_length));
WxBitmapButton6 = new wxBitmapButton(themepage, ID_DOOM_BTN,
DoomInstallButton, wxPoint(0,0), wxSize(64,54),
@@ -221,6 +220,21 @@ void rbutilFrm::CreateGUIControls(void)
WxFlexGridSizer2->Add(WxStaticText7, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
+ wxBitmap TalkInstallButton (wxGetBitmapFromMemory(doom_btn_png,doom_btn_png_length));
+ WxBitmapButton7 = new wxBitmapButton(themepage, ID_TALK_BTN,
+ TalkInstallButton, wxPoint(0,0), wxSize(64,54),
+ wxRAISED_BORDER | wxBU_AUTODRAW,wxDefaultValidator, wxT("Create Talk Files"));
+ WxBitmapButton7->SetToolTip(wxT("Click here to create Talk files."));
+ WxFlexGridSizer2->Add(WxBitmapButton7, 0,
+ wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
+
+ wxStaticText* WxStaticText8 = new wxStaticText(themepage, wxID_ANY,
+ wxT("Create Talk Files.\n\n"));
+ WxFlexGridSizer2->Add(WxStaticText8, 0,
+ wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
+
+
+
/*********************+
Uninstall Page
***********************/
@@ -1007,6 +1021,34 @@ void rbutilFrm::OnPortableInstall(wxCommandEvent& event)
wxLogVerbose(wxT("=== end rbutilFrm::OnUnstallPortable"));
}
+void rbutilFrm::OnTalkBtn(wxCommandEvent& event)
+{
+ wxLogVerbose(wxT("=== begin rbutilFrm::OnTalkBtn(event)"));
+
+ TalkFileCreator talk;
+
+ talkInstallDlg dialog(&talk,NULL,wxID_ANY);
+
+ if (dialog.ShowModal() != wxID_OK)
+ return;
+
+ // really install ?
+ wxMessageDialog msg(this,wxT("Do you really want to create Talkfiles ?"),wxT("Talk file creation"),wxOK|wxCANCEL);
+ if(msg.ShowModal() != wxID_OK )
+ return;
+
+ if(talk.createTalkFiles())
+ {
+ MESG_DIALOG(wxT("Talk files have been successfully created."));
+ }
+ else
+ {
+ ERR_DIALOG(wxT("Talkfile creation failed"), wxT("Talk file creation"));
+ }
+
+ wxLogVerbose(wxT("=== end rbutilFrm::OnTalkBtn"));
+}
+
int rbutilFrm::GetDeviceId()
{
int index = gv->plat_id.Index(gv->curplat);
diff --git a/rbutil/rbutilFrm.h b/rbutil/rbutilFrm.h
index 64afe97..63e1ee3 100644
--- a/rbutil/rbutilFrm.h
+++ b/rbutil/rbutilFrm.h
@@ -44,7 +44,6 @@
#include "rbutilCtrls.h"
-
class rbutilFrm : public wxFrame
{
private:
@@ -72,6 +71,7 @@ public:
wxBitmapButton *WxBitmapButton4;
wxBitmapButton *WxBitmapButton5;
wxBitmapButton *WxBitmapButton6;
+ wxBitmapButton *WxBitmapButton7;
wxFlexGridSizer *WxFlexGridSizer1;
wxStaticBoxSizer *WxStaticBoxSizer3;
wxStaticBitmap *WxStaticBitmap1;
@@ -96,6 +96,7 @@ public:
ID_FONT_BTN = 1128,
ID_THEMES_BTN = 1139,
ID_DOOM_BTN = 1140,
+ ID_TALK_BTN = 1141,
ID_BOOTLOADER_BTN = 1129,
ID_WXPANEL1 = 1064,
@@ -121,6 +122,7 @@ public:
void OnManualUpdate(wxUpdateUIEvent& event);
void OnFileProxy(wxCommandEvent& event);
void OnDoomBtn(wxCommandEvent& event);
+ void OnTalkBtn(wxCommandEvent& event);
int GetDeviceId();