This commit is contained in:
Kovid Goyal 2009-01-31 12:47:12 -08:00
commit 510675f9cd
4 changed files with 28 additions and 7 deletions

View File

@ -40,7 +40,7 @@ class Device(_Device):
<match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.vendor_id" int="%(vendor_id)s">
<match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.product_id" int="%(product_id)s">
%(BCD_start)s
<match key="volume.is_partition" bool="false">
<match key="@info.parent:storage.lun" int="0">
<merge key="volume.label" type="string">%(main_memory)s</merge>
<merge key="%(app)s.mainvolume" type="string">%(deviceclass)s</merge>
</match>
@ -54,7 +54,7 @@ class Device(_Device):
<match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.vendor_id" int="%(vendor_id)s">
<match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.product_id" int="%(product_id)s">
%(BCD_start)s
<match key="volume.is_partition" bool="true">
<match key="@info.parent:storage.lun" int="1">
<merge key="volume.label" type="string">%(storage_card)s</merge>
<merge key="%(app)s.cardvolume" type="string">%(deviceclass)s</merge>
</match>

View File

@ -0,0 +1,16 @@
__license__ = 'GPL v3'
__copyright__ = '2009, John Schember john@nachtimwald.com'
'''
List View for showing recipies. Allows for keyboad events when selecting new
items.
'''
from PyQt4.Qt import QListView, SIGNAL
class RecipeListView(QListView):
def __init__(self, *args):
QListView.__init__(self, *args)
def selectionChanged(self, selected, deselected):
self.emit(SIGNAL('itemChanged(QModelIndex)'), selected.indexes()[0])

View File

@ -241,8 +241,7 @@ class SchedulerDialog(QDialog, Ui_Dialog):
self._model = RecipeModel(db)
self.current_recipe = None
self.recipes.setModel(self._model)
self.connect(self.recipes, SIGNAL('activated(QModelIndex)'), self.show_recipe)
self.connect(self.recipes, SIGNAL('clicked(QModelIndex)'), self.show_recipe)
self.connect(self.recipes, SIGNAL('itemChanged(QModelIndex)'), self.show_recipe)
self.connect(self.username, SIGNAL('textEdited(QString)'), self.set_account_info)
self.connect(self.password, SIGNAL('textEdited(QString)'), self.set_account_info)
self.connect(self.schedule, SIGNAL('stateChanged(int)'), self.do_schedule)
@ -359,7 +358,6 @@ class SchedulerDialog(QDialog, Ui_Dialog):
else:
self.last_downloaded.setText(_('Last downloaded: never'))
class Scheduler(QObject):
INTERVAL = 1 # minutes

View File

@ -24,7 +24,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QListView" name="recipes" >
<widget class="RecipeListView" name="recipes" >
<property name="alternatingRowColors" >
<bool>true</bool>
</property>
@ -321,6 +321,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>RecipeListView</class>
<extends>QListView</extends>
<header>recipelistview.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../images.qrc" />
</resources>