Skip to content

Commit 6e495f8

Browse files
committed
Ensure that the root path is not left blank
1 parent 4d85c76 commit 6e495f8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

update_gui.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def __init__(self, server, parent=None):
6363
self.progress = 0
6464

6565
self.root_path = QLineEdit()
66+
self.root_path.textChanged[str].connect(self.on_path_changed)
6667
self.browse_button = QPushButton('Browse...')
6768
self.browse_button.clicked.connect(self.on_browse_button)
6869
self.progress_bar = QProgressBar()
@@ -76,6 +77,7 @@ def __init__(self, server, parent=None):
7677
self.to_combo_box = QComboBox()
7778
self.to_combo_box.addItems(self.server.available_updates())
7879
self.update_button = QPushButton('Go!')
80+
self.update_button.setEnabled(False)
7981
self.update_button.clicked.connect(self.on_update_button)
8082
self.status_label = QLabel('Idle.')
8183
self.step_label = QLabel()
@@ -153,6 +155,9 @@ def on_autodetect_checked(self):
153155
self.from_combo_box.setEnabled(not self.autodetect_checkbox.isChecked())
154156
self.perform_autodetect()
155157

158+
def on_path_changed(self, path):
159+
self.update_button.setEnabled(bool(path))
160+
156161
def on_browse_button(self):
157162
dialog = QFileDialog(self, 'Select root path...')
158163
dialog.setFileMode(QFileDialog.DirectoryOnly)

0 commit comments

Comments
 (0)