Index: rbutil/rbutil.ini
===================================================================
--- rbutil/rbutil.ini	(revision 13019)
+++ rbutil/rbutil.ini	(working copy)
@@ -43,8 +43,6 @@
 needsbootloader=no
 bootloadermethod=
 bootloadername=
-autodetect=no
-combinedname=
 resolution=11x2x1
 
 [recorder]
@@ -54,8 +52,6 @@
 needsbootloader=no
 bootloadermethod=
 bootloadername=
-autodetect=no
-combinedname=
 resolution=112x64x1
 
 [recorder8mb]
@@ -65,8 +61,6 @@
 needsbootloader=no
 bootloadermethod=
 bootloadername=
-autodetect=no
-combinedname=
 resolution=112x64x1
 
 [recorderv2]
@@ -76,8 +70,6 @@
 needsbootloader=no
 bootloadermethod=
 bootloadername=
-autodetect=no
-combinedname=
 resolution=112x64x1
 
 [fmrecorder]
@@ -87,8 +79,6 @@
 needsbootloader=no
 bootloadermethod=
 bootloadername=
-autodetect=no
-combinedname=
 resolution=112x64x1
 
 [fmrecorder8mb]
@@ -98,8 +88,6 @@
 needsbootloader=no
 bootloadermethod=
 bootloadername=
-autodetect=no
-combinedname=
 resolution=112x64x1
 
 [ondiosp]
@@ -109,8 +97,6 @@
 needsbootloader=no
 bootloadermethod=
 bootloadername=
-autodetect=no
-combinedname=
 resolution=112x64x1
 
 [ondiofm]
@@ -120,8 +106,6 @@
 needsbootloader=no
 bootloadermethod=
 bootloadername=
-autodetect=no
-combinedname=
 resolution=112x64x1
 
 [h100]
@@ -131,8 +115,6 @@
 needsbootloader=yes
 bootloadermethod=fwpatcher
 bootloadername=bootloader-h100.bin
-autodetect=no
-combinedname=
 resolution=160x128x2
 
 [h120]
@@ -142,8 +124,6 @@
 needsbootloader=yes
 bootloadermethod=fwpatcher
 bootloadername=bootloader-h120.bin
-autodetect=no
-combinedname=
 resolution=160x128x2
 
 [h300]
@@ -153,8 +133,6 @@
 needsbootloader=yes
 bootloadermethod=fwpatcher
 bootloadername=bootloader-h300.bin
-autodetect=no
-combinedname=
 resolution=220x176x16
 
 [h10_5gbums]
@@ -164,8 +142,6 @@
 needsbootloader=yes
 bootloadermethod=h10
 bootloadername=H10.mi4
-autodetect=no
-combinedname=
 resolution=128x128x16
 
 [h10_5gbmtp]
@@ -175,8 +151,6 @@
 needsbootloader=yes
 bootloadermethod=h10
 bootloadername=H10_5GB-MTP/H10.mi4
-autodetect=no
-combinedname=
 resolution=128x128x16
 
 [h10]
@@ -186,8 +160,6 @@
 needsbootloader=yes
 bootloadermethod=h10
 bootloadername=H10_20GC.mi4
-autodetect=no
-combinedname=
 resolution=160x128x16
 
 [ipodcolor]
@@ -196,9 +168,7 @@
 released=no
 needsbootloader=yes
 bootloadermethod=ipodpatcher
-bootloadername=none
-autodetect=yes
-combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
+bootloadername=ipodcolor
 resolution=220x176x16
 
 [ipodnano]
@@ -207,9 +177,7 @@
 released=no
 needsbootloader=yes
 bootloadermethod=ipodpatcher
-bootloadername=none
-autodetect=yes
-combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
+bootloadername=ipodnano
 resolution=176x132x16
 
 [ipod4gray]
@@ -218,9 +186,7 @@
 released=no
 needsbootloader=yes
 bootloadermethod=ipodpatcher
-bootloadername=none
-autodetect=yes
-combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
+bootloadername=ipod4g
 resolution=160x128x2
 
 [ipodvideo]
@@ -229,9 +195,7 @@
 released=no
 needsbootloader=yes
 bootloadermethod=ipodpatcher
-bootloadername=none
-autodetect=yes
-combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
+bootloadername=ipodvideo
 resolution=320x240x16
 
 [ipod3g]
@@ -240,9 +204,7 @@
 released=no
 needsbootloader=yes
 bootloadermethod=ipodpatcher
-bootloadername=none
-autodetect=yes
-combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
+bootloadername=ipod3g
 resolution=160x128x2
 
 [ipodmini1g]
@@ -251,9 +213,7 @@
 released=no
 needsbootloader=yes
 bootloadermethod=ipodpatcher
-bootloadername=none
-autodetect=yes
-combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
+bootloadername=ipodmini
 resolution=138x110x2
 
 [ipodmini2g]
@@ -262,9 +222,7 @@
 released=no
 needsbootloader=yes
 bootloadermethod=ipodpatcher
-bootloadername=none
-autodetect=yes
-combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
+bootloadername=ipodmini2g
 resolution=138x110x2
 
 [iaudiox5]
@@ -274,8 +232,6 @@
 needsbootloader=yes
 bootloadermethod=iaudio
 bootloadername=x5_fw.bin
-autodetect=no
-combinedname=
 resolution=160x128x16
 
 [iaudiox5v]
@@ -285,8 +241,6 @@
 needsbootloader=yes
 bootloadermethod=iaudio
 bootloadername=x5v_fw.bin
-autodetect=no
-combinedname=
 resolution=160x128x2
 
 [iaudiom5]
@@ -296,8 +250,6 @@
 needsbootloader=yes
 bootloadermethod=iaudio
 bootloadername=m5_fw.bin
-autodetect=no
-combinedname=
 resolution=160x128x16
 
 [gigabeatf]
@@ -306,6 +258,4 @@
 needsbootloader=yes
 bootloadermethod=gigabeatf
 bootloadername=FWIMG01.DAT
-autodetect=no
-combinedname=
 resolution=240x320x16
Index: rbutil/rbutil.cpp
===================================================================
--- rbutil/rbutil.cpp	(revision 13019)
+++ rbutil/rbutil.cpp	(working copy)
@@ -125,9 +125,10 @@
                 buf, 100, NULL, wxPD_APP_MODAL |
                 wxPD_AUTO_HIDE | wxPD_SMOOTH | wxPD_ELAPSED_TIME |
                 wxPD_REMAINING_TIME | wxPD_CAN_ABORT);
+    progress->SetSize(500,200);
     progress->Update(0);
-    progress->SetSize(500,200);
 
+
     input = true;
     wxURL* in_http = new wxURL(src);
     if (in_http->GetError() == wxURL_NOERR)
@@ -750,3 +751,4 @@
     return rc ? true : false;
 }
 
+
Index: rbutil/install_dialogs.cpp
===================================================================
--- rbutil/install_dialogs.cpp	(revision 0)
+++ rbutil/install_dialogs.cpp	(revision 0)
@@ -0,0 +1,815 @@
+
+#include "install_dialogs.h"
+#include "wizard.xpm"
+
+
+
+////////////////////////////////////////////////
+//// Bootloader Installation
+/////////////////////////////////////////////////
+
+IMPLEMENT_CLASS( bootloaderInstallDlg, wxDialog )
+
+BEGIN_EVENT_TABLE( bootloaderInstallDlg, wxDialog )
+      EVT_UPDATE_UI( ID_DEVICEPOS, bootloaderInstallDlg::OnDevicePosUpdate)
+      EVT_UPDATE_UI( ID_FIRMWARE, bootloaderInstallDlg::OnFirmwarePosUpdate)
+END_EVENT_TABLE()
+
+bootloaderInstallDlg::bootloaderInstallDlg( )
+{
+    Init();
+}
+
+bootloaderInstallDlg::bootloaderInstallDlg( wxWindow* parent,
+    wxWindowID id, const wxString& caption,
+    const wxPoint& pos, const wxSize& size, long style )
+{
+    Init();
+    Create(parent, id, caption, pos, size, style);
+}
+
+void bootloaderInstallDlg::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);
+
+    m_deviceselector = new DeviceSelectorCtrl(this,ID_DEVICE,true);
+    wxBoxSizer3->Add(m_deviceselector, 0, wxALIGN_LEFT|wxALL, 5);
+
+    m_devicepos = new DevicePositionCtrl(this,ID_DEVICEPOS);
+    wxBoxSizer3->Add(m_devicepos, 0, wxALIGN_LEFT|wxALL, 5);
+
+    m_firmwarepos = new FirmwarePositionCtrl(this,ID_FIRMWARE);
+    wxBoxSizer3->Add(m_firmwarepos, 0, wxALIGN_LEFT|wxALL, 5);
+
+    OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
+    topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+
+}
+
+//init the local variables
+void bootloaderInstallDlg::Init()
+{
+
+}
+
+// create the window
+bool bootloaderInstallDlg::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 bootloaderInstallDlg::OnDevicePosUpdate( wxUpdateUIEvent& event )
+{
+    int index = gv->plat_id.Index( m_deviceselector->getDevice());
+    if(index == -1) return;
+
+    if(gv->plat_bootloadermethod[index] != "ipodpatcher" && gv->plat_bootloadermethod[index] != "sansapatcher")
+    {
+        event.Enable(true);
+    }else
+    {
+        event.Enable(false);
+    }
+
+}
+
+void bootloaderInstallDlg::OnFirmwarePosUpdate( wxUpdateUIEvent& event )
+{
+    int index = gv->plat_id.Index( m_deviceselector->getDevice());
+    if(index == -1) return;
+
+    if(gv->plat_bootloadermethod[index] == "fwpatcher")
+    {
+        event.Enable(true);
+    }else
+    {
+        event.Enable(false);
+    }
+}
+
+// tranver data from the controls
+bool bootloaderInstallDlg::TransferDataFromWindow()
+{
+
+    gv->curplat = m_deviceselector->getDevice();
+    gv->curplatnum = gv->plat_id.Index(gv->curplat);
+
+
+    if(gv->curplat == wxT(""))
+    {
+        WARN_DIALOG(wxT("You have not selected a audio device"),
+                wxT("Select a Device"));
+        return false;
+    }
+
+    if( m_devicepos->IsEnabled())
+    {
+        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;
+        }
+    }
+
+
+    if(m_firmwarepos->IsEnabled())
+    {
+       gv->curfirmware = m_firmwarepos->getFirmwarePos();
+        if(!wxFileExists(gv->curfirmware))
+        {
+            WARN_DIALOG(wxT("The Firmware position is not valid"),
+                wxT("Select a original Firmware"));
+            gv->curfirmware = wxT("");
+            return false;
+        }
+    }
+    return true;
+}
+
+// tranver data to the controls
+bool bootloaderInstallDlg::TransferDataToWindow()
+{
+    m_deviceselector->setDefault();
+    m_devicepos->setDefault();
+    m_firmwarepos->setDefault();
+    return true;
+}
+
+////////////////////////////////////////////////
+//// Bootloader Deinstallation
+/////////////////////////////////////////////////
+
+IMPLEMENT_CLASS( bootloaderDeInstallDlg, wxDialog )
+
+BEGIN_EVENT_TABLE( bootloaderDeInstallDlg, wxDialog )
+
+END_EVENT_TABLE()
+
+bootloaderDeInstallDlg::bootloaderDeInstallDlg( )
+{
+    Init();
+}
+
+bootloaderDeInstallDlg::bootloaderDeInstallDlg( wxWindow* parent,
+    wxWindowID id, const wxString& caption,
+    const wxPoint& pos, const wxSize& size, long style )
+{
+    Init();
+    Create(parent, id, caption, pos, size, style);
+}
+
+void bootloaderDeInstallDlg::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);
+
+    m_deviceselector = new DeviceSelectorCtrl(this,ID_DEVICE,true);
+    wxBoxSizer3->Add(m_deviceselector, 0, wxALIGN_LEFT|wxALL, 5);
+
+ // controls at the bottom
+    OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
+    topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+
+
+}
+
+//init the local variables
+void bootloaderDeInstallDlg::Init()
+{
+
+}
+
+// create the window
+bool bootloaderDeInstallDlg::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;
+}
+
+// tranver data from the controls
+bool bootloaderDeInstallDlg::TransferDataFromWindow()
+{
+
+    gv->curplat = m_deviceselector->getDevice();
+    gv->curplatnum = gv->plat_id.Index(gv->curplat);
+    if(gv->curplat == wxT(""))
+    {
+        WARN_DIALOG(wxT("You have not selected a audio device"),
+                wxT("Select a Device"));
+        return false;
+    }
+
+    return true;
+}
+
+// tranver data to the controls
+bool bootloaderDeInstallDlg::TransferDataToWindow()
+{
+    m_deviceselector->setDefault();
+    return true;
+}
+
+////////////////////////////////////////////////
+//// Font Installation
+/////////////////////////////////////////////////
+
+
+IMPLEMENT_CLASS( fontInstallDlg, wxDialog )
+
+BEGIN_EVENT_TABLE( fontInstallDlg, wxDialog )
+
+END_EVENT_TABLE()
+
+fontInstallDlg::fontInstallDlg( )
+{
+    Init();
+}
+
+fontInstallDlg::fontInstallDlg( wxWindow* parent,
+    wxWindowID id, const wxString& caption,
+    const wxPoint& pos, const wxSize& size, long style )
+{
+    Init();
+    Create(parent, id, caption, pos, size, style);
+}
+
+void fontInstallDlg::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);
+
+    m_devicepos = new DevicePositionCtrl(this,ID_DEVICEPOS);
+    wxBoxSizer3->Add(m_devicepos, 0, wxALIGN_LEFT|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 fontInstallDlg::Init()
+{
+
+}
+
+// create the window
+bool fontInstallDlg::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;
+}
+
+
+// tranver data from the controls
+bool fontInstallDlg::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;
+    }
+
+    return true;
+}
+
+// tranver data to the controls
+bool fontInstallDlg::TransferDataToWindow()
+{
+   m_devicepos->setDefault();
+   return true;
+}
+
+////////////////////////////////////////////////
+//// Rockbox DeInstallation
+/////////////////////////////////////////////////
+
+IMPLEMENT_CLASS( rockboxDeInstallDlg, wxDialog )
+
+BEGIN_EVENT_TABLE( rockboxDeInstallDlg, wxDialog )
+
+END_EVENT_TABLE()
+
+rockboxDeInstallDlg::rockboxDeInstallDlg( )
+{
+    Init();
+}
+
+rockboxDeInstallDlg::rockboxDeInstallDlg( wxWindow* parent,
+    wxWindowID id, const wxString& caption,
+    const wxPoint& pos, const wxSize& size, long style )
+{
+    Init();
+    Create(parent, id, caption, pos, size, style);
+}
+
+void rockboxDeInstallDlg::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);
+
+    m_devicepos = new DevicePositionCtrl(this,ID_DEVICEPOS);
+    wxBoxSizer3->Add(m_devicepos, 0, wxALIGN_LEFT|wxALL, 5);
+
+    // Full deinstallation ?
+    wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
+        wxT("Rockbox Utility normally uninstalls Rockbox using an uninstall\n"
+          "file created during installation.  This means that when Rockbox is\n"
+          "uninstalled all your configuration files are preserved.  However,\n"
+          "you can also perform a full uninstall, which will completely\n"
+          "remove all traces of Rockbox from your system, and can be used\n"
+          "even if Rockbox was previously installed manually."));
+    wxBoxSizer3->Add(WxStaticText1,0,wxGROW | wxALL,5);
+
+    wxCheckBox* FullCheckBox = new wxCheckBox(this, ID_FULL_CHCKBX,
+        wxT("Perform a full uninstall"));
+    wxBoxSizer3->Add(FullCheckBox, 0, wxALL, 5);
+
+   // controls at the bottom
+    OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
+    topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+
+}
+
+//init the local variables
+void rockboxDeInstallDlg::Init()
+{
+
+}
+
+// create the window
+bool rockboxDeInstallDlg::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;
+}
+
+
+// tranver data from the controls
+bool rockboxDeInstallDlg::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;
+    }
+
+    wxCheckBox* fullchkbx = (wxCheckBox*) FindWindow(ID_FULL_CHCKBX);
+    gv->curisfull = fullchkbx->IsChecked();
+
+    return true;
+}
+
+// tranver data to the controls
+bool rockboxDeInstallDlg::TransferDataToWindow()
+{
+    m_devicepos->setDefault();
+    return true;
+}
+
+////////////////////////////////////////////////
+//// Themes Installation
+/////////////////////////////////////////////////
+
+IMPLEMENT_CLASS( themesInstallDlg, wxDialog )
+
+BEGIN_EVENT_TABLE( themesInstallDlg, wxDialog )
+   EVT_UPDATE_UI( ID_THEME, themesInstallDlg::OnThemeUpdate)
+END_EVENT_TABLE()
+
+themesInstallDlg::themesInstallDlg( )
+{
+
+}
+
+themesInstallDlg::themesInstallDlg( wxWindow* parent,
+    wxWindowID id, const wxString& caption,
+    const wxPoint& pos, const wxSize& size, long style )
+{
+    Create(parent, id, caption, pos, size, style);
+}
+
+void themesInstallDlg::CreateControls()
+{
+    // A top-level sizer
+    wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(topSizer);
+
+    wxBoxSizer* topHoriSizer = new wxBoxSizer(wxHORIZONTAL);
+    topSizer->Add(topHoriSizer, 0, wxALIGN_LEFT|wxALL, 5);
+
+      // bitmap
+    wxBitmap sidebmp(wizard_xpm);
+
+    ImageCtrl* sideimage = new ImageCtrl(this,wxID_ANY);
+    sideimage->SetBitmap(sidebmp);
+    topHoriSizer->Add(sideimage,0,wxALIGN_LEFT | wxALL,5);
+
+    wxBoxSizer* mainVertiSizer = new wxBoxSizer(wxVERTICAL);
+    topHoriSizer->Add(mainVertiSizer, 0, wxGROW|wxALL, 5);
+
+    m_deviceselector = new DeviceSelectorCtrl(this,ID_DEVICE,false);
+    mainVertiSizer->Add(m_deviceselector, 0, wxALIGN_LEFT|wxALL, 5);
+
+    wxBoxSizer* wxBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
+    mainVertiSizer->Add(wxBoxSizer4, 0, wxGROW|wxALL, 0);
+
+    wxBoxSizer* wxBoxSizer5 = new wxBoxSizer(wxVERTICAL);
+    wxBoxSizer4->Add(wxBoxSizer5, 0, wxGROW|wxALL, 0);
+
+    m_devicepos = new DevicePositionCtrl(this,ID_DEVICEPOS);
+    wxBoxSizer5->Add(m_devicepos, 0, wxALIGN_LEFT|wxALL, 5);
+
+    m_theme = new ThemeCtrl(this,ID_THEME);
+    wxBoxSizer5->Add(m_theme, 0, wxALIGN_LEFT|wxALL, 5);
+
+     // controls at the bottom
+    OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
+    topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+
+
+}
+
+
+// create the window
+bool themesInstallDlg::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;
+}
+
+
+// tranver data from the controls
+bool themesInstallDlg::TransferDataFromWindow()
+{
+    wxString temp = m_deviceselector->getDevice();
+    gv->curplat = temp;
+    gv->curplatnum = gv->plat_id.Index(gv->curplat);
+    if(gv->curplat == wxT(""))
+    {
+        WARN_DIALOG(wxT("You have not selected a audio device"),
+                wxT("Select a Device"));
+        return false;
+    }
+
+    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;
+    }
+
+    gv->themesToInstall.Clear();
+    gv->themesToInstall = m_theme->getThemesToInstall();
+
+    if(gv->themesToInstall.GetCount() == 0)
+    {
+         WARN_DIALOG(wxT("You have not selected a Theme to Install"), wxT("Select a Theme"));
+         return false;
+    }
+
+    return true;
+}
+
+void themesInstallDlg::OnThemeUpdate( wxUpdateUIEvent& event )
+{
+   wxString test =  m_deviceselector->getDevice();
+   m_theme->setDevice(test);
+   this->GetSizer()->Fit(this);
+   this->GetSizer()->SetSizeHints(this);
+   Layout();
+}
+
+// tranver data to the controls
+bool themesInstallDlg::TransferDataToWindow()
+{
+    m_devicepos->setDefault();
+    m_deviceselector->setDefault();
+    m_theme->setDevice(gv->curplat);
+    return true;
+}
+////////////////////////////////////////////////
+//// Rockbox Installation
+/////////////////////////////////////////////////
+
+IMPLEMENT_CLASS( rockboxInstallDlg, wxDialog )
+
+BEGIN_EVENT_TABLE( rockboxInstallDlg, wxDialog )
+    EVT_RADIOBOX(ID_BUILD_BOX, rockboxInstallDlg::OnBuildBox)
+    EVT_UPDATE_UI( ID_BUILD_BOX, rockboxInstallDlg::OnBuildBoxUpdate)
+END_EVENT_TABLE()
+
+rockboxInstallDlg::rockboxInstallDlg( )
+{
+}
+
+rockboxInstallDlg::rockboxInstallDlg( wxWindow* parent,
+    wxWindowID id, const wxString& caption,
+    const wxPoint& pos, const wxSize& size, long style )
+{
+    Create(parent, id, caption, pos, size, style);
+}
+
+void rockboxInstallDlg::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);
+
+    m_deviceselector = new DeviceSelectorCtrl(this,ID_DEVICE,false);
+    wxBoxSizer3->Add(m_deviceselector, 0, wxALIGN_LEFT|wxALL, 5);
+
+    m_devicepos = new DevicePositionCtrl(this,ID_DEVICEPOS);
+    wxBoxSizer3->Add(m_devicepos, 0, wxALIGN_LEFT|wxALL, 5);
+
+    // Build information
+    wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
+    wxT("Please select the Rockbox version you would like "
+        "to install on your audio\ndevice:"));
+    wxBoxSizer3->Add(WxStaticText1,0,wxGROW | wxALL,5);
+
+    wxArrayString array;
+    wxString buf;
+    buf.Printf(wxT("Rockbox stable version (%s)") , gv->last_release.c_str());
+    array.Add(buf);
+    array.Add(wxT("Archived Build"));
+    array.Add(wxT("Current Build "));
+
+    wxRadioBox* BuildRadioBox = new wxRadioBox(this, ID_BUILD_BOX, wxT("Version"),
+        wxDefaultPosition, wxDefaultSize, array, 0, wxRA_SPECIFY_ROWS);
+    wxBoxSizer3->Add(BuildRadioBox, 0, wxGROW | wxALL, 5);
+
+    wxStaticBox* WxStaticBox1 = new wxStaticBox(this, wxID_ANY, wxT("Details:"));
+    wxStaticBoxSizer* WxStaticBoxSizer2 = new wxStaticBoxSizer(WxStaticBox1,
+        wxVERTICAL);
+    wxStaticText* DetailText = new wxStaticText(this, ID_DETAIL_TXT, wxT(""));
+    wxBoxSizer3->Add(WxStaticBoxSizer2, 1, wxGROW | wxALL, 5);
+    WxStaticBoxSizer2->Add(DetailText, 1, wxGROW | wxALL, 5);
+
+    wxStaticText* WxStaticText2 = new wxStaticText(this, wxID_ANY,
+        wxT("Rockbox Utility stores copies of Rockbox it has downloaded on the\n"
+        "local hard disk to save network traffic.  If your local copy is\n"
+        "no longer working, tick this box to download a fresh copy.") );
+    wxBoxSizer3->Add(WxStaticText2, 0 , wxALL, 5);
+
+    wxCheckBox* NoCacheCheckBox = new wxCheckBox(this, ID_NOCACHE_CHCKBX,
+        wxT("Don't use locally cached copies of Rockbox") );
+    wxBoxSizer3->Add(NoCacheCheckBox, 0, wxALL, 5);
+    // controls at the bottom
+    OkCancelCtrl* okCancel = new OkCancelCtrl(this,wxID_ANY);
+    topSizer->Add(okCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+
+}
+
+// create the window
+bool rockboxInstallDlg::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 rockboxInstallDlg::OnBuildBoxUpdate( wxUpdateUIEvent& event )
+ {
+    int index = gv->plat_id.Index( m_deviceselector->getDevice());
+    if(index == -1) return;
+    wxRadioBox* BuildRadioBox = (wxRadioBox*) FindWindow(ID_BUILD_BOX);
+
+    if (gv->plat_released[index] )
+    {
+        BuildRadioBox->Enable(BUILD_RELEASE, true);
+    }
+    else
+    {
+        BuildRadioBox->Enable(BUILD_RELEASE, false);
+    }
+ }
+
+void rockboxInstallDlg::OnBuildBox(wxCommandEvent& event)
+{
+    wxString str;
+    wxRadioBox* BuildRadioBox = (wxRadioBox*) FindWindow(ID_BUILD_BOX);
+    wxCheckBox* NoCacheCheckBox = (wxCheckBox*) FindWindow(ID_NOCACHE_CHCKBX);
+    wxStaticText* DetailText = (wxStaticText*)FindWindow(ID_DETAIL_TXT);
+
+    switch(BuildRadioBox->GetSelection() )
+    {
+         case BUILD_RELEASE:
+            str = _("This is the last released version of Rockbox, and is the\n"
+               "recommended version to install.");
+            NoCacheCheckBox->Enable();
+            break;
+         case BUILD_DAILY:
+            str = _("These are automatically built each day from the current\n"
+                "development source code.  This generally has more features\n"
+                "than the last release but may be much less stable.  Features\n"
+                "may change regularly.");
+            NoCacheCheckBox->Enable();
+            break;
+        case BUILD_BLEEDING:
+            str = _("This is the absolute up to the minute Rockbox built after\n"
+                "the last change was made.\n\n"
+                "Note:  This option will always download a fresh copy from the\n"
+                "web server.\n");
+            NoCacheCheckBox->Enable(false);
+            break;
+        default:
+            break;
+    }
+
+    DetailText->SetLabel(str);
+
+    this->GetSizer()->Layout();
+    this->GetSizer()->Fit(this);
+    this->GetSizer()->SetSizeHints(this);
+    Refresh();
+}
+
+
+// tranver data from the controls
+bool rockboxInstallDlg::TransferDataFromWindow()
+{
+    wxRadioBox* BuildRadioBox = (wxRadioBox*) FindWindow(ID_BUILD_BOX);
+    wxCheckBox* NoCacheCheckBox = (wxCheckBox*) FindWindow(ID_NOCACHE_CHCKBX);
+
+    gv->curplat = m_deviceselector->getDevice();
+    gv->curplatnum = gv->plat_id.Index(gv->curplat);
+    if(gv->curplat == wxT(""))
+    {
+        WARN_DIALOG(wxT("You have not selected a audio device"),
+                wxT("Select a Device"));
+        return false;
+    }
+
+
+    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;
+    }
+
+    gv->curbuild = BuildRadioBox->GetSelection();
+    gv->nocache = (gv->curbuild == BUILD_BLEEDING) ? true :
+                  NoCacheCheckBox->IsChecked();
+
+    return true;
+}
+
+// tranver data to the controls
+bool rockboxInstallDlg::TransferDataToWindow()
+{
+    m_devicepos->setDefault();
+    m_deviceselector->setDefault();
+
+    wxRadioBox* BuildRadioBox = (wxRadioBox*) FindWindow(ID_BUILD_BOX);
+
+    int index =gv->plat_id.Index(m_deviceselector->getDevice());
+    wxCommandEvent updateradiobox(wxEVT_COMMAND_RADIOBOX_SELECTED,
+        ID_BUILD_BOX);
+
+    if (gv->plat_released[index] )
+    {
+        BuildRadioBox->Enable(BUILD_RELEASE, true);
+        BuildRadioBox->SetSelection(BUILD_RELEASE);
+    } else {
+        BuildRadioBox->Enable(BUILD_RELEASE, false);
+        BuildRadioBox->SetSelection(BUILD_DAILY);
+
+    }
+    wxPostEvent(this, updateradiobox);
+    return true;
+}

