1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge remote-tracking branch 'Impyy/fix-friend-rm-dialog'

This commit is contained in:
agilob 2015-09-23 19:20:27 +01:00
commit dcfc0d7bc7
No known key found for this signature in database
GPG Key ID: 296F0B764741106C
3 changed files with 8 additions and 23 deletions

View File

@ -7,9 +7,15 @@
<x>0</x>
<y>0</y>
<width>300</width>
<height>180</height>
<height>110</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>110</height>
</size>
</property>
<property name="windowTitle">
<string>Remove friend</string>
</property>
@ -27,19 +33,6 @@
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="yes">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="placeholderText">
<string>YES</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="removeHistory">
<property name="text">

View File

@ -10,9 +10,8 @@ RemoveFriendDialog::RemoveFriendDialog(QWidget *parent, const Friend *f)
ui.setupUi(this);
ui.label->setText(ui.label->text().replace("&lt;name&gt;", f->getDisplayedName()));
auto removeButton = ui.buttonBox->button(QDialogButtonBox::Ok);
removeButton->setEnabled(false);
removeButton->setText(tr("Remove"));
connect(ui.yes, &QLineEdit::textChanged, this, &RemoveFriendDialog::onTextChanged);
adjustSize();
connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &RemoveFriendDialog::onAccepted);
connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &RemoveFriendDialog::close);
setFocus();
@ -23,9 +22,3 @@ void RemoveFriendDialog::onAccepted()
_accepted = true;
close();
}
void RemoveFriendDialog::onTextChanged(QString text)
{
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(text == ui.yes->placeholderText());
}

View File

@ -25,7 +25,6 @@ public:
public slots:
void onAccepted();
void onTextChanged(QString text);
protected:
Ui_RemoveFriendDialog ui;