This commit is contained in:
Kovid Goyal 2014-03-31 08:22:15 +05:30
parent 9ab2da5533
commit 45a9c57e0a

View File

@ -818,6 +818,7 @@ class PluginWidget(QWidget,Ui_Form):
open_url(QUrl('http://manual.calibre-ebook.com/catalogs.html')) open_url(QUrl('http://manual.calibre-ebook.com/catalogs.html'))
class CheckableTableWidgetItem(QTableWidgetItem): class CheckableTableWidgetItem(QTableWidgetItem):
''' '''
Borrowed from kiwidude Borrowed from kiwidude
''' '''
@ -853,6 +854,7 @@ class NoWheelComboBox(QComboBox):
class ComboBox(NoWheelComboBox): class ComboBox(NoWheelComboBox):
# Caller is responsible for providing the list in the preferred order # Caller is responsible for providing the list in the preferred order
def __init__(self, parent, items, selected_text,insert_blank=True): def __init__(self, parent, items, selected_text,insert_blank=True):
NoWheelComboBox.__init__(self, parent) NoWheelComboBox.__init__(self, parent)
self.populate_combo(items, selected_text, insert_blank) self.populate_combo(items, selected_text, insert_blank)
@ -868,6 +870,7 @@ class ComboBox(NoWheelComboBox):
self.setCurrentIndex(0) self.setCurrentIndex(0)
class GenericRulesTable(QTableWidget): class GenericRulesTable(QTableWidget):
''' '''
Generic methods for managing rows in a QTableWidget Generic methods for managing rows in a QTableWidget
''' '''
@ -1175,7 +1178,7 @@ class ExclusionRules(GenericRulesTable):
self._initialize() self._initialize()
def _init_table_widget(self): def _init_table_widget(self):
header_labels = [self.COLUMNS[index]['name'] \ header_labels = [self.COLUMNS[index]['name']
for index in sorted(self.COLUMNS.keys(), key=lambda c: self.COLUMNS[c]['ordinal'])] for index in sorted(self.COLUMNS.keys(), key=lambda c: self.COLUMNS[c]['ordinal'])]
self.setColumnCount(len(header_labels)) self.setColumnCount(len(header_labels))
self.setHorizontalHeaderLabels(header_labels) self.setHorizontalHeaderLabels(header_labels)
@ -1267,7 +1270,7 @@ class PrefixRules(GenericRulesTable):
self._initialize() self._initialize()
def _init_table_widget(self): def _init_table_widget(self):
header_labels = [self.COLUMNS[index]['name'] \ header_labels = [self.COLUMNS[index]['name']
for index in sorted(self.COLUMNS.keys(), key=lambda c: self.COLUMNS[c]['ordinal'])] for index in sorted(self.COLUMNS.keys(), key=lambda c: self.COLUMNS[c]['ordinal'])]
self.setColumnCount(len(header_labels)) self.setColumnCount(len(header_labels))
self.setHorizontalHeaderLabels(header_labels) self.setHorizontalHeaderLabels(header_labels)