Sync to trunk.

This commit is contained in:
John Schember 2010-01-21 18:12:18 -05:00
commit c560bf0511
5 changed files with 250 additions and 0 deletions

View File

View File

@ -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 <kovid@kovidgoyal.net>'
__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']}

View File

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>579</width>
<height>411</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QListWidget" name="db_fields">
<property name="geometry">
<rect>
<x>297</x>
<y>20</y>
<width>256</width>
<height>281</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string extracomment="Select all fields to be exported"/>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
<item>
<property name="text">
<string>author_sort</string>
</property>
</item>
<item>
<property name="text">
<string>authors</string>
</property>
</item>
<item>
<property name="text">
<string>comments</string>
</property>
</item>
<item>
<property name="text">
<string>cover</string>
</property>
</item>
<item>
<property name="text">
<string>formats</string>
</property>
</item>
<item>
<property name="text">
<string>id</string>
</property>
</item>
<item>
<property name="text">
<string>isbn</string>
</property>
</item>
<item>
<property name="text">
<string>pubdate</string>
</property>
</item>
<item>
<property name="text">
<string>publisher</string>
</property>
</item>
<item>
<property name="text">
<string>rating</string>
</property>
</item>
<item>
<property name="text">
<string>series_index</string>
</property>
</item>
<item>
<property name="text">
<string>series</string>
</property>
</item>
<item>
<property name="text">
<string>size</string>
</property>
</item>
<item>
<property name="text">
<string>tags</string>
</property>
</item>
<item>
<property name="text">
<string>timestamp</string>
</property>
</item>
<item>
<property name="text">
<string>title</string>
</property>
</item>
<item>
<property name="text">
<string>uuid</string>
</property>
</item>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>171</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Fields to include in output:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -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 <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from <basename> import Ui_Form
from PyQt4.Qt import QDialog, QWidget
class PluginWidget(QWidget,Ui_Form):
TITLE = _('<formats> Output')
HELP = _('Options specific to')+' <formats> '+_('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 {}

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>579</width>
<height>411</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>12</y>
<width>181</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Tab template for catalog.ui</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>407</x>
<y>10</y>
<width>161</width>
<height>22</height>
</rect>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>