1
Former-commit-id: 66ee2655c998a22f680c668ad47697caa2f9d879
This commit is contained in:
Alex Yatskov 2013-11-10 14:17:42 -08:00
parent b82a42f875
commit d9c6a5667d
3 changed files with 23 additions and 23 deletions

View File

@ -17,11 +17,11 @@
from PyQt4 import QtGui from PyQt4 import QtGui
from gen import about_ui
import constants import constants
import gen.about_ui
class DialogAbout(QtGui.QDialog, about_ui.Ui_DialogAbout): class DialogAbout(QtGui.QDialog, gen.about_ui.Ui_DialogAbout):
def __init__(self, parent): def __init__(self, parent):
QtGui.QDialog.__init__(self, parent) QtGui.QDialog.__init__(self, parent)
self.setupUi(self) self.setupUi(self)

View File

@ -17,11 +17,11 @@
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore
from gen import preferences_ui
import copy import copy
import gen.preferences_ui
class DialogPreferences(QtGui.QDialog, preferences_ui.Ui_DialogPreferences): class DialogPreferences(QtGui.QDialog, gen.preferences_ui.Ui_DialogPreferences):
def __init__(self, parent, preferences, anki): def __init__(self, parent, preferences, anki):
QtGui.QDialog.__init__(self, parent) QtGui.QDialog.__init__(self, parent)
self.setupUi(self) self.setupUi(self)

View File

@ -17,17 +17,17 @@
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore
from about import DialogAbout import about
from gen import reader_ui
from preferences import DialogPreferences
import constants import constants
import gen.reader_ui
import os import os
import preferences
import reader_util import reader_util
import tarfile import tarfile
import update import update
class MainWindowReader(QtGui.QMainWindow, reader_ui.Ui_MainWindowReader): class MainWindowReader(QtGui.QMainWindow, gen.reader_ui.Ui_MainWindowReader):
class State: class State:
def __init__(self): def __init__(self):
self.filename = unicode() self.filename = unicode()
@ -66,26 +66,26 @@ class MainWindowReader(QtGui.QMainWindow, reader_ui.Ui_MainWindowReader):
if len(filenames) > 0: if len(filenames) > 0:
self.openFile(filenames[0]) self.openFile(filenames[0])
self.actionAbout.triggered.connect(self.onActionAbout)
self.actionCopyAllDefinitions.triggered.connect(self.onActionCopyAllDefinitions)
self.actionCopyDefinition.triggered.connect(self.onActionCopyDefinition)
self.actionCopySentence.triggered.connect(self.onActionCopySentence)
self.actionFeedback.triggered.connect(self.onActionFeedback)
self.actionFind.triggered.connect(self.onActionFind)
self.actionFindNext.triggered.connect(self.onActionFindNext)
self.actionHomepage.triggered.connect(self.onActionHomepage)
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.actionToggleWrap.toggled.connect(self.onActionToggleWrap)
self.actionZoomIn.triggered.connect(self.onActionZoomIn) self.actionZoomIn.triggered.connect(self.onActionZoomIn)
self.actionZoomOut.triggered.connect(self.onActionZoomOut) self.actionZoomOut.triggered.connect(self.onActionZoomOut)
self.actionZoomReset.triggered.connect(self.onActionZoomReset) self.actionZoomReset.triggered.connect(self.onActionZoomReset)
self.actionFind.triggered.connect(self.onActionFind) self.dockAnki.visibilityChanged.connect(self.onVisibilityChanged)
self.actionFindNext.triggered.connect(self.onActionFindNext) self.dockKanji.visibilityChanged.connect(self.onVisibilityChanged)
self.actionToggleWrap.toggled.connect(self.onActionToggleWrap) self.dockVocab.visibilityChanged.connect(self.onVisibilityChanged)
self.actionCopyDefinition.triggered.connect(self.onActionCopyDefinition) self.listDefinitions.itemDoubleClicked.connect(self.onDefinitionDoubleClicked)
self.actionCopyAllDefinitions.triggered.connect(self.onActionCopyAllDefinitions)
self.actionCopySentence.triggered.connect(self.onActionCopySentence)
self.actionHomepage.triggered.connect(self.onActionHomepage)
self.actionFeedback.triggered.connect(self.onActionFeedback)
self.textDefinitions.anchorClicked.connect(self.onDefinitionsAnchorClicked) self.textDefinitions.anchorClicked.connect(self.onDefinitionsAnchorClicked)
self.textVocabSearch.returnPressed.connect(self.onDefinitionSearchReturn) self.textVocabSearch.returnPressed.connect(self.onDefinitionSearchReturn)
self.listDefinitions.itemDoubleClicked.connect(self.onDefinitionDoubleClicked)
self.dockVocab.visibilityChanged.connect(self.onVisibilityChanged)
self.dockKanji.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['checkForUpdates']: if self.preferences['checkForUpdates']:
@ -166,13 +166,13 @@ class MainWindowReader(QtGui.QMainWindow, reader_ui.Ui_MainWindowReader):
def onActionPreferences(self): def onActionPreferences(self):
dialog = DialogPreferences(self, self.preferences, self.anki) dialog = preferences.DialogPreferences(self, self.preferences, self.anki)
if dialog.exec_() == QtGui.QDialog.Accepted: if dialog.exec_() == QtGui.QDialog.Accepted:
self.applyPreferencesContent() self.applyPreferencesContent()
def onActionAbout(self): def onActionAbout(self):
dialog = DialogAbout(self) dialog = about.DialogAbout(self)
dialog.exec_() dialog.exec_()