finished work with avatar
authorMax Usachev <maxusachev@gmail.com>
Thu, 17 Jun 2010 10:58:55 +0000 (13:58 +0300)
committerMax Usachev <maxusachev@gmail.com>
Thu, 17 Jun 2010 10:58:55 +0000 (13:58 +0300)
controller.py
database/SQLite.py
ui/hildon_ui.py

index 3f1494d..e7717e6 100644 (file)
@@ -42,6 +42,8 @@ class MeabookController:
         for field in ordered_fields:
             if (field in fields_to_show) and (field in entry_fields):
                 info.append((field, entry[field]))
+        if not 'image' in fields_to_show and 'image' in entry.keys():
+            info.append(('image', entry['image']))
         return info
 
     def get_all_folders(self, parent=0):
index 28229cb..3b10611 100644 (file)
@@ -83,8 +83,8 @@ class SQLite:
     def get_fields(self):
         """Returns all fields from FIELDS table."""
 
-        return [item[0] for item in self.conn.execute( \
-            "SELECT name FROM fields").fetchall()]
+        return [item[0] for item in self.conn.execute("SELECT name FROM \
+            fields").fetchall() if item[0]!='image']
 
     # operations with DATA table
     def add_entry(self, entry):
index 0a71ce7..855d569 100644 (file)
@@ -115,7 +115,6 @@ class HildonMeabook(MeabookUI):
         def show_settings_dialog(widget, parent, func1, func2, entry_id):
             dialog = ConfigurationDialog(self.controller, self.config)
             response = getattr(dialog, func1)(None, parent)
-            print response
             if response == gtk.RESPONSE_OK:
                 func2(parent, entry_id)
 
@@ -129,6 +128,8 @@ class HildonMeabook(MeabookUI):
             pannable_area.set_property('mov-mode', hildon.MOVEMENT_MODE_BOTH)
             image = self.renderer.render_image(dict(entry))
             for fname, fvalue in entry:
+                if fname == 'image':
+                    continue
                 button = self.renderer.render_button(_(fname) , fvalue, fname)
                 info_box.pack_start(button, expand=False)
             # pack widgets