summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mga-advisor.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/mga-advisor.py b/mga-advisor.py
index ef34888..8fbcf73 100644
--- a/mga-advisor.py
+++ b/mga-advisor.py
@@ -255,7 +255,7 @@ class Widget(QWidget):
return yaml.dump(data, default_flow_style=False, sort_keys=False, width=75, allow_unicode=True)
def export(self):
- if not self.valid_number():
+ if not self.check_data():
return
default_path = self.settings.value("Default/path", "/mageia-advisories/advisories")
if QDir().mkpath(QDir().homePath() + default_path):
@@ -275,6 +275,20 @@ class Widget(QWidget):
filepath = filepath[len(QDir().homePath()):]
self.settings.setValue('Default/path', filepath)
+ def check_data(self):
+ anomalies = ""
+ if self.ui.bug_le.text() == "":
+ anomalies = "\n".join([anomalies, "- no bug number given"])
+ if self.ui.list_src.count() == 0:
+ anomalies = "\n".join([anomalies, "- no source given"])
+ if anomalies != "":
+ message = "There is anomalies:\n" + anomalies + "\nDo you want to continue?"
+ mb = QMessageBox(QMessageBox.Warning, "Anomalies", message, QMessageBox.Yes|QMessageBox.No)
+ returncode = mb.exec()
+ if returncode != QMessageBox.Yes:
+ return False
+ return True
+
def cancel(self):
self.close()