diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-09-29 19:47:49 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-09-29 19:47:49 +0300 |
commit | afb66424e8a237a9878e85c93391f788bd98a28e (patch) | |
tree | 60419168be004db456fd922fa0f0bec32c55efed /mesongui.py | |
parent | 6e4fa81733239da4f48d979d3c755ecf71c226a3 (diff) | |
download | meson-afb66424e8a237a9878e85c93391f788bd98a28e.zip meson-afb66424e8a237a9878e85c93391f788bd98a28e.tar.gz meson-afb66424e8a237a9878e85c93391f788bd98a28e.tar.bz2 |
Prevent premature generation.
Diffstat (limited to 'mesongui.py')
-rwxr-xr-x | mesongui.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/mesongui.py b/mesongui.py index e2e5731..2abf793 100755 --- a/mesongui.py +++ b/mesongui.py @@ -378,7 +378,6 @@ class Starter(): uifile = 'mesonstart.ui' self.ui = uic.loadUi(uifile) self.ui.source_entry.setText(sdir) - self.ui.show() self.dialog = PyQt5.QtWidgets.QFileDialog() if len(sdir) == 0: self.dialog.setDirectory(os.getcwd()) @@ -387,6 +386,21 @@ class Starter(): self.ui.source_browse_button.clicked.connect(self.src_browse_clicked) self.ui.build_browse_button.clicked.connect(self.build_browse_clicked) self.ui.cross_browse_button.clicked.connect(self.cross_browse_clicked) + self.ui.source_entry.textChanged.connect(self.update_button) + self.ui.build_entry.textChanged.connect(self.update_button) + self.ui.generate_button.clicked.connect(self.generate) + self.update_button() + self.ui.show() + + def generate(self): + srcdir = self.ui.source_entry.text() + builddir = self.ui.build_entry.text() + + def update_button(self): + if self.ui.source_entry.text() == '' or self.ui.build_entry.text() == '': + self.ui.generate_button.setEnabled(False) + else: + self.ui.generate_button.setEnabled(True) def src_browse_clicked(self): self.dialog.setFileMode(2) |