annotate frontends/src/primitivus/profile_manager.py @ 587:952322b1d490

Remove trailing whitespaces.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 18 Jan 2013 17:55:34 +0100
parents ca13633d3b6b
children 84a6e83157c2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
112
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/usr/bin/python
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
3
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
4 """
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
5 Primitivus: a SAT frontend
572
ca13633d3b6b dates update
Goffi <goffi@goffi.org>
parents: 511
diff changeset
6 Copyright (C) 2009, 2010, 2011, 2012, 2013 Jérôme Poisson (goffi@goffi.org)
112
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
7
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
8 This program is free software: you can redistribute it and/or modify
480
2a072735e459 Licence modification: the full project is now under AGPL v3+ instead of GPL v3+
Goffi <goffi@goffi.org>
parents: 459
diff changeset
9 it under the terms of the GNU Affero General Public License as published by
112
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
10 the Free Software Foundation, either version 3 of the License, or
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
11 (at your option) any later version.
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
12
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
13 This program is distributed in the hope that it will be useful,
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
480
2a072735e459 Licence modification: the full project is now under AGPL v3+ instead of GPL v3+
Goffi <goffi@goffi.org>
parents: 459
diff changeset
16 GNU Affero General Public License for more details.
112
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
17
480
2a072735e459 Licence modification: the full project is now under AGPL v3+ instead of GPL v3+
Goffi <goffi@goffi.org>
parents: 459
diff changeset
18 You should have received a copy of the GNU Affero General Public License
112
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
20 """
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
21
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
22 import urwid
422
5a18c5f08d9b Primitivus: Profile Manager: fixed redraw on profile change + use of AdvandedEdit for login field
Goffi <goffi@goffi.org>
parents: 421
diff changeset
23 from urwid_satext.sat_widgets import AdvancedEdit,Password,List,InputDialog,ConfirmDialog,Alert,FocusFrame
225
fd9b7834d98a distutils installation script, draft
Goffi <goffi@goffi.org>
parents: 223
diff changeset
24 from sat.tools.jid import JID
112
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
25
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
26
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
27 class ProfileManager(urwid.WidgetWrap):
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
28
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
29 def __init__(self, host):
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
30 self.host = host
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
31 #profiles list
112
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
32 profiles = self.host.bridge.getProfilesList()
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
33 profiles.sort()
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
34
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
35 #login & password box must be created before list because of onProfileChange
422
5a18c5f08d9b Primitivus: Profile Manager: fixed redraw on profile change + use of AdvandedEdit for login field
Goffi <goffi@goffi.org>
parents: 421
diff changeset
36 self.login_wid = AdvancedEdit(_('Login:'),align='center')
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
37 self.pass_wid = Password(_('Password:'),align='center')
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
38
511
62f7f2403093 Primitivus: present contacts in groups chat can now be clicked
Goffi <goffi@goffi.org>
parents: 480
diff changeset
39 self.list_profile = List(profiles, style=['single'], align='center', on_change=self.onProfileChange)
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
40
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
41 #new & delete buttons
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
42 buttons = [urwid.Button(_("New"), self.onNewProfile),
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
43 urwid.Button(_("Delete"), self.onDeleteProfile)]
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
44 buttons_flow = urwid.GridFlow(buttons, max([len(button.get_label()) for button in buttons])+4, 1, 1, 'center')
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
45
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
46 #second part: login information:
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
47 divider = urwid.Divider('-')
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
48
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
49 #connect button
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
50 connect_button = urwid.Button(_("Connect"), self.onConnectProfile)
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
51
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
52 #we now build the widget
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
53 body_content = urwid.SimpleListWalker([buttons_flow,self.list_profile,divider,self.login_wid, self.pass_wid, connect_button])
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
54 frame_body = urwid.ListBox(body_content)
115
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
55 frame = urwid.Frame(frame_body,urwid.AttrMap(urwid.Text(_("Profile Manager"),align='center'),'title'))
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
56 self.main_widget = urwid.LineBox(frame)
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
57 urwid.WidgetWrap.__init__(self, self.main_widget)
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
58
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
59 def __refillProfiles(self):
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
60 """Update the list of profiles"""
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
61 profiles = self.host.bridge.getProfilesList()
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
62 profiles.sort()
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
63 self.list_profile.changeValues(profiles)
112
f551e44adb25 Primitivus first draft
Goffi <goffi@goffi.org>
parents:
diff changeset
64
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
65 def cancelDialog(self, button):
117
1f0fd6f03e2b misc fixes
Goffi <goffi@goffi.org>
parents: 115
diff changeset
66 self.host.removePopUp()
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
67
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
68 def newProfile(self, button, edit):
217
b4dfe15c0b25 primitivus: misc comments
Goffi <goffi@goffi.org>
parents: 173
diff changeset
69 """Create the profile"""
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
70 name = edit.get_edit_text()
421
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
71 self.host.bridge.asyncCreateProfile(name, callback=lambda: self._newProfileCreated(name), errback=self._profileCreationFailure)
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
72
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
73 def _newProfileCreated(self, name):
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
74 self.__refillProfiles()
217
b4dfe15c0b25 primitivus: misc comments
Goffi <goffi@goffi.org>
parents: 173
diff changeset
75 #We select the profile created in the list
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
76 self.list_profile.selectValue(name)
117
1f0fd6f03e2b misc fixes
Goffi <goffi@goffi.org>
parents: 115
diff changeset
77 self.host.removePopUp()
421
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
78 self.host.redraw()
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
79
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
80 def _profileCreationFailure(self, reason):
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
81 self.host.removePopUp()
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
82 if reason=="CONFLICT":
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
83 message=_("A profile with this name already exists")
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
84 elif reason=="CANCELED":
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
85 message=_("Profile creation cancelled by backend")
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
86 elif reason=="DATABASE":
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
87 message=_("Database error")
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
88 else:
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
89 message=_("Unknown reason (%s)") % reason
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
90 popup = Alert(_("Can't create profile"), message, ok_cb=self.host.removePopUp)
28e4299d4553 primitivus: profile manager updated to use new asynchronous profile creation
Goffi <goffi@goffi.org>
parents: 413
diff changeset
91 self.host.showPopUp(popup)
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
92
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
93 def deleteProfile(self, button):
119
ded2431cea5a Primitivus: chat window / text sending.
Goffi <goffi@goffi.org>
parents: 117
diff changeset
94 profile_name = self.list_profile.getSelectedValue()
115
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
95 if profile_name:
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
96 self.host.bridge.deleteProfile(profile_name)
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
97 self.__refillProfiles()
117
1f0fd6f03e2b misc fixes
Goffi <goffi@goffi.org>
parents: 115
diff changeset
98 self.host.removePopUp()
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
99
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
100 def onNewProfile(self, e):
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
101 pop_up_widget = InputDialog(_("New profile"), _("Please enter a new profile name"), cancel_cb=self.cancelDialog, ok_cb=self.newProfile)
117
1f0fd6f03e2b misc fixes
Goffi <goffi@goffi.org>
parents: 115
diff changeset
102 self.host.showPopUp(pop_up_widget)
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
103
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
104 def onDeleteProfile(self, e):
119
ded2431cea5a Primitivus: chat window / text sending.
Goffi <goffi@goffi.org>
parents: 117
diff changeset
105 pop_up_widget = ConfirmDialog(_("Are you sure you want to delete the profile %s ?") % self.list_profile.getSelectedValue(), no_cb=self.cancelDialog, yes_cb=self.deleteProfile)
117
1f0fd6f03e2b misc fixes
Goffi <goffi@goffi.org>
parents: 115
diff changeset
106 self.host.showPopUp(pop_up_widget)
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
107
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
108 def onProfileChange(self, list_wid):
413
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
109 def setJID(jabberID):
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
110 self.login_wid.set_edit_text(jabberID)
446
39a8ca1a2675 Primitivus: fixed redraw on profile change in profile manager
Goffi <goffi@goffi.org>
parents: 423
diff changeset
111 self.host.redraw()
413
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
112 def setPassword(password):
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
113 self.pass_wid.set_edit_text(password)
446
39a8ca1a2675 Primitivus: fixed redraw on profile change in profile manager
Goffi <goffi@goffi.org>
parents: 423
diff changeset
114 self.host.redraw()
413
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
115
119
ded2431cea5a Primitivus: chat window / text sending.
Goffi <goffi@goffi.org>
parents: 117
diff changeset
116 profile_name = list_wid.getSelectedValue()
115
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
117 if profile_name:
413
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
118 self.host.bridge.asyncGetParamA("JabberID", "Connection", profile_key=profile_name, callback=setJID, errback=self.getParamError)
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
119 self.host.bridge.asyncGetParamA("Password", "Connection", profile_key=profile_name, callback=setPassword, errback=self.getParamError)
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
120
113
e5ca22113280 Primitivus: profile manager
Goffi <goffi@goffi.org>
parents: 112
diff changeset
121 def onConnectProfile(self, button):
119
ded2431cea5a Primitivus: chat window / text sending.
Goffi <goffi@goffi.org>
parents: 117
diff changeset
122 profile_name = self.list_profile.getSelectedValue()
115
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
123 if not profile_name:
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
124 pop_up_widget = Alert(_('No profile selected'), _('You need to create and select a profile before connecting'), ok_cb=self.cancelDialog)
117
1f0fd6f03e2b misc fixes
Goffi <goffi@goffi.org>
parents: 115
diff changeset
125 self.host.showPopUp(pop_up_widget)
115
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
126 elif profile_name[0] == '@':
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
127 pop_up_widget = Alert(_('Bad profile name'), _("A profile name can't start with a @"), ok_cb=self.cancelDialog)
117
1f0fd6f03e2b misc fixes
Goffi <goffi@goffi.org>
parents: 115
diff changeset
128 self.host.showPopUp(pop_up_widget)
115
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
129 else:
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
130 profile = self.host.bridge.getProfileName(profile_name)
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
131 assert(profile)
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
132 #TODO: move this to quick_app
413
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
133 self.host.bridge.asyncGetParamA("JabberID", "Connection", profile_key=profile,
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
134 callback=lambda old_jid: self.__old_jidReceived(old_jid, profile), errback=self.getParamError)
115
eed4f77c942e primitivus: Profile Manager should now be fully fonctionnal
Goffi <goffi@goffi.org>
parents: 113
diff changeset
135
413
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
136 def __old_jidReceived(self, old_jid, profile):
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
137 self.host.bridge.asyncGetParamA("Password", "Connection", profile_key=profile,
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
138 callback=lambda old_pass: self.__old_passReceived(old_jid, old_pass, profile), errback=self.getParamError)
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
139
413
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
140 def __old_passReceived(self, old_jid, old_pass, profile):
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
141 """Check if we have new jid/pass, save them if it is the case, and plug profile"""
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
142 new_jid = self.login_wid.get_edit_text()
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
143 new_pass = self.pass_wid.get_edit_text()
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
144
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
145 if old_jid != new_jid:
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
146 self.host.bridge.setParam("JabberID", new_jid, "Connection", profile)
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
147 self.host.bridge.setParam("Server", JID(new_jid).domain, "Connection", profile)
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
148 if old_pass != new_pass:
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
149 self.host.bridge.setParam("Password", new_pass, "Connection", profile)
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 228
diff changeset
150 self.host.plug_profile(profile)
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
151
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 422
diff changeset
152 def getParamError(self, ignore):
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 422
diff changeset
153 popup = Alert("Error", _("Can't get profile parameter"), ok_cb=self.host.removePopUp)
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 422
diff changeset
154 self.host.showPopUp(popup)