1 # BiaWeb Website content manager (c) 2010 V.Harishankar
2 # Site Configuration Dialog class
6 import ui_site_configuration_dialog
as uscd
8 class SiteConfigDialog (PyQt4
.QtGui
.QDialog
, uscd
.Ui_SiteConfigDialog
):
9 def __init__ (self
, parent
):
10 PyQt4
.QtGui
.QDialog
.__init
__ (self
, parent
)
14 destpath
= PyQt4
.QtGui
.QFileDialog
.getExistingDirectory (self
, "Select destination directory",
15 os
.path
.expanduser ("~") )
17 self
.destination
.setText (destpath
)
20 site_title
= str (self
.site_title
.text ()).strip ()
21 site_url
= str (self
.site_url
.text ()).strip ()
22 keywords
= str (self
.keywords
.text ()).strip ()
23 destination
= str (self
.destination
.text ()).strip ()
24 description
= str (self
.description
.toPlainText ()).strip ()
26 # site title, url, description, keywords and destination folder are required
27 if site_title
<> "" and site_url
<> "" and keywords
<> "" and destination
<> "" and description
<> "":
28 PyQt4
.QtGui
.QDialog
.accept (self
)
30 PyQt4
.QtGui
.QMessageBox
.critical (self
, "Missing Fields", "Some required fields are missing")