1

more binding changes

This commit is contained in:
Alex Yatskov 2011-10-27 08:18:57 -07:00
parent 0f84f444fb
commit 426463b2c1
2 changed files with 12 additions and 13 deletions

View File

@ -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

View File

@ -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 <http://www.gnu.org/licenses/>.
#
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: