gnome-lirc-properties r5 - in trunk: . data gnome_lirc_properties gnome_lirc_properties/ui



Author: murrayc
Date: Fri Apr 25 11:58:08 2008
New Revision: 5
URL: http://svn.gnome.org/viewvc/gnome-lirc-properties?rev=5&view=rev

Log:
2008-04-25  Murray Cumming  <murrayc murrayc com>

* data/receivers.conf: Add Snapstream Firefly to the list of supported 
receivers, as well as the Snapstream_Firefly_R1000 name which appeared 
in previous versions of lirc (The change is probably due to Debian or 
Ubuntu).
Note that this is in /usr/share/lirc/remotes/atiusb/atilircd.conf.ati*.

* gnome_lirc_properties/backend.py
BackendService.WriteRemoteConfiguration(): When writing Unknown as 
the vendor, do not translate it, because strings should not be 
translated in configuration files.
* gnome_lirc_properties/lirc.py (Receiver.__init__,
RemotesDatabase.find(): Handle Unknown specially for the vendor name, 
because the database stores them as None. This fixes the problem that 
the chosen remote control was not shown when the vendor was unknown.
RemotesDatabase.check_hardware_settings(): Cope with a None 
selected_remote instead of crashing.
* gnome_lirc_properties/ui/RemoteControlProperties.py
RemoteControlProperties.__restore_hardware_settings(): Print a 
clue when the remote control could not be found in our database.

Modified:
   trunk/ChangeLog
   trunk/data/receivers.conf
   trunk/gnome_lirc_properties/backend.py
   trunk/gnome_lirc_properties/lirc.py
   trunk/gnome_lirc_properties/ui/RemoteControlProperties.py

Modified: trunk/data/receivers.conf
==============================================================================
--- trunk/data/receivers.conf	(original)
+++ trunk/data/receivers.conf	Fri Apr 25 11:58:08 2008
@@ -33,7 +33,7 @@
 product-id         = 0x3100
 
 [SnapStream Media: Firefly PC Remote]
-compatible-remotes = Snapstream_Firefly_R1000
+compatible-remotes = Snapstream_Firefly_R1000, Snapstream Firefly
 kernel-module      = lirc_atiusb
 lirc-driver        = default
 vendor-id          = 0x0bc7

Modified: trunk/gnome_lirc_properties/backend.py
==============================================================================
--- trunk/gnome_lirc_properties/backend.py	(original)
+++ trunk/gnome_lirc_properties/backend.py	Fri Apr 25 11:58:08 2008
@@ -680,7 +680,7 @@
 
         if remote:
             values = {
-                'VENDOR': remote.vendor or _('Unknown'),
+                'VENDOR': remote.vendor or 'Unknown', # Note; We do not translate Unknown here, though we do in the UI.
                 'MODEL': remote.product or remote.name
             }
 

Modified: trunk/gnome_lirc_properties/lirc.py
==============================================================================
--- trunk/gnome_lirc_properties/lirc.py	(original)
+++ trunk/gnome_lirc_properties/lirc.py	Fri Apr 25 11:58:08 2008
@@ -49,6 +49,7 @@
         self.__properties = dict(properties)
 
         self.__compatible_remotes = properties.get('compatible-remotes')
+        print("Receiver: compatible-remotes=%s\n" % self.__compatible_remotes)
 
         if self.__compatible_remotes:
             self.__compatible_remotes = [
@@ -340,11 +341,28 @@
     def find(self, vendor, product, default=None):
         '''Tries to find the specified remote control.'''
 
+        # Cope with Unknown vendors:
+        # We store 'Unknown' (not translated) in the configuration file in backend.WriteRemoteConfiguration() if vendor is None:
+        vendor_name = vendor;
+        if(vendor_name == 'Unknown'):
+          vendor_name = None
+
+        # Try looking at the remote.product
+        # (the combo lists product.name if remote.product is None):
         for remote in self:
-            if (remote.vendor == vendor and
+            #print ("RemotesDatabase.find(): remote.vendor=%s, remote_product=%s\n" % (remote.vendor, remote.product))
+            if (remote.vendor == vendor_name and
                 remote.product == product):
                 return remote
 
+        # Try looking at the remote.name
+        # (the combo lists product.name if remote.product is None):
+        for remote in self:
+            #print ("RemotesDatabase.find(): remote.vendor=%s, remote_product=%s\n" % (remote.vendor, remote.product))
+            if (remote.vendor == vendor_name and
+                remote.name == product):
+                return remote
+
         return default
 
     def __iter__(self):
@@ -1016,6 +1034,9 @@
         if remote is None:
             return False
 
+        if selected_remote is None:
+            return False;
+
         if (remote.vendor == selected_remote.vendor and
             remote.product == selected_remote.product):
             return True

Modified: trunk/gnome_lirc_properties/ui/RemoteControlProperties.py
==============================================================================
--- trunk/gnome_lirc_properties/ui/RemoteControlProperties.py	(original)
+++ trunk/gnome_lirc_properties/ui/RemoteControlProperties.py	Fri Apr 25 11:58:08 2008
@@ -250,8 +250,12 @@
         settings = lirc.HardwareConfParser(config.LIRC_HARDWARE_CONF)
 
         # Practice some sanity checks on that file:
-        remote = self.__remotes_db.find(settings.get('REMOTE_VENDOR'),
-                                        settings.get('REMOTE_MODEL'))
+        remote_vendor = settings.get('REMOTE_VENDOR')
+        remote_model = settings.get('REMOTE_MODEL')
+        remote = self.__remotes_db.find(remote_vendor, remote_model)
+
+        if(remote is None):
+          print("__restore_hardware_settings(): No remote found in the db for remote_vendor=%s, remote_model=%s\n" % (remote_vendor, remote_model))
 
         if (not lirc.check_hardware_settings(remote) and
             self.__confirm_rewrite_configuration(remote)):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]