Skip to content

Commit

Permalink
Ensure that the root path is not left blank
Browse files Browse the repository at this point in the history
  • Loading branch information
puigru committed Sep 26, 2019
1 parent 4d85c76 commit 6e495f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions update_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def __init__(self, server, parent=None):
self.progress = 0

self.root_path = QLineEdit()
self.root_path.textChanged[str].connect(self.on_path_changed)
self.browse_button = QPushButton('Browse...')
self.browse_button.clicked.connect(self.on_browse_button)
self.progress_bar = QProgressBar()
Expand All @@ -76,6 +77,7 @@ def __init__(self, server, parent=None):
self.to_combo_box = QComboBox()
self.to_combo_box.addItems(self.server.available_updates())
self.update_button = QPushButton('Go!')
self.update_button.setEnabled(False)
self.update_button.clicked.connect(self.on_update_button)
self.status_label = QLabel('Idle.')
self.step_label = QLabel()
Expand Down Expand Up @@ -153,6 +155,9 @@ def on_autodetect_checked(self):
self.from_combo_box.setEnabled(not self.autodetect_checkbox.isChecked())
self.perform_autodetect()

def on_path_changed(self, path):
self.update_button.setEnabled(bool(path))

def on_browse_button(self):
dialog = QFileDialog(self, 'Select root path...')
dialog.setFileMode(QFileDialog.DirectoryOnly)
Expand Down

0 comments on commit 6e495f8

Please sign in to comment.