forked from bitshares/bitshares1-qtwallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUtilities.cpp
34 lines (26 loc) · 813 Bytes
/
Utilities.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "Utilities.hpp"
#include <fc/log/logger.hpp>
#include <QApplication>
#include <QClipboard>
#include <QDesktopServices>
#include <QFileDialog>
void Utilities::copy_to_clipboard(const QString& string)
{
qApp->clipboard()->setText(string);
}
void Utilities::open_in_external_browser(const QString& url)
{
QDesktopServices::openUrl(QUrl(url));
}
void Utilities::open_in_external_browser(const QUrl& url)
{
QDesktopServices::openUrl(url);
}
QString Utilities::prompt_user_to_open_file(const QString& dialogCaption)
{
return QFileDialog::getOpenFileName(nullptr, dialogCaption, QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).first());
}
void Utilities::log_message(const QString& message)
{
wlog("Message from GUI: ${msg}", ("msg",message.toStdString()));
}