diff --git a/src/calibre/gui2/catalog/__init__.py b/src/calibre/gui2/catalog/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/calibre/gui2/catalog/catalog_csv_xml.py b/src/calibre/gui2/catalog/catalog_csv_xml.py new file mode 100644 index 0000000000..f20a97ce2f --- /dev/null +++ b/src/calibre/gui2/catalog/catalog_csv_xml.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai +from __future__ import with_statement + +__license__ = 'GPL v3' +__copyright__ = '2009, Kovid Goyal ' +__docformat__ = 'restructuredtext en' + + +from calibre.gui2 import gprefs +from calibre.gui2.catalog.catalog_csv_xml_ui import Ui_Form +from PyQt4.Qt import QDialog, QWidget, SIGNAL + +class PluginWidget(QWidget,Ui_Form): + + TITLE = _('CSV/XML Output') + HELP = _('Options specific to')+' CSV/XML '+_('output') + sync_enabled = False + + def initialize(self, name): + QWidget.__init__(self) + self.setupUi(self) + self.name = name + # Restore the activated fields from last use + for x in range(self.db_fields.count()): + pref = '%s_db_fields_%s' % (self.name, self.db_fields.item(x).text()) + activated = gprefs[pref] if pref in gprefs else False + self.db_fields.item(x).setSelected(activated) + + def options(self): + # Save the currently activated fields + for x in range(self.db_fields.count()): + pref = '%s_db_fields_%s' % (self.name, self.db_fields.item(x).text()) + gprefs[pref] = self.db_fields.item(x).isSelected() + + # Return a dictionary with current options for this widget + if len(self.db_fields.selectedItems()): + return {'fields':[str(item.text()) for item in self.db_fields.selectedItems()]} + else: + return {'fields':['all']} \ No newline at end of file diff --git a/src/calibre/gui2/catalog/catalog_csv_xml.ui b/src/calibre/gui2/catalog/catalog_csv_xml.ui new file mode 100644 index 0000000000..76ad414539 --- /dev/null +++ b/src/calibre/gui2/catalog/catalog_csv_xml.ui @@ -0,0 +1,142 @@ + + + Form + + + + 0 + 0 + 579 + 411 + + + + Form + + + + + 297 + 20 + 256 + 281 + + + + + 0 + 0 + + + + + + + QAbstractItemView::MultiSelection + + + + author_sort + + + + + authors + + + + + comments + + + + + cover + + + + + formats + + + + + id + + + + + isbn + + + + + pubdate + + + + + publisher + + + + + rating + + + + + series_index + + + + + series + + + + + size + + + + + tags + + + + + timestamp + + + + + title + + + + + uuid + + + + + + + 20 + 20 + 171 + 17 + + + + Fields to include in output: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + diff --git a/src/calibre/gui2/catalog/catalog_tab_template.py b/src/calibre/gui2/catalog/catalog_tab_template.py new file mode 100644 index 0000000000..3c24f5f45f --- /dev/null +++ b/src/calibre/gui2/catalog/catalog_tab_template.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai +from __future__ import with_statement + +__license__ = 'GPL v3' +__copyright__ = '2009, Kovid Goyal ' +__docformat__ = 'restructuredtext en' + + +from import Ui_Form +from PyQt4.Qt import QDialog, QWidget + +class PluginWidget(QWidget,Ui_Form): + + TITLE = _(' Output') + HELP = _('Options specific to')+' '+_('output') + # Indicates whether this plugin wants its output synced to the connected device + sync_enabled = False + + def initialize(self): + QWidget.__init__(self) + self.setupUi(self) + + def options(self): + # Return a dictionary with options for this Widget + return {} \ No newline at end of file diff --git a/src/calibre/gui2/catalog/catalog_tab_template.ui b/src/calibre/gui2/catalog/catalog_tab_template.ui new file mode 100644 index 0000000000..5df881beac --- /dev/null +++ b/src/calibre/gui2/catalog/catalog_tab_template.ui @@ -0,0 +1,42 @@ + + + Form + + + + 0 + 0 + 579 + 411 + + + + Form + + + + + 20 + 12 + 181 + 17 + + + + Tab template for catalog.ui + + + + + + 407 + 10 + 161 + 22 + + + + + + +