Property changes on: rbutil/install_dialogs.cpp
___________________________________________________________________
Name: svn:executable
   + *

Index: rbutil/rbutilCtrls.cpp
===================================================================
--- rbutil/rbutilCtrls.cpp	(revision 0)
+++ rbutil/rbutilCtrls.cpp	(revision 0)
@@ -0,0 +1,592 @@
+
+#include "rbutilCtrls.h"
+#include "bootloaders.h"
+
+/////////////////////////////////////////////////////////////
+//// Controls
+////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////
+//// Image Ctrl
+//////////////////////////////////////////////
+
+BEGIN_EVENT_TABLE(ImageCtrl, wxControl)
+    EVT_PAINT(ImageCtrl::OnPaint)
+END_EVENT_TABLE()
+
+IMPLEMENT_DYNAMIC_CLASS(ImageCtrl, wxControl)
+
+bool ImageCtrl::Create(wxWindow* parent, wxWindowID id,
+    const wxPoint& pos, const wxSize& size, long style,
+    const wxValidator& validator)
+{
+    if (!wxControl::Create(parent, id, pos, size, style, validator)) return false;
+
+return true;
+}
+
+void ImageCtrl::OnPaint(wxPaintEvent& event)
+{
+    wxPaintDC dc(this);
+    dc.DrawBitmap(m_bitmap,0,0,false);
+}
+
+void ImageCtrl::SetBitmap(wxBitmap bmp)
+{
+    m_bitmap = bmp;
+    Refresh();
+
+}
+
+wxSize ImageCtrl::DoGetBestSize() const
+{
+    wxSize bestsize;
+    bestsize.x = m_bitmap.GetWidth();
+    bestsize.y = m_bitmap.GetHeight();
+    return bestsize;
+}
+
+
+
+/////////////////////////////////////////////
+//// Theme Control
+//////////////////////////////////////////////
+
+BEGIN_EVENT_TABLE(ThemeCtrl, wxControl)
+    EVT_LISTBOX(ID_THEME_LST, ThemeCtrl::OnThemesLst)
+END_EVENT_TABLE()
+
+IMPLEMENT_DYNAMIC_CLASS(ThemeCtrl, wxControl)
+
+bool ThemeCtrl::Create(wxWindow* parent, wxWindowID id,
+    const wxPoint& pos, const wxSize& size, long style,
+    const wxValidator& validator)
+{
+    if (!wxControl::Create(parent, id, pos, size, style, validator)) return false;
+
+    CreateControls();
+
+    GetSizer()->Fit(this);
+
+    GetSizer()->SetSizeHints(this);
+return true;
+}
+
+void ThemeCtrl::CreateControls()
+{
+    // A top-level sizer
+    wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(topSizer);
+
+    wxBoxSizer* horizontalSizer = new wxBoxSizer(wxHORIZONTAL);
+    topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5);
+
+    //Device Selection
+     wxBoxSizer* wxBoxSizer7 = new wxBoxSizer(wxVERTICAL);
+    horizontalSizer->Add(wxBoxSizer7,0,wxGROW | wxALL,0);
+
+    wxStaticText* m_desc = new wxStaticText( this, wxID_STATIC,
+        wxT("Select one or more Themes to install"), wxDefaultPosition,
+        wxDefaultSize, 0 );
+    wxBoxSizer7->Add(m_desc, 0, wxALIGN_LEFT|wxALL, 5);
+
+    m_themeList = new wxListBox(this,ID_THEME_LST,wxDefaultPosition,
+            wxDefaultSize,0,NULL,wxLB_EXTENDED);
+    wxBoxSizer7->Add(m_themeList, 0, wxALIGN_LEFT|wxALL, 5);
+
+    // Preview Picture
+    wxBoxSizer* wxBoxSizer9 = new wxBoxSizer(wxVERTICAL);
+    horizontalSizer->Add(wxBoxSizer9,0,wxGROW | wxALL,0);
+
+    wxStaticText* preview_desc= new wxStaticText(this,wxID_ANY,wxT("Preview:"));
+    wxBoxSizer9->Add(preview_desc,0,wxGROW | wxALL,5);
+
+    m_PreviewBitmap = new ImageCtrl(this,ID_PREVIEW_BITMAP);
+    wxBoxSizer9->Add(m_PreviewBitmap,0,wxALIGN_LEFT | wxALL,5);
+
+    wxStaticBox* groupbox= new wxStaticBox(this,wxID_ANY,wxT("Selected Theme:"));
+    wxStaticBoxSizer* styleSizer = new wxStaticBoxSizer( groupbox, wxVERTICAL );
+    topSizer->Add(styleSizer,0,wxGROW|wxALL,0);
+
+    // horizontal sizer
+    wxBoxSizer* wxBoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
+    styleSizer->Add(wxBoxSizer8,0,wxGROW | wxALL,0);
+
+    // File size
+    wxStaticText* size_desc= new wxStaticText(this,wxID_ANY,wxT("Filesize:"));
+    wxBoxSizer8->Add(size_desc,0,wxGROW | wxALL,5);
+
+    m_size= new wxStaticText(this,ID_FILESIZE,wxT(""));
+    wxBoxSizer8->Add(m_size,0,wxGROW | wxALL,5);
+
+    // Description
+    wxStaticText* desc_desc= new wxStaticText(this,wxID_ANY,wxT("Description:"));
+    styleSizer->Add(desc_desc,0,wxGROW | wxALL,5);
+
+    m_themedesc= new wxStaticText(this,ID_DESC,wxT(""));
+    styleSizer->Add(m_themedesc,0,wxGROW | wxALL,5);
+
+    topSizer->Fit(this);
+    topSizer->SetSizeHints(this);
+    Layout();
+
+}
+
+void ThemeCtrl::Init()
+{
+    m_Themes.Clear();
+    m_Themes_path.Clear();
+    m_Themes_size.Clear();
+    m_Themes_image.Clear();
+    m_Themes_desc.Clear();
+
+}
+
+void ThemeCtrl::setDevice(wxString device)
+{
+    wxCriticalSectionLocker locker(m_setDeviceSection);
+
+    int index = gv->plat_id.Index(device);
+    if(index  == -1) return;
+
+    if(gv->plat_resolution[index] == m_currentResolution)
+        return;
+    else
+        m_currentResolution = gv->plat_resolution[index];
+
+    // load the themelist
+    Init();
+    m_size->SetLabel(wxT(""));
+    m_themedesc->SetLabel(wxT(""));
+    m_themeList->Clear();
+
+     //get correct Themes list
+    wxString src,dest,err;
+
+    src.Printf(wxT("%srbutil.php?res=%s"),gv->themes_url.c_str(),m_currentResolution.c_str());
+    dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s.list"),
+        gv->stdpaths->GetUserDataDir().c_str(),m_currentResolution.c_str());
+
+    if(DownloadURL(src, dest))
+    {
+        MESG_DIALOG(wxT("Unable to download themes list."));
+        return;
+    }
+
+     //read and parse Themes list
+    wxString themelistraw;
+    wxFFile themefile;
+    if(!themefile.Open(dest))       //open file
+    {
+        MESG_DIALOG(wxT("Unable to open themes list."));
+        return;
+    }
+    if(!themefile.ReadAll(&themelistraw))  //read complete file
+    {
+        MESG_DIALOG(wxT("Unable to read themes list."));
+        return;
+    }
+    wxRegEx reAll(wxT("<body >(.+)</body>"));  //extract body part
+    if(! reAll.Matches(themelistraw))
+    {
+        MESG_DIALOG(wxT("Themes list is in wrong Format."));
+        return;
+    }
+    wxString lines = reAll.GetMatch(themelistraw,1);
+
+    // prepare text
+    lines.Replace(wxT("<br />"),wxT(""),true);   //replace <br /> with nothing
+    lines.Replace(wxT("\n"),wxT(""),true);   //replace \n with nothing
+    lines.Trim(true);                         //strip WS at end
+    lines.Trim(false);                         //strip WS at beginning
+    wxStringTokenizer tkz(lines,wxT("|"));   //tokenize it
+
+    while ( tkz.HasMoreTokens() )           // read all entrys
+    {
+        m_Themes.Add(tkz.GetNextToken());         //Theme name
+        m_Themes_path.Add(tkz.GetNextToken());    //Theme path
+        m_Themes_size.Add(tkz.GetNextToken());    //File size
+        m_Themes_image.Add(tkz.GetNextToken());   //Screenshot
+        m_Themes_desc.Add(tkz.GetNextToken());    //Description
+
+        m_themeList->Append(m_Themes.Last());
+    }
+}
+
+
+void ThemeCtrl::OnThemesLst(wxCommandEvent& event)
+{
+    wxCriticalSectionLocker locker(m_ThemeSelectSection);
+
+    wxArrayInt selected;
+    int numSelected = m_themeList->GetSelections(selected);
+    if(numSelected == 0) return;
+
+    int index = selected[0];
+
+    m_size->SetLabel(m_Themes_size[index]);
+    m_themedesc->SetLabel(m_Themes_desc[index]);
+    m_themedesc->Wrap(200);                       // wrap desc
+
+    wxString src,dest;
+
+    int pos = m_Themes_image[index].Find('/',true);
+    wxString filename = m_Themes_image[index](pos+1,m_Themes_image[index].Length());
+
+    dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
+            gv->stdpaths->GetUserDataDir().c_str(),m_currentResolution.c_str());
+
+    if(!wxDirExists(dest))
+        wxMkdir(dest);
+
+    //this is a URL no PATH_SEP
+    src.Printf(wxT("%s/data/%s/%s"),gv->themes_url.c_str(),m_currentResolution.c_str(),filename.c_str());
+    dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s" PATH_SEP "%s"),
+        gv->stdpaths->GetUserDataDir().c_str(),m_currentResolution.c_str(),filename.c_str());
+
+    if(DownloadURL(src, dest))
+    {
+        MESG_DIALOG(wxT("Unable to download image."));
+        return;
+    }
+
+    m_currentimage = dest;
+    wxBitmap bmp;
+    bmp.LoadFile(m_currentimage,wxBITMAP_TYPE_PNG);
+    m_PreviewBitmap->SetBitmap(bmp);
+
+    this->GetSizer()->Layout();
+    this->GetSizer()->Fit(this);
+    this->GetSizer()->SetSizeHints(this);
+    Refresh();
+
+}
+
+
+ wxArrayString ThemeCtrl::getThemesToInstall()
+ {
+    wxArrayString themes;
+    wxArrayInt selected;
+    int numSelected = m_themeList->GetSelections(selected);
+
+    for(int i=0; i < numSelected; i++)
+    {
+        themes.Add(m_Themes_path[selected[i]]);
+    }
+    return themes;
+
+ }
+
+/////////////////////////////////////////////
+//// Ok Cancel Control
+//////////////////////////////////////////////
+
+BEGIN_EVENT_TABLE(OkCancelCtrl, wxControl)
+
+END_EVENT_TABLE()
+
+IMPLEMENT_DYNAMIC_CLASS(OkCancelCtrl, wxControl)
+
+bool OkCancelCtrl::Create(wxWindow* parent, wxWindowID id,
+    const wxPoint& pos, const wxSize& size, long style,
+    const wxValidator& validator)
+{
+    if (!wxControl::Create(parent, id, pos, size, style, validator)) return false;
+
+    CreateControls();
+    GetSizer()->Fit(this);
+    GetSizer()->SetSizeHints(this);
+return true;
+}
+
+void OkCancelCtrl::CreateControls()
+{
+    // A top-level sizer
+    wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
+    this->SetSizer(topSizer);
+
+    // The OK button
+    m_OkBtn = new wxButton ( this, wxID_OK, wxT("&OK"),
+        wxDefaultPosition, wxDefaultSize, 0 );
+    topSizer->Add(m_OkBtn, 0, wxALL, 5);
+    // The Cancel button
+    m_CancelBtn = new wxButton ( this, wxID_CANCEL,
+        wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
+    topSizer->Add(m_CancelBtn, 0, wxALL, 5);
+
+    Layout();
+
+}
+
+
+/////////////////////////////////////////////
+//// Device Selector
+//////////////////////////////////////////////
+
+BEGIN_EVENT_TABLE(DeviceSelectorCtrl, wxControl)
+    EVT_BUTTON(ID_AUTODETECT_BTN, DeviceSelectorCtrl::OnAutoDetect)
+    EVT_COMBOBOX(ID_DEVICE_CBX,DeviceSelectorCtrl::OnComboBox)
+END_EVENT_TABLE()
+
+IMPLEMENT_DYNAMIC_CLASS(DeviceSelectorCtrl, wxControl)
+
+bool DeviceSelectorCtrl::Create(wxWindow* parent, wxWindowID id,bool bootmode,
+    const wxPoint& pos, const wxSize& size, long style,
+    const wxValidator& validator)
+{
+    if (!wxControl::Create(parent, id, pos, size, style, validator)) return false;
+
+    CreateControls(bootmode);
+    GetSizer()->Fit(this);
+    GetSizer()->SetSizeHints(this);
+return true;
+}
+
+void DeviceSelectorCtrl::CreateControls(bool bootmode)
+{
+    // A top-level sizer
+    wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(topSizer);
+
+    //Device Selection
+    m_desc = new wxStaticText( this, wxID_STATIC,
+        wxT("Select your Device"), wxDefaultPosition,
+        wxDefaultSize, 0 );
+    topSizer->Add(m_desc, 0, wxALIGN_LEFT|wxALL, 5);
+
+    wxBoxSizer* horizontalSizer = new wxBoxSizer(wxHORIZONTAL);
+    topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5);
+
+    if(bootmode)
+    {
+        // create array with all platforms which need a Bootloader
+        wxArrayString bootloaderPlatforms;
+        for (unsigned int i=0; i< gv->plat_name.GetCount(); i++) {
+            if (gv->plat_needsbootloader[i])
+            {
+                bootloaderPlatforms.Add(gv->plat_name[i]);
+            }
+        }
+
+        m_deviceCbx = new wxComboBox(this, ID_DEVICE_CBX,wxT(""),
+            wxDefaultPosition,wxDefaultSize,bootloaderPlatforms,wxCB_READONLY);
+    }
+    else
+    {
+        m_deviceCbx = new wxComboBox(this, ID_DEVICE_CBX,wxT(""),
+            wxDefaultPosition,wxDefaultSize,gv->plat_name,wxCB_READONLY);
+    }
+
+    m_deviceCbx->SetToolTip(wxT("Select your Device."));
+    m_deviceCbx->SetHelpText(wxT("Select your Device."));
+
+    horizontalSizer->Add(m_deviceCbx, 0, wxALIGN_LEFT|wxALL, 5);
+
+    wxButton* m_autodetectBtn = new wxButton(this, ID_AUTODETECT_BTN, wxT("Autodetect"),
+         wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
+         wxT("AutodetectBtn"));
+
+    m_autodetectBtn->SetToolTip(wxT("Autodetection of the Device."));
+    m_autodetectBtn->SetHelpText(wxT("Autodetection of the Device."));
+
+    horizontalSizer->Add(m_autodetectBtn,0,wxGROW | wxALL,5);
+    Layout();
+
+}
+
+wxString DeviceSelectorCtrl::getDevice()
+{
+    return m_currentDevice;
+}
+
+void DeviceSelectorCtrl::setDefault()
+{
+    int index = gv->plat_id.Index(gv->curplat);
+    if(index == -1) return;
+    m_deviceCbx->SetValue(gv->plat_name[index]);
+}
+
+void DeviceSelectorCtrl::OnComboBox(wxCommandEvent& event)
+{
+    int index = gv->plat_name.Index(m_deviceCbx->GetValue());
+    if(index == -1) m_currentDevice = wxT("");
+
+    m_currentDevice = gv->plat_id[index];
+}
+
+void DeviceSelectorCtrl::OnAutoDetect(wxCommandEvent& event)
+{
+    struct ipod_t ipod;
+    int n = ipod_scan(&ipod);
+    if(n == 1)
+    {
+        int index = gv->plat_bootloadername.Index(ipod.targetname);
+        m_deviceCbx->SetValue(gv->plat_name[index]);
+    }
+    else if (n > 1)
+    {
+        WARN_DIALOG(wxT("More then one device Ipod detected, please connect only One"),
+                wxT("Detecting a Device"));
+        return;
+    }
+    else
+    {
+         WARN_DIALOG(wxT("No Device detected. (This function currently only works for Ipods)."),
+                wxT("Detecting a Device"));
+        return;
+    }
+
+}
+
+/////////////////////////////////////////////
+//// DevicePosition Selector
+//////////////////////////////////////////////
+
+BEGIN_EVENT_TABLE(DevicePositionCtrl, wxControl)
+    EVT_BUTTON(ID_BROWSE_BTN, DevicePositionCtrl::OnBrowseBtn)
+END_EVENT_TABLE()
+
+IMPLEMENT_DYNAMIC_CLASS(DevicePositionCtrl, wxControl)
+
+bool DevicePositionCtrl::Create(wxWindow* parent, wxWindowID id,
+    const wxPoint& pos, const wxSize& size, long style,
+    const wxValidator& validator)
+{
+    if (!wxControl::Create(parent, id, pos, size, style, validator)) return false;
+
+    CreateControls();
+    GetSizer()->Fit(this);
+    GetSizer()->SetSizeHints(this);
+return true;
+}
+
+void DevicePositionCtrl::CreateControls()
+{
+    // A top-level sizer
+    wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(topSizer);
+
+    //Device Selection
+    m_desc = new wxStaticText( this, wxID_STATIC,
+        wxT("Select your Device in the Filesystem"), wxDefaultPosition,
+        wxDefaultSize, 0 );
+    topSizer->Add(m_desc, 0, wxALIGN_LEFT|wxALL, 5);
+
+    wxBoxSizer* horizontalSizer = new wxBoxSizer(wxHORIZONTAL);
+    topSizer->Add(horizontalSizer, 0, wxGROW|wxALL, 5);
+
+    m_devicePos = new wxTextCtrl(this,wxID_ANY,gv->curdestdir);
+    m_devicePos->SetToolTip(wxT("Select your Devicefolder"));
+    m_devicePos->SetHelpText(wxT("Select your Devicefolder"));
+    horizontalSizer->Add(m_devicePos,0,wxGROW | wxALL,5);
+
+    m_browseBtn = new wxButton(this, ID_BROWSE_BTN, wxT("Browse"),
+         wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
+         wxT("BrowseBtn"));
+    m_browseBtn->SetToolTip(wxT("Browse for your Device"));
+    m_browseBtn->SetHelpText(wxT("Browse for your Device"));
+    horizontalSizer->Add(m_browseBtn,0,wxGROW | wxALL,5);
+
+    topSizer->Fit(this);
+    Layout();
+
+}
+
+wxString DevicePositionCtrl::getDevicePos()
+{
+    return m_devicePos->GetValue();
+
+}
+
+void DevicePositionCtrl::setDefault()
+{
+    m_devicePos->SetValue(gv->curdestdir);
+}
+
+void DevicePositionCtrl::OnBrowseBtn(wxCommandEvent& event)
+{
+     const wxString& temp = wxDirSelector(
+        wxT("Please select the location of your audio device"), gv->curdestdir);
+
+    if (!temp.empty())
+    {
+        m_devicePos->SetValue(temp);
+    }
+
+}
+
+/////////////////////////////////////////////
+//// FirmwarePosition Selector
+//////////////////////////////////////////////
+
+BEGIN_EVENT_TABLE(FirmwarePositionCtrl, wxControl)
+    EVT_BUTTON(ID_BROWSE_BTN, FirmwarePositionCtrl::OnBrowseBtn)
+END_EVENT_TABLE()
+
+IMPLEMENT_DYNAMIC_CLASS(FirmwarePositionCtrl, wxControl)
+
+bool FirmwarePositionCtrl::Create(wxWindow* parent, wxWindowID id,
+    const wxPoint& pos, const wxSize& size, long style,
+    const wxValidator& validator)
+{
+    if (!wxControl::Create(parent, id, pos, size, style, validator)) return false;
+
+    CreateControls();
+    GetSizer()->Fit(this);
+    GetSizer()->SetSizeHints(this);
+return true;
+}
+
+void FirmwarePositionCtrl::CreateControls()
+{
+    // A top-level sizer
+    wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(topSizer);
+
+    //Device Selection
+    m_desc = new wxStaticText( this, wxID_STATIC,
+        wxT("Select original Firmware form the Manufacturer"), wxDefaultPosition,
+        wxDefaultSize, 0 );
+    topSizer->Add(m_desc, 0, wxALIGN_LEFT|wxALL, 5);
+
+    wxBoxSizer* horizontalSizer = new wxBoxSizer(wxHORIZONTAL);
+    topSizer->Add(horizontalSizer, 0, wxALIGN_LEFT|wxALL, 5);
+
+    m_firmwarePos = new wxTextCtrl(this,wxID_ANY,gv->curdestdir);
+    m_firmwarePos->SetToolTip(wxT("Select the original Firmware"));
+    m_firmwarePos->SetHelpText(wxT("Select the original Firmware"));
+    horizontalSizer->Add(m_firmwarePos,0,wxGROW | wxALL,5);
+
+    m_browseBtn = new wxButton(this, ID_BROWSE_BTN, wxT("Browse"),
+         wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
+         wxT("BrowseBtn"));
+    m_browseBtn->SetToolTip(wxT("Browse for the original Firmware"));
+    m_browseBtn->SetHelpText(wxT("Browse for the original Firmware"));
+    horizontalSizer->Add(m_browseBtn,0,wxGROW | wxALL,5);
+
+    Layout();
+
+}
+
+wxString FirmwarePositionCtrl::getFirmwarePos()
+{
+    return m_firmwarePos->GetValue();
+
+}
+
+void FirmwarePositionCtrl::setDefault()
+{
+    m_firmwarePos->SetValue(gv->curfirmware);
+}
+
+void FirmwarePositionCtrl::OnBrowseBtn(wxCommandEvent& event)
+{
+     wxString temp = wxFileSelector(
+        wxT("Please select the location of the original Firmware"), gv->curdestdir,wxT(""),wxT(""),wxT("*.hex"));
+
+    if (!temp.empty())
+    {
+        m_firmwarePos->SetValue(temp);
+    }
+
+}

