Daniel Brötzmann pushed to branch mainwindow at gajim / gajim

Commits:

5 changed files:

Changes:

  • gajim/common/settings.py
    ... ... @@ -163,6 +163,8 @@ def init(self) -> None:
    163 163
             self._load_settings()
    
    164 164
             self._load_account_settings()
    
    165 165
             if not self._settings['app']:
    
    166
    +            # ['app'] is empty in a newly created database.
    
    167
    +            # If there is an old config, it gets migrated at this point.
    
    166 168
                 self._migrate_old_config()
    
    167 169
                 self._commit()
    
    168 170
             self._migrate_database()
    
    ... ... @@ -247,7 +249,8 @@ def _migrate(self) -> None:
    247 249
                 sql = '''INSERT INTO settings(name, settings)
    
    248 250
                          VALUES ('workspaces', ?)'''
    
    249 251
                 self._con.execute(sql, (json.dumps(INITAL_WORKSPACE),))
    
    250
    -            self._set_user_version(2)
    
    252
    +            self._settings['workspaces'] = INITAL_WORKSPACE
    
    253
    +            self._set_user_version(1)
    
    251 254
     
    
    252 255
         def _migrate_old_config(self) -> None:
    
    253 256
             config_file = configpaths.get('CONFIG_FILE')
    

  • gajim/data/gui/chat_list_row.ui
    ... ... @@ -148,6 +148,7 @@
    148 148
                             <property name="can-focus">False</property>
    
    149 149
                             <property name="no-show-all">True</property>
    
    150 150
                             <property name="halign">start</property>
    
    151
    +                        <property name="ellipsize">end</property>
    
    151 152
                             <property name="single-line-mode">True</property>
    
    152 153
                             <property name="xalign">0</property>
    
    153 154
                             <style>
    

  • gajim/gtk/conversation/rows/base.py
    ... ... @@ -77,6 +77,7 @@ def create_timestamp_widget(timestamp: datetime) -> Gtk.Label:
    77 77
         def create_name_widget(name: str, is_self: bool) -> Gtk.Label:
    
    78 78
             label = Gtk.Label()
    
    79 79
             label.set_selectable(True)
    
    80
    +        label.set_ellipsize(Pango.EllipsizeMode.END)
    
    80 81
             label.get_style_context().add_class('conversation-nickname')
    
    81 82
             label.set_markup(GLib.markup_escape_text(name))
    
    82 83
     
    

  • gajim/gtk/conversation/rows/message.py
    ... ... @@ -22,6 +22,7 @@
    22 22
     from gajim.common import app
    
    23 23
     from gajim.common.const import AvatarSize
    
    24 24
     from gajim.common.const import TRUST_SYMBOL_DATA
    
    25
    +from gajim.common.helpers import get_group_chat_nick
    
    25 26
     from gajim.common.helpers import get_muc_context
    
    26 27
     from gajim.common.helpers import reduce_chars_newlines
    
    27 28
     from gajim.common.helpers import to_user_string
    
    ... ... @@ -87,11 +88,14 @@ def __init__(self,
    87 88
                 self._message_widget = MessageWidget(account)
    
    88 89
                 self._message_widget.add_content(result)
    
    89 90
                 if self._is_groupchat:
    
    90
    -                if self._contact.get_self().name != name:
    
    91
    +                our_nick = get_group_chat_nick(
    
    92
    +                    self._account, self._contact.jid)
    
    93
    +                if name != our_nick:
    
    91 94
                         self._check_for_highlight(result)
    
    92 95
     
    
    93 96
             if self._is_groupchat:
    
    94
    -            is_self = name == self._contact.get_self().name
    
    97
    +            our_nick = get_group_chat_nick(self._account, self._contact.jid)
    
    98
    +            is_self = name == our_nick
    
    95 99
             else:
    
    96 100
                 is_self = kind == 'outgoing'
    
    97 101
             name_widget = self.create_name_widget(name, is_self)
    

  • gajim/gtk/main.py
    ... ... @@ -80,6 +80,7 @@ def __init__(self):
    80 80
                 ('account-disabled', ged.GUI1, self._on_account_disabled),
    
    81 81
             ])
    
    82 82
     
    
    83
    +        self._check_for_account()
    
    83 84
             self._load_chats()
    
    84 85
             self._add_actions()
    
    85 86
             self._add_actions2()
    
    ... ... @@ -414,6 +415,17 @@ def _remove_contact():
    414 415
                  DialogButton.make('Remove',
    
    415 416
                                    callback=_remove_contact)]).show()
    
    416 417
     
    
    418
    +    @staticmethod
    
    419
    +    def _check_for_account():
    
    420
    +        accounts = app.settings.get_accounts()
    
    421
    +        if (not accounts or accounts == ['Local'] and
    
    422
    +                not app.settings.get_account_setting('Local', 'active')):
    
    423
    +            # Either no account configured or only disabled Local account
    
    424
    +            def _open_wizard():
    
    425
    +                open_window('AccountWizard')
    
    426
    +
    
    427
    +            GLib.idle_add(_open_wizard)
    
    428
    +
    
    417 429
         def _load_chats(self):
    
    418 430
             for workspace_id in app.settings.get_workspaces():
    
    419 431
                 self.add_workspace(workspace_id)