diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-07-16 20:42:32 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-07-16 20:42:32 +0200 |
commit | 0d2a5ccadac5abf08a0fdc9c80be75dc4e4b5534 (patch) | |
tree | 3b0dfb8e8b723fc74fce42b399b73538a9b33b95 /dialog.cpp | |
parent | 10ea3185eeaf7c8859bef5044f5a224bf0cd3e3f (diff) | |
download | alpine-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.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -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(); +} + |