From 5e53d40e68c5b001ddfb239f8b5a51c66e6e5ec9 Mon Sep 17 00:00:00 2001 From: BasioMeusPuga Date: Fri, 23 Mar 2018 23:56:01 +0530 Subject: [PATCH] Redesign settings dialog Remove dependency on requests --- lector/definitionsdialog.py | 21 +- lector/resources/raw/settings.ui | 436 ++++++++++++++++------------- lector/resources/settingswindow.py | 207 ++++++++------ lector/settingsdialog.py | 32 ++- lector/widgets.py | 2 +- setup.py | 8 +- 6 files changed, 409 insertions(+), 297 deletions(-) diff --git a/lector/definitionsdialog.py b/lector/definitionsdialog.py index 8b3b559..da851aa 100644 --- a/lector/definitionsdialog.py +++ b/lector/definitionsdialog.py @@ -16,7 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import requests +import json +import urllib.request from PyQt5 import QtWidgets, QtCore, QtGui, QtMultimedia from lector.resources import definitions @@ -57,18 +58,21 @@ class DefinitionsUI(QtWidgets.QDialog, definitions.Ui_Dialog): language = self.parent.settings['dictionary_language'] url = url + language + '/' + word.lower() - r = requests.get( - url, - headers={'app_id': self.app_id, 'app_key': self.app_key}) + req = urllib.request.Request(url) + req.add_header('app_id', self.app_id) + req.add_header('app_key', self.app_key) - if r.status_code != 200: - print('A firm nope on the dictionary finding thing') + try: + response = urllib.request.urlopen(req) + if response.getcode() == 200: + return_json = json.loads(response.read()) + return return_json + except urllib.error.HTTPError: return None - return r.json() - def find_definition(self, word): word_root_json = self.api_call(self.root_url, word) + print(word_root_json) if not word_root_json: self.set_text(word, None, None, True) return @@ -78,6 +82,7 @@ class DefinitionsUI(QtWidgets.QDialog, definitions.Ui_Dialog): definition_json = self.api_call(self.define_url, word_root) if not definition_json: + self.set_text(word, None, None, True) return definitions = {} diff --git a/lector/resources/raw/settings.ui b/lector/resources/raw/settings.ui index f03b912..cabeb71 100644 --- a/lector/resources/raw/settings.ui +++ b/lector/resources/raw/settings.ui @@ -6,206 +6,264 @@ 0 0 - 1216 - 658 + 1022 + 513 Settings - + - - - - - Library - - - - - - - - - true - - - false - - - - - - - - - - Switches - - - - - - - - - - Startup: Refresh library - - - - - - - Remember open files - - - - - - - Enabling reduces startup time and memory usage - - - Load covers only when needed - - - - - - - - - - - - - Cover shadows - - - - - - - Generate tags from files - - - - - - - Greatly reduces page transition time at the cost of more memory - - - Cache comic / pdf pages - - - - - - - - - - - - - - 0 - 0 - - - - Dictionary: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - - - - - Horizontal scrolling with Alt + Scroll -Reopen book to see changes - - - Hide scrollbars when reading - - - - - - - - - Restart application to see changes - - - Icon theme: - - - - - - - Restart application to see changes - - - Dar&k - - - - - - - Restart application to see changes - - - &Light - - - - - - - - - - - + + + + 0 + 0 + + + - - + + - - - Scan Library - + + + + + + + + + + + + + + + + Library + + + + + + + + + + Startup: Refresh library + + + + + + + Remember open files + + + + + + + + + + + Cover shadows + + + + + + + Enabling reduces startup time and memory usage + + + Load covers only when needed + + + + + + + + + + + Generate tags from files + + + + + + + + + Restart application to see changes + + + Icon theme: + + + + + + + Restart application to see changes + + + &Dark + + + + + + + Restart application to see changes + + + L&ight + + + + + + + + + + + + + + + + Reading + + + + + + + + + + Horizontal scrolling with Alt + Scroll +Reopen book to see changes + + + Hide scrollbars when reading + + + + + + + Greatly reduces page transition time at the cost of more memory + + + Cache comic / pdf pages + + + + + + + + + + + + + + 0 + 0 + + + + Dictionary language: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + true + + + false + + + + + - - - Close - - - - - - - About - - - true - - + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Scan Library + + + + + + + Close + + + + diff --git a/lector/resources/settingswindow.py b/lector/resources/settingswindow.py index 8ccd2fc..8914b37 100644 --- a/lector/resources/settingswindow.py +++ b/lector/resources/settingswindow.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'raw/settings.ui' +# Form implementation generated from reading ui file 'raw/settings2.ui' # # Created by: PyQt5 UI code generator 5.10.1 # @@ -11,30 +11,41 @@ from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName("Dialog") - Dialog.resize(1216, 658) - self.gridLayout_3 = QtWidgets.QGridLayout(Dialog) - self.gridLayout_3.setObjectName("gridLayout_3") - self.verticalLayout_2 = QtWidgets.QVBoxLayout() - self.verticalLayout_2.setObjectName("verticalLayout_2") - self.groupBox_2 = QtWidgets.QGroupBox(Dialog) - self.groupBox_2.setObjectName("groupBox_2") - self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox_2) - self.gridLayout_2.setObjectName("gridLayout_2") - self.treeView = QtWidgets.QTreeView(self.groupBox_2) - self.treeView.setObjectName("treeView") - self.gridLayout_2.addWidget(self.treeView, 0, 0, 1, 1) - self.aboutBox = QtWidgets.QTextBrowser(self.groupBox_2) - self.aboutBox.setOpenExternalLinks(True) - self.aboutBox.setOpenLinks(False) - self.aboutBox.setObjectName("aboutBox") - self.gridLayout_2.addWidget(self.aboutBox, 1, 0, 1, 1) - self.verticalLayout_2.addWidget(self.groupBox_2) - self.groupBox = QtWidgets.QGroupBox(Dialog) - self.groupBox.setObjectName("groupBox") - self.gridLayout = QtWidgets.QGridLayout(self.groupBox) + Dialog.resize(1022, 513) + self.gridLayout = QtWidgets.QGridLayout(Dialog) self.gridLayout.setObjectName("gridLayout") + self.listView = QtWidgets.QListView(Dialog) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.listView.sizePolicy().hasHeightForWidth()) + self.listView.setSizePolicy(sizePolicy) + self.listView.setObjectName("listView") + self.gridLayout.addWidget(self.listView, 0, 0, 1, 1) + self.verticalLayout_4 = QtWidgets.QVBoxLayout() + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.stackedWidget = QtWidgets.QStackedWidget(Dialog) + self.stackedWidget.setObjectName("stackedWidget") + self.treeViewPage = QtWidgets.QWidget() + self.treeViewPage.setObjectName("treeViewPage") + self.gridLayout_5 = QtWidgets.QGridLayout(self.treeViewPage) + self.gridLayout_5.setObjectName("gridLayout_5") + self.treeView = QtWidgets.QTreeView(self.treeViewPage) + self.treeView.setObjectName("treeView") + self.gridLayout_5.addWidget(self.treeView, 0, 0, 1, 1) + self.stackedWidget.addWidget(self.treeViewPage) + self.switchPage = QtWidgets.QWidget() + self.switchPage.setObjectName("switchPage") + self.gridLayout_2 = QtWidgets.QGridLayout(self.switchPage) + self.gridLayout_2.setObjectName("gridLayout_2") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") + self.groupBox = QtWidgets.QGroupBox(self.switchPage) + self.groupBox.setObjectName("groupBox") + self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox) + self.gridLayout_4.setObjectName("gridLayout_4") + self.verticalLayout_2 = QtWidgets.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.refreshLibrary = QtWidgets.QCheckBox(self.groupBox) @@ -43,28 +54,56 @@ class Ui_Dialog(object): self.fileRemember = QtWidgets.QCheckBox(self.groupBox) self.fileRemember.setObjectName("fileRemember") self.horizontalLayout_4.addWidget(self.fileRemember) - self.performCulling = QtWidgets.QCheckBox(self.groupBox) - self.performCulling.setObjectName("performCulling") - self.horizontalLayout_4.addWidget(self.performCulling) - self.verticalLayout.addLayout(self.horizontalLayout_4) - self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.coverShadows = QtWidgets.QCheckBox(self.groupBox) - self.coverShadows.setObjectName("coverShadows") - self.horizontalLayout.addWidget(self.coverShadows) - self.autoTags = QtWidgets.QCheckBox(self.groupBox) - self.autoTags.setObjectName("autoTags") - self.horizontalLayout.addWidget(self.autoTags) - self.cachingEnabled = QtWidgets.QCheckBox(self.groupBox) - self.cachingEnabled.setObjectName("cachingEnabled") - self.horizontalLayout.addWidget(self.cachingEnabled) - self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1) - self.horizontalLayout_6 = QtWidgets.QHBoxLayout() - self.horizontalLayout_6.setObjectName("horizontalLayout_6") + self.verticalLayout_2.addLayout(self.horizontalLayout_4) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") - self.languageLabel = QtWidgets.QLabel(self.groupBox) + self.coverShadows = QtWidgets.QCheckBox(self.groupBox) + self.coverShadows.setObjectName("coverShadows") + self.horizontalLayout_3.addWidget(self.coverShadows) + self.performCulling = QtWidgets.QCheckBox(self.groupBox) + self.performCulling.setObjectName("performCulling") + self.horizontalLayout_3.addWidget(self.performCulling) + self.verticalLayout_2.addLayout(self.horizontalLayout_3) + self.horizontalLayout_9 = QtWidgets.QHBoxLayout() + self.horizontalLayout_9.setObjectName("horizontalLayout_9") + self.autoTags = QtWidgets.QCheckBox(self.groupBox) + self.autoTags.setObjectName("autoTags") + self.horizontalLayout_9.addWidget(self.autoTags) + self.horizontalLayout_7 = QtWidgets.QHBoxLayout() + self.horizontalLayout_7.setObjectName("horizontalLayout_7") + self.label = QtWidgets.QLabel(self.groupBox) + self.label.setObjectName("label") + self.horizontalLayout_7.addWidget(self.label) + self.darkIconsRadio = QtWidgets.QRadioButton(self.groupBox) + self.darkIconsRadio.setObjectName("darkIconsRadio") + self.horizontalLayout_7.addWidget(self.darkIconsRadio) + self.lightIconsRadio = QtWidgets.QRadioButton(self.groupBox) + self.lightIconsRadio.setObjectName("lightIconsRadio") + self.horizontalLayout_7.addWidget(self.lightIconsRadio) + self.horizontalLayout_9.addLayout(self.horizontalLayout_7) + self.verticalLayout_2.addLayout(self.horizontalLayout_9) + self.gridLayout_4.addLayout(self.verticalLayout_2, 0, 0, 1, 1) + self.verticalLayout.addWidget(self.groupBox) + self.groupBox_2 = QtWidgets.QGroupBox(self.switchPage) + self.groupBox_2.setObjectName("groupBox_2") + self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox_2) + self.gridLayout_3.setObjectName("gridLayout_3") + self.verticalLayout_3 = QtWidgets.QVBoxLayout() + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.horizontalLayout_6 = QtWidgets.QHBoxLayout() + self.horizontalLayout_6.setObjectName("horizontalLayout_6") + self.hideScrollBars = QtWidgets.QCheckBox(self.groupBox_2) + self.hideScrollBars.setObjectName("hideScrollBars") + self.horizontalLayout_6.addWidget(self.hideScrollBars) + self.cachingEnabled = QtWidgets.QCheckBox(self.groupBox_2) + self.cachingEnabled.setObjectName("cachingEnabled") + self.horizontalLayout_6.addWidget(self.cachingEnabled) + self.verticalLayout_3.addLayout(self.horizontalLayout_6) + self.horizontalLayout_8 = QtWidgets.QHBoxLayout() + self.horizontalLayout_8.setObjectName("horizontalLayout_8") + self.horizontalLayout_5 = QtWidgets.QHBoxLayout() + self.horizontalLayout_5.setObjectName("horizontalLayout_5") + self.languageLabel = QtWidgets.QLabel(self.groupBox_2) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) @@ -72,42 +111,41 @@ class Ui_Dialog(object): self.languageLabel.setSizePolicy(sizePolicy) self.languageLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) self.languageLabel.setObjectName("languageLabel") - self.horizontalLayout_3.addWidget(self.languageLabel) - self.languageBox = QtWidgets.QComboBox(self.groupBox) + self.horizontalLayout_5.addWidget(self.languageLabel) + self.languageBox = QtWidgets.QComboBox(self.groupBox_2) self.languageBox.setObjectName("languageBox") - self.horizontalLayout_3.addWidget(self.languageBox) - self.horizontalLayout_6.addLayout(self.horizontalLayout_3) - self.hideScrollBars = QtWidgets.QCheckBox(self.groupBox) - self.hideScrollBars.setObjectName("hideScrollBars") - self.horizontalLayout_6.addWidget(self.hideScrollBars) - self.horizontalLayout_5 = QtWidgets.QHBoxLayout() - self.horizontalLayout_5.setObjectName("horizontalLayout_5") - self.label = QtWidgets.QLabel(self.groupBox) - self.label.setObjectName("label") - self.horizontalLayout_5.addWidget(self.label) - self.darkIconsRadio = QtWidgets.QRadioButton(self.groupBox) - self.darkIconsRadio.setObjectName("darkIconsRadio") - self.horizontalLayout_5.addWidget(self.darkIconsRadio) - self.lightIconsRadio = QtWidgets.QRadioButton(self.groupBox) - self.lightIconsRadio.setObjectName("lightIconsRadio") - self.horizontalLayout_5.addWidget(self.lightIconsRadio) - self.horizontalLayout_6.addLayout(self.horizontalLayout_5) - self.gridLayout.addLayout(self.horizontalLayout_6, 2, 0, 1, 1) - self.verticalLayout_2.addWidget(self.groupBox) - self.gridLayout_3.addLayout(self.verticalLayout_2, 0, 0, 1, 1) - self.horizontalLayout_2 = QtWidgets.QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.horizontalLayout_5.addWidget(self.languageBox) + self.horizontalLayout_8.addLayout(self.horizontalLayout_5) + self.verticalLayout_3.addLayout(self.horizontalLayout_8) + self.gridLayout_3.addLayout(self.verticalLayout_3, 2, 0, 1, 1) + self.verticalLayout.addWidget(self.groupBox_2) + self.gridLayout_2.addLayout(self.verticalLayout, 0, 0, 1, 1) + spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.gridLayout_2.addItem(spacerItem, 1, 0, 1, 1) + self.stackedWidget.addWidget(self.switchPage) + self.aboutPage = QtWidgets.QWidget() + self.aboutPage.setObjectName("aboutPage") + self.gridLayout_6 = QtWidgets.QGridLayout(self.aboutPage) + self.gridLayout_6.setObjectName("gridLayout_6") + self.aboutBox = QtWidgets.QTextBrowser(self.aboutPage) + self.aboutBox.setOpenExternalLinks(True) + self.aboutBox.setOpenLinks(False) + self.aboutBox.setObjectName("aboutBox") + self.gridLayout_6.addWidget(self.aboutBox, 0, 0, 1, 1) + self.stackedWidget.addWidget(self.aboutPage) + self.verticalLayout_4.addWidget(self.stackedWidget) + self.horizontalLayout_10 = QtWidgets.QHBoxLayout() + self.horizontalLayout_10.setObjectName("horizontalLayout_10") + spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_10.addItem(spacerItem1) self.okButton = QtWidgets.QPushButton(Dialog) self.okButton.setObjectName("okButton") - self.horizontalLayout_2.addWidget(self.okButton) + self.horizontalLayout_10.addWidget(self.okButton) self.cancelButton = QtWidgets.QPushButton(Dialog) self.cancelButton.setObjectName("cancelButton") - self.horizontalLayout_2.addWidget(self.cancelButton) - self.aboutButton = QtWidgets.QPushButton(Dialog) - self.aboutButton.setCheckable(True) - self.aboutButton.setObjectName("aboutButton") - self.horizontalLayout_2.addWidget(self.aboutButton) - self.gridLayout_3.addLayout(self.horizontalLayout_2, 1, 0, 1, 1) + self.horizontalLayout_10.addWidget(self.cancelButton) + self.verticalLayout_4.addLayout(self.horizontalLayout_10) + self.gridLayout.addLayout(self.verticalLayout_4, 0, 1, 1, 1) self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog) @@ -115,27 +153,26 @@ class Ui_Dialog(object): def retranslateUi(self, Dialog): _translate = QtCore.QCoreApplication.translate Dialog.setWindowTitle(_translate("Dialog", "Settings")) - self.groupBox_2.setTitle(_translate("Dialog", "Library")) - self.groupBox.setTitle(_translate("Dialog", "Switches")) + self.groupBox.setTitle(_translate("Dialog", "Library")) self.refreshLibrary.setText(_translate("Dialog", "Startup: Refresh library")) self.fileRemember.setText(_translate("Dialog", "Remember open files")) + self.coverShadows.setText(_translate("Dialog", "Cover shadows")) self.performCulling.setToolTip(_translate("Dialog", "Enabling reduces startup time and memory usage")) self.performCulling.setText(_translate("Dialog", "Load covers only when needed")) - self.coverShadows.setText(_translate("Dialog", "Cover shadows")) self.autoTags.setText(_translate("Dialog", "Generate tags from files")) - self.cachingEnabled.setToolTip(_translate("Dialog", "Greatly reduces page transition time at the cost of more memory")) - self.cachingEnabled.setText(_translate("Dialog", "Cache comic / pdf pages")) - self.languageLabel.setText(_translate("Dialog", "Dictionary:")) - self.hideScrollBars.setToolTip(_translate("Dialog", "Horizontal scrolling with Alt + Scroll\n" -"Reopen book to see changes")) - self.hideScrollBars.setText(_translate("Dialog", "Hide scrollbars when reading")) self.label.setToolTip(_translate("Dialog", "Restart application to see changes")) self.label.setText(_translate("Dialog", "Icon theme: ")) self.darkIconsRadio.setToolTip(_translate("Dialog", "Restart application to see changes")) - self.darkIconsRadio.setText(_translate("Dialog", "Dar&k")) + self.darkIconsRadio.setText(_translate("Dialog", "&Dark")) self.lightIconsRadio.setToolTip(_translate("Dialog", "Restart application to see changes")) - self.lightIconsRadio.setText(_translate("Dialog", "&Light")) + self.lightIconsRadio.setText(_translate("Dialog", "L&ight")) + self.groupBox_2.setTitle(_translate("Dialog", "Reading")) + self.hideScrollBars.setToolTip(_translate("Dialog", "Horizontal scrolling with Alt + Scroll\n" +"Reopen book to see changes")) + self.hideScrollBars.setText(_translate("Dialog", "Hide scrollbars when reading")) + self.cachingEnabled.setToolTip(_translate("Dialog", "Greatly reduces page transition time at the cost of more memory")) + self.cachingEnabled.setText(_translate("Dialog", "Cache comic / pdf pages")) + self.languageLabel.setText(_translate("Dialog", "Dictionary language:")) self.okButton.setText(_translate("Dialog", "Scan Library")) self.cancelButton.setText(_translate("Dialog", "Close")) - self.aboutButton.setText(_translate("Dialog", "About")) diff --git a/lector/settingsdialog.py b/lector/settingsdialog.py index d6f9fb8..7dada8a 100644 --- a/lector/settingsdialog.py +++ b/lector/settingsdialog.py @@ -22,7 +22,7 @@ import os import copy import pathlib -from PyQt5 import QtWidgets, QtCore +from PyQt5 import QtWidgets, QtCore, QtGui from lector import database from lector.models import MostExcellentFileSystemModel @@ -42,7 +42,6 @@ class SettingsUI(QtWidgets.QDialog, settingswindow.Ui_Dialog): self.resize(self.parent.settings['settings_dialog_size']) self.move(self.parent.settings['settings_dialog_position']) - self.aboutBox.setVisible(False) install_dir = os.path.realpath(__file__) install_dir = pathlib.Path(install_dir).parents[1] aboutfile_path = os.path.join(install_dir, 'lector', 'resources', 'about.html') @@ -73,7 +72,6 @@ class SettingsUI(QtWidgets.QDialog, settingswindow.Ui_Dialog): self._translate('SettingsUI', 'Save changes and start library scan')) self.okButton.clicked.connect(self.start_library_scan) self.cancelButton.clicked.connect(self.cancel_pressed) - self.aboutButton.clicked.connect(self.about_pressed) # Radio buttons if self.parent.settings['icon_theme'] == 'DarkIcons': @@ -100,6 +98,21 @@ class SettingsUI(QtWidgets.QDialog, settingswindow.Ui_Dialog): self.cachingEnabled.clicked.connect(self.manage_checkboxes) self.hideScrollBars.clicked.connect(self.manage_checkboxes) + # Generate the QStandardItemModel for the listView + self.listModel = QtGui.QStandardItemModel() + + library_string = self._translate('SettingsUI', 'Library') + switches_string = self._translate('SettingsUI', 'Switches') + about_string = self._translate('SettingsUI', 'About') + list_options = [library_string, switches_string, about_string] + + for i in list_options: + item = QtGui.QStandardItem() + item.setText(i) + self.listModel.appendRow(item) + self.listView.setModel(self.listModel) + self.listView.clicked.connect(self.page_switch) + # Generate the filesystem treeView self.generate_tree() @@ -237,6 +250,13 @@ class SettingsUI(QtWidgets.QDialog, settingswindow.Ui_Dialog): self.thread.finished.connect(self.parent.move_on) self.thread.start() + def page_switch(self, index): + self.stackedWidget.setCurrentIndex(index.row()) + if index.row() == 0: + self.okButton.setVisible(True) + else: + self.okButton.setVisible(False) + def cancel_pressed(self): self.filesystem_model.tag_data = copy.deepcopy(self.tag_data_copy) self.hide() @@ -251,8 +271,6 @@ class SettingsUI(QtWidgets.QDialog, settingswindow.Ui_Dialog): def no_more_settings(self): self.parent.libraryToolBar.settingsButton.setChecked(False) - self.aboutBox.hide() - self.treeView.show() self.resizeEvent() def resizeEvent(self, event=None): @@ -292,7 +310,3 @@ class SettingsUI(QtWidgets.QDialog, settingswindow.Ui_Dialog): if not self.performCulling.isChecked(): self.parent.load_all_covers() - - def about_pressed(self): - self.treeView.setVisible(not self.treeView.isVisible()) - self.aboutBox.setVisible(not self.aboutBox.isVisible()) diff --git a/lector/widgets.py b/lector/widgets.py index 1025109..2aa7389 100644 --- a/lector/widgets.py +++ b/lector/widgets.py @@ -890,9 +890,9 @@ class PliantQTextBrowser(QtWidgets.QTextBrowser): self.main_window.closeEvent() def mouseMoveEvent(self, event): - event.accept() self.viewport().setCursor(QtCore.Qt.IBeamCursor) self.parent.mouse_hide_timer.start(3000) + QtWidgets.QTextBrowser.mouseMoveEvent(self, event) class PliantWidgetsCommonFunctions(): diff --git a/setup.py b/setup.py index 789806a..b9a574b 100644 --- a/setup.py +++ b/setup.py @@ -6,17 +6,15 @@ HERE = path.abspath(path.dirname(__file__)) MAJOR_VERSION = '0' MINOR_VERSION = '3' -MICRO_VERSION = '0' +MICRO_VERSION = '2' VERSION = "{}.{}.{}".format(MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION) # Get the long description from the README file with codecs.open(path.join(HERE, 'README.md'), encoding='utf-8') as f: LONG_DESC = f.read() -INSTALL_DEPS = ['requests', - 'beautifulsoup4'] -TEST_DEPS = ['pytest', - 'unittest2'] +INSTALL_DEPS = ['beautifulsoup4'] +TEST_DEPS = [] DEV_DEPS = [] setup(