Network/IRC/IrcIdentitiesEditDialog.py

Sun, 02 Dec 2012 18:52:03 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 02 Dec 2012 18:52:03 +0100
changeset 2243
c0323a43d966
parent 2240
11445430c553
child 2246
fdf22a29fbf4
permissions
-rw-r--r--

Continued with the IRC management and added a few more TODOs.

2239
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3 # Copyright (c) 2012 Detlev Offenbach <detlev@die-offenbachs.de>
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the identities management dialog.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 import copy
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11
2240
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
12 from PyQt4.QtCore import pyqtSlot, Qt, QEvent
2239
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from PyQt4.QtGui import QDialog, QInputDialog, QLineEdit, QItemSelectionModel
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 from E5Gui import E5MessageBox
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 from .Ui_IrcIdentitiesEditDialog import Ui_IrcIdentitiesEditDialog
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 from .IrcNetworkManager import IrcIdentity
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 import Utilities
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 import UI.PixmapCache
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 class IrcIdentitiesEditDialog(QDialog, Ui_IrcIdentitiesEditDialog):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 Class implementing the identities management dialog.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 def __init__(self, manager, identityName, parent=None):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 Constructor
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 @param manager reference to the IRC network manager object (IrcNetworkManager)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 @param identityName name of the identity to be selected (string)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 @param parent reference to the parent widget (QWidget)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 super().__init__(parent)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.setupUi(self)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 self.addButton.setIcon(UI.PixmapCache.getIcon("plus.png"))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 self.copyButton.setIcon(UI.PixmapCache.getIcon("editCopy.png"))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 self.renameButton.setIcon(UI.PixmapCache.getIcon("editRename.png"))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 self.deleteButton.setIcon(UI.PixmapCache.getIcon("minus.png"))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 self.nicknameAddButton.setIcon(UI.PixmapCache.getIcon("plus.png"))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 self.nicknameDeleteButton.setIcon(UI.PixmapCache.getIcon("minus.png"))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.nicknameUpButton.setIcon(UI.PixmapCache.getIcon("1uparrow.png"))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 self.nicknameDownButton.setIcon(UI.PixmapCache.getIcon("1downarrow.png"))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 self.__manager = manager
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.__identities = self.__manager.getIdentities()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.__currentIdentity = None
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 identities = list(sorted(self.__manager.getIdentityNames()))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 identities[identities.index(IrcIdentity.DefaultIdentityName)] = \
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 IrcIdentity.DefaultIdentityDisplay
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 self.identitiesCombo.addItems(identities)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 if identityName == IrcIdentity.DefaultIdentityName:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 identityName = IrcIdentity.DefaultIdentityDisplay
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 index = self.identitiesCombo.findText(identityName)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 if index == -1:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 index = 0
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 identityName = self.identitiesCombo.itemText(0)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 self.identitiesCombo.setCurrentIndex(index)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 self.on_identitiesCombo_currentIndexChanged(identityName)
2240
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
67
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
68 self.nicknameEdit.installEventFilter(self)
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
69
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
70 def eventFilter(self, obj, evt):
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
71 """
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
72 Public method to handle events for other objects.
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
73
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
74 @param obj reference to the object (QObject)
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
75 @param evt reference to the event (QEvent)
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
76 @return flag indicating that the event should be filtered out (boolean)
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
77 """
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
78 if obj == self.nicknameEdit and evt.type() == QEvent.KeyPress:
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
79 if evt.key() in [Qt.Key_Enter, Qt.Key_Return]:
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
80 self.on_nicknameAddButton_clicked()
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
81 return True
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
82
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
83 return super().eventFilter(obj, evt)
2239
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 def __updateIdentitiesButtons(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 Private slot to update the status of the identity related buttons.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 enable = self.identitiesCombo.currentText() != IrcIdentity.DefaultIdentityDisplay
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 self.renameButton.setEnabled(enable)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 self.deleteButton.setEnabled(enable)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 @pyqtSlot(str)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 def on_identitiesCombo_currentIndexChanged(self, identity):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 Private slot to handle the selection of an identity.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 if identity == IrcIdentity.DefaultIdentityDisplay:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 identity = IrcIdentity.DefaultIdentityName
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 self.__updateIdentitiesButtons()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 if self.__currentIdentity and not self.__checkCurrentIdentity():
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 return
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 self.__refreshCurrentIdentity()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.__currentIdentity = self.__identities[identity]
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108
2243
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
109 # General Tab
2239
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 self.realnameEdit.setText(self.__currentIdentity.getRealName())
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 self.nicknamesList.clear()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 self.nicknamesList.addItems(self.__currentIdentity.getNickNames())
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 self.serviceEdit.setText(self.__currentIdentity.getServiceName())
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 self.passwordEdit.setText(self.__currentIdentity.getPassword())
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115
2243
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
116 # Away Tab
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
117 self.rememberPosOnAwayCheckBox.setChecked(
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
118 self.__currentIdentity.rememberAwayPosition())
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
119 self.awayEdit.setText(self.__currentIdentity.getAwayMessage())
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
120 self.autoAwayGroup.setChecked(self.__currentIdentity.autoAway())
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
121 self.inactivitySpinBox.setValue(self.__currentIdentity.getAutoAwayTimeout())
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
122 self.autoReturnCheckBox.setChecked(self.__currentIdentity.autoReturn())
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
123
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
124 # Advanced Tab
2240
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
125 self.identEdit.setText(self.__currentIdentity.getIdent())
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
126 self.quitEdit.setText(self.__currentIdentity.getQuitMessage())
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
127 self.partEdit.setText(self.__currentIdentity.getPartMessage())
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
128
2239
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 self.__updateIdentitiesButtons()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 self.__updateNicknameUpDownButtons()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 self.__updateNicknameButtons()
2240
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
132
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
133 self.identityTabWidget.setCurrentIndex(0)
2239
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 def __refreshCurrentIdentity(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 Private method to read back the data for the current identity.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 if self.__currentIdentity is None:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 return
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141
2243
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
142 # General Tab
2239
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 self.__currentIdentity.setRealName(self.realnameEdit.text())
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 self.__currentIdentity.setNickNames([self.nicknamesList.item(row).text()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 for row in range(self.nicknamesList.count())])
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 self.__currentIdentity.setServiceName(self.serviceEdit.text())
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 self.__currentIdentity.setPassword(self.passwordEdit.text())
2240
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
148
2243
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
149 # Away Tab
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
150 self.__currentIdentity.setRememberAwayPosition(
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
151 self.rememberPosOnAwayCheckBox.isChecked())
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
152 self.__currentIdentity.setAwayMessage(self.awayEdit.text())
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
153 self.__currentIdentity.setAutoAway(self.autoAwayGroup.isChecked())
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
154 self.__currentIdentity.setAutoAwayTimeout(self.inactivitySpinBox.value())
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
155 self.__currentIdentity.setAutoReturn(self.autoReturnCheckBox.isChecked())
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
156
c0323a43d966 Continued with the IRC management and added a few more TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2240
diff changeset
157 # Advanced Tab
2240
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
158 self.__currentIdentity.setIdent(self.identEdit.text())
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
159 self.__currentIdentity.setQuitMessage(self.quitEdit.text())
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
160 self.__currentIdentity.setPartMessage(self.partEdit.text())
2239
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 def __checkCurrentIdentity(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 Private method to check the data for the current identity.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 @return flag indicating a successful check (boolean)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 if self.nicknamesList.count() == 0:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 E5MessageBox.critical(self,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 self.trUtf8("Edit Identity"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 self.trUtf8("""The identity must contain at least one nick name."""))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 block = self.identitiesCombo.blockSignals(True)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 identity = self.__currentIdentity.getName()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 if identity == IrcIdentity.DefaultIdentityName:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 identity = IrcIdentity.DefaultIdentityDisplay
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 self.identitiesCombo.setCurrentIndex(self.identitiesCombo.findText(identity))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 self.identitiesCombo.blockSignals(block)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 self.identityTabWidget.setCurrentIndex(0)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 self.nicknameEdit.setFocus()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 return False
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 if not self.realnameEdit.text():
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 E5MessageBox.critical(self,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 self.trUtf8("Edit Identity"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 self.trUtf8("""The identity must have a real name."""))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 block = self.identitiesCombo.blockSignals(True)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187 identity = self.__currentIdentity.getName()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 if identity == IrcIdentity.DefaultIdentityName:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 identity = IrcIdentity.DefaultIdentityDisplay
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 self.identitiesCombo.setCurrentIndex(self.identitiesCombo.findText(identity))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 self.identitiesCombo.blockSignals(block)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 self.identityTabWidget.setCurrentIndex(0)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 self.realnameEdit.setFocus()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 return False
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 return True
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 @pyqtSlot()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 def on_addButton_clicked(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 Private slot to add a new idntity.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 name, ok = QInputDialog.getText(
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 self,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 self.trUtf8("Add Identity"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 self.trUtf8("Identity Name:"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207 QLineEdit.Normal)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 if ok:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 if name:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 if name in self.__identities:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 E5MessageBox.critical(self,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 self.trUtf8("Add Identity"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 self.trUtf8("""An identity named <b>{0}</b> already exists."""
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215 """ You must provide a different name.""").format(
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 name))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 self.on_addButton_clicked()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 else:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 identity = IrcIdentity(name)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 identity.setIdent(Utilities.getUserName())
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 identity.setRealName(Utilities.getRealName())
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 self.__identities[name] = identity
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 self.identitiesCombo.addItem(name)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 self.identitiesCombo.setCurrentIndex(self.identitiesCombo.count() - 1)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 else:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 E5MessageBox.critical(self,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 self.trUtf8("Add Identity"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 self.trUtf8("""The identity has to have a name."""))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 self.on_addButton_clicked()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 @pyqtSlot()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 def on_copyButton_clicked(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 Private slot to copy the selected identity.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 currentIdentity = self.identitiesCombo.currentText()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 name, ok = QInputDialog.getText(
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 self,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 self.trUtf8("Copy Identity"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 self.trUtf8("Identity Name:"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 QLineEdit.Normal,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 currentIdentity)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 if ok:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 if name:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 if name in self.__identities:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 E5MessageBox.critical(self,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 self.trUtf8("Copy Identity"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 self.trUtf8("""An identity named <b>{0}</b> already exists."""
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 """ You must provide a different name.""").format(
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251 name))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 self.on_copyButton_clicked()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 else:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 identity = copy.deepcopy(self.__currentIdentity)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 identity.setName(name)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 self.__identities[name] = identity
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 self.identitiesCombo.addItem(name)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258 self.identitiesCombo.setCurrentIndex(self.identitiesCombo.count() - 1)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259 else:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 E5MessageBox.critical(self,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 self.trUtf8("Copy Identity"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 self.trUtf8("""The identity has to have a name."""))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263 self.on_copyButton_clicked()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 @pyqtSlot()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 def on_renameButton_clicked(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 Private slot to rename the selected identity.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 currentIdentity = self.identitiesCombo.currentText()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 name, ok = QInputDialog.getText(
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 self,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 self.trUtf8("Rename Identity"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 self.trUtf8("Identity Name:"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 QLineEdit.Normal,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 currentIdentity)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 if ok and name != currentIdentity:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 if name:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 if name in self.__identities:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 E5MessageBox.critical(self,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 self.trUtf8("Rename Identity"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 self.trUtf8("""An identity named <b>{0}</b> already exists."""
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 """ You must provide a different name.""").format(
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 name))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 self.on_renameButton_clicked()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287 else:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288 del self.__identities[currentIdentity]
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 self.__currentIdentity.setName(name)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 self.__identities[name] = self.__currentIdentity
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 self.identitiesCombo.setItemText(
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 self.identitiesCombo.currentIndex(), name)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293 else:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294 E5MessageBox.critical(self,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 self.trUtf8("Copy Identity"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 self.trUtf8("""The identity has to have a name."""))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 self.on_renameButton_clicked()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 @pyqtSlot()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 def on_deleteButton_clicked(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 Private slot to rename the selected identity.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 currentIdentity = self.identitiesCombo.currentText()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 if currentIdentity == IrcIdentity.DefaultIdentityDisplay:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 return
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 inUse = False
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309 for networkName in self.__manager.getNetworkNames():
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 inUse = (
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311 self.__manager.getNetwork(networkName).getIdentityName() ==
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312 currentIdentity)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313 if inUse:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 break
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 if inUse:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 msg = self.trUtf8("""This identity is in use. If you remove it, the network"""
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 """ settings using it will fall back to the default"""
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 """ identity. Should it be deleted anyway?""")
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 else:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 msg = self.trUtf8("""Do you really want to delete all information for"""
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 """ this identity?""")
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 res = E5MessageBox.yesNo(self,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 self.trUtf8("Delete Identity"),
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 msg,
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 icon = E5MessageBox.Warning)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 if res:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 del self.__identities[currentIdentity]
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 self.identitiesCombo.removeItem(
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 self.identitiesCombo.findText(currentIdentity))
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332 def __updateNicknameUpDownButtons(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
333 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
334 Private method to set the enabled state of the nick name up and down buttons.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 if len(self.nicknamesList.selectedItems()) == 0:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 self.nicknameUpButton.setEnabled(False)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 self.nicknameDownButton.setEnabled(False)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 else:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 if self.nicknamesList.currentRow() == 0:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 self.nicknameUpButton.setEnabled(False)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 self.nicknameDownButton.setEnabled(True)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 elif self.nicknamesList.currentRow() == self.nicknamesList.count() - 1:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 self.nicknameUpButton.setEnabled(True)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 self.nicknameDownButton.setEnabled(False)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 else:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 self.nicknameUpButton.setEnabled(True)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 self.nicknameDownButton.setEnabled(True)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 def __updateNicknameButtons(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 Private slot to update the nick name buttons except the up and down buttons.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354 self.nicknameDeleteButton.setEnabled(
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
355 len(self.nicknamesList.selectedItems()) != 0)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 self.nicknameAddButton.setEnabled(self.nicknameEdit.text() != "")
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 @pyqtSlot(str)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 def on_nicknameEdit_textEdited(self, nick):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 Private slot handling a change of the nick name.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 """
2240
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
364 sel = self.nicknamesList.selectedItems()
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
365 if sel:
11445430c553 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2239
diff changeset
366 sel[0].setText(nick)
2239
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 self.__updateNicknameButtons()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370 @pyqtSlot()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 def on_nicknamesList_itemSelectionChanged(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 Private slot handling the selection of a nick name.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375 items = self.nicknamesList.selectedItems()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
376 if items:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
377 self.nicknameEdit.setText(items[0].text())
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
378
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379 self.__updateNicknameUpDownButtons()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 self.__updateNicknameButtons()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 self.nicknameEdit.setFocus()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 @pyqtSlot()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 def on_nicknameAddButton_clicked(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
386 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 Private slot to add a new nickname.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 nick = self.nicknameEdit.text()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390 if nick not in [self.nicknamesList.item(row).text()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
391 for row in range(self.nicknamesList.count())]:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 self.nicknamesList.insertItem(0, nick)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393 self.nicknamesList.setCurrentRow(0, QItemSelectionModel.Clear)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 self.nicknameEdit.clear()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395 self.__updateNicknameButtons()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
397 @pyqtSlot()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 def on_nicknameDeleteButton_clicked(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
400 Private slot to delete a nick name.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
401 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
402 itm = self.nicknamesList.takeItem(self.nicknamesList.currentRow())
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
403 del itm
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
404 self.__updateNicknameButtons()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
405
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
406 @pyqtSlot()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
407 def on_nicknameUpButton_clicked(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
408 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
409 Private slot to move the selected entry up one row.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411 row = self.nicknamesList.currentRow()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
412 if row > 0:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
413 itm = self.nicknamesList.takeItem(row)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414 row -= 1
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415 self.nicknamesList.insertItem(row, itm)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416 self.nicknamesList.setCurrentItem(itm)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 @pyqtSlot()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
419 def on_nicknameDownButton_clicked(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 Private slot to move the selected entry down one row.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 row = self.nicknamesList.currentRow()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 if row < self.nicknamesList.count() - 1:
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425 itm = self.nicknamesList.takeItem(row)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 row += 1
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427 self.nicknamesList.insertItem(row, itm)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
428 self.nicknamesList.setCurrentItem(itm)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
429
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
430 def accept(self):
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
431 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432 Public slot handling the acceptance of the dialog.
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
433 """
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434 if not self.__checkCurrentIdentity():
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
435 return
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437 self.__refreshCurrentIdentity()
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438 self.__manager.setIdentities(self.__identities)
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
439
a47b50e80a20 Continued with the IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440 super().accept()

eric ide

mercurial