Property changes on: rbutil/rbutilCtrls.cpp
___________________________________________________________________
Name: svn:executable
   + *

Index: rbutil/rbutilFrm.h
===================================================================
--- rbutil/rbutilFrm.h	(revision 13019)
+++ rbutil/rbutilFrm.h	(working copy)
@@ -41,8 +41,8 @@
 #include <wx/richtext/richtextctrl.h>
 
 #include "rbutil.h"
-#include "wizard_pages.h"
 
+
 class rbutilFrm : public wxFrame
 {
 private:
Index: rbutil/bootloaders.cpp
===================================================================
--- rbutil/bootloaders.cpp	(revision 13019)
+++ rbutil/bootloaders.cpp	(working copy)
@@ -35,25 +35,10 @@
       else return false;
 }
 // uses ipodpatcher for add and rem of bootloader
-bool ipodpatcher(int mode)
+bool ipodpatcher(int mode,wxString bootloadername)
 {
     wxString src,dest,buf;
 
-    // downloading files
-    if(mode == BOOTLOADER_ADD)
-    {
-        src.Printf(wxT("%s/ipod/%s.ipod"), gv->bootloader_url.c_str(),gv->curbootloader.c_str());
-        dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
-                    gv->stdpaths->GetUserDataDir().c_str(),gv->curbootloader.c_str());
-        if ( DownloadURL(src, dest) )
-        {
-            wxRemoveFile(dest);
-            buf.Printf(wxT("Unable to download %s"), src.c_str() );
-            ERR_DIALOG(buf, wxT("Install"));
-            return false;
-        }
-    }
-
     struct ipod_t ipod;
 
     int n = ipod_scan(&ipod);
@@ -68,6 +53,21 @@
          return false;
     }
 
+     // downloading files
+    if(mode == BOOTLOADER_ADD)
+    {
+        src.Printf(wxT("%s/ipod/%s.ipod"),gv->bootloader_url.c_str(),bootloadername.c_str());
+        dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
+                    gv->stdpaths->GetUserDataDir().c_str(),bootloadername.c_str());
+        if ( DownloadURL(src, dest) )
+        {
+            wxRemoveFile(dest);
+            buf.Printf(wxT("Unable to download %s"), src.c_str() );
+            ERR_DIALOG(buf, wxT("Install"));
+            return false;
+        }
+    }
+
     if (ipod_open(&ipod, 0) < 0)
     {
        ERR_DIALOG(wxT("[ERR] could not open ipod"), wxT("open Ipod"));
@@ -163,20 +163,20 @@
 }
 
 // gigabeatinstallation
-bool gigabeatf(int mode)
+bool gigabeatf(int mode,wxString bootloadername,wxString deviceDir)
 {
    wxString path1,path2;
    wxString err;
    wxString src,dest;
 
-   path1.Printf(wxT("%s" PATH_SEP "GBSYSTEM" PATH_SEP "FWIMG" PATH_SEP "FWIMG01.DAT"),gv->curdestdir.c_str());
+   path1.Printf(wxT("%s" PATH_SEP "GBSYSTEM" PATH_SEP "FWIMG" PATH_SEP "FWIMG01.DAT"),deviceDir.c_str());
 
     if(mode == BOOTLOADER_ADD)
     {
         //Files downloaden
-        src.Printf(wxT("%s/gigabeat/%s"), gv->bootloader_url.c_str(),gv->curbootloader.c_str());
+        src.Printf(wxT("%s/gigabeat/%s"), gv->bootloader_url.c_str(),bootloadername.c_str());
         dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
-                    gv->stdpaths->GetUserDataDir().c_str(),gv->curbootloader.c_str());
+                    gv->stdpaths->GetUserDataDir().c_str(),bootloadername.c_str());
          if( DownloadURL(src, dest) )
          {
               wxRemoveFile(dest);
@@ -233,20 +233,20 @@
 }
 
 // iaudio bootloader install
-bool iaudiox5(int mode)
+bool iaudiox5(int mode,wxString bootloadername,wxString deviceDir)
 {
     wxString path1,path2;
     wxString err;
     wxString src,dest;
 
-    path1.Printf(wxT("%s" PATH_SEP "FIRMWARE" PATH_SEP "%s"),gv->curdestdir.c_str(),gv->curbootloader.c_str());
+    path1.Printf(wxT("%s" PATH_SEP "FIRMWARE" PATH_SEP "%s"),deviceDir.c_str(),bootloadername.c_str());
 
     if(mode == BOOTLOADER_ADD)
     {
         //Files downloaden
-        src.Printf(wxT("%s/iaudio/%s"), gv->bootloader_url.c_str(),gv->curbootloader.c_str());
+        src.Printf(wxT("%s/iaudio/%s"),gv->bootloader_url.c_str(),bootloadername.c_str());
         dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
-                    gv->stdpaths->GetUserDataDir().c_str(),gv->curbootloader.c_str());
+                    gv->stdpaths->GetUserDataDir().c_str(),bootloadername.c_str());
          if( DownloadURL(src, dest) )
          {
               wxRemoveFile(dest);
@@ -270,19 +270,19 @@
 }
 
 // H10 install
-bool h10(int mode)
+bool h10(int mode,wxString bootloadername,wxString deviceDir)
 {
   wxString err,src,dest,path1,path2;
 
-   int pos = gv->curbootloader.Find('/');
+   int pos = bootloadername.Find('/');
    if(pos == wxNOT_FOUND) pos = 0;
-   wxString firmwarename = gv->curbootloader.SubString(pos,gv->curbootloader.Length());
+   wxString firmwarename = bootloadername.SubString(pos,bootloadername.Length());
    //wxString firmDir = gv->curbootloader.SubString(0,pos);
 
   if(mode == BOOTLOADER_ADD)
   {
      //Files downloaden
-     src.Printf(wxT("%s/iriver/%s"), gv->bootloader_url.c_str(),gv->curbootloader.c_str());
+     src.Printf(wxT("%s/iriver/%s"), gv->bootloader_url.c_str(),bootloadername.c_str());
      dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
                   gv->stdpaths->GetUserDataDir().c_str(),firmwarename.c_str());
      if( DownloadURL(src, dest) )
@@ -293,12 +293,12 @@
            return false;
      }
 
-     path1.Printf(wxT("%sSYSTEM" PATH_SEP "%s"),gv->curdestdir.c_str(),firmwarename.c_str());
-     path2.Printf(wxT("%sSYSTEM" PATH_SEP "Original.mi4"),gv->curdestdir.c_str());
+     path1.Printf(wxT("%sSYSTEM" PATH_SEP "%s"),deviceDir.c_str(),firmwarename.c_str());
+     path2.Printf(wxT("%sSYSTEM" PATH_SEP "Original.mi4"),deviceDir.c_str());
 
      if(!wxFileExists(path1))  //Firmware dosent exists on player
      {
-        path1.Printf(wxT("%sSYSTEM" PATH_SEP "H10EMP.mi4"),gv->curdestdir.c_str());   //attempt other firmwarename
+        path1.Printf(wxT("%sSYSTEM" PATH_SEP "H10EMP.mi4"),deviceDir.c_str());   //attempt other firmwarename
         if(!wxFileExists(path1))  //Firmware dosent exists on player
         {
             err.Printf(wxT("[ERR] File %s does not Exist"),path1.c_str());
@@ -328,11 +328,11 @@
   }
   else if(mode == BOOTLOADER_REM)
   {
-     path1.Printf(wxT("%sSYSTEM" PATH_SEP "%s"),gv->curdestdir.c_str(),firmwarename.c_str());
+     path1.Printf(wxT("%sSYSTEM" PATH_SEP "%s"),deviceDir.c_str(),firmwarename.c_str());
      path2.Printf(wxT("%sSYSTEM" PATH_SEP "Original.mi4"),gv->curdestdir.c_str());
      if(!wxFileExists(path1))  //Firmware dosent exists on player
      {
-         path1.Printf(wxT("%s" PATH_SEP "SYSTEM" PATH_SEP "H10EMP.mi4"),gv->curdestdir.c_str());   //attempt other firmwarename
+         path1.Printf(wxT("%s" PATH_SEP "SYSTEM" PATH_SEP "H10EMP.mi4"),deviceDir.c_str());   //attempt other firmwarename
          if(!wxFileExists(path1))  //Firmware dosent exists on player
          {
             err.Printf(wxT("[ERR] File %s does not Exist"),path1.c_str());
@@ -361,7 +361,7 @@
 }
 
 // FWPatcher
-bool fwpatcher(int mode)
+bool fwpatcher(int mode,wxString bootloadername,wxString deviceDir,wxString firmware)
 {
     if(mode == BOOTLOADER_ADD)
     {
@@ -369,7 +369,7 @@
         wxString src,dest,err;
         int series,table_entry;
 
-        if (!FileMD5(gv->curfirmware, md5sum_str)) {
+        if (!FileMD5(firmware, md5sum_str)) {
         ERR_DIALOG(wxT("Could not open firmware"), wxT("Open Firmware"));
         return false;
        }
@@ -402,9 +402,9 @@
                 else
                 {
                     //Download bootloader
-                    src.Printf(wxT("%s/iriver/%s"), gv->bootloader_url.c_str(),gv->curbootloader.c_str());
+                    src.Printf(wxT("%s/iriver/%s"), gv->bootloader_url.c_str(),bootloadername.c_str());
                     dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
-                            gv->stdpaths->GetUserDataDir().c_str(),gv->curbootloader.c_str());
+                            gv->stdpaths->GetUserDataDir().c_str(),bootloadername.c_str());
                     if( DownloadURL(src, dest) )
                     {
                         wxRemoveFile(dest);
@@ -413,7 +413,7 @@
                         return false;
                     }
 
-                    if(!PatchFirmware(gv->curfirmware,dest,series, table_entry))  // Patch firmware
+                    if(!PatchFirmware(firmware,dest,series, table_entry))  // Patch firmware
                     {
                         ERR_DIALOG(wxT("Patching Firmware failed"), wxT("Patching Firmware"));
                         return false;
@@ -425,11 +425,11 @@
                         gv->stdpaths->GetUserDataDir().c_str());
 
                 if(gv->curplat == wxT("h100"))
-                    dest.Printf(wxT("%s" PATH_SEP "ihp_100.hex"),gv->curdestdir.c_str());
+                    dest.Printf(wxT("%s" PATH_SEP "ihp_100.hex"),deviceDir.c_str());
                 else if(gv->curplat == wxT("h120"))
-                    dest.Printf(wxT("%s" PATH_SEP "ihp_120.hex"),gv->curdestdir.c_str());
+                    dest.Printf(wxT("%s" PATH_SEP "ihp_120.hex"),deviceDir.c_str());
                 else if(gv->curplat == wxT("h300"))
-                dest.Printf(wxT("%s" PATH_SEP "H300.hex"),gv->curdestdir.c_str());
+                dest.Printf(wxT("%s" PATH_SEP "H300.hex"),deviceDir.c_str());
 
                 if(!wxRenameFile(src,dest))
                 {
@@ -440,7 +440,6 @@
                 {
                     return true;
                 }
-
          }
 
     }
Index: rbutil/wizard_pages.h
===================================================================
--- rbutil/wizard_pages.h	(revision 13019)
+++ rbutil/wizard_pages.h	(working copy)
@@ -1,241 +0,0 @@
-/***************************************************************************
- *             __________               __   ___.
- *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
- *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
- *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
- *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
- *                     \/            \/     \/    \/            \/
- * Module: rbutil
- * File: wizard_pages.h
- *
- * Copyright (C) 2005 Christi Alice Scarborough
- *
- * All files in this archive are subject to the GNU General Public License.
- * See the file COPYING in the source tree root for full license agreement.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-
-
-#ifndef __wizard_pages_HPP_
-#define __wizard_pages_HPP_
-
-#include "rbutil.h"
-
-
-////// Dialog for Preview of Theme //////////////
-class wxThemeImageDialog : public wxDialog
-{
-private:
-   DECLARE_EVENT_TABLE()
-
-public:
-    wxThemeImageDialog(wxWindow* parent,wxWindowID id,wxString title,wxBitmap bmp);
-    void OnPaint(wxPaintEvent& WXUNUSED(event));
-    void SetImage(wxBitmap bmp);
-    void OnClose(wxCloseEvent& event);
-
-private:
-    wxBitmap m_bitmap;
-};
-
-
-
-class wxThemesPage : public wxWizardPageSimple
-{
-private:
-    DECLARE_EVENT_TABLE()
-
-public:
-    enum {
-         ID_PREVIEW_BTN      = 1000,
-         ID_LISTBOX          = 1001,
-         ID_INSTALLCHECKBOX  = 1002,
-    };
-
-public:
-    wxThemesPage(wxWizard *parent);
-    virtual bool TransferDataFromWindow(void);
-    void OnPageShown(wxWizardEvent& event);
-    void OnPreviewBtn(wxCommandEvent& event);
-    void OnListBox(wxCommandEvent& event);
-    void OnCheckBox(wxCommandEvent& event);
-    void OnWizardPageChanging(wxWizardEvent& event);
-
-public:
-   wxListBox* ThemesListBox;
-   wxButton* m_previewBtn;
-   wxStaticText* m_desc;
-   wxStaticText* m_size;
-   wxCheckBox* m_InstallCheckBox;
-   wxThemeImageDialog* myImageDialog;
-
-   wxArrayString m_Themes;
-   wxArrayString m_Themes_path;
-   wxArrayString m_Themes_image;
-   wxArrayString m_Themes_desc;
-   wxArrayString m_Themes_size;
-   wxArrayInt    m_installTheme;
-
-};
-
-class wxBootPlatformPage : public wxWizardPageSimple
-{
-public:
-    wxBootPlatformPage(wxWizard *parent);
-    virtual bool TransferDataFromWindow(void);
-    virtual wxWizardPage *GetNext() const;
-    void SetNext(wxWizardPage * next) {wxWizardPageSimple::SetNext(next); my_next = next;}
-
-public:
-    wxListBox* BootPlatformListBox;
-    wxWizardPage *my_next;
-};
-
-class wxIpodLocationPage : public wxWizardPageSimple
-{
-private:
-    DECLARE_EVENT_TABLE()
-
-public:
-    enum {
-         ID_IPODLOCATION_BTN      = 1000,
-    };
-public:
-    wxIpodLocationPage(wxWizard* parent);
-   	void OnIpodLocationBtn(wxCommandEvent& event);
-   	void OnWizardPageChanging(wxWizardEvent& event);
-   	virtual wxWizardPage *GetPrev() const;
-    void SetPrev(wxWizardPage * prev) {wxWizardPageSimple::SetPrev(prev); my_prev = prev;}
-
-private:
-    wxStaticText* IpodLocationText;
-    wxStaticText* IpodLocationLabel;
-    wxStaticText* IpodLocationExtraText;
-    wxButton* IpodLocationBtn;
-    wxWizardPage *my_prev;
-};
-
-
-
-class wxBootLocationPage : public wxWizardPageSimple
-{
-private:
-    DECLARE_EVENT_TABLE()
-
-public:
-    enum {
-         ID_BOOTLOCATION_BTN      = 1000,
-    };
-
-public:
-    wxBootLocationPage(wxWizard* parent);
-    virtual bool TransferDataFromWindow(void);
-   	void OnBootLocationBtn(wxCommandEvent& event);
-   	void OnPageShown(wxWizardEvent& event);
-   	void OnWizardPageChanging(wxWizardEvent& event);
-   	virtual wxWizardPage *GetPrev() const;
-   	virtual wxWizardPage *GetNext() const;
-    void SetPrev(wxWizardPage * prev) {wxWizardPageSimple::SetPrev(prev); my_prev = prev;}
-
-private:
-    wxStaticText* BootLocationText;
-    wxStaticText* BootLocationLabel;
-    wxStaticText* BootLocationInfo;
-    wxButton* BootLocationBtn;
-    wxWizardPage *my_prev;
-
-};
-
-class wxFirmwareLocationPage : public wxWizardPageSimple
-{
-  private:
-    DECLARE_EVENT_TABLE()
-
-public:
-    enum {
-         ID_FIRMWARELOCATION_BTN      = 1000,
-    };
-
-public:
-    wxFirmwareLocationPage(wxWizard* parent);
-   	void OnFirmwareFilenameBtn(wxCommandEvent& event);
-   	void OnWizardPageChanging(wxWizardEvent& event);
-
-private:
-    wxStaticText* FirmwareLocationText;
-    wxStaticText* FirmwareLocationFilename;
-    wxButton* FirmwareLocationBtn;
-
-};
-
-
-class wxPlatformPage : public wxWizardPageSimple
-{
-public:
-    wxPlatformPage(wxWizard *parent);
-    virtual bool TransferDataFromWindow(void);
-
-public:
-    wxListBox* PlatformListBox;
-};
-
-class wxLocationPage : public wxWizardPageSimple
-{
-private:
-    DECLARE_EVENT_TABLE()
-
-public:
-    enum {
-         ID_LOCATION_BTN      = 1000,
-    };
-
-public:
-    wxLocationPage(wxWizard* parent);
-    virtual bool TransferDataFromWindow(void);
-    void OnWizardPageChanging(wxWizardEvent& event);
-   	void OnLocationBtn(wxCommandEvent& event);
-   	void OnPageShown(wxWizardEvent& event);
-
-private:
-    wxStaticText* LocationText;
-    wxStaticText* BootLocationInfo;
-     wxStaticText* LocationInfo;
-};
-
-class wxBuildPage : public wxWizardPageSimple
-{
-private:
-    DECLARE_EVENT_TABLE()
-
-public:
-   enum {
-        ID_BUILD_BOX       = 1000,
-   };
-
-public:
-    wxBuildPage(wxWizard *parent);
-    virtual bool TransferDataFromWindow(void);
-    void OnBuildBox(wxCommandEvent& event);
-    void OnPageShown(wxWizardEvent& event);
-
-private:
-    wxRadioBox* BuildRadioBox;
-    wxStaticText* DetailText;
-    wxCheckBox* NoCacheCheckBox;
-};
-
-class wxFullUninstallPage : public wxWizardPageSimple
-{
-public:
-    wxFullUninstallPage(wxWizard *parent);
-    virtual bool TransferDataFromWindow(void);
-
-private:
-    wxCheckBox* FullCheckBox;
-};
-
-
-#endif
Index: rbutil/Makefile
===================================================================
--- rbutil/Makefile	(revision 13019)
+++ rbutil/Makefile	(working copy)
@@ -12,7 +12,7 @@
 CXX=$(shell $(PREFIX)wx-config --cxx)
 INC =
 CFLAGS = -Wall -Wundef
-OBJS=rbutil.o rbutilApp.o rbutilFrm.o wizard_pages.o bootloaders.o installlog.o ipodpatcher/ipodpatcher.o ipodpatcher/ipodio-posix.o irivertools.o md5sum.o
+OBJS=rbutil.o rbutilApp.o rbutilFrm.o rbutilCtrls.o install_dialogs.o bootloaders.o installlog.o ipodpatcher/ipodpatcher.o ipodpatcher/ipodio-posix.o irivertools.o md5sum.o
 
 # Install into /usr/local by default
 ifndef DESTDIR
Index: rbutil/rbutilApp.cpp
===================================================================
--- rbutil/rbutilApp.cpp	(revision 13019)
+++ rbutil/rbutilApp.cpp	(working copy)
@@ -171,12 +171,6 @@
         gv->GlobalConfig->Read(buf.Format(wxT("/%s/bootloadername"),
             cur.c_str()), &tmpstr);
         gv->plat_bootloadername.Add(tmpstr);
-        gv->GlobalConfig->Read(buf.Format(wxT("/%s/autodetect"),
-            cur.c_str()), &tmpstr);
-        gv->plat_autodetect.Add( (tmpstr == wxT("yes")) ? true : false ) ;
-        gv->GlobalConfig->Read(buf.Format(wxT("/%s/combinedname"),
-            cur.c_str()), &tmpstr);
-        gv->plat_combinedname.Add(tmpstr);
         gv->GlobalConfig->Read(buf.Format(wxT("/%s/resolution"),
             cur.c_str()), &tmpstr);
         gv->plat_resolution.Add(tmpstr);
@@ -255,6 +249,7 @@
     gv->UserConfig->SetPath(wxT("/defaults"));
     if (gv->UserConfig->Read(wxT("curdestdir"), &str) ) gv->curdestdir = str;
     if (gv->UserConfig->Read(wxT("curplatform"), &str) ) gv->curplat = str;
+    if (gv->UserConfig->Read(wxT("curfirmware"), &str) ) gv->curfirmware = str;
     gv->UserConfig->SetPath(stack);
 }
 
@@ -263,6 +258,7 @@
     gv->UserConfig->SetPath(wxT("/defaults"));
     gv->UserConfig->Write(wxT("curdestdir"), gv->curdestdir);
     gv->UserConfig->Write(wxT("curplatform"), gv->curplat);
+     gv->UserConfig->Write(wxT("curfirmware"), gv->curfirmware);
 
     delete gv->UserConfig;
 
Index: rbutil/rbutilFrm.cpp
===================================================================
--- rbutil/rbutilFrm.cpp	(revision 13019)
+++ rbutil/rbutilFrm.cpp	(working copy)
@@ -31,6 +31,7 @@
 #include "themes_3d.xpm"
 
 #include "bootloaders.h"
+#include "install_dialogs.h"
 
 #include "wizard.xpm"
 
@@ -79,11 +80,10 @@
 	WxPanel1->SetSizer(WxBoxSizer2);
 	WxPanel1->SetAutoLayout(TRUE);
 
-	wxBitmap WxStaticBitmap1_BITMAP(rblogo_xpm);
-	WxStaticBitmap1 = new wxStaticBitmap(WxPanel1, ID_WXSTATICBITMAP1,
-        WxStaticBitmap1_BITMAP, wxPoint(0,0), wxSize(400,123));
-	WxStaticBitmap1->Enable(false);
-	WxBoxSizer2->Add(WxStaticBitmap1,0,wxALIGN_CENTER_HORIZONTAL | wxALL,5);
+    wxBitmap rockboxbmp(rblogo_xpm);
+    ImageCtrl* rockboxbmpCtrl = new ImageCtrl(this,wxID_ANY);
+    rockboxbmpCtrl->SetBitmap(rockboxbmp);
+    WxBoxSizer2->Add(rockboxbmpCtrl,0,wxALIGN_CENTER_HORIZONTAL | wxALL,5);
 
 	wxStaticBox* WxStaticBoxSizer3_StaticBoxObj = new wxStaticBox(WxPanel1,
         wxID_ANY, wxT("Please choose an option"));
@@ -299,94 +299,64 @@
 {
     wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderRemoveBtn(event)"));
 
-    wxWizard *wizard = new wxWizard(this, wxID_ANY,
-                    wxT("Rockbox Bootloader Uninstallation Wizard"),
-                    wxBitmap(wizard_xpm),
-                    wxDefaultPosition,
-                    wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
-    wxBootPlatformPage* page1 = new wxBootPlatformPage(wizard);
-    wxBootLocationPage* page2 = new wxBootLocationPage(wizard);  //  Only one of these pages are shown
-    wxIpodLocationPage* page3 = new wxIpodLocationPage(wizard);  //  depending on Device selected
+    bootloaderDeInstallDlg dialog(NULL, wxID_ANY,
+        wxT("Bootloader Installation"));
 
-    page1->SetNext(page2);
-    page2->SetPrev(page1);
-    page2->SetNext(page3);
-    page3->SetPrev(page2);
-
-    wizard->GetPageAreaSizer()->Add(page1);
-
-
-    if (wizard->RunWizard(page1) )
+    if (dialog.ShowModal() == wxID_OK)
     {
-        // uninstall the bootloader
-        if(gv->curbootloadermethod == wxT("ipodpatcher"))
-        {
+        int index = gv->curplatnum;
+        wxString bootloadermethod = gv->plat_bootloadermethod[index];
 
-            if(ipodpatcher(BOOTLOADER_REM))
+        if(bootloadermethod == wxT("ipodpatcher"))
+        {
+            wxString bootloadername = wxT("bootloader-");
+            bootloadername.Append(gv->plat_bootloadername[index] );
+            if(ipodpatcher(BOOTLOADER_REM,bootloadername))
             {
-                wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been uninstalled.")
-                            ,wxT("Uninstallation"), wxOK |wxICON_INFORMATION);
-                msg->ShowModal();
-                delete msg;
+                MESG_DIALOG(wxT("The Bootloader has been uninstalled.") );
             }
             else
             {
-                MESG_DIALOG(wxT("The Uninstallation has failed.") );
+                MESG_DIALOG(wxT("The Uninstallation failed.") );
             }
         }
-        else if(gv->curbootloadermethod == wxT("gigabeatf"))
+        else if(bootloadermethod== wxT("gigabeatf"))
         {
 
-            if(gigabeatf(BOOTLOADER_REM))
+            if(gigabeatf(BOOTLOADER_REM,gv->plat_bootloadername[index],gv->curdestdir))
             {
-                wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been uninstalled.")
-                            ,wxT("Uninstallation"), wxOK |wxICON_INFORMATION);
-                msg->ShowModal();
-                delete msg;
+               MESG_DIALOG(wxT("The Bootloader has been uninstalled."));
             }
             else
-                MESG_DIALOG(wxT("The Uninstallation has failed.") );
+                MESG_DIALOG(wxT("The Uninstallation failed.") );
         }
-        else if(gv->curbootloadermethod == wxT("h10"))
+        else if(bootloadermethod == wxT("iaudio") )
         {
-            if(h10(BOOTLOADER_REM))
-            {
-                wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been uninstalled.")
-                            ,wxT("Uninstallation"), wxOK |wxICON_INFORMATION);
-                msg->ShowModal();
-                delete msg;
-            }
-            else
-               MESG_DIALOG(wxT("The Uninstallation has failed.") );
-
+           MESG_DIALOG(wxT("To uninstall the Bootloader on this Device,\n"
+                    "you need to download and install an Original Firmware from the Manufacturer."));
         }
-        else if(gv->curbootloadermethod == wxT("iaudio") )
+        else if(bootloadermethod == wxT("fwpatcher"))
         {
-           wxMessageDialog* msg = new wxMessageDialog(this, wxT("To uninstall the Bootloader on this Device,\n"
-                    "you need to download and install an Original Firmware from the Manufacturer.")
-                            ,wxT("Uninstallation"), wxOK |wxICON_INFORMATION);
-           msg->ShowModal();
-           delete msg;
+           MESG_DIALOG(wxT("To uninstall the Bootloader on this Device,\n"
+                         "you need to download and install an original Firmware from the Manufacturer.\n"
+                         "To do this, you need to boot into the original Firmware."));
         }
-        else if(gv->curbootloadermethod == wxT("fwpatcher") )
+        else if(bootloadermethod == wxT("h10"))
         {
-           wxMessageDialog* msg = new wxMessageDialog(this, wxT("To uninstall the Bootloader on this Device,\n"
-                         "you need to download and install an original Firmware from the Manufacturer.\n"
-                         "To do this, you need to boot into the original Firmware.")
-                            ,wxT("Uninstallation"), wxOK |wxICON_INFORMATION);
-           msg->ShowModal();
-           delete msg;
+            if(h10(BOOTLOADER_REM,gv->plat_bootloadername[index],gv->curdestdir))
+            {
+               MESG_DIALOG(wxT("The Bootloader has been uninstalled."));
+            }
+            else
+              MESG_DIALOG(wxT("The Uninstallation failed.") );
         }
         else
         {
-           MESG_DIALOG(wxT("Unsupported Bootloader Method") );
+            MESG_DIALOG(wxT("Unsupported Bootloader Uninstall method.") );
         }
     }
-    else
-    {
-        MESG_DIALOG(wxT("The bootloader Uninstallation wizard was cancelled") );
-    }
 
+
     wxLogVerbose(wxT("=== end rbutilFrm::OnBootloaderRemoveBtn"));
 }
 
@@ -394,105 +364,74 @@
 {
     wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderBtn(event)"));
 
-    wxWizard *wizard = new wxWizard(this, wxID_ANY,
-                    wxT("Rockbox Installation Wizard"),
-                    wxBitmap(wizard_xpm),
-                    wxDefaultPosition,
-                    wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
-    wxBootPlatformPage* page1 = new wxBootPlatformPage(wizard);
-    wxFirmwareLocationPage* page2 = new wxFirmwareLocationPage(wizard);   //this page is optional
-    wxBootLocationPage* page3 = new wxBootLocationPage(wizard);  //  Only one of these pages are shown
-    wxIpodLocationPage* page4 = new wxIpodLocationPage(wizard);  //  depending on Device selected
+    bootloaderInstallDlg dialog(NULL, wxID_ANY,
+        wxT("Bootloader Installation"));
 
-    page1->SetNext(page2);
-    page2->SetPrev(page1);
-    page2->SetNext(page3);
-    page3->SetPrev(page2);
-    page3->SetNext(page4);
-    page4->SetPrev(page3);
-
-    wizard->GetPageAreaSizer()->Add(page1);
-
-    if (wizard->RunWizard(page1) )
+    if (dialog.ShowModal() == wxID_OK)
     {
-        // start installation depending on player
-        if(gv->curbootloadermethod == wxT("ipodpatcher"))
-        {
+        int index = gv->curplatnum;
+        wxString bootloadermethod = gv->plat_bootloadermethod[index];
 
-            if(ipodpatcher(BOOTLOADER_ADD))
+        if(bootloadermethod == wxT("ipodpatcher"))
+        {
+            wxString bootloadername = wxT("bootloader-");
+            bootloadername.Append(gv->plat_bootloadername[index] );
+            if(ipodpatcher(BOOTLOADER_ADD,bootloadername))
             {
-               wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been installed on your device.")
-                            ,wxT("Installation"), wxOK |wxICON_INFORMATION);
-               msg->ShowModal();
-               delete msg;
+                MESG_DIALOG(wxT("The Bootloader has been installed on your device.") );
             }
             else
             {
                 MESG_DIALOG(wxT("The installation has failed.") );
             }
         }
-        else if(gv->curbootloadermethod == wxT("gigabeatf"))
+        else if(bootloadermethod== wxT("gigabeatf"))
         {
 
-            if(gigabeatf(BOOTLOADER_ADD))
+            if(gigabeatf(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir))
             {
-               wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been installed on your device.")
-                            ,wxT("Installation"), wxOK |wxICON_INFORMATION);
-               msg->ShowModal();
-               delete msg;
+               MESG_DIALOG(wxT("The Bootloader has been installed on your device."));
             }
             else
                 MESG_DIALOG(wxT("The installation has failed.") );
         }
-        else if(gv->curbootloadermethod == wxT("iaudio") )
+        else if(bootloadermethod == wxT("iaudio") )
         {
-            if(iaudiox5(BOOTLOADER_ADD))
+            if(iaudiox5(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir))
             {
-               wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been installed on your device.\n"
+                MESG_DIALOG(wxT("The Bootloader has been installed on your device.\n"
                              "Now turn OFF your Device, unplug USB,and insert Charger\n"
-                             "Your Device will automatically upgrade the flash with the Rockbox bootloader")
-                            ,wxT("Installation"), wxOK |wxICON_INFORMATION);
-               msg->ShowModal();
-               delete msg;
+                             "Your Device will automatically upgrade the flash with the Rockbox bootloader"));
             }
             else
                 MESG_DIALOG(wxT("The installation has failed.") );
         }
-        else if(gv->curbootloadermethod == wxT("fwpatcher"))
+        else if(bootloadermethod == wxT("fwpatcher"))
         {
-            if(fwpatcher(BOOTLOADER_ADD))
+            if(fwpatcher(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir,gv->curfirmware))
             {
-               wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been patched and copied on your device.\n"
-                             "Now use the Firmware upgrade option of your Device\n")
-                            ,wxT("Installation"), wxOK |wxICON_INFORMATION);
-               msg->ShowModal();
-               delete msg;
+              MESG_DIALOG(wxT("The Bootloader has been patched and copied on your device.\n"
+                             "Now use the Firmware upgrade option of your Device\n"));
             }
             else
                 MESG_DIALOG(wxT("The installation has failed.") );
         }
-        else if(gv->curbootloadermethod == wxT("h10"))
+        else if(bootloadermethod == wxT("h10"))
         {
-            if(h10(BOOTLOADER_ADD))
+            if(h10(BOOTLOADER_ADD,gv->plat_bootloadername[index],gv->curdestdir))
             {
-               wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been patched and copied on your device.\n")
-                            ,wxT("Installation"), wxOK |wxICON_INFORMATION);
-               msg->ShowModal();
-               delete msg;
+               MESG_DIALOG(wxT("The Bootloader has been patched and copied on your device.\n"));
             }
             else
               MESG_DIALOG(wxT("The installation has failed.") );
         }
         else
         {
-           MESG_DIALOG(wxT("Unsupported Bootloader Method") );
+            MESG_DIALOG(wxT("Unsupported Bootloader Install method.") );
         }
     }
-    else
-    {
-        MESG_DIALOG(wxT("The bootloader installation wizard was cancelled") );
-    }
 
+
     wxLogVerbose(wxT("=== end rbutilFrm::OnBootloaderBtn"));
 
 }
@@ -507,22 +446,10 @@
     wxFileConfig* buildinfo;
     wxDateSpan oneday;
 
-    wxWizard *wizard = new wxWizard(this, wxID_ANY,
-                    wxT("Rockbox Installation Wizard"),
-                    wxBitmap(wizard_xpm),
-                    wxDefaultPosition,
-                    wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
-    wxPlatformPage* page1 = new wxPlatformPage(wizard);
-    wxLocationPage* page2 = new wxLocationPage(wizard);
-    wxBuildPage*    page3 = new wxBuildPage(wizard);
-    page1->SetNext(page2);
-    page2->SetPrev(page1);
-    page2->SetNext(page3);
-    page3->SetPrev(page2);
+    rockboxInstallDlg dialog(NULL, wxID_ANY,
+        wxT("Rockbox Installation"));
 
-    wizard->GetPageAreaSizer()->Add(page1);
-
-    if (wizard->RunWizard(page1) )
+    if (dialog.ShowModal() == wxID_OK)
     {
         switch (gv->curbuild)
         {
@@ -613,9 +540,6 @@
             buf.Printf(wxT("Unable to unzip %s"), dest.c_str() );
             ERR_DIALOG(buf, wxT("Install"));
         }
-    } else
-    {
-        MESG_DIALOG(wxT("The installation wizard was cancelled") );
     }
 
     wxLogVerbose(wxT("=== end rbutilFrm::OnInstallBtn"));
@@ -631,17 +555,12 @@
     wxFileConfig* buildinfo;
     wxDateSpan oneday;
 
-    wxWizard *wizard = new wxWizard(this, wxID_ANY,
-                    wxT("Rockbox Font Installation Wizard"),
-                    wxBitmap(wizard_xpm),
-                    wxDefaultPosition,
-                    wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
-    wxLocationPage* page1 = new wxLocationPage(wizard);
+    fontInstallDlg dialog(NULL, wxID_ANY,
+        wxT("Font Installation"));
 
-    wizard->GetPageAreaSizer()->Add(page1);
-
-    if (wizard->RunWizard(page1) )
+    if (dialog.ShowModal() == wxID_OK)
     {
+
         buf.Printf(wxT("%s" PATH_SEP ".rockbox"), gv->curdestdir.c_str()) ;
         if (! wxDirExists(buf) )
         {
@@ -710,11 +629,7 @@
             buf.Printf(wxT("Unable to unzip %s"), dest.c_str() );
             ERR_DIALOG(buf, wxT("Font Install"));
         }
-    } else
-    {
-        MESG_DIALOG(wxT("The font installation wizard was cancelled") );
     }
-
     wxLogVerbose(wxT("=== end rbutilFrm::OnFontBtn"));
 }
 
@@ -722,25 +637,13 @@
 void rbutilFrm::OnThemesBtn(wxCommandEvent& event)
 {
     wxString src, dest, buf;
-    wxTimeSpan day(24);
     wxLogVerbose(wxT("=== begin rbutilFrm::OnThemesBtn(event)"));
 
-    wxWizard *wizard = new wxWizard(this, wxID_ANY,
-                    wxT("Rockbox Themes Installation Wizard"),
-                    wxBitmap(wizard_xpm),
-                    wxDefaultPosition,
-                    wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
-    wxPlatformPage* page1 = new wxPlatformPage(wizard);
-    wxLocationPage* page2 = new wxLocationPage(wizard);
-    wxThemesPage* page3 = new wxThemesPage(wizard);
-    page1->SetNext(page2);
-    page2->SetPrev(page1);
-    page2->SetNext(page3);
-    page3->SetPrev(page2);
 
-    wizard->GetPageAreaSizer()->Add(page1);
+    themesInstallDlg dialog(NULL, wxID_ANY,
+        wxT("Theme Installation"));
 
-    if (wizard->RunWizard(page1) )
+    if (dialog.ShowModal() == wxID_OK)
     {
         bool success=true;
         for(unsigned int i=0 ;i < gv->themesToInstall.GetCount();i++)
@@ -756,35 +659,21 @@
         {
             MESG_DIALOG(wxT("The Theme installation completed successfully.") );
         }
-
-
     }
-    else
-    {
-        MESG_DIALOG(wxT("The Themes installation wizard was cancelled") );
-    }
 
+
      wxLogVerbose(wxT("=== end rbutilFrm::OnThemesBtn(event)"));
 }
 
 
 void rbutilFrm::OnRemoveBtn(wxCommandEvent& event)
 {
-   wxLogVerbose(wxT("=== begin rbutilFrm::OnRemoveBtn(event)"));
+    wxLogVerbose(wxT("=== begin rbutilFrm::OnRemoveBtn(event)"));
 
-   wxWizard *wizard = new wxWizard(this, wxID_ANY,
-                    wxT("Rockbox Uninstallation Wizard"),
-                    wxBitmap(wizard_xpm),
-                    wxDefaultPosition,
-                    wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
-    wxLocationPage* page1 = new wxLocationPage(wizard);
-    wxFullUninstallPage *page2 = new wxFullUninstallPage(wizard);
-    page1->SetNext(page2);
-    page2->SetPrev(page1);
+    rockboxDeInstallDlg dialog(NULL, wxID_ANY,
+        wxT("Rockbox Deinstallation"));
 
-    wizard->GetPageAreaSizer()->Add(page1);
-
-    if (wizard->RunWizard(page1) )
+    if (dialog.ShowModal() == wxID_OK)
     {
         if (Uninstall(gv->curdestdir, gv->curisfull) )
         {
@@ -798,9 +687,6 @@
             msg->ShowModal();
             delete msg;
         }
-    } else
-    {
-        MESG_DIALOG(wxT("The uninstallation wizard was cancelled.") );
     }
 
     wxLogVerbose(wxT("=== end rbutilFrm::OnRemoveBtn"));
@@ -813,30 +699,19 @@
     wxFileSystem fs;
     wxDateSpan oneday;
 
-    wxWizard *wizard = new wxWizard(this, wxID_ANY,
-                    wxT("Rockbox Utility Portable Installation Wizard"),
-                    wxBitmap(wizard_xpm),
-                    wxDefaultPosition,
-                    wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
-    wxLocationPage* page1 = new wxLocationPage(wizard);
+    fontInstallDlg dialog(NULL, wxID_ANY,
+        wxT("Rockbox Utility Portable Installation"));
 
-    wizard->GetPageAreaSizer()->Add(page1);
-
-    if (wizard->RunWizard(page1) )
+    if (dialog.ShowModal() == wxID_OK)
     {
         if ( InstallRbutil(gv->curdestdir) )
         {
-            wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Rockbox Utility has been installed on your device.")
-                            ,wxT("Installation"), wxOK |wxICON_INFORMATION);
-            msg->ShowModal();
-            delete msg;
+            MESG_DIALOG(wxT("The Rockbox Utility has been installed on your device."));
+
         } else
         {
             ERR_DIALOG(wxT("Installation failed"), wxT("Portable Install"));
         }
-    } else
-    {
-        MESG_DIALOG(wxT("The portable installation wizard was cancelled") );
     }
 
     wxLogVerbose(wxT("=== end rbutilFrm::OnUnstallPortable"));
Index: rbutil/rbutil.h
===================================================================
--- rbutil/rbutil.h	(revision 13019)
+++ rbutil/rbutil.h	(working copy)
@@ -51,6 +51,11 @@
 #include <wx/file.h>
 #include <wx/wizard.h>
 #include <wx/event.h>
+#include <wx/statline.h>
+#include <wx/valgen.h>
+#include <wx/thread.h>
+#include <wx/regex.h>
+#include <wx/tokenzr.h>
 
 #ifdef __WXMSW__
 #define PATH_SEP "\\"
@@ -88,8 +93,6 @@
     wxArrayInt              plat_needsbootloader;
     wxArrayString           plat_bootloadermethod;
     wxArrayString           plat_bootloadername;
-    wxArrayInt              plat_autodetect;
-    wxArrayString           plat_combinedname;
     wxArrayString           plat_resolution;
     wxString                download_url;
     wxString                daily_url;
@@ -105,13 +108,11 @@
     wxString                curplat;
     unsigned int            curplatnum;
     wxString                curdestdir;
+    wxString                curfirmware;
     unsigned int            curbuild;
     bool                    curisfull;
     bool                    nocache;
     bool                    portable;
-    wxString                curbootloadermethod;
-    wxString                curbootloader;
-    wxString                curfirmware;
     wxString                curresolution;
     wxArrayString           themesToInstall;
 
@@ -155,4 +156,5 @@
 #define BOOTLOADER_ADD      0
 #define BOOTLOADER_REM      1
 
+
 #endif
Index: rbutil/install_dialogs.h
===================================================================
--- rbutil/install_dialogs.h	(revision 0)
+++ rbutil/install_dialogs.h	(revision 0)
@@ -0,0 +1,247 @@
+#ifndef INSTALL_DIALOGS_H_INCLUDED
+#define INSTALL_DIALOGS_H_INCLUDED
+
+#include "rbutil.h"
+
+#include "rbutilCtrls.h"
+class bootloaderInstallDlg : public wxDialog
+{
+    DECLARE_CLASS( bootloaderInstallDlg )
+    DECLARE_EVENT_TABLE()
+public:
+enum {
+			ID_DEVICE = 1001,
+			ID_DEVICEPOS = 1002,
+			ID_FIRMWARE = 1003,
+     }; //End of Enum
+public:
+	bootloaderInstallDlg( );
+    bootloaderInstallDlg( wxWindow* parent,
+            wxWindowID id = wxID_ANY,
+            const wxString& caption = wxT("Bootloader Installation"),
+            const wxPoint& pos = wxDefaultPosition,
+            const wxSize& size = wxDefaultSize,
+            long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    // Member initialization
+    void Init();
+    //Creation
+    bool Create( wxWindow* parent,
+        wxWindowID id = wxID_ANY,
+        const wxString& caption = wxT("Bootloader Installation"),
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    // Creates the controls and sizers
+    void CreateControls();
+
+    void OnDevicePosUpdate( wxUpdateUIEvent& event );
+    void OnFirmwarePosUpdate( wxUpdateUIEvent& event );
+
+    bool TransferDataFromWindow();
+    bool TransferDataToWindow();
+
+private:
+
+    DeviceSelectorCtrl* m_deviceselector;
+    DevicePositionCtrl* m_devicepos;
+    FirmwarePositionCtrl* m_firmwarepos;
+
+
+};
+
+class bootloaderDeInstallDlg : public wxDialog
+{
+    DECLARE_CLASS( bootloaderDeInstallDlg )
+    DECLARE_EVENT_TABLE()
+public:
+enum {
+			ID_DEVICE = 1001,
+
+     }; //End of Enum
+public:
+	bootloaderDeInstallDlg( );
+    bootloaderDeInstallDlg( wxWindow* parent,
+            wxWindowID id = wxID_ANY,
+            const wxString& caption = wxT("Bootloader Deinstallation"),
+            const wxPoint& pos = wxDefaultPosition,
+            const wxSize& size = wxDefaultSize,
+            long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    /// Member initialization
+    void Init();
+    /// Creation
+    bool Create( wxWindow* parent,
+        wxWindowID id = wxID_ANY,
+        const wxString& caption = wxT("Bootloader Deinstallation"),
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    /// Creates the controls and sizers
+    void CreateControls();
+
+    bool TransferDataFromWindow();
+    bool TransferDataToWindow();
+
+private:
+   DeviceSelectorCtrl* m_deviceselector;
+};
+
+
+class fontInstallDlg : public wxDialog
+{
+    DECLARE_CLASS( fontInstallDlg )
+    DECLARE_EVENT_TABLE()
+public:
+enum {
+			ID_DEVICEPOS = 1002,
+     }; //End of Enum
+public:
+	fontInstallDlg( );
+    fontInstallDlg( wxWindow* parent,
+            wxWindowID id = wxID_ANY,
+            const wxString& caption = wxT("Font Installation"),
+            const wxPoint& pos = wxDefaultPosition,
+            const wxSize& size = wxDefaultSize,
+            long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    /// Member initialization
+    void Init();
+    /// Creation
+    bool Create( wxWindow* parent,
+        wxWindowID id = wxID_ANY,
+        const wxString& caption = wxT("Font Installation"),
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    /// Creates the controls and sizers
+    void CreateControls();
+
+    bool TransferDataFromWindow();
+    bool TransferDataToWindow();
+
+private:
+     DevicePositionCtrl* m_devicepos;
+};
+
+
+class rockboxDeInstallDlg : public wxDialog
+{
+    DECLARE_CLASS( rockboxDeInstallDlg )
+    DECLARE_EVENT_TABLE()
+public:
+enum {
+			ID_DEVICEPOS = 1002,
+			ID_FULL_CHCKBX = 1003,
+     }; //End of Enum
+public:
+	rockboxDeInstallDlg( );
+    rockboxDeInstallDlg( wxWindow* parent,
+            wxWindowID id = wxID_ANY,
+            const wxString& caption = wxT("Rockbox Deinstallation"),
+            const wxPoint& pos = wxDefaultPosition,
+            const wxSize& size = wxDefaultSize,
+            long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    /// Member initialization
+    void Init();
+    /// Creation
+    bool Create( wxWindow* parent,
+        wxWindowID id = wxID_ANY,
+        const wxString& caption = wxT("Rockbox Deinstallation"),
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    /// Creates the controls and sizers
+    void CreateControls();
+
+    bool TransferDataFromWindow();
+    bool TransferDataToWindow();
+
+private:
+    DevicePositionCtrl* m_devicepos;
+};
+
+class themesInstallDlg : public wxDialog
+{
+    DECLARE_CLASS( themesInstallDlg )
+    DECLARE_EVENT_TABLE()
+public:
+enum {
+			ID_DEVICE = 1001,
+			ID_DEVICEPOS = 1002,
+			ID_THEME = 1006,
+     }; //End of Enum
+public:
+	themesInstallDlg( );
+    themesInstallDlg( wxWindow* parent,
+            wxWindowID id = wxID_ANY,
+            const wxString& caption = wxT("Themes Installation"),
+            const wxPoint& pos = wxDefaultPosition,
+            const wxSize& size = wxDefaultSize,
+            long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    // Creation
+    bool Create( wxWindow* parent,
+        wxWindowID id = wxID_ANY,
+        const wxString& caption = wxT("Themes Installation"),
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    // Creates the controls and sizers
+    void CreateControls();
+
+    void OnThemeUpdate( wxUpdateUIEvent& event );
+
+    bool TransferDataFromWindow();
+    bool TransferDataToWindow();
+
+private:
+    wxString currentPreview;
+    DeviceSelectorCtrl* m_deviceselector;
+    DevicePositionCtrl* m_devicepos;
+    ThemeCtrl*  m_theme;
+
+
+
+};
+
+class rockboxInstallDlg : public wxDialog
+{
+    DECLARE_CLASS( rockboxInstallDlg )
+    DECLARE_EVENT_TABLE()
+public:
+enum {
+			ID_DEVICE = 1001,
+			ID_DEVICEPOS = 1002,
+			ID_BUILD_BOX = 1006,
+			ID_DEVICE_POS_CTRL = 1007,
+			ID_DETAIL_TXT = 1008,
+			ID_NOCACHE_CHCKBX =1009,
+
+     }; //End of Enum
+public:
+	rockboxInstallDlg( );
+    rockboxInstallDlg( wxWindow* parent,
+            wxWindowID id = wxID_ANY,
+            const wxString& caption = wxT("Rockbox Installation"),
+            const wxPoint& pos = wxDefaultPosition,
+            const wxSize& size = wxDefaultSize,
+            long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    // Creation
+    bool Create( wxWindow* parent,
+        wxWindowID id = wxID_ANY,
+        const wxString& caption = wxT("Rockbox Installation"),
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU );
+    // Creates the controls and sizers
+    void CreateControls();
+
+    void OnBuildBox(wxCommandEvent& event);
+    void OnBuildBoxUpdate( wxUpdateUIEvent& event );
+
+    bool TransferDataFromWindow();
+    bool TransferDataToWindow();
+
+private:
+    DeviceSelectorCtrl* m_deviceselector;
+    DevicePositionCtrl* m_devicepos;
+};
+
+#endif // INSTALL_DIALOGS_H_INCLUDED

Property changes on: rbutil/install_dialogs.h
___________________________________________________________________
Name: svn:executable
   + *

Index: rbutil/rbutilCtrls.h
===================================================================
--- rbutil/rbutilCtrls.h	(revision 0)
+++ rbutil/rbutilCtrls.h	(revision 0)
@@ -0,0 +1,282 @@
+#ifndef RBUTILCTRLS_H_INCLUDED
+#define RBUTILCTRLS_H_INCLUDED
+
+#include "rbutil.h"
+
+
+class ImageCtrl: public wxControl
+{
+DECLARE_DYNAMIC_CLASS(ImageCtrl)
+DECLARE_EVENT_TABLE()
+
+public:
+    // Constructors
+    ImageCtrl() { }
+    ImageCtrl(wxWindow* parent, wxWindowID id,
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxNO_BORDER,
+        const wxValidator& validator = wxDefaultValidator)
+        {
+            Create(parent, id, pos, size, style, validator);
+        }
+    // Creation
+    bool Create(wxWindow* parent, wxWindowID id,
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxNO_BORDER,
+        const wxValidator& validator = wxDefaultValidator);
+
+    // Event handlers
+    void OnPaint(wxPaintEvent& event);
+
+    wxSize DoGetBestSize() const ;
+
+    void SetBitmap(wxBitmap bmp);
+
+protected:
+    wxBitmap m_bitmap;
+
+};
+
+class ThemeCtrl: public wxControl
+{
+DECLARE_DYNAMIC_CLASS(ThemeCtrl)
+DECLARE_EVENT_TABLE()
+public:
+enum {
+			ID_DESC = 10001,
+			ID_FILESIZE= 10002,
+			ID_INSTALLCHECKBOX= 10003,
+			ID_PREVIEW_BITMAP = 10004,
+			ID_THEME_LST = 10005,
+     }; //End of Enum
+
+public:
+    // Constructors
+    ThemeCtrl() { Init(); }
+    ThemeCtrl(wxWindow* parent, wxWindowID id,
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxNO_BORDER,
+        const wxValidator& validator = wxDefaultValidator)
+        {
+            Init();
+            Create(parent, id, pos, size, style, validator);
+        }
+    // Creation
+    bool Create(wxWindow* parent, wxWindowID id,
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxNO_BORDER,
+        const wxValidator& validator = wxDefaultValidator);
+
+     // Creates the controls and sizers
+   void CreateControls();
+   // Common initialization
+   void Init();
+   // Event handlers
+   void OnThemesLst(wxCommandEvent& event);
+   void OnCheckBox(wxCommandEvent& event);
+
+   void setDevice(wxString device);
+   wxArrayString getThemesToInstall();
+
+protected:
+    wxString m_currentimage;
+    wxString m_currentResolution;
+
+    wxStaticText* m_desc;
+    wxListBox* m_themeList;
+    wxStaticText* m_size;
+    wxStaticText* m_themedesc;
+    ImageCtrl* m_PreviewBitmap;
+
+    wxArrayString m_Themes;
+    wxArrayString m_Themes_path;
+    wxArrayString m_Themes_size;
+    wxArrayString m_Themes_image;
+    wxArrayString m_Themes_desc;
+
+    wxCriticalSection m_setDeviceSection;
+    wxCriticalSection m_ThemeSelectSection;
+
+};
+
+class OkCancelCtrl: public wxControl
+{
+DECLARE_DYNAMIC_CLASS(OkCancelCtrl)
+DECLARE_EVENT_TABLE()
+
+public:
+    // Constructors
+    OkCancelCtrl() { Init(); }
+    OkCancelCtrl(wxWindow* parent, wxWindowID id,
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxNO_BORDER,
+        const wxValidator& validator = wxDefaultValidator)
+        {
+            Init();
+            Create(parent, id, pos, size, style, validator);
+            }
+    // Creation
+    bool Create(wxWindow* parent, wxWindowID id,
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxNO_BORDER,
+        const wxValidator& validator = wxDefaultValidator);
+
+     // Creates the controls and sizers
+   void CreateControls();
+   // Common initialization
+   void Init() { }
+
+protected:
+    wxButton* m_OkBtn;
+    wxButton* m_CancelBtn;
+
+};
+
+class DeviceSelectorCtrl: public wxControl
+{
+DECLARE_DYNAMIC_CLASS(DeviceSelectorCtrl)
+DECLARE_EVENT_TABLE()
+public:
+enum {
+			ID_DEVICE_CBX = 10001,
+			ID_AUTODETECT_BTN= 10002,
+     }; //End of Enum
+
+public:
+    // Constructors
+    DeviceSelectorCtrl() { }
+    DeviceSelectorCtrl(wxWindow* parent, wxWindowID id,bool bootmode,
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxNO_BORDER,
+        const wxValidator& validator = wxDefaultValidator)
+        {
+            Create(parent, id,bootmode, pos, size, style, validator);
+        }
+    // Creation
+    bool Create(wxWindow* parent, wxWindowID id,bool bootmode,
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxNO_BORDER,
+        const wxValidator& validator = wxDefaultValidator);
+
+     // Creates the controls and sizers
+   void CreateControls(bool bootmode);
+   // Event handlers
+   void OnAutoDetect(wxCommandEvent& event);
+   void OnComboBox(wxCommandEvent& event);
+   // Accessors
+   wxString getDevice();
+   void setDefault();
+
+protected:
+    wxString m_currentDevice;
+    wxComboBox* m_deviceCbx;
+    wxStaticText* m_desc;
+    wxButton* m_autodetectBtn;
+
+};
+
+
+class DevicePositionCtrl: public wxControl
+{
+DECLARE_DYNAMIC_CLASS(DevicePositionCtrl)
+DECLARE_EVENT_TABLE()
+public:
+enum {
+			ID_BROWSE_BTN = 10003,
+     }; //End of Enum
+
+public:
+    // Constructors
+    DevicePositionCtrl() { Init(); }
+    DevicePositionCtrl(wxWindow* parent, wxWindowID id,
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxNO_BORDER,
+        const wxValidator& validator = wxDefaultValidator)
+        {
+            Init();
+            Create(parent, id, pos, size, style, validator);
+            }
+    // Creation
+    bool Create(wxWindow* parent, wxWindowID id,
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxNO_BORDER,
+        const wxValidator& validator = wxDefaultValidator);
+
+     // Creates the controls and sizers
+   void CreateControls();
+   // Common initialization
+   void Init() { }
+   // Event handlers
+   void OnBrowseBtn(wxCommandEvent& event);
+   // Accessors
+   wxString getDevicePos();
+
+   void setDefault();
+
+protected:
+    wxTextCtrl* m_devicePos;
+    wxStaticText* m_desc;
+    wxButton* m_browseBtn;
+
+};
+
+
+class FirmwarePositionCtrl: public wxControl
+{
+DECLARE_DYNAMIC_CLASS(FirmwarePositionCtrl)
+DECLARE_EVENT_TABLE()
+public:
+enum {
+			ID_BROWSE_BTN = 10004,
+     }; //End of Enum
+
+public:
+    // Constructors
+    FirmwarePositionCtrl() { Init(); }
+    FirmwarePositionCtrl(wxWindow* parent, wxWindowID id,
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxNO_BORDER,
+        const wxValidator& validator = wxDefaultValidator)
+        {
+            Init();
+            Create(parent, id, pos, size, style, validator);
+            }
+    // Creation
+    bool Create(wxWindow* parent, wxWindowID id,
+        const wxPoint& pos = wxDefaultPosition,
+        const wxSize& size = wxDefaultSize,
+        long style = wxNO_BORDER,
+        const wxValidator& validator = wxDefaultValidator);
+
+     // Creates the controls and sizers
+   void CreateControls();
+   // Common initialization
+   void Init() { }
+   // Event handlers
+   void OnBrowseBtn(wxCommandEvent& event);
+   // Accessors
+   wxString getFirmwarePos();
+    void setDefault();
+
+protected:
+    wxTextCtrl* m_firmwarePos;
+    wxStaticText* m_desc;
+    wxButton* m_browseBtn;
+
+};
+
+
+
+#endif
+

Property changes on: rbutil/rbutilCtrls.h
___________________________________________________________________
Name: svn:executable
   + *

Index: rbutil/wizard_pages.cpp
===================================================================
--- rbutil/wizard_pages.cpp	(revision 13019)
+++ rbutil/wizard_pages.cpp	(working copy)
@@ -1,967 +0,0 @@
-/***************************************************************************
- *             __________               __   ___.
- *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
- *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
- *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
- *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
- *                     \/            \/     \/    \/            \/
- * Module: rbutil
- * File: wizardpages.cpp
- *
- * Copyright (C) 2005 Christi Alice Scarborough
- *
- * All files in this archive are subject to the GNU General Public License.
- * See the file COPYING in the source tree root for full license agreement.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-
-#include "wizard_pages.h"
-#include "bootloaders.h"
-
-
-#include <wx/regex.h>
-#include <wx/tokenzr.h>
-
-/////// Bootplatform page ///////////////////////////////////77
-wxBootPlatformPage::wxBootPlatformPage(wxWizard *parent) : wxWizardPageSimple(parent)
-{
-    wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
-
-    wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
-        wxT("Please select the model of audio device that you would like to"
-        "\ninstall the Rockbox Bootloader on from the list below:"));
-    WxBoxSizer1->Add(WxStaticText1,0,wxGROW | wxALL,5);
-
-    wxArrayString arrayStringFor_WxListBox1;
-    for (unsigned int i=0; i< gv->plat_name.GetCount(); i++) {
-        if (gv->plat_needsbootloader[i])
-        {
-           if(gv->plat_autodetect[i])
-           {
-                if(arrayStringFor_WxListBox1.Index(gv->plat_combinedname[i]) == wxNOT_FOUND)
-                    arrayStringFor_WxListBox1.Add(gv->plat_combinedname[i]);
-           }
-           else
-           {
-                arrayStringFor_WxListBox1.Add(gv->plat_name[i]);
-           }
-        }
-    }
-
-    BootPlatformListBox = new wxListBox(this, wxID_ANY, wxDefaultPosition,
-        wxDefaultSize, arrayStringFor_WxListBox1, wxLB_SINGLE);
-    WxBoxSizer1->Add(BootPlatformListBox,0,wxGROW | wxALL,5);
-
-    SetSizer(WxBoxSizer1);
-    WxBoxSizer1->Fit(this);
-
-    for (unsigned int i=0; i< gv->plat_id.GetCount(); i++) {
-        if (gv->plat_id[i] == gv->curplat) BootPlatformListBox->SetSelection(i);
-    }
-
-}
-
-wxWizardPage * wxBootPlatformPage::GetNext() const
-{
-   if(gv->curbootloadermethod != wxT("fwpatcher")&& gv->curbootloadermethod != wxT("ipodpatcher"))
-   {
-       if(wxWizardPageSimple::GetNext()->GetNext() != NULL)  // not iriver hx0 and ipod, skip one page
-           return wxWizardPageSimple::GetNext()->GetNext();
-   }
-   else if(gv->curbootloadermethod == wxT("ipodpatcher"))
-   {
-        if(wxWizardPageSimple::GetNext()->GetNext() != NULL)
-            if(wxWizardPageSimple::GetNext()->GetNext()->GetNext() != NULL)
-                return wxWizardPageSimple::GetNext()->GetNext()->GetNext(); //ipod, skip 2 pages
-            else
-                return wxWizardPageSimple::GetNext()->GetNext(); //ipod, skip 1 page (for uninstallation)
-   }
-
-   // all others , no skip
-   return wxWizardPageSimple::GetNext();
-}
-
-bool wxBootPlatformPage::TransferDataFromWindow()
-{
-    if (BootPlatformListBox->GetSelection() == wxNOT_FOUND )
-    {
-        WARN_DIALOG(wxT("You must select an audio device type before proceeding"),
-            wxT("Select Platform"));
-        return false;
-    } else
-    {
-        int idx = gv->plat_name.Index(BootPlatformListBox->GetStringSelection());
-        if(idx == wxNOT_FOUND) idx =gv->plat_combinedname.Index(BootPlatformListBox->GetStringSelection());
-        gv->curplatnum = idx;
-        gv->curplat = gv->plat_id[gv->curplatnum];
-        gv->curbootloadermethod = gv->plat_bootloadermethod[gv->curplatnum];
-        gv->curbootloader = gv->plat_bootloadername[gv->curplatnum];
-
-        return true;
-    }
-}
-//// Plattfor Page //////////////////////////
-wxPlatformPage::wxPlatformPage(wxWizard *parent) : wxWizardPageSimple(parent)
-{
-    wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
-
-    wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
-        wxT("Please select the model of audio device that you would like to"
-        "\ninstall Rockbox on from the list below:"));
-    WxBoxSizer1->Add(WxStaticText1,0,wxGROW | wxALL,5);
-
-    wxArrayString arrayStringFor_WxListBox1;
-    PlatformListBox = new wxListBox(this, wxID_ANY, wxDefaultPosition,
-        wxDefaultSize, gv->plat_name, wxLB_SINGLE);
-    WxBoxSizer1->Add(PlatformListBox,0,wxGROW | wxALL,5);
-
-    SetSizer(WxBoxSizer1);
-    WxBoxSizer1->Fit(this);
-    for (unsigned int i=0; i< gv->plat_id.GetCount(); i++) {
-        if (gv->plat_id[i] == gv->curplat) PlatformListBox->SetSelection(i);
-    }
-}
-
-bool wxPlatformPage::TransferDataFromWindow()
-{
-    if (PlatformListBox->GetSelection() == wxNOT_FOUND )
-    {
-        WARN_DIALOG(wxT("You must select an audio device type before proceeding"),
-            wxT("Select Platform"));
-        return false;
-    } else
-    {
-        gv->curplatnum = PlatformListBox->GetSelection();
-        gv->curplat = gv->plat_id[gv->curplatnum];
-        gv->curresolution = gv->plat_resolution[gv->curplatnum];
-        return true;
-    }
-}
-
-
-//////////////// ThemeImage Dialog /////////////////
-BEGIN_EVENT_TABLE(wxThemeImageDialog,wxDialog)
-   EVT_PAINT(wxThemeImageDialog::OnPaint)
-   EVT_CLOSE(wxThemeImageDialog::OnClose)
-END_EVENT_TABLE();
-wxThemeImageDialog::wxThemeImageDialog(wxWindow* parent,wxWindowID id,wxString title,wxBitmap bmp)  :
-   wxDialog(parent, id, title)
-{
-    wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
-    m_bitmap = bmp;
-
-    sizerTop->SetMinSize(64,64);
-
-    SetSizer(sizerTop);
-
-    sizerTop->SetSizeHints(this);
-    sizerTop->Fit(this);
-
-}
-
-void wxThemeImageDialog::OnClose(wxCloseEvent& event)
-{
-    event.Veto();
-    this->Show(false);
-}
-
-void wxThemeImageDialog::SetImage(wxBitmap bmp)
-{
-    m_bitmap = bmp;
-    this->GetSizer()->SetMinSize(m_bitmap.GetWidth(),m_bitmap.GetHeight());
-    this->GetSizer()->Fit(this);
-    Layout();
-    Refresh();
-}
-
-void wxThemeImageDialog::OnPaint(wxPaintEvent& WXUNUSED(event))
-{
-    wxPaintDC dc( this );
-    dc.DrawBitmap( m_bitmap, 0, 0, true /* use mask */ );
-}
-
-////////////////// Themes page ////////////////////////
-BEGIN_EVENT_TABLE(wxThemesPage,wxWizardPageSimple)
-	EVT_WIZARD_PAGE_CHANGED          (wxID_ANY, wxThemesPage::OnPageShown)
-	EVT_WIZARD_PAGE_CHANGING         (wxID_ANY, wxThemesPage::OnWizardPageChanging)
-	EVT_LISTBOX                      (ID_LISTBOX,wxThemesPage::OnListBox)
-	EVT_BUTTON                       (ID_PREVIEW_BTN, wxThemesPage::OnPreviewBtn)
-	EVT_CHECKBOX                     (ID_INSTALLCHECKBOX, wxThemesPage::OnCheckBox)
-END_EVENT_TABLE();
-
-wxThemesPage::wxThemesPage(wxWizard *parent) : wxWizardPageSimple(parent)
-{
-    m_parent = parent;
-
-    myImageDialog = new wxThemeImageDialog(this,wxID_ANY,wxT("Preview"),NULL);
-    myImageDialog->Show(false);
-
-    wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
-
-    wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
-        wxT("Please select the Theme you would like to"
-        "\ninstall on your Device from the list below:"));
-    mainSizer->Add(WxStaticText1,0,wxGROW | wxALL,5);
-
-    // create theme listbox
-    wxArrayString list;
-    for(int i = 0; i< 35;i++)
-        list.Add(wxT(""));
-    ThemesListBox= new wxListBox(this, ID_LISTBOX, wxDefaultPosition,
-        wxDefaultSize,list, wxLB_SINGLE);
-    mainSizer->Add(ThemesListBox,10,wxGROW | wxALL,5);
-
-    // create groupbox
-    wxStaticBox* groupbox= new wxStaticBox(this,wxID_ANY,wxT("Selected Theme:"));
-    wxBoxSizer* styleSizer = new wxStaticBoxSizer( groupbox, wxVERTICAL );
-    mainSizer->Add(styleSizer,11,wxGROW | wxALL,5);
-
-    // horizontal sizer
-    wxBoxSizer* wxBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
-    styleSizer->Add(wxBoxSizer2,0,wxGROW | wxALL,0);
-
-    // preview button
-    m_previewBtn = new wxButton(this, ID_PREVIEW_BTN, wxT("Preview"),
-         wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
-        wxT("PreviewBtn"));
-    wxBoxSizer2->Add(m_previewBtn,0,wxGROW | wxALL,5);
-
-    // checkbox for Install
-    m_InstallCheckBox= new wxCheckBox(this,ID_INSTALLCHECKBOX,wxT("Install")
-        ,wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
-        wxT("InstallCheckbox"));
-    wxBoxSizer2->Add(m_InstallCheckBox,0,wxGROW | wxALL,5);
-
-    // horizontal sizer
-    wxBoxSizer* wxBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
-    styleSizer->Add(wxBoxSizer3,0,wxGROW | wxALL,0);
-
-    // File size
-    wxStaticText* size= new wxStaticText(this,wxID_ANY,wxT("Filesize:"));
-    wxBoxSizer3->Add(size,0,wxGROW | wxALL,5);
-
-    m_size= new wxStaticText(this,wxID_ANY,wxT(""));
-    wxBoxSizer3->Add(m_size,0,wxGROW | wxALL,5);
-
-    // Description
-    wxStaticText* desc= new wxStaticText(this,wxID_ANY,wxT("Description:"));
-    styleSizer->Add(desc,0,wxGROW | wxALL,5);
-
-    m_desc= new wxStaticText(this,wxID_ANY,wxT(""));
-    styleSizer->Add(m_desc,0,wxGROW | wxALL,5);
-
-    SetSizer(mainSizer);
-    mainSizer->Fit(this);
-
-}
-
-bool wxThemesPage::TransferDataFromWindow()
-{
-    gv->themesToInstall.Clear();
-
-    for(unsigned int i=0; i < m_installTheme.GetCount(); i++)
-    {
-        if(m_installTheme[i])
-        {
-            gv->themesToInstall.Add(m_Themes_path[i]);
-        }
-    }
-
-    return true;
-
-}
-
-void wxThemesPage::OnWizardPageChanging(wxWizardEvent& event)
-{
-   if(event.GetDirection())  // going forwards in the Wizard
-   {
-        if(gv->themesToInstall.GetCount() == 0)
-        {
-            WARN_DIALOG(wxT("You have not selected a Theme to Install"), wxT("Select a Theme"));
-            event.Veto();
-        }
-   }
-}
-
-void wxThemesPage::OnCheckBox(wxCommandEvent& event)
-{
-    int index = ThemesListBox->GetSelection();         //get Index
-    if(index == wxNOT_FOUND)
-        return;
-
-    m_installTheme[index]= ! m_installTheme[index];    // Toggle install
-
-}
-
-void wxThemesPage::OnListBox(wxCommandEvent& event)
-{
-    int index = ThemesListBox->GetSelection();  //get Index
-    if(index == wxNOT_FOUND)
-        return;
-
-    m_desc->SetLabel(m_Themes_desc[index]);     //set Desc
-    m_desc->Wrap(270);                       // wrap desc
-    m_size->SetLabel(m_Themes_size[index]+wxT(" kb"));  //set file size
-    m_InstallCheckBox->SetValue(m_installTheme[index]);  // set the install checkbox
-
-    this->GetSizer()->Layout();
-
-    if(myImageDialog->IsShown())
-    {
-        wxString src,dest;
-
-        int pos = m_Themes_image[index].Find('/',true);
-        wxString filename = m_Themes_image[index](pos+1,m_Themes_image[index].Length());
-
-        dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
-                gv->stdpaths->GetUserDataDir().c_str(),gv->curresolution.c_str());
-
-        if(!wxDirExists(dest))
-            wxMkdir(dest);
-
-        //this is a URL no PATH_SEP
-        src.Printf(wxT("%s/data/%s/%s"),gv->themes_url.c_str(),gv->curresolution.c_str(),filename.c_str());
-        dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s" PATH_SEP "%s"),
-            gv->stdpaths->GetUserDataDir().c_str(),gv->curresolution.c_str(),filename.c_str());
-
-        if(DownloadURL(src, dest))
-        {
-            MESG_DIALOG(wxT("Unable to download image."));
-            return;
-        }
-
-        wxBitmap bmp;
-        bmp.LoadFile(dest,wxBITMAP_TYPE_PNG);
-        myImageDialog->SetImage(bmp);
-    }
-
-}
-
-void wxThemesPage::OnPreviewBtn(wxCommandEvent& event)
-{
-
-    int index = ThemesListBox->GetSelection();
-    if(index == wxNOT_FOUND)
-        return;
-
-    wxString src,dest;
-
-    int pos = m_Themes_image[index].Find('/',true);
-    wxString filename = m_Themes_image[index](pos+1,m_Themes_image[index].Length());
-
-    dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
-            gv->stdpaths->GetUserDataDir().c_str(),gv->curresolution.c_str());
-
-    if(!wxDirExists(dest))
-        wxMkdir(dest);
-
-    //this is a URL no PATH_SEP
-    src.Printf(wxT("%s/data/%s/%s"),gv->themes_url.c_str(),gv->curresolution.c_str(),filename.c_str());
-    dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s" PATH_SEP "%s"),
-        gv->stdpaths->GetUserDataDir().c_str(),gv->curresolution.c_str(),filename.c_str());
-
-    if(DownloadURL(src, dest))
-    {
-        MESG_DIALOG(wxT("Unable to download image."));
-        return;
-    }
-
-    wxBitmap bmp;
-    bmp.LoadFile(dest,wxBITMAP_TYPE_PNG);
-
-    myImageDialog->SetImage(bmp);
-
-    myImageDialog->Show(true);
-
-}
-
-void wxThemesPage::OnPageShown(wxWizardEvent& event)
-{
-    // clear Theme info
-    m_Themes.Clear();
-    m_Themes_image.Clear();
-    m_Themes_path.Clear();
-    m_Themes_desc.Clear();
-    m_Themes_size.Clear();
-    m_installTheme.Clear();
-    m_desc->SetLabel(wxT(""));
-    m_size->SetLabel(wxT(""));
-    m_InstallCheckBox->SetValue(false);
-
-    //get correct Themes list
-    wxString src,dest,err;
-
-    src.Printf(wxT("%srbutil.php?res=%s"),gv->themes_url.c_str(),gv->curresolution.c_str());
-    dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s.list"),
-        gv->stdpaths->GetUserDataDir().c_str(),gv->curresolution.c_str());
-
-    if(DownloadURL(src, dest))
-    {
-        MESG_DIALOG(wxT("Unable to download themes list."));
-        return;
-    }
-
-    //read and parse Themes list
-    wxString themelistraw;
-    wxFFile themefile;
-    if(!themefile.Open(dest))       //open file
-    {
-        MESG_DIALOG(wxT("Unable to open themes list."));
-        return;
-    }
-    if(!themefile.ReadAll(&themelistraw))  //read complete file
-    {
-        MESG_DIALOG(wxT("Unable to read themes list."));
-        return;
-    }
-    wxRegEx reAll(wxT("<body >(.+)</body>"));  //extract body part
-    if(! reAll.Matches(themelistraw))
-    {
-        MESG_DIALOG(wxT("Themes list is in wrong Format."));
-        return;
-    }
-    wxString lines = reAll.GetMatch(themelistraw,1);
-
-    // prepare text
-    lines.Replace(wxT("<br />"),wxT(""),true);   //replace <br /> with nothing
-    lines.Replace(wxT("\n"),wxT(""),true);   //replace \n with nothing
-    lines.Trim(true);                         //strip WS at end
-    lines.Trim(false);                         //strip WS at beginning
-    wxStringTokenizer tkz(lines,wxT("|"));   //tokenize it
-
-    while ( tkz.HasMoreTokens() )           // read all entrys
-    {
-        m_Themes.Add(tkz.GetNextToken());         //Theme name
-        m_Themes_path.Add(tkz.GetNextToken());    //Theme path
-        m_Themes_size.Add(tkz.GetNextToken());    //File size
-        m_Themes_image.Add(tkz.GetNextToken());   //Screenshot
-        m_Themes_desc.Add(tkz.GetNextToken());    //Description
-        m_installTheme.Add(false);                //Theme should be installed ?
-    }
-
-    // set ThemeList
-    ThemesListBox->Set(m_Themes);
-}
-
- //////////////////// Ipod Locaction Page /////////////////////////////
-BEGIN_EVENT_TABLE(wxIpodLocationPage,wxWizardPageSimple)
-	EVT_BUTTON   (ID_IPODLOCATION_BTN, wxIpodLocationPage::OnIpodLocationBtn)
-	EVT_WIZARD_PAGE_CHANGING(wxID_ANY, wxIpodLocationPage::OnWizardPageChanging)
-END_EVENT_TABLE();
-
-wxIpodLocationPage::wxIpodLocationPage(wxWizard* parent) : wxWizardPageSimple(parent)
-{
-
-    wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
-
-    // Header text
-    IpodLocationLabel = new wxStaticText(this, wxID_ANY,
-        wxT("Rockbox utility needs to know the device where your ipod\n"
-            "device is located on your computer. Use the\n"
-            "Scan Button:"));
-    WxBoxSizer1->Add(IpodLocationLabel,0,wxGROW | wxALL, 5);
-
-    // device location
-   	wxBoxSizer* WxBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
-   	WxBoxSizer1->Add(WxBoxSizer3,0,
-        wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-  	IpodLocationText = new wxStaticText(this, wxID_ANY, wxT(""),
-        wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    WxBoxSizer3->Add(IpodLocationText,1,
-        wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-    IpodLocationBtn = new wxButton(this, ID_IPODLOCATION_BTN, wxT("Scan"),
-        wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
-        wxT("IpodLocationBtn"));
-   	IpodLocationBtn->SetToolTip(wxT("Scan for your Ipod"));
-   	WxBoxSizer3->Add(IpodLocationBtn,0,wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-     // Extra text
-    IpodLocationExtraText = new wxStaticText(this,wxID_ANY, wxT(""));
-    WxBoxSizer1->Add(IpodLocationExtraText,0,wxGROW | wxALL, 5);
-
-   	SetSizer(WxBoxSizer1);
-    WxBoxSizer1->Fit(this);
-}
-
-wxWizardPage* wxIpodLocationPage::GetPrev() const
-{
-    if(gv->curbootloadermethod == wxT("ipodpatcher"))   //if ipod, skip previous
-    {
-        if(wxWizardPageSimple::GetPrev()->GetPrev() != NULL)
-            return wxWizardPageSimple::GetPrev()->GetPrev();
-
-    }
-    return wxWizardPageSimple::GetPrev();
-}
-
-void wxIpodLocationPage::OnWizardPageChanging(wxWizardEvent& event)
-{
-   if(event.GetDirection())  // going forwards in the Wizard
-   {
-       if(gv->curbootloadermethod==wxT("ipodpatcher"))
-       {
-            if(IpodLocationText->GetLabel() == wxT("no Ipod found") ||
-                    IpodLocationText->GetLabel() ==wxT("More than 1 Ipod found") ||
-                    IpodLocationText->GetLabel() ==wxT(""))
-            {
-                WARN_DIALOG(wxT("No valid ipod found!"), wxT("Select Location"));
-                event.Veto();       //stop pagechanging
-            }
-       }
-   }
-}
-
-void wxIpodLocationPage::OnIpodLocationBtn(wxCommandEvent& event)
-{
-    wxLogVerbose(wxT("=== begin wxIpodLocationPage::OnIpodLocationBtn"));
-    struct ipod_t ipod;
-    int n = ipod_scan(&ipod);
-    gv->curbootloader=wxT("");
-
-    if(n == 0)
-      IpodLocationText->SetLabel(wxT("no Ipod found"));
-    else if( n==1)
-    {
-      gv->curbootloader=wxT("bootloader-");
-      gv->curbootloader.Append(wxString(ipod.targetname, wxConvUTF8));
-      IpodLocationText->SetLabel(wxString(ipod.modelstr, wxConvUTF8));
-    }
-    else
-      IpodLocationText->SetLabel(wxT("More than 1 Ipod found"));
-
-    if(ipod.macpod)
-      IpodLocationExtraText->SetLabel(wxT("This Ipod is a Mac formated Ipod\n"
-                                      "Rockbox will not work on this.\n"
-                                      "You have to convert it first to Fat32"));
-    wxLogVerbose(wxT("=== end wxIpodLocationPage::OnIpodLocationBtn"));
-
-}
-
-BEGIN_EVENT_TABLE(wxBootLocationPage,wxWizardPageSimple)
-	EVT_BUTTON   (ID_BOOTLOCATION_BTN, wxBootLocationPage::OnBootLocationBtn)
-	EVT_WIZARD_PAGE_CHANGING(wxID_ANY, wxBootLocationPage::OnWizardPageChanging)
-	EVT_WIZARD_PAGE_CHANGED (wxID_ANY, wxBootLocationPage::OnPageShown)
-END_EVENT_TABLE();
-
-wxBootLocationPage::wxBootLocationPage(wxWizard* parent) : wxWizardPageSimple(parent)
-    {
-
-    wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
-
-    // Header text
-    BootLocationLabel = new wxStaticText(this, wxID_ANY,
-        wxT("Rockbox utility needs to know the folder where your audio\n"
-            "device is located on your computer.  Currently Rockbox utility\n"
-            "is configured to use the following location:"));
-    WxBoxSizer1->Add(BootLocationLabel,0,wxGROW | wxALL, 5);
-
-    // device location
-   	wxBoxSizer* WxBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
-   	WxBoxSizer1->Add(WxBoxSizer3,0,
-        wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-    if (gv->curdestdir == wxT("")) gv->curdestdir = wxT("<none>");
-  	BootLocationText = new wxStaticText(this, wxID_ANY, gv->curdestdir,
-        wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    WxBoxSizer3->Add(BootLocationText,1,
-        wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-   	BootLocationBtn = new wxButton(this, ID_BOOTLOCATION_BTN, wxT("Change"),
-        wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
-        wxT("BootLocationBtn"));
-   	BootLocationBtn->SetToolTip(wxT("Select the location of your audio device"));
-   	WxBoxSizer3->Add(BootLocationBtn,0,wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-
-    BootLocationInfo = new wxStaticText(this, wxID_ANY, wxT(""),
-        wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    WxBoxSizer1->Add(BootLocationInfo,0,
-        wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-   	SetSizer(WxBoxSizer1);
-    WxBoxSizer1->Fit(this);
-}
-
-wxWizardPage* wxBootLocationPage::GetPrev() const
-{
-    if(gv->curbootloadermethod != wxT("fwpatcher"))
-    {
-        if(wxWizardPageSimple::GetPrev()->GetPrev() != NULL)
-            return wxWizardPageSimple::GetPrev()->GetPrev();
-
-    }
-
-    return wxWizardPageSimple::GetPrev();
-}
-
-wxWizardPage* wxBootLocationPage::GetNext() const
-{
-    if(gv->curbootloadermethod == wxT("ipodpatcher"))
-    {
-        return wxWizardPageSimple::GetNext();  // if ipod then this is not the last page
-    }
-    else return NULL;  // else this is the last page
-}
-
-void wxBootLocationPage::OnPageShown(wxWizardEvent& event)
-{
-   if(gv->curplat == wxT("h10") || gv->curplat == wxT("h10_5gb"))
-   {
-      BootLocationInfo->SetLabel(wxT("Your Device needs to be in UMS Mode. \n\n"
-                                     "If it is an MTP device, you can do this by \n"
-                                     "reseting you Device via the Pinhole,or disconnecting the Battery \n"
-                                     "then connecting it via the Data cable with the PC. \n"
-                                     "Then press and hold Next,push the Power button, and \n"
-                                     "continue to hold the Next button until the \n"
-                                     "USB-Connected Screen appears." ));
-   }
-   else
-   {
-      BootLocationInfo->SetLabel(wxT(""));
-   }
-
-}
-
-void wxBootLocationPage::OnWizardPageChanging(wxWizardEvent& event)
-{
-   if(event.GetDirection())  // going forwards in the Wizard
-   {
-      if(!wxDirExists(BootLocationText->GetLabel()))
-      {
-          WARN_DIALOG(wxT("You have not selected a valid location for your audio "
-                    "device"), wxT("Select Location"));
-           event.Veto();
-      }
-
-   }
-}
-
-bool wxBootLocationPage::TransferDataFromWindow()
-{
-    gv->curdestdir = BootLocationText->GetLabel();
-    return true;
-
-}
-
-
-void wxBootLocationPage::OnBootLocationBtn(wxCommandEvent& event)
-{
-   const wxString& temp = wxDirSelector(
-        wxT("Please select the location of your audio device"), gv->curdestdir);
-   wxLogVerbose(wxT("=== begin wxBootLocationPage::OnBootLocationBtn(event)"));
-   if (!temp.empty())
-   {
-           BootLocationText->SetLabel(temp);
-   }
-   wxLogVerbose(wxT("=== end wxBootLocationPage::OnBootLocationBtn"));
-
-}
-
-
-BEGIN_EVENT_TABLE(wxFirmwareLocationPage,wxWizardPageSimple)
-	EVT_BUTTON   (ID_FIRMWARELOCATION_BTN, wxFirmwareLocationPage::OnFirmwareFilenameBtn)
-	EVT_WIZARD_PAGE_CHANGING(wxID_ANY, wxFirmwareLocationPage::OnWizardPageChanging)
-END_EVENT_TABLE();
-
-wxFirmwareLocationPage::wxFirmwareLocationPage(wxWizard* parent) : wxWizardPageSimple(parent)
-{
-
-    wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
-
-    // Header text
-    FirmwareLocationText = new wxStaticText(this, wxID_ANY,
-        wxT("For this step Rockbox Utility needs an original Firmware.\n"
-             "You can download this from the Manufacturers Website."));
-    WxBoxSizer1->Add(FirmwareLocationText,0,wxGROW | wxALL, 5);
-
-    // Filename text
-    wxBoxSizer* WxBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
-   	WxBoxSizer1->Add(WxBoxSizer4,0,
-        wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-    FirmwareLocationFilename = new wxStaticText(this, wxID_ANY, gv->curfirmware,
-        wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    WxBoxSizer4->Add(FirmwareLocationFilename,1,
-        wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-    // Button
-    FirmwareLocationBtn = new wxButton(this, ID_FIRMWARELOCATION_BTN, wxT("Explore"),
-        wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
-        wxT("FirmwareLocationBtn"));
-    FirmwareLocationBtn->SetToolTip(wxT("Select the location of the downloaded Firmware"));
-    WxBoxSizer4->Add(FirmwareLocationBtn,0,wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-
-   	SetSizer(WxBoxSizer1);
-    WxBoxSizer1->Fit(this);
-}
-
-void wxFirmwareLocationPage::OnWizardPageChanging(wxWizardEvent& event)
-{
-   if(event.GetDirection())  // going forwards in the Wizard
-   {
-        if( !wxFileExists(gv->curfirmware))
-        {
-            WARN_DIALOG(wxT("You have not selected a valid location for the firmware "
-                      "file"), wxT("Select File"));
-            event.Veto();
-        }
-   }
-
-}
-
-void wxFirmwareLocationPage::OnFirmwareFilenameBtn(wxCommandEvent& event)
-{
-     wxString temp = wxFileSelector(
-        wxT("Please select the location of the original Firmware"), gv->curdestdir,wxT(""),wxT(""),wxT("*.hex"));
-       wxLogVerbose(wxT("=== begin wxFirmwareLocationPage::OnFirmwareFilenameBtn(event)"));
-       if (!temp.empty())
-       {
-           gv->curfirmware=temp;
-           if(temp.Length() > 30)
-           {
-                temp.Remove(0, temp.Length()-30);
-                temp.Prepend(wxT("..."));
-           }
-           FirmwareLocationFilename->SetLabel(temp);
-       }
-       wxLogVerbose(wxT("=== end wxFirmwareLocationPage::OnFirmwareFilenameBtn"));
-}
-
-BEGIN_EVENT_TABLE(wxLocationPage,wxWizardPageSimple)
-	EVT_BUTTON   (ID_LOCATION_BTN, wxLocationPage::OnLocationBtn)
-	EVT_WIZARD_PAGE_CHANGING(wxID_ANY, wxLocationPage::OnWizardPageChanging)
-	EVT_WIZARD_PAGE_CHANGED(wxID_ANY, wxLocationPage::OnPageShown)
-END_EVENT_TABLE();
-
-wxLocationPage::wxLocationPage(wxWizard* parent) : wxWizardPageSimple(parent)
-    {
-    wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
-
-    wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
-        wxT("Rockbox utility needs to know the folder where your audio\n"
-            "device is located on your computer.  Currently Rockbox utility\n"
-            "is configured to use the following location:"));
-    WxBoxSizer1->Add(WxStaticText1,0,wxGROW | wxALL, 5);
-
-   	wxBoxSizer* WxBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
-   	WxBoxSizer1->Add(WxBoxSizer3,0,
-        wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-    if (gv->curdestdir == wxT("")) gv->curdestdir = wxT("<none>");
-  	LocationText = new wxStaticText(this, wxID_ANY, gv->curdestdir,
-        wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    WxBoxSizer3->Add(LocationText,1,
-        wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-   	wxButton* LocationBtn = new wxButton(this, ID_LOCATION_BTN, wxT("Change"),
-        wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
-        wxT("LocationBtn"));
-   	LocationBtn->SetToolTip(wxT("Select the location of your audio device"));
-   	WxBoxSizer3->Add(LocationBtn,0,wxALIGN_CENTER_VERTICAL | wxALL, 5);
-
-   	LocationInfo = new wxStaticText(this, wxID_ANY, wxT(""),
-        wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
-    WxBoxSizer1->Add(LocationInfo,0,wxGROW | wxALL, 5);
-
-   	SetSizer(WxBoxSizer1);
-    WxBoxSizer1->Fit(this);
-}
-
-
-void wxLocationPage::OnPageShown(wxWizardEvent& event)
-{
-   if(gv->curplat == wxT("h10") || gv->curplat == wxT("h10_5gb"))
-   {
-      LocationInfo->SetLabel(wxT("Your Device needs to be in UMS Mode. \n\n"
-                                     "If it is an MTP device, you can do this by \n"
-                                     "reseting you Device via the Pinhole,or disconnecting the Battery \n"
-                                     "then connecting it via the Data cable with the PC. \n"
-                                     "Then press and hold Next,push the Power button, and \n"
-                                     "continue to hold the Next button until the \n"
-                                     "USB-Connected Screen appears." ));
-   }
-   else
-   {
-      LocationInfo->SetLabel(wxT(""));
-   }
-
-
-}
-
-void wxLocationPage::OnWizardPageChanging(wxWizardEvent& event)
-{
-   if(event.GetDirection())  // going forwards in the Wizard
-   {
-        if(!wxDirExists(LocationText->GetLabel()))
-        {
-              WARN_DIALOG(wxT("You have not selected a valid location for your audio "
-            "device"), wxT("Select Location"));
-            event.Veto();
-        }
-   }
-}
-
-bool wxLocationPage::TransferDataFromWindow()
-{
-    gv->curdestdir = LocationText->GetLabel();
-    return true;
-}
-
-void wxLocationPage::OnLocationBtn(wxCommandEvent& event)
-{
-    const wxString& temp = wxDirSelector(
-        wxT("Please select the location of your audio device"), gv->curdestdir);
-    wxLogVerbose(wxT("=== begin wxLocationPage::OnLocationBtn(event)"));
-    if (!temp.empty())
-    {
-        LocationText->SetLabel(temp);
-    }
-    wxLogVerbose(wxT("=== end wxLocationPage::OnLocationBtn"));
-}
-
-BEGIN_EVENT_TABLE(wxBuildPage,wxWizardPageSimple)
-	EVT_RADIOBOX                     (ID_BUILD_BOX, wxBuildPage::OnBuildBox)
-	EVT_WIZARD_PAGE_CHANGED          (wxID_ANY, wxBuildPage::OnPageShown)
-END_EVENT_TABLE();
-
-
-wxBuildPage::wxBuildPage(wxWizard *parent) : wxWizardPageSimple(parent)
-{
-    wxString buf;
-
-    wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
-
-    wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
-    wxT("Please select the Rockbox version you would like "
-        "to install on your audio\ndevice:"));
-    WxBoxSizer1->Add(WxStaticText1,0,wxGROW | wxALL,5);
-
-    wxArrayString* array = new wxArrayString();
-    buf.Printf(wxT("Rockbox stable version (%s)") , gv->last_release.c_str());
-    array->Add(buf);
-    array->Add(wxT("Archived Build"));
-    array->Add(wxT("Current Build "));
-
-    BuildRadioBox = new wxRadioBox(this, ID_BUILD_BOX, wxT("Version"),
-        wxDefaultPosition, wxDefaultSize, *array, 0, wxRA_SPECIFY_ROWS);
-    WxBoxSizer1->Add(BuildRadioBox, 0, wxGROW | wxALL, 5);
-    delete array;
-
-    wxStaticBox* WxStaticBox1 = new wxStaticBox(this, wxID_ANY, wxT("Details:"));
-    wxStaticBoxSizer* WxStaticBoxSizer2 = new wxStaticBoxSizer(WxStaticBox1,
-        wxVERTICAL);
-    DetailText = new wxStaticText(this, wxID_ANY, wxT(""));
-    WxBoxSizer1->Add(WxStaticBoxSizer2, 1, wxGROW | wxALL, 5);
-    WxStaticBoxSizer2->Add(DetailText, 1, wxGROW | wxALL, 5);
-
-    wxStaticText* WxStaticText2 = new wxStaticText(this, wxID_ANY,
-        wxT("Rockbox Utility stores copies of Rockbox it has downloaded on the\n"
-        "local hard disk to save network traffic.  If your local copy is\n"
-        "no longer working, tick this box to download a fresh copy.") );
-    WxBoxSizer1->Add(WxStaticText2, 0 , wxALL, 5);
-
-    NoCacheCheckBox = new wxCheckBox(this, wxID_ANY,
-        wxT("Don't use locally cached copies of Rockbox") );
-    WxBoxSizer1->Add(NoCacheCheckBox, 0, wxALL, 5);
-
-    SetSizer(WxBoxSizer1);
-    WxBoxSizer1->Fit(this);
-    WxBoxSizer1->SetSizeHints(this);
-}
-
-bool wxBuildPage::TransferDataFromWindow()
-{
-    gv->curbuild = BuildRadioBox->GetSelection();
-    gv->nocache = (gv->curbuild == BUILD_BLEEDING) ? true :
-                  NoCacheCheckBox->IsChecked();
-    return true;
-}
-
-void wxBuildPage::OnBuildBox(wxCommandEvent& event)
-{
-    wxString str;
-
-    switch(BuildRadioBox->GetSelection() )
-    {
-         case BUILD_RELEASE:
-            str = _("This is the last released version of Rockbox, and is the\n"
-               "recommended version to install.");
-            NoCacheCheckBox->Enable();
-            break;
-         case BUILD_DAILY:
-            str = _("These are automatically built each day from the current\n"
-                "development source code.  This generally has more features\n"
-                "than the last release but may be much less stable.  Features\n"
-                "may change regularly.");
-            NoCacheCheckBox->Enable();
-            break;
-        case BUILD_BLEEDING:
-            str = _("This is the absolute up to the minute Rockbox built after\n"
-                "the last change was made.\n\n"
-                "Note:  This option will always download a fresh copy from the\n"
-                "web server.\n");
-            NoCacheCheckBox->Enable(false);
-            break;
-        default:
-            break;
-    }
-
-    DetailText->SetLabel(str);
-}
-
-void wxBuildPage::OnPageShown(wxWizardEvent& event)
-{
-    wxCommandEvent updateradiobox(wxEVT_COMMAND_RADIOBOX_SELECTED,
-        ID_BUILD_BOX);
-
-    if (gv->plat_released[gv->curplatnum] )
-    {
-        BuildRadioBox->Enable(BUILD_RELEASE, true);
-        BuildRadioBox->SetSelection(BUILD_RELEASE);
-    } else {
-        BuildRadioBox->Enable(BUILD_RELEASE, false);
-        BuildRadioBox->SetSelection(BUILD_DAILY);
-
-    }
-
-    wxPostEvent(this, updateradiobox);
-}
-
-wxFullUninstallPage::wxFullUninstallPage(wxWizard* parent) :
-    wxWizardPageSimple(parent)
-{
-    wxString buf;
-
-	wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
-
-    wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
-        wxT("Rockbox Utility normally uninstalls Rockbox using an uninstall\n"
-          "file created during installation.  This means that when Rockbox is\n"
-          "uninstalled all your configuration files are preserved.  However,\n"
-          "you can also perform a full uninstall, which will completely\n"
-          "remove all traces of Rockbox from your system, and can be used\n"
-          "even if Rockbox was previously installed manually.\n\n"
-          "Archos users will need to reinstall any firmware upgrades obtained\n"
-          "from Archos after a full uninstall."));
-    WxBoxSizer1->Add(WxStaticText1,0,wxGROW | wxALL,5);
-
-    FullCheckBox = new wxCheckBox(this, wxID_ANY,
-        wxT("Perform a full uninstall"));
-    WxBoxSizer1->Add(FullCheckBox, 0, wxALL, 5);
-
-    SetSizer(WxBoxSizer1);
-    WxBoxSizer1->Fit(this);
-    WxBoxSizer1->SetSizeHints(this);
-}
-
-bool wxFullUninstallPage::TransferDataFromWindow()
-{
-    gv->curisfull = FullCheckBox->IsChecked();
-    return true;
-}
Index: rbutil/bootloaders.h
===================================================================
--- rbutil/bootloaders.h	(revision 13019)
+++ rbutil/bootloaders.h	(working copy)
@@ -23,6 +23,7 @@
 #ifndef BOOTLOADERS_H_INCLUDED
 #define BOOTLOADERS_H_INCLUDED
 
+#include <wx/string.h>
 
 extern "C" {
     // Ipodpatcher
@@ -31,11 +32,11 @@
 
 
 bool initIpodpatcher();
-bool ipodpatcher(int mode);
-bool gigabeatf(int mode);
-bool iaudiox5(int mode);
-bool fwpatcher(int mode);
-bool h10(int mode);
+bool ipodpatcher(int mode,wxString bootloadername);
+bool gigabeatf(int mode,wxString bootloadername,wxString deviceDir);
+bool iaudiox5(int mode,wxString bootloadername,wxString deviceDir);
+bool fwpatcher(int mode,wxString bootloadername,wxString deviceDir,wxString firmware);
+bool h10(int mode,wxString bootloadername,wxString deviceDir);
 
 
 #endif // BOOTLOADERS_H_INCLUDED
Index: rbutil/rbutil.cbp
===================================================================
--- rbutil/rbutil.cbp	(revision 13019)
+++ rbutil/rbutil.cbp	(working copy)
@@ -101,6 +101,8 @@
 		<Unit filename="h120sums.h" />
 		<Unit filename="h300sums.h" />
 		<Unit filename="install_3d.xpm" />
+		<Unit filename="install_dialogs.cpp" />
+		<Unit filename="install_dialogs.h" />
 		<Unit filename="installlog.cpp" />
 		<Unit filename="installlog.h" />
 		<Unit filename="ipodpatcher\ipodio-win32.c">
@@ -136,8 +138,6 @@
 		<Unit filename="uninstall_3d.xpm" />
 		<Unit filename="untools2_3d.xpm" />
 		<Unit filename="wizard.xpm" />
-		<Unit filename="wizard_pages.cpp" />
-		<Unit filename="wizard_pages.h" />
 		<Unit filename="wx_pch.h" />
 		<Extensions>
 			<code_completion />
