mirror of
https://github.com/feather-wallet/feather.git
synced 2024-11-17 01:37:53 +00:00
Added option that hides notifications
Added option that hides status notifications.
This commit is contained in:
parent
2a7acddfaa
commit
919edeec14
5 changed files with 41 additions and 23 deletions
|
@ -115,6 +115,12 @@ void Settings::setupPrivacyTab() {
|
||||||
m_ctx->updateBalance();
|
m_ctx->updateBalance();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// [Hide notifications]
|
||||||
|
ui->checkBox_hideNotifications->setChecked(config()->get(Config::hideNotifications).toBool());
|
||||||
|
connect(ui->checkBox_hideNotifications, &QCheckBox::toggled, [this](bool toggled){
|
||||||
|
config()->set(Config::hideNotifications, toggled);
|
||||||
|
});
|
||||||
|
|
||||||
// [Disable websocket]
|
// [Disable websocket]
|
||||||
ui->checkBox_enableWebsocket->setChecked(!config()->get(Config::disableWebsocket).toBool());
|
ui->checkBox_enableWebsocket->setChecked(!config()->get(Config::disableWebsocket).toBool());
|
||||||
connect(ui->checkBox_enableWebsocket, &QCheckBox::toggled, [this](bool checked){
|
connect(ui->checkBox_enableWebsocket, &QCheckBox::toggled, [this](bool checked){
|
||||||
|
|
|
@ -346,6 +346,13 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBox_hideNotifications">
|
||||||
|
<property name="text">
|
||||||
|
<string>Hide notifications</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBox_offlineMode">
|
<widget class="QCheckBox" name="checkBox_offlineMode">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
|
@ -480,10 +480,12 @@ void externalLinkWarning(QWidget *parent, const QString &url){
|
||||||
}
|
}
|
||||||
|
|
||||||
void desktopNotify(const QString &title, const QString &message, int duration) {
|
void desktopNotify(const QString &title, const QString &message, int duration) {
|
||||||
|
if (!Config::hideNotifications)
|
||||||
|
{
|
||||||
QStringList notify_send = QStringList() << title << message << "-t" << QString::number(duration);
|
QStringList notify_send = QStringList() << title << message << "-t" << QString::number(duration);
|
||||||
QStringList kdialog = QStringList() << title << message;
|
QStringList kdialog = QStringList() << title << message;
|
||||||
QStringList macos = QStringList() << "-e" << QString(R"(display notification "%1" with title "%2")").arg(message).arg(title);
|
QStringList macos = QStringList() << "-e" << QString(R"(display notification "%1" with title "%2")").arg(message).arg(title);
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
QProcess process;
|
QProcess process;
|
||||||
if (fileExists("/usr/bin/kdialog"))
|
if (fileExists("/usr/bin/kdialog"))
|
||||||
process.start("/usr/bin/kdialog", kdialog);
|
process.start("/usr/bin/kdialog", kdialog);
|
||||||
|
@ -492,14 +494,15 @@ void desktopNotify(const QString &title, const QString &message, int duration) {
|
||||||
process.waitForFinished(-1);
|
process.waitForFinished(-1);
|
||||||
QString stdout = process.readAllStandardOutput();
|
QString stdout = process.readAllStandardOutput();
|
||||||
QString stderr = process.readAllStandardError();
|
QString stderr = process.readAllStandardError();
|
||||||
#elif defined(Q_OS_MACOS)
|
#elif defined(Q_OS_MACOS)
|
||||||
QProcess process;
|
QProcess process;
|
||||||
// @TODO: need to escape special chars with "\"
|
// @TODO: need to escape special chars with "\"
|
||||||
process.start("osascript", macos);
|
process.start("osascript", macos);
|
||||||
process.waitForFinished(-1);
|
process.waitForFinished(-1);
|
||||||
QString stdout = process.readAllStandardOutput();
|
QString stdout = process.readAllStandardOutput();
|
||||||
QString stderr = process.readAllStandardError();
|
QString stderr = process.readAllStandardError();
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextCharFormat addressTextFormat(const SubaddressIndex &index, quint64 amount) {
|
QTextCharFormat addressTextFormat(const SubaddressIndex &index, quint64 amount) {
|
||||||
|
|
|
@ -74,6 +74,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
||||||
{Config::multiBroadcast, {QS("multiBroadcast"), true}},
|
{Config::multiBroadcast, {QS("multiBroadcast"), true}},
|
||||||
{Config::warnOnExternalLink,{QS("warnOnExternalLink"), true}},
|
{Config::warnOnExternalLink,{QS("warnOnExternalLink"), true}},
|
||||||
{Config::hideBalance, {QS("hideBalance"), false}},
|
{Config::hideBalance, {QS("hideBalance"), false}},
|
||||||
|
{Config::hideNotifications, {QS("hideNotifications"), false}},
|
||||||
{Config::disableLogging, {QS("disableLogging"), false}},
|
{Config::disableLogging, {QS("disableLogging"), false}},
|
||||||
|
|
||||||
{Config::blockExplorer,{QS("blockExplorer"), "exploremonero.com"}},
|
{Config::blockExplorer,{QS("blockExplorer"), "exploremonero.com"}},
|
||||||
|
|
|
@ -79,6 +79,7 @@ public:
|
||||||
warnOnExternalLink,
|
warnOnExternalLink,
|
||||||
hideBalance,
|
hideBalance,
|
||||||
disableLogging,
|
disableLogging,
|
||||||
|
hideNotifications,
|
||||||
|
|
||||||
blockExplorer,
|
blockExplorer,
|
||||||
redditFrontend,
|
redditFrontend,
|
||||||
|
|
Loading…
Reference in a new issue