summaryrefslogtreecommitdiffstats
path: root/dialog.cpp
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-07-16 20:42:32 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2012-07-16 20:42:32 +0200
commit0d2a5ccadac5abf08a0fdc9c80be75dc4e4b5534 (patch)
tree3b0dfb8e8b723fc74fce42b399b73538a9b33b95 /dialog.cpp
parent10ea3185eeaf7c8859bef5044f5a224bf0cd3e3f (diff)
downloadalpine-usb-creator-0d2a5ccadac5abf08a0fdc9c80be75dc4e4b5534.tar.bz2
alpine-usb-creator-0d2a5ccadac5abf08a0fdc9c80be75dc4e4b5534.tar.xz
Enable start button only when source and target is selected
Diffstat (limited to 'dialog.cpp')
-rw-r--r--dialog.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/dialog.cpp b/dialog.cpp
index 7b5145b..73a0ff2 100644
--- a/dialog.cpp
+++ b/dialog.cpp
@@ -33,11 +33,14 @@ void Dialog::RefreshDrives(void)
m_target->Clear();
m_target->Append(wxT("~/tmp/alpine"));
#endif
+ if (!m_target->IsEmpty())
+ m_target->SetSelection(0);
}
void Dialog::OnRefreshDrives(wxCommandEvent &event)
{
RefreshDrives();
+ UpdateStartButton();
}
void Dialog::OnStartButton(wxCommandEvent &event)
@@ -47,5 +50,26 @@ void Dialog::OnStartButton(wxCommandEvent &event)
void Dialog::OnCancelButton(wxCommandEvent &event)
{
- Close();
+ Close();
}
+
+void Dialog::UpdateStartButton(void)
+{
+ if ((m_target->GetSelection() != wxNOT_FOUND)
+ && wxFileExists(m_iso_picker->GetPath())) {
+ m_start_button->Enable();
+ } else {
+ m_start_button->Disable();
+ }
+}
+
+void Dialog::OnIsoChange(wxFileDirPickerEvent &event)
+{
+ UpdateStartButton();
+}
+
+void Dialog::OnTargetChange(wxCommandEvent &event)
+{
+ UpdateStartButton();
+}
+