X-Git-Url: https://harishankar.org/repos/?p=biaweb_qt.git;a=blobdiff_plain;f=main_window.py;fp=main_window.py;h=6b7f31ad7f919c0e369bf4c8c81199465cb2a60c;hp=32e39f9910728c616659a388c362032407e1d18b;hb=2687a3c3b18c3a267ca60ecdd3759ed0856471e0;hpb=c78ebaf4ae0e486c54907edf51159615f2b4f81e diff --git a/main_window.py b/main_window.py index 32e39f9..6b7f31a 100644 --- a/main_window.py +++ b/main_window.py @@ -20,7 +20,9 @@ class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow): # refresh the category list def repopulate_categories (self): recs = biaweb_db.get_categories (self.current_db) - if not recs: + + # check with False because None is returned when no records exist + if recs == False: PyQt4.QtGui.QMessageBox.critical (self, "Error", "SQLite 3 error in getting the categories") return @@ -32,7 +34,9 @@ class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow): # refresh the articles list def repopulate_articles (self, catid=None): recs = biaweb_db.get_articles (self.current_db, catid) - if not recs: + + # check with False because None is returned when no records exist + if recs == False: PyQt4.QtGui.QMessageBox.critical (self, "Error", "SQLite 3 error in getting the articles") return @@ -218,7 +222,7 @@ class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow): PyQt4.QtGui.QMessageBox.critical (self, "Error", "Cannot edit templates. You need to create or open a website first") else: - tdlg = tpld.TemplatesDialog (self) + tdlg = tpld.TemplatesDialog (self, self.current_db) tdlg.exec_ () # function to get the category or article ID from current selected item in a tree widget