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:
commit
dcfc0d7bc7
|
@ -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">
|
||||
|
|
|
@ -10,9 +10,8 @@ RemoveFriendDialog::RemoveFriendDialog(QWidget *parent, const Friend *f)
|
|||
ui.setupUi(this);
|
||||
ui.label->setText(ui.label->text().replace("<name>", 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());
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ public:
|
|||
|
||||
public slots:
|
||||
void onAccepted();
|
||||
void onTextChanged(QString text);
|
||||
|
||||
protected:
|
||||
Ui_RemoveFriendDialog ui;
|
||||
|
|
Loading…
Reference in New Issue
Block a user