Network/IRC/IrcChannelEditDialog.py

Sun, 29 Sep 2013 14:12:38 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 29 Sep 2013 14:12:38 +0200
changeset 2960
9453efa25fd5
parent 2302
f29e9405c851
child 3057
10516539f238
child 3160
209a07d7e401
permissions
-rw-r--r--

Continued correcting doc strings by using the new doc string checker.

2235
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
2302
f29e9405c851 Updated copyright for 2013.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2235
diff changeset
3 # Copyright (c) 2012 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
2235
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to edit channel data.
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 from PyQt4.QtCore import pyqtSlot
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 from PyQt4.QtGui import QDialog, QDialogButtonBox
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from .Ui_IrcChannelEditDialog import Ui_IrcChannelEditDialog
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 class IrcChannelEditDialog(QDialog, Ui_IrcChannelEditDialog):
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 """
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 Class implementing a dialog to edit channel data.
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 def __init__(self, name, key, autoJoin, edit, parent=None):
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 Constructor
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 @param name channel name (string)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 @param key channel key (string)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 @param autoJoin flag indicating, that the channel should
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 be joined automatically (boolean)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 @param edit flag indicating an edit of an existing
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 channel (boolean)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 @param parent reference to the parent widget (QWidget)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 """
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 super().__init__(parent)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 self.setupUi(self)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 self.nameEdit.setText(name)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 self.keyEdit.setText(key)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 self.autoJoinCheckBox.setChecked(autoJoin)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 self.nameEdit.setReadOnly(edit)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(name != "")
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 @pyqtSlot(str)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 def on_nameEdit_textChanged(self, txt):
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 """
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 Private slot to handle changes of the given name.
2960
9453efa25fd5 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
47
9453efa25fd5 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
48 @param txt text of the edit (string)
2235
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 """
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(txt != "")
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 def getData(self):
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 """
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 Public method to get the channel data.
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 @return tuple giving the channel name, channel key and a flag
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 indicating, that the channel should be joined automatically
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 (string, string, boolean)
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 """
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 return (self.nameEdit.text(),
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 self.keyEdit.text(),
266800cbe7cc Continued with IRC management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 self.autoJoinCheckBox.isChecked())

eric ide

mercurial