mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge branch 'pr1480'
Conflicts: src/widget/form/addfriendform.cpp
This commit is contained in:
commit
72e78ff6cd
|
@ -19,6 +19,7 @@
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QErrorMessage>
|
#include <QErrorMessage>
|
||||||
|
#include <QClipboard>
|
||||||
#include <tox/tox.h>
|
#include <tox/tox.h>
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "src/nexus.h"
|
#include "src/nexus.h"
|
||||||
|
@ -67,6 +68,7 @@ void AddFriendForm::show(Ui::MainWindow &ui)
|
||||||
ui.mainHead->layout()->addWidget(head);
|
ui.mainHead->layout()->addWidget(head);
|
||||||
main->show();
|
main->show();
|
||||||
head->show();
|
head->show();
|
||||||
|
setIdFromClipboard();
|
||||||
toxId.setFocus();
|
toxId.setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,3 +118,13 @@ Ignore the proxy and connect to the Internet directly?"), QMessageBox::Yes|QMess
|
||||||
this->message.clear();
|
this->message.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AddFriendForm::setIdFromClipboard()
|
||||||
|
{
|
||||||
|
QClipboard* clipboard = QApplication::clipboard();
|
||||||
|
QString id = clipboard->text().trimmed();
|
||||||
|
if (Core::getInstance()->isReady() && !id.isEmpty() && ToxID::isToxId(id)) {
|
||||||
|
if (!ToxID::fromString(id).isMine())
|
||||||
|
toxId.setText(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ private slots:
|
||||||
void onSendTriggered();
|
void onSendTriggered();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void setIdFromClipboard();
|
||||||
QLabel headLabel, toxIdLabel, messageLabel;
|
QLabel headLabel, toxIdLabel, messageLabel;
|
||||||
QPushButton sendButton;
|
QPushButton sendButton;
|
||||||
QLineEdit toxId;
|
QLineEdit toxId;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user