Commit 681daa9b authored by Philipp Hörist's avatar Philipp Hörist
Browse files

new profile window

parent 76ff47ba
......@@ -106,22 +106,25 @@ def send_vcard(self, vcard, sha):
if not app.account_is_connected(self._account):
return
iq = nbxmpp.Iq(typ='set')
iq2 = iq.setTag(nbxmpp.NS_VCARD + ' vCard')
for i in vcard:
if i == 'jid':
continue
if isinstance(vcard[i], dict):
iq3 = iq2.addChild(i)
for j in vcard[i]:
iq3.addChild(j).setData(vcard[i][j])
elif isinstance(vcard[i], list):
for j in vcard[i]:
if isinstance(vcard, nbxmpp.Iq):
iq = vcard
else:
iq = nbxmpp.Iq(typ='set')
iq2 = iq.setTag(nbxmpp.NS_VCARD + ' vCard')
for i in vcard:
if i == 'jid':
continue
if isinstance(vcard[i], dict):
iq3 = iq2.addChild(i)
for k in j:
iq3.addChild(k).setData(j[k])
else:
iq2.addChild(i).setData(vcard[i])
for j in vcard[i]:
iq3.addChild(j).setData(vcard[i][j])
elif isinstance(vcard[i], list):
for j in vcard[i]:
iq3 = iq2.addChild(i)
for k in j:
iq3.addChild(k).setData(j[k])
else:
iq2.addChild(i).setData(vcard[i])
log.info('Upload avatar: %s %s', self._account, sha)
......
......@@ -220,3 +220,15 @@ .field-fixed { font-size: 16px; font-weight: bold; padding-top:5px;}
.data-form-title { font-size: 16px; font-weight: bold; }
.data-form-widget scrolledwindow { border: 1px solid; border-color:@unfocused_borders; }
.data-form-widget treeview { padding: 5px; }
#ProfileWindow grid { padding:18px; }
.profile-address-entry { border-radius: 0 0 0 0; border-width: 1px 1px 0 1px; }
.profile-address-entry:nth-child(first) { border-radius: 4px 4px 0 0; }
.profile-address-entry:nth-child(last) { border-radius: 0 0 4px 4px; border-width: 1px; }
.profile-textview-edit { padding: 8px; border: 1px solid; border-color: @borders; border-radius: 4px; background-color: @theme_base_color }
.profile-textview-edit border { border: none; }
.profile-textview text { background-color: @theme_unfocused_bg_color }
.profile-label-fix {padding-top:9px;}
......@@ -105,6 +105,9 @@
from gajim.common.const import ACTIVITIES, MOODS
from gajim import roster_window
from gajim import profile_window_new
from gajim import config
from threading import Thread
from gajim.common import ged
......@@ -122,7 +125,6 @@
from gajim.gtk import SSLErrorDialog
from gajim.gtk import ConfirmationDialogDoubleCheck
from gajim.gtk import ChangeNickDialog
from gajim.gtk import ProfileWindow
from gajim.common import configpaths
......@@ -284,9 +286,9 @@ def handle_event_status(self, obj): # OUR status
self.show_vcard_when_connect.remove(account)
def edit_own_details(self, account):
window = app.get_app_window(ProfileWindow)
window = app.get_app_window(profile_window_new.ProfileWindow)
if window is None:
ProfileWindow(account)
profile_window_new.ProfileWindow(account)
else:
window.present()
......@@ -2328,6 +2330,7 @@ def save_avatar(self, data, publish=False):
GdkPixbuf.InterpType.BILINEAR)
publish_path = os.path.join(
configpaths.get('AVATAR'), 'temp_publish')
pixbuf.savev(publish_path, 'png', [], [])
with open(publish_path, 'rb') as file:
data = file.read()
......
This diff is collapsed.
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