From d9c6a5667d1267cc2a8d9001ebd22b2da3088dcd Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 10 Nov 2013 14:17:42 -0800 Subject: [PATCH] Cleanup Former-commit-id: 66ee2655c998a22f680c668ad47697caa2f9d879 --- yomi_base/about.py | 4 ++-- yomi_base/preferences.py | 4 ++-- yomi_base/reader.py | 38 +++++++++++++++++++------------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/yomi_base/about.py b/yomi_base/about.py index 2f51a19..ceae11f 100644 --- a/yomi_base/about.py +++ b/yomi_base/about.py @@ -17,11 +17,11 @@ from PyQt4 import QtGui -from gen import about_ui 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): QtGui.QDialog.__init__(self, parent) self.setupUi(self) diff --git a/yomi_base/preferences.py b/yomi_base/preferences.py index 541ba5e..d782bce 100644 --- a/yomi_base/preferences.py +++ b/yomi_base/preferences.py @@ -17,11 +17,11 @@ from PyQt4 import QtGui, QtCore -from gen import preferences_ui 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): QtGui.QDialog.__init__(self, parent) self.setupUi(self) diff --git a/yomi_base/reader.py b/yomi_base/reader.py index 0084196..e4fc7d8 100644 --- a/yomi_base/reader.py +++ b/yomi_base/reader.py @@ -17,17 +17,17 @@ from PyQt4 import QtGui, QtCore -from about import DialogAbout -from gen import reader_ui -from preferences import DialogPreferences +import about import constants +import gen.reader_ui import os +import preferences import reader_util import tarfile import update -class MainWindowReader(QtGui.QMainWindow, reader_ui.Ui_MainWindowReader): +class MainWindowReader(QtGui.QMainWindow, gen.reader_ui.Ui_MainWindowReader): class State: def __init__(self): self.filename = unicode() @@ -66,26 +66,26 @@ class MainWindowReader(QtGui.QMainWindow, reader_ui.Ui_MainWindowReader): if len(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.actionPreferences.triggered.connect(self.onActionPreferences) - self.actionAbout.triggered.connect(self.onActionAbout) + self.actionToggleWrap.toggled.connect(self.onActionToggleWrap) self.actionZoomIn.triggered.connect(self.onActionZoomIn) self.actionZoomOut.triggered.connect(self.onActionZoomOut) self.actionZoomReset.triggered.connect(self.onActionZoomReset) - self.actionFind.triggered.connect(self.onActionFind) - self.actionFindNext.triggered.connect(self.onActionFindNext) - self.actionToggleWrap.toggled.connect(self.onActionToggleWrap) - self.actionCopyDefinition.triggered.connect(self.onActionCopyDefinition) - 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.dockAnki.visibilityChanged.connect(self.onVisibilityChanged) + self.dockKanji.visibilityChanged.connect(self.onVisibilityChanged) + self.dockVocab.visibilityChanged.connect(self.onVisibilityChanged) + self.listDefinitions.itemDoubleClicked.connect(self.onDefinitionDoubleClicked) self.textDefinitions.anchorClicked.connect(self.onDefinitionsAnchorClicked) 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) if self.preferences['checkForUpdates']: @@ -166,13 +166,13 @@ class MainWindowReader(QtGui.QMainWindow, reader_ui.Ui_MainWindowReader): def onActionPreferences(self): - dialog = DialogPreferences(self, self.preferences, self.anki) + dialog = preferences.DialogPreferences(self, self.preferences, self.anki) if dialog.exec_() == QtGui.QDialog.Accepted: self.applyPreferencesContent() def onActionAbout(self): - dialog = DialogAbout(self) + dialog = about.DialogAbout(self) dialog.exec_()