Commit 6c83ae35 authored by Philipp Hörist's avatar Philipp Hörist

Profile: Sort VCard on save

parent 3cf19c3c
Pipeline #6903 passed with stages
in 10 minutes and 25 seconds
......@@ -197,7 +197,6 @@ def _on_cancel_clicked(self, _widget):
self._ui.nickname_entry.set_sensitive(False)
self._ui.avatar_image.set_from_surface(self._current_avatar)
self._ui.nickname_entry.set_text(app.nicks[self.account])
self._vcard_grid.clear()
self._vcard_grid.set_vcard(self._current_vcard.copy())
self._new_avatar = False
......@@ -214,6 +213,7 @@ def _on_save_clicked(self, _widget):
self._ui.nickname_entry.set_sensitive(False)
self._vcard_grid.validate()
self._vcard_grid.sort()
vcard = self._vcard_grid.get_vcard()
self._current_vcard = vcard.copy()
......
......@@ -158,6 +158,7 @@ def set_editable(self, enabled):
prop.set_editable(enabled)
def set_vcard(self, vcard):
self.clear()
self._vcard = vcard
for entry in ORDER:
......@@ -205,6 +206,9 @@ def clear(self):
self._props = []
def sort(self):
self.set_vcard(self._vcard)
class DescriptionLabel(Gtk.Label):
def __init__(self, value):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment