summaryrefslogtreecommitdiff
path: root/rbutil/rbutilCtrls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilCtrls.cpp')
-rw-r--r--rbutil/rbutilCtrls.cpp37
1 files changed, 26 insertions, 11 deletions
diff --git a/rbutil/rbutilCtrls.cpp b/rbutil/rbutilCtrls.cpp
index 36caeeaac0..fe89ca84f4 100644
--- a/rbutil/rbutilCtrls.cpp
+++ b/rbutil/rbutilCtrls.cpp
@@ -144,7 +144,7 @@ void ThemeCtrl::Init()
144 144
145void ThemeCtrl::setDevice(wxString device) 145void ThemeCtrl::setDevice(wxString device)
146{ 146{
147 147
148 int index = gv->plat_id.Index(device); 148 int index = gv->plat_id.Index(device);
149 if(index == -1) return; 149 if(index == -1) return;
150 150
@@ -210,13 +210,13 @@ void ThemeCtrl::setDevice(wxString device)
210 210
211 m_themeList->Append(m_Themes.Last()); 211 m_themeList->Append(m_Themes.Last());
212 } 212 }
213 213
214 this->GetSizer()->Layout(); 214 this->GetSizer()->Layout();
215 this->GetSizer()->Fit(this); 215 this->GetSizer()->Fit(this);
216 this->GetSizer()->SetSizeHints(this); 216 this->GetSizer()->SetSizeHints(this);
217 m_parent->GetSizer()->Layout(); 217 m_parent->GetSizer()->Layout();
218 m_parent->GetSizer()->Fit(m_parent); 218 m_parent->GetSizer()->Fit(m_parent);
219 m_parent->GetSizer()->SetSizeHints(m_parent); 219 m_parent->GetSizer()->SetSizeHints(m_parent);
220} 220}
221 221
222 222
@@ -265,10 +265,10 @@ void ThemeCtrl::OnThemesLst(wxCommandEvent& event)
265 this->GetSizer()->Layout(); 265 this->GetSizer()->Layout();
266 this->GetSizer()->Fit(this); 266 this->GetSizer()->Fit(this);
267 this->GetSizer()->SetSizeHints(this); 267 this->GetSizer()->SetSizeHints(this);
268 268
269 m_parent->GetSizer()->Layout(); 269 m_parent->GetSizer()->Layout();
270 m_parent->GetSizer()->Fit(m_parent); 270 m_parent->GetSizer()->Fit(m_parent);
271 m_parent->GetSizer()->SetSizeHints(m_parent); 271 m_parent->GetSizer()->SetSizeHints(m_parent);
272 272
273} 273}
274 274
@@ -369,7 +369,7 @@ void DeviceSelectorCtrl::CreateControls()
369 369
370 m_deviceCbx = new wxComboBox(this, ID_DEVICE_CBX,wxT(""), 370 m_deviceCbx = new wxComboBox(this, ID_DEVICE_CBX,wxT(""),
371 wxDefaultPosition,wxDefaultSize,gv->plat_name,wxCB_READONLY); 371 wxDefaultPosition,wxDefaultSize,gv->plat_name,wxCB_READONLY);
372 372
373 m_deviceCbx->SetToolTip(wxT("Select your Device.")); 373 m_deviceCbx->SetToolTip(wxT("Select your Device."));
374 m_deviceCbx->SetHelpText(wxT("Select your Device.")); 374 m_deviceCbx->SetHelpText(wxT("Select your Device."));
375 375
@@ -413,24 +413,39 @@ void DeviceSelectorCtrl::OnAutoDetect(wxCommandEvent& event)
413 int n = ipod_scan(&ipod); 413 int n = ipod_scan(&ipod);
414 if(n == 1) 414 if(n == 1)
415 { 415 {
416 wxString temp(ipod.targetname,wxConvUTF8); 416 wxString temp(ipod.targetname,wxConvUTF8);
417 int index = gv->plat_bootloadername.Index(temp); 417 int index = gv->plat_bootloadername.Index(temp); // use the bootloader names..
418 m_deviceCbx->SetValue(gv->plat_name[index]); 418 m_deviceCbx->SetValue(gv->plat_name[index]);
419 gv->curplat=gv->plat_id[index]; 419 gv->curplat=gv->plat_id[index];
420 return;
420 } 421 }
421 else if (n > 1) 422 else if (n > 1)
422 { 423 {
423 WARN_DIALOG(wxT("More then one device Ipod detected, please connect only One"), 424 WARN_DIALOG(wxT("More then one Ipod device detected, please connect only One"),
424 wxT("Detecting a Device")); 425 wxT("Detecting a Device"));
425 return; 426 return;
426 } 427 }
427 else 428
429 struct sansa_t sansa;
430 int n2 = sansa_scan(&sansa);
431 if(n2==1)
428 { 432 {
429 WARN_DIALOG(wxT("No Device detected. (This function currently only works for Ipods)."), 433 int index = gv->plat_id.Index(wxT("sansae200"));
434 m_deviceCbx->SetValue(gv->plat_name[index]);
435 gv->curplat=gv->plat_id[index];
436 return;
437 }
438 else if (n2 > 1)
439 {
440 WARN_DIALOG(wxT("More then one Sansa device detected, please connect only One"),
430 wxT("Detecting a Device")); 441 wxT("Detecting a Device"));
431 return; 442 return;
432 } 443 }
433 444
445 WARN_DIALOG(wxT("No Device detected. (This function currently only works for Ipods and Sansas)."),
446 wxT("Detecting a Device"));
447 return;
448
434} 449}
435 450
436///////////////////////////////////////////// 451/////////////////////////////////////////////