Merge lp:~janos-gyerik/ubuntu-accomplishments-viewer/show-examples-in-identity-screen into lp:ubuntu-accomplishments-viewer

Proposed by Janos Gyerik
Status: Merged
Merged at revision: 118
Proposed branch: lp:~janos-gyerik/ubuntu-accomplishments-viewer/show-examples-in-identity-screen
Merge into: lp:ubuntu-accomplishments-viewer
Diff against target: 54 lines (+15/-6)
1 file modified
accomplishments_viewer/EditExtrainfoDialog.py (+15/-6)
To merge this branch: bzr merge lp:~janos-gyerik/ubuntu-accomplishments-viewer/show-examples-in-identity-screen
Reviewer Review Type Date Requested Status
Ubuntu Accomplishments Viewer Developers Pending
Review via email: mp+111722@code.launchpad.net

Description of the change

Show the [example] in the identity screen (the one opened with ctrl-i) if there is any.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'accomplishments_viewer/EditExtrainfoDialog.py'
--- accomplishments_viewer/EditExtrainfoDialog.py 2012-05-17 21:12:19 +0000
+++ accomplishments_viewer/EditExtrainfoDialog.py 2012-06-23 18:46:17 +0000
@@ -79,10 +79,10 @@
79 for i in infoneeded:79 for i in infoneeded:
80 if i["needs-information"] not in section_dict:80 if i["needs-information"] not in section_dict:
81 section_dict[i["needs-information"]] = list([i["collection"]])81 section_dict[i["needs-information"]] = list([i["collection"]])
82 extrainfo_dict[i["needs-information"]] = [i["label"],i["description"],i["value"]]82 extrainfo_dict[i["needs-information"]] = i
83 else:83 else:
84 section_dict[i["needs-information"]].append(i["collection"])84 section_dict[i["needs-information"]].append(i["collection"])
85 extrainfo_dict[i["needs-information"]] = [i["label"],i["description"],i["value"]]85 extrainfo_dict[i["needs-information"]] = i
86 for a in section_dict:86 for a in section_dict:
87 section_dict[a] = tuple(section_dict[a])87 section_dict[a] = tuple(section_dict[a])
88 88
@@ -148,12 +148,13 @@
148 148
149 for f in d:149 for f in d:
150 #for each information field in the group...150 #for each information field in the group...
151 extrainfolist = extrainfo_dict[f]151 extrainfo = extrainfo_dict[f]
152 label = extrainfolist[0]152 label = extrainfo['label']
153 label = label.replace("&","&") #pango would complain on that153 label = label.replace("&","&") #pango would complain on that
154 description = extrainfolist[1]154 description = extrainfo['description']
155 description = description.replace("&","&") #pango would complain on that155 description = description.replace("&","&") #pango would complain on that
156 value = extrainfolist[2]156 value = extrainfo['value']
157 example = extrainfo.get('example')
157 158
158 g_entrybox = Gtk.HBox()159 g_entrybox = Gtk.HBox()
159 g_mainlabel = Gtk.Label(label)160 g_mainlabel = Gtk.Label(label)
@@ -166,12 +167,20 @@
166 g_desclabel = Gtk.Label("<small><small><b>" + description + "</b></small></small>")167 g_desclabel = Gtk.Label("<small><small><b>" + description + "</b></small></small>")
167 g_desclabel.set_use_markup(True)168 g_desclabel.set_use_markup(True)
168 g_desclabel.set_alignment(1,0)169 g_desclabel.set_alignment(1,0)
170
171 if example:
172 g_example = Gtk.Label("<small><small><b>Example: " + example + "</b></small></small>")
173 g_example.set_use_markup(True)
174 g_example.set_alignment(1,0)
175 g_example.set_margin_right(20)
169 176
170 g_entrybox.set_margin_right(20)177 g_entrybox.set_margin_right(20)
171 g_desclabel.set_margin_right(20)178 g_desclabel.set_margin_right(20)
172 179
173 g_box.pack_start(g_entrybox,True,False,0)180 g_box.pack_start(g_entrybox,True,False,0)
174 g_box.pack_start(g_desclabel,True,False,0)181 g_box.pack_start(g_desclabel,True,False,0)
182 if example:
183 g_box.pack_start(g_example,True,False,0)
175 g_entrybox.pack_end(g_entry,False,False,0)184 g_entrybox.pack_end(g_entry,False,False,0)
176 g_entrybox.pack_end(g_mainlabel,False,False,0)185 g_entrybox.pack_end(g_mainlabel,False,False,0)
177 186

Subscribers

People subscribed via source and target branches

to all changes: