Skip to content

Commit

Permalink
Small changes to collection creator dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
radosuav committed Jul 10, 2020
1 parent 1197a0a commit 69ec87d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions CollectionCreatorDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,19 @@ def selectIcon(self):
self.tr("Select image"),
self.basedir,
self.tr("Image Files(*.png *.jpg *.bmp)"))[0]
self.lineEdit_icon.setText(filename)
self.checkIcon()
self.iconSelected = 1
self.activateButton()
if filename:
self.lineEdit_icon.setText(filename)
self.checkIcon()
self.iconSelected = 1
self.activateButton()

def selectCss(self):
filename = QFileDialog.getOpenFileName(self,
self.tr("Select CSS file"),
self.basedir,
self.tr("CSS Files(*.css *.CSS)"))[0]
self.lineEdit_css.setText(filename)
self.activateButton()
if filename:
self.lineEdit_css.setText(filename)

def closeWindow(self):
self.close()
Expand Down Expand Up @@ -101,6 +102,8 @@ def createCollection(self):
confOptions["description"] = self.lineEdit_desc.text()
confOptions["name"] = self.lineEdit_name.text()
confOptions["icon"] = self.copyFile(self.lineEdit_icon.text())
if not self.lineEdit_css.text():
self.lineEdit_css.setText(os.path.join(os.path.dirname(__file__), "style.css"))
confOptions["css"] = self.copyFile(self.lineEdit_css.text())
confOptions["aboutHTML"] = self.textEdit_about.toPlainText()
with io.open(self.confFile, 'w', encoding="utf-8") as fp:
Expand Down

0 comments on commit 69ec87d

Please sign in to comment.