From: Max Usachev Date: Thu, 17 Jun 2010 10:58:55 +0000 (+0300) Subject: finished work with avatar X-Git-Url: https://vcs.maemo.org/git/?p=meabook;a=commitdiff_plain;h=66736185aeb9127772701ebb96db0295bd029f4d finished work with avatar --- diff --git a/controller.py b/controller.py index 3f1494d..e7717e6 100644 --- a/controller.py +++ b/controller.py @@ -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): diff --git a/database/SQLite.py b/database/SQLite.py index 28229cb..3b10611 100644 --- a/database/SQLite.py +++ b/database/SQLite.py @@ -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): diff --git a/ui/hildon_ui.py b/ui/hildon_ui.py index 0a71ce7..855d569 100644 --- a/ui/hildon_ui.py +++ b/ui/hildon_ui.py @@ -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