| ... |
... |
@@ -12,6 +12,9 @@ |
|
12
|
12
|
# You should have received a copy of the GNU General Public License
|
|
13
|
13
|
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
|
|
14
|
14
|
|
|
|
15
|
+from typing import Any
|
|
|
16
|
+from typing import Optional
|
|
|
17
|
+
|
|
15
|
18
|
from gi.repository import Gtk
|
|
16
|
19
|
|
|
17
|
20
|
from gajim.common import app
|
| ... |
... |
@@ -22,7 +25,7 @@ |
|
22
|
25
|
|
|
23
|
26
|
|
|
24
|
27
|
class StatusMessageSelector(Gtk.Box):
|
|
25
|
|
- def __init__(self, account=None):
|
|
|
28
|
+ def __init__(self, account: Optional[str] = None) -> None:
|
|
26
|
29
|
Gtk.Box.__init__(self)
|
|
27
|
30
|
self.get_style_context().add_class('linked')
|
|
28
|
31
|
self._account = account
|
| ... |
... |
@@ -43,10 +46,10 @@ def __init__(self, account=None): |
|
43
|
46
|
self.show_all()
|
|
44
|
47
|
app.ged.register_event_handler('our-show', ged.POSTGUI, self.update)
|
|
45
|
48
|
|
|
46
|
|
- def _on_changed(self, _entry):
|
|
|
49
|
+ def _on_changed(self, _entry: Gtk.Entry) -> None:
|
|
47
|
50
|
self._button.set_sensitive(True)
|
|
48
|
51
|
|
|
49
|
|
- def _set_status_message(self, *args):
|
|
|
52
|
+ def _set_status_message(self, *args: Any) -> None:
|
|
50
|
53
|
self._button.set_sensitive(False)
|
|
51
|
54
|
message = self._entry.get_text()
|
|
52
|
55
|
message = to_one_line(message)
|
| ... |
... |
@@ -61,7 +64,7 @@ def _set_status_message(self, *args): |
|
61
|
64
|
client = app.get_client(account)
|
|
62
|
65
|
client.change_status(client.status, message)
|
|
63
|
66
|
|
|
64
|
|
- def update(self, *args):
|
|
|
67
|
+ def update(self, *args: Any) -> None:
|
|
65
|
68
|
if self._account is None:
|
|
66
|
69
|
message = get_global_status_message()
|
|
67
|
70
|
else:
|