queue for erase/set credentials

This commit is contained in:
fourtf
2019-09-14 22:58:53 +02:00
parent 13d1fab303
commit 9bbc4f8a5e
8 changed files with 122 additions and 18 deletions
+21 -1
View File
@@ -33,10 +33,30 @@ IrcConnectionEditor::IrcConnectionEditor(const IrcServerData &data, bool isAdd,
this->ui_->passwordLineEdit->setText(password);
});
QObject::connect(this->ui_->loginMethodComboBox,
qOverload<int>(&QComboBox::currentIndexChanged), this,
[this](int index) {
IrcAuthType type;
switch (index)
{
case 0: // anonymous
type = IrcAuthType::Anonymous;
break;
case 1: // custom
this->ui_->connectCommandsEditor->setFocus();
type = IrcAuthType::Custom;
break;
case 2: // PASS
type = IrcAuthType::Pass;
break;
}
});
QFont font("Monospace");
font.setStyleHint(QFont::TypeWriter);
this->ui_->connectCommandsEditor->setFont(font);
} // namespace chatterino
}
IrcConnectionEditor::~IrcConnectionEditor()
{
+8 -3
View File
@@ -142,7 +142,7 @@
</spacer>
</item>
<item row="8" column="1">
<widget class="QComboBox" name="comboBox">
<widget class="QComboBox" name="loginMethodComboBox">
<item>
<property name="text">
<string>Anonymous</string>
@@ -150,7 +150,12 @@
</item>
<item>
<property name="text">
<string>PASS</string>
<string>Custom</string>
</property>
</item>
<item>
<property name="text">
<string>Server Password (/PASS $password)</string>
</property>
</item>
</widget>
@@ -210,7 +215,7 @@ on connect:</string>
<tabstop>userNameLineEdit</tabstop>
<tabstop>nickNameLineEdit</tabstop>
<tabstop>realNameLineEdit</tabstop>
<tabstop>comboBox</tabstop>
<tabstop>loginMethodComboBox</tabstop>
<tabstop>passwordLineEdit</tabstop>
</tabstops>
<resources/>
+2 -1
View File
@@ -174,7 +174,8 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
{
if (conn.id == data.id)
{
Irc::getInstance().connections.removeItem(i);
Irc::getInstance().connections.removeItem(
i, Irc::noEraseCredentialCaller);
Irc::getInstance().connections.insertItem(data,
i);
}