Beispiel #1
0
        void on_editAccountButton_clicked()
        {
            var selected = accountsList.SelectionModel().SelectedIndexes();

            if (selected.Count > 0)
            {
                var data = accountsList.Model().Data(selected[0], (int)Qt.ItemDataRole.DisplayRole);
                var jid  = new jabber.JID((string)data);

                var accountService = ServiceManager.Get <AccountService>();

                Account account = accountService.GetAccount(jid);
                if (account != null)
                {
                    if (!account.IsReadOnly)
                    {
                        var dialog = new EditAccountDialog(account.Info, this);
                        dialog.Show();
                        dialog.Exec();

                        accountsList.Update();
                    }
                    else
                    {
                        QMessageBox.Critical(this, "Error", "Cannot modify account while connected.");
                    }
                }
            }
        }
Beispiel #2
0
        void on_editAccountButton_clicked()
        {
            var selected = accountsList.SelectionModel().SelectedIndexes();
            if (selected.Count > 0) {
                var data = accountsList.Model().Data(selected[0], (int)Qt.ItemDataRole.DisplayRole);
                var jid = new jabber.JID((string)data);

                var accountService = ServiceManager.Get<AccountService>();

                Account account = accountService.GetAccount(jid);
                if (account != null) {
                    if (!account.IsReadOnly) {
                        var dialog = new EditAccountDialog(account.Info, this);
                        dialog.Show();
                        dialog.Exec();

                        accountsList.Update();
                    } else {
                        QMessageBox.Critical(this, "Error", "Cannot modify account while connected.");
                    }
                }
            }
        }