Esempio n. 1
0
	def __init__(self, qnotero, firstRun=False):

		"""
		Constructor

		Arguments:
		qnotero -- a Qnotero instance

		Keyword arguments:
		firstRun -- indicates if the first run message should be shown
					(default=False)
		"""

		QDialog.__init__(self)
		self.qnotero = qnotero
		self.ui = Ui_Preferences()
		self.ui.setupUi(self)
		self.ui.labelLocatePath.hide()
		if not firstRun:
			self.ui.labelFirstRun.hide()
		self.ui.labelTitleMsg.setText( \
			self.ui.labelTitleMsg.text().replace(u"[version]", \
			self.qnotero.version))
		self.ui.pushButtonZoteroPathAutoDetect.clicked.connect( \
			self.zoteroPathAutoDetect)
		self.ui.pushButtonZoteroPathBrowse.clicked.connect( \
			self.zoteroPathBrowse)
		self.ui.checkBoxAutoUpdateCheck.setChecked(getConfig(u"autoUpdateCheck"))
		self.ui.lineEditZoteroPath.setText(getConfig(u"zoteroPath"))
		i = 0
		import libqnotero._themes
		themePath = os.path.dirname(libqnotero._themes.__file__)
		for _, theme, _ in pkgutil.iter_modules([themePath]):
			self.ui.comboBoxTheme.addItem(theme)
			if theme == getConfig(u"theme").lower():
				self.ui.comboBoxTheme.setCurrentIndex(i)
			i += 1
		self.setStyleSheet(self.qnotero.styleSheet())
		self.adjustSize()