1 # BiaWeb Website content manager (c) 2010 V.Harishankar
6 import site_configuration_dialog
as scd
10 class MainWindow (PyQt4
.QtGui
.QMainWindow
, ui_main_window
.Ui_MainWindow
):
12 PyQt4
.QtGui
.QMainWindow
.__init
__ (self
)
14 self
.current_db
= None
17 dlg
= scd
.SiteConfigDialog (self
)
18 if dlg
.exec_ () == PyQt4
.QtGui
.QDialog
.Accepted
:
19 site_title
= str (dlg
.site_title
.text ()).strip ()
20 site_url
= str (dlg
.site_url
.text ()).strip ()
21 keywords
= str (dlg
.keywords
.text ()).strip ()
22 destination
= str (dlg
.destination
.text ()).strip ()
23 description
= str (dlg
.description
.toPlainText ()).strip ()
24 num_rss
= dlg
.num_rss_items
.value ()
25 copyright
= str (dlg
.copyright
.text ()).strip ()
27 savefilename
= PyQt4
.QtGui
.QFileDialog
.getSaveFileName (self
, "Save site database to")
30 self
.current_db
= savefilename
31 self
.setWindowTitle ("BiaWeb - " + self
.current_db
)
32 flag
= biaweb_db
.create_db (str (savefilename
), site_title
, site_url
, keywords
, description
,
33 copyright
, num_rss
, destination
)
35 PyQt4
.QtGui
.QMessageBox
.information (self
, "Success",
36 "New site db successfully created")
38 PyQt4
.QtGui
.QMessageBox
.critical (self
, "Error", "SQLite 3 error in creating database.")
40 def onFileQuit (self
):