mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
refs #911, paste support in forms
* added paste icon * base class utility functions * implemented paste for livery, airline and aircraft ICAO
This commit is contained in:
committed by
Mathew Sutcliffe
parent
5e69be6208
commit
fc3a36512e
@@ -8,6 +8,9 @@
|
||||
*/
|
||||
|
||||
#include "blackgui/editors/form.h"
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QShortcut>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Network;
|
||||
@@ -17,7 +20,7 @@ namespace BlackGui
|
||||
namespace Editors
|
||||
{
|
||||
CForm::CForm(QWidget *parent) : COverlayMessagesFrame(parent)
|
||||
{ }
|
||||
{ }
|
||||
|
||||
CForm::~CForm() { }
|
||||
|
||||
@@ -37,9 +40,22 @@ namespace BlackGui
|
||||
return this->m_swiftDbUser.get();
|
||||
}
|
||||
|
||||
void CForm::jsonPasted(const QString &json)
|
||||
{
|
||||
Q_UNUSED(json);
|
||||
}
|
||||
|
||||
void CForm::ps_userChanged()
|
||||
{
|
||||
// void
|
||||
}
|
||||
|
||||
void CForm::ps_pasted()
|
||||
{
|
||||
if (!QApplication::clipboard()) { return; }
|
||||
const QString data = QApplication::clipboard()->text();
|
||||
if (!Json::looksLikeSwiftJson(data)) { return; }
|
||||
this->jsonPasted(data);
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user