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 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2011 Alex Yatskov # Copyright (C) 2011 Alex Yatskov
# #
# This program is free software: you can redistribute it and/or modify # 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) QtGui.QDialog.__init__(self, parent)
self.setupUi(self) self.setupUi(self)
bindings = [ self.accepted.connect(self.onAccept)
(self, 'accepted()', self.onAccept), self.buttonContentColorFg.clicked.connect(self.onButtonColorFgClicked)
(self.buttonContentColorFg, 'clicked()', self.onButtonColorFgClicked), self.buttonContentColorBg.clicked.connect(self.onButtonColorBgClicked)
(self.buttonContentColorBg, 'clicked()', self.onButtonColorBgClicked), self.comboContentFontFamily.currentFontChanged.connect(self.onFontFamilyChanged)
(self.comboContentFontFamily, 'currentFontChanged(const QFont&)', self.onFontFamilyChanged), self.spinContentFontSize.valueChanged.connect(self.onFontSizeChanged)
(self.spinContentFontSize, 'valueChanged(int)', self.onFontSizeChanged)
]
for action, signal, callback in bindings:
self.connect(action, QtCore.SIGNAL(signal), callback)
self.preferences = preferences self.preferences = preferences
self.anki = anki self.anki = anki

View File

@ -1,4 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Alex Yatskov # Copyright (C) 2011 Alex Yatskov
# #
# This program is free software: you can redistribute it and/or modify # 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 # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import os import os
@ -70,9 +73,6 @@ class MainWindowReader(QtGui.QMainWindow, Ui_MainWindowReader):
if filenames: if filenames:
self.openFile(filenames[0]) self.openFile(filenames[0])
if self.preferences.generalFindUpdates:
self.updateFinder.start()
self.actionOpen.triggered.connect(self.onActionOpen) self.actionOpen.triggered.connect(self.onActionOpen)
self.actionPreferences.triggered.connect(self.onActionPreferences) self.actionPreferences.triggered.connect(self.onActionPreferences)
self.actionAbout.triggered.connect(self.onActionAbout) self.actionAbout.triggered.connect(self.onActionAbout)
@ -94,6 +94,9 @@ class MainWindowReader(QtGui.QMainWindow, Ui_MainWindowReader):
self.dockAnki.visibilityChanged.connect(self.onVisibilityChanged) self.dockAnki.visibilityChanged.connect(self.onVisibilityChanged)
self.updateFinder.updateResult.connect(self.onUpdaterSearchResult) self.updateFinder.updateResult.connect(self.onUpdaterSearchResult)
if self.preferences.generalFindUpdates:
self.updateFinder.start()
def applyPreferences(self): def applyPreferences(self):
if self.preferences.uiReaderState != None: if self.preferences.uiReaderState != None: