diff --git a/core/preferences.py b/core/preferences.py index 316978e..9683080 100644 --- a/core/preferences.py +++ b/core/preferences.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- + # Copyright (C) 2011 Alex Yatskov # # This program is free software: you can redistribute it and/or modify @@ -24,16 +25,11 @@ class DialogPreferences(QtGui.QDialog, Ui_DialogPreferences): QtGui.QDialog.__init__(self, parent) self.setupUi(self) - bindings = [ - (self, 'accepted()', self.onAccept), - (self.buttonContentColorFg, 'clicked()', self.onButtonColorFgClicked), - (self.buttonContentColorBg, 'clicked()', self.onButtonColorBgClicked), - (self.comboContentFontFamily, 'currentFontChanged(const QFont&)', self.onFontFamilyChanged), - (self.spinContentFontSize, 'valueChanged(int)', self.onFontSizeChanged) - ] - - for action, signal, callback in bindings: - self.connect(action, QtCore.SIGNAL(signal), callback) + self.accepted.connect(self.onAccept) + self.buttonContentColorFg.clicked.connect(self.onButtonColorFgClicked) + self.buttonContentColorBg.clicked.connect(self.onButtonColorBgClicked) + self.comboContentFontFamily.currentFontChanged.connect(self.onFontFamilyChanged) + self.spinContentFontSize.valueChanged.connect(self.onFontSizeChanged) self.preferences = preferences self.anki = anki diff --git a/core/reader.py b/core/reader.py index 6d26f99..0ea41d3 100644 --- a/core/reader.py +++ b/core/reader.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- + +# # Copyright (C) 2011 Alex Yatskov # # This program is free software: you can redistribute it and/or modify @@ -13,6 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# import os @@ -70,9 +73,6 @@ class MainWindowReader(QtGui.QMainWindow, Ui_MainWindowReader): if filenames: self.openFile(filenames[0]) - if self.preferences.generalFindUpdates: - self.updateFinder.start() - self.actionOpen.triggered.connect(self.onActionOpen) self.actionPreferences.triggered.connect(self.onActionPreferences) self.actionAbout.triggered.connect(self.onActionAbout) @@ -94,6 +94,9 @@ class MainWindowReader(QtGui.QMainWindow, Ui_MainWindowReader): self.dockAnki.visibilityChanged.connect(self.onVisibilityChanged) self.updateFinder.updateResult.connect(self.onUpdaterSearchResult) + if self.preferences.generalFindUpdates: + self.updateFinder.start() + def applyPreferences(self): if self.preferences.uiReaderState != None: