From c12d214b5900db99f147848e046be758fb963070 Mon Sep 17 00:00:00 2001 From: NoDRM Date: Wed, 13 Jul 2022 15:34:47 +0200 Subject: [PATCH] Fix Obok plugin on Calibre 6 (#98) --- Obok_plugin/config.py | 2 +- Obok_plugin/dialogs.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Obok_plugin/config.py b/Obok_plugin/config.py index 9a637f3..a9363ad 100644 --- a/Obok_plugin/config.py +++ b/Obok_plugin/config.py @@ -62,7 +62,7 @@ class ConfigWidget(QWidget): def edit_kobo_directory(self): - tmpkobodirectory = QFileDialog.getExistingDirectory(self, "Select Kobo directory", self.kobodirectory or "/home", QFileDialog.ShowDirsOnly) + tmpkobodirectory = QFileDialog.getExistingDirectory(self, "Select Kobo directory", self.kobodirectory or "/home", QFileDialog.Option.ShowDirsOnly) if tmpkobodirectory != u"" and tmpkobodirectory is not None: self.kobodirectory = tmpkobodirectory diff --git a/Obok_plugin/dialogs.py b/Obok_plugin/dialogs.py index 85abfaf..16bfcb0 100644 --- a/Obok_plugin/dialogs.py +++ b/Obok_plugin/dialogs.py @@ -409,7 +409,7 @@ class ReadOnlyTableWidgetItem(QTableWidgetItem): def __init__(self, text): if text is None: text = '' - QTableWidgetItem.__init__(self, text, QTableWidgetItem.UserType) + QTableWidgetItem.__init__(self, text, QTableWidgetItem.ItemType.UserType) self.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEnabled) class AuthorTableWidgetItem(ReadOnlyTableWidgetItem): @@ -448,7 +448,7 @@ class IconWidgetItem(ReadOnlyTableWidgetItem): class NumericTableWidgetItem(QTableWidgetItem): def __init__(self, number, is_read_only=False): - QTableWidgetItem.__init__(self, '', QTableWidgetItem.UserType) + QTableWidgetItem.__init__(self, '', QTableWidgetItem.ItemType.UserType) self.setData(Qt.DisplayRole, number) if is_read_only: self.setFlags(Qt.ItemIsSelectable|Qt.ItemIsEnabled)