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 # check the required fields before accepting
21 site_title
= str (self
.site_title
.text ()).strip ()
22 site_url
= str (self
.site_url
.text ()).strip ()
23 keywords
= str (self
.keywords
.text ()).strip ()
24 destination
= str (self
.destination
.text ()).strip ()
25 description
= str (self
.description
.toPlainText ()).strip ()
27 # site title, url, description, keywords and destination folder are required
28 if site_title
<> "" and site_url
<> "" and keywords
<> "" and destination
<> "" and description
<> "":
29 PyQt4
.QtGui
.QDialog
.accept (self
)
31 PyQt4
.QtGui
.QMessageBox
.critical (self
, "Missing Fields", "Some required fields are missing")