X-Git-Url: https://harishankar.org/repos/?p=biaweb_qt.git;a=blobdiff_plain;f=main_window.py;fp=main_window.py;h=b2547b65899ed2131d0ebf1f626d8693969c52e6;hp=0d6c91a5d96036ed4690a2091e88e624cc3be40a;hb=903f2462bb6e7130191b1b0c667a9f6fce1e6189;hpb=e14aab0777f4dcc7200894ee75fab329007adb53 diff --git a/main_window.py b/main_window.py index 0d6c91a..b2547b6 100644 --- a/main_window.py +++ b/main_window.py @@ -5,6 +5,7 @@ import PyQt4 import ui_main_window import site_configuration_dialog as scd import category_dialog as catd +import article_dialog as artd import biaweb_db import sys @@ -44,6 +45,29 @@ class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow): self.repopulate_categories () self.repopulate_articles () + # when add article is triggered + def onArticleAdd (self): + if self.current_db == None: + PyQt4.QtGui.QMessageBox.critical (self, "Error", + "Cannot create article. You need to create or open a website first") + else: + catid = self.get_selected_item_id (self.categories) + # if no category is selected + if catid is None: + PyQt4.QtGui.QMessageBox.critical (self, "Error", "No category selected for article") + return + artdlg = artd.ArticleDialog (self) + artdlg.exec_ () + + + # when edit article is triggered + def onArticleEdit (self): + pass + + # when delete article is triggered + def onArticleDelete (self): + pass + # when item selection is changed in categories tree widget def onCategorySelectionChanged (self): if self.current_db is not None: