mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Another PyQt 5.6 compatibility fix
This commit is contained in:
parent
8470b1794d
commit
e7dbd513a9
@ -13,7 +13,8 @@ from collections import OrderedDict
|
|||||||
|
|
||||||
from PyQt5.Qt import (QDialog, Qt, QTime, QObject, QMenu, QHBoxLayout,
|
from PyQt5.Qt import (QDialog, Qt, QTime, QObject, QMenu, QHBoxLayout,
|
||||||
QAction, QIcon, QMutex, QTimer, pyqtSignal, QWidget, QGridLayout,
|
QAction, QIcon, QMutex, QTimer, pyqtSignal, QWidget, QGridLayout,
|
||||||
QCheckBox, QTimeEdit, QLabel, QLineEdit, QDoubleSpinBox, QSize)
|
QCheckBox, QTimeEdit, QLabel, QLineEdit, QDoubleSpinBox, QSize,
|
||||||
|
QTreeView, QSizePolicy)
|
||||||
|
|
||||||
from calibre.gui2.dialogs.scheduler_ui import Ui_Dialog
|
from calibre.gui2.dialogs.scheduler_ui import Ui_Dialog
|
||||||
from calibre.gui2 import config as gconf, error_dialog, gprefs
|
from calibre.gui2 import config as gconf, error_dialog, gprefs
|
||||||
@ -30,6 +31,19 @@ def convert_day_time_schedule(val):
|
|||||||
return (tuple(xrange(7)), hour, minute)
|
return (tuple(xrange(7)), hour, minute)
|
||||||
return ((day_of_week,), hour, minute)
|
return ((day_of_week,), hour, minute)
|
||||||
|
|
||||||
|
class RecipesView(QTreeView):
|
||||||
|
|
||||||
|
def __init__(self, parent):
|
||||||
|
QTreeView.__init__(self, parent)
|
||||||
|
self.setAnimated(True)
|
||||||
|
self.setHeaderHidden(True)
|
||||||
|
self.setObjectName('recipes')
|
||||||
|
self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Expanding)
|
||||||
|
|
||||||
|
def currentChanged(self, current, previous):
|
||||||
|
QTreeView.currentChanged(self, current, previous)
|
||||||
|
self.parent().current_changed(current, previous)
|
||||||
|
|
||||||
class Base(QWidget):
|
class Base(QWidget):
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
@ -210,6 +224,8 @@ class SchedulerDialog(QDialog, Ui_Dialog):
|
|||||||
self.recipe_model.searched.connect(self.search.search_done,
|
self.recipe_model.searched.connect(self.search.search_done,
|
||||||
type=Qt.QueuedConnection)
|
type=Qt.QueuedConnection)
|
||||||
self.recipe_model.searched.connect(self.search_done)
|
self.recipe_model.searched.connect(self.search_done)
|
||||||
|
self.recipes = RecipesView(self)
|
||||||
|
self.gridLayout.addWidget(self.recipes, 1, 0, 1, 1)
|
||||||
self.recipes.setFocus(Qt.OtherFocusReason)
|
self.recipes.setFocus(Qt.OtherFocusReason)
|
||||||
self.commit_on_change = True
|
self.commit_on_change = True
|
||||||
self.previous_urn = None
|
self.previous_urn = None
|
||||||
@ -220,7 +236,6 @@ class SchedulerDialog(QDialog, Ui_Dialog):
|
|||||||
self.buttonBox.ActionRole)
|
self.buttonBox.ActionRole)
|
||||||
self.download_button.setIcon(QIcon(I('arrow-down.png')))
|
self.download_button.setIcon(QIcon(I('arrow-down.png')))
|
||||||
self.download_button.setVisible(False)
|
self.download_button.setVisible(False)
|
||||||
self.recipes.currentChanged = self.current_changed
|
|
||||||
for b, c in self.SCHEDULE_TYPES.iteritems():
|
for b, c in self.SCHEDULE_TYPES.iteritems():
|
||||||
b = getattr(self, b)
|
b = getattr(self, b)
|
||||||
b.toggled.connect(self.schedule_type_selected)
|
b.toggled.connect(self.schedule_type_selected)
|
||||||
|
@ -53,12 +53,21 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>518</width>
|
<width>581</width>
|
||||||
<height>498</height>
|
<height>444</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -118,29 +127,28 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="days_of_week">
|
<widget class="QRadioButton" name="days_of_week">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Days of week</string>
|
<string>&Days of week</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="days_of_month">
|
<widget class="QRadioButton" name="days_of_month">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Days of month</string>
|
<string>Da&ys of month</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="every_x_days">
|
<widget class="QRadioButton" name="every_x_days">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Every x days</string>
|
<string>Every &x days</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="schedule_stack">
|
<widget class="QStackedWidget" name="schedule_stack"/>
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="last_downloaded">
|
<widget class="QLabel" name="last_downloaded">
|
||||||
@ -316,31 +324,6 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QTreeView" name="recipes">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="showDropIndicator" stdset="0">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="animated">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="headerHidden">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="count_label">
|
<widget class="QLabel" name="count_label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -356,7 +339,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_7">
|
<widget class="QLabel" name="label_7">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Delete downloaded news &older than:</string>
|
<string>Delete downloaded &news older than:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>old_news</cstring>
|
<cstring>old_news</cstring>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user