summaryrefslogtreecommitdiffstats
path: root/mga-advisor.py
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2024-03-08 17:32:08 +0100
committerPapoteur <papoteur@mageia.org>2024-03-08 17:32:08 +0100
commit03408f8ba991626cecb0262f763e83ba7d584f98 (patch)
tree31dced8461911a99b1399a4271264dfaec640fe8 /mga-advisor.py
parent05e57051fb6bf346da7e0700a1262579b346d827 (diff)
downloadmga-advisor-master.tar
mga-advisor-master.tar.gz
mga-advisor-master.tar.bz2
mga-advisor-master.tar.xz
mga-advisor-master.zip
Ad check that there is source at export timeHEADmaster
Diffstat (limited to 'mga-advisor.py')
-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()