mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-30 12:48:55 +01:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96295a52de | ||
|
|
ccd0e8e64b | ||
|
|
3b3ec89306 | ||
|
|
373fe8e02a |
@@ -184,6 +184,11 @@ AppContext::AppContext(QCommandLineParser *cmdargs) {
|
|||||||
|
|
||||||
// libwallet connects
|
// libwallet connects
|
||||||
connect(this->walletManager, &WalletManager::walletOpened, this, &AppContext::onWalletOpened);
|
connect(this->walletManager, &WalletManager::walletOpened, this, &AppContext::onWalletOpened);
|
||||||
|
|
||||||
|
// hideOnClose
|
||||||
|
auto hideOnClose = config()->get(Config::hideOnClose).toBool();
|
||||||
|
if(hideOnClose)
|
||||||
|
QApplication::setQuitOnLastWindowClosed(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppContext::initTor() {
|
void AppContext::initTor() {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ ContactsWidget::ContactsWidget(QWidget *parent) :
|
|||||||
auto username = index.model()->data(index.siblingAtColumn(AddressBookModel::Description), Qt::UserRole).toString();
|
auto username = index.model()->data(index.siblingAtColumn(AddressBookModel::Description), Qt::UserRole).toString();
|
||||||
|
|
||||||
m_rowMenu = new QMenu(ui->contacts);
|
m_rowMenu = new QMenu(ui->contacts);
|
||||||
if(username.contains("(YellWOWPages)"))
|
if(username.contains("(yp)"))
|
||||||
m_rowMenu->addAction(QIcon(":/assets/images/network.png"), "Visit user's YellWOWPage", this, &ContactsWidget::visitYellowPage);
|
m_rowMenu->addAction(QIcon(":/assets/images/network.png"), "Visit user's YellWOWPage", this, &ContactsWidget::visitYellowPage);
|
||||||
|
|
||||||
m_rowMenu->addAction(QIcon(":/assets/images/copy.png"), "Copy address", this, &ContactsWidget::copyAddress);
|
m_rowMenu->addAction(QIcon(":/assets/images/copy.png"), "Copy address", this, &ContactsWidget::copyAddress);
|
||||||
@@ -89,7 +89,7 @@ void ContactsWidget::loadYellowPages() {
|
|||||||
auto contacts = this->data();
|
auto contacts = this->data();
|
||||||
for (auto item: m_ctx->yellowPagesData) {
|
for (auto item: m_ctx->yellowPagesData) {
|
||||||
auto obj = item.toObject();
|
auto obj = item.toObject();
|
||||||
const auto username = QString("%1 (YellWOWPages)").arg(obj.value("username").toString());
|
const auto username = QString("%1 (yp)").arg(obj.value("username").toString());
|
||||||
const auto address = obj.value("address").toString();
|
const auto address = obj.value("address").toString();
|
||||||
|
|
||||||
if(contacts.contains(username)) {
|
if(contacts.contains(username)) {
|
||||||
@@ -115,7 +115,7 @@ void ContactsWidget::visitYellowPage() {
|
|||||||
auto username = index.model()->data(
|
auto username = index.model()->data(
|
||||||
index.siblingAtColumn(AddressBookModel::Description),
|
index.siblingAtColumn(AddressBookModel::Description),
|
||||||
Qt::UserRole).toString();
|
Qt::UserRole).toString();
|
||||||
username = username.replace(" (YellWOWPages)", "").trimmed();
|
username = username.replace(" (yp)", "").trimmed();
|
||||||
Utils::externalLinkWarning(this, QString("https://yellow.wownero.com/user/%1").arg(username));
|
Utils::externalLinkWarning(this, QString("https://yellow.wownero.com/user/%1").arg(username));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+24
-3
@@ -108,11 +108,14 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
|
|||||||
m_trayIcon = new QSystemTrayIcon(QIcon(":/assets/images/appicons/64x64.png"));
|
m_trayIcon = new QSystemTrayIcon(QIcon(":/assets/images/appicons/64x64.png"));
|
||||||
m_trayIcon->show();
|
m_trayIcon->show();
|
||||||
|
|
||||||
|
m_trayActionHome = new QAction("Show", this);
|
||||||
|
m_trayActionHome->setStatusTip("Show");
|
||||||
|
|
||||||
m_trayActionCalc = new QAction("Calc", this);
|
m_trayActionCalc = new QAction("Calc", this);
|
||||||
m_trayActionCalc->setStatusTip("Calculator");
|
m_trayActionCalc->setStatusTip("Calculator");
|
||||||
|
|
||||||
m_trayActionSend = new QAction("Send", this);
|
m_trayActionSend = new QAction("Send", this);
|
||||||
m_trayActionSend->setStatusTip("Send WOW payment");
|
m_trayActionSend->setStatusTip("Send a WOW payment");
|
||||||
|
|
||||||
m_trayActionHistory = new QAction("History", this);
|
m_trayActionHistory = new QAction("History", this);
|
||||||
m_trayActionHistory->setStatusTip("View incoming transfers");
|
m_trayActionHistory->setStatusTip("View incoming transfers");
|
||||||
@@ -120,6 +123,7 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
|
|||||||
m_trayActionExit = new QAction("Quit", this);
|
m_trayActionExit = new QAction("Quit", this);
|
||||||
m_trayActionExit->setStatusTip("Exit application");
|
m_trayActionExit->setStatusTip("Exit application");
|
||||||
|
|
||||||
|
m_trayMenu.addAction(m_trayActionHome);
|
||||||
m_trayMenu.addAction(m_trayActionSend);
|
m_trayMenu.addAction(m_trayActionSend);
|
||||||
m_trayMenu.addAction(m_trayActionHistory);
|
m_trayMenu.addAction(m_trayActionHistory);
|
||||||
m_trayMenu.addAction(m_trayActionCalc);
|
m_trayMenu.addAction(m_trayActionCalc);
|
||||||
@@ -127,6 +131,7 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
|
|||||||
m_trayIcon->setContextMenu(&m_trayMenu);
|
m_trayIcon->setContextMenu(&m_trayMenu);
|
||||||
|
|
||||||
// @TODO: only init tray *after* boot
|
// @TODO: only init tray *after* boot
|
||||||
|
connect(m_trayActionHome, &QAction::triggered, this, &MainWindow::showHomeWindow);
|
||||||
connect(m_trayActionCalc, &QAction::triggered, this, &MainWindow::showCalcWindow);
|
connect(m_trayActionCalc, &QAction::triggered, this, &MainWindow::showCalcWindow);
|
||||||
connect(m_trayActionSend, &QAction::triggered, this, &MainWindow::showSendTab);
|
connect(m_trayActionSend, &QAction::triggered, this, &MainWindow::showSendTab);
|
||||||
connect(m_trayActionHistory, &QAction::triggered, this, &MainWindow::showHistoryTab);
|
connect(m_trayActionHistory, &QAction::triggered, this, &MainWindow::showHistoryTab);
|
||||||
@@ -968,7 +973,6 @@ void MainWindow::menuNewRestoreClicked() {
|
|||||||
|
|
||||||
void MainWindow::menuQuitClicked() {
|
void MainWindow::menuQuitClicked() {
|
||||||
cleanupBeforeClose();
|
cleanupBeforeClose();
|
||||||
|
|
||||||
QCoreApplication::quit();
|
QCoreApplication::quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1038,9 +1042,16 @@ void MainWindow::skinChanged(const QString &skinName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::closeEvent(QCloseEvent *event) {
|
void MainWindow::closeEvent(QCloseEvent *event) {
|
||||||
cleanupBeforeClose();
|
auto hideOnClose = config()->get(Config::hideOnClose).toBool();
|
||||||
|
if(hideOnClose && !this->isHidden()) {
|
||||||
|
this->hide();
|
||||||
|
event->ignore();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanupBeforeClose();
|
||||||
QWidget::closeEvent(event);
|
QWidget::closeEvent(event);
|
||||||
|
QApplication::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::donateButtonClicked() {
|
void MainWindow::donateButtonClicked() {
|
||||||
@@ -1054,15 +1065,25 @@ void MainWindow::donateButtonClicked() {
|
|||||||
|
|
||||||
void MainWindow::showHistoryTab() {
|
void MainWindow::showHistoryTab() {
|
||||||
this->raise();
|
this->raise();
|
||||||
|
this->show();
|
||||||
ui->tabWidget->setCurrentIndex(Tabs::HISTORY);
|
ui->tabWidget->setCurrentIndex(Tabs::HISTORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showSendTab() {
|
void MainWindow::showSendTab() {
|
||||||
this->raise();
|
this->raise();
|
||||||
|
this->show();
|
||||||
ui->tabWidget->setCurrentIndex(Tabs::SEND);
|
ui->tabWidget->setCurrentIndex(Tabs::SEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::showHomeWindow() {
|
||||||
|
this->raise();
|
||||||
|
this->show();
|
||||||
|
ui->tabWidget->setCurrentIndex(Tabs::HOME);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::showCalcWindow() {
|
void MainWindow::showCalcWindow() {
|
||||||
|
this->raise();
|
||||||
|
this->show();
|
||||||
m_windowCalc->show();
|
m_windowCalc->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ public slots:
|
|||||||
void showViewOnlyDialog();
|
void showViewOnlyDialog();
|
||||||
void donateButtonClicked();
|
void donateButtonClicked();
|
||||||
void showCalcWindow();
|
void showCalcWindow();
|
||||||
|
void showHomeWindow();
|
||||||
void payToMany();
|
void payToMany();
|
||||||
void showWalletCacheDebugDialog();
|
void showWalletCacheDebugDialog();
|
||||||
void showSendTab();
|
void showSendTab();
|
||||||
@@ -200,6 +201,7 @@ private:
|
|||||||
|
|
||||||
QSystemTrayIcon *m_trayIcon;
|
QSystemTrayIcon *m_trayIcon;
|
||||||
QMenu m_trayMenu;
|
QMenu m_trayMenu;
|
||||||
|
QAction *m_trayActionHome;
|
||||||
QAction *m_trayActionCalc;
|
QAction *m_trayActionCalc;
|
||||||
QAction *m_trayActionExit;
|
QAction *m_trayActionExit;
|
||||||
QAction *m_trayActionSend;
|
QAction *m_trayActionSend;
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ Settings::Settings(QWidget *parent) :
|
|||||||
m_ctx->updateBalance();
|
m_ctx->updateBalance();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(ui->checkBox_hideOnClose, &QCheckBox::toggled, [this](bool toggled){
|
||||||
|
config()->set(Config::hideOnClose, toggled);
|
||||||
|
QApplication::setQuitOnLastWindowClosed(toggled);
|
||||||
|
});
|
||||||
|
|
||||||
connect(ui->closeButton, &QDialogButtonBox::accepted, this, &Settings::close);
|
connect(ui->closeButton, &QDialogButtonBox::accepted, this, &Settings::close);
|
||||||
|
|
||||||
// nodes
|
// nodes
|
||||||
@@ -40,6 +45,7 @@ Settings::Settings(QWidget *parent) :
|
|||||||
// setup checkboxes
|
// setup checkboxes
|
||||||
ui->checkBox_externalLink->setChecked(config()->get(Config::warnOnExternalLink).toBool());
|
ui->checkBox_externalLink->setChecked(config()->get(Config::warnOnExternalLink).toBool());
|
||||||
ui->checkBox_hideBalance->setChecked(config()->get(Config::hideBalance).toBool());
|
ui->checkBox_hideBalance->setChecked(config()->get(Config::hideBalance).toBool());
|
||||||
|
ui->checkBox_hideOnClose->setChecked(config()->get(Config::hideOnClose).toBool());
|
||||||
|
|
||||||
// setup comboboxes
|
// setup comboboxes
|
||||||
this->setupSkinCombobox();
|
this->setupSkinCombobox();
|
||||||
|
|||||||
@@ -198,6 +198,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QCheckBox" name="checkBox_hideOnClose">
|
||||||
|
<property name="text">
|
||||||
|
<string>Hide application on close</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_node">
|
<widget class="QWidget" name="tab_node">
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
|||||||
{Config::windowState, {QS("windowState"), {}}},
|
{Config::windowState, {QS("windowState"), {}}},
|
||||||
{Config::firstRun,{QS("firstRun"), false}},
|
{Config::firstRun,{QS("firstRun"), false}},
|
||||||
{Config::hideBalance, {QS("hideBalance"), false}},
|
{Config::hideBalance, {QS("hideBalance"), false}},
|
||||||
|
{Config::hideOnClose, {QS("hideOnClose"), false}},
|
||||||
{Config::hideFiatBalance, {QS("hideFiatBalance"), false}},
|
{Config::hideFiatBalance, {QS("hideFiatBalance"), false}},
|
||||||
{Config::redditFrontend, {QS("redditFrontend"), "old.reddit.com"}},
|
{Config::redditFrontend, {QS("redditFrontend"), "old.reddit.com"}},
|
||||||
{Config::showHistorySyncNotice, {QS("showHistorySyncNotice"), true}},
|
{Config::showHistorySyncNotice, {QS("showHistorySyncNotice"), true}},
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public:
|
|||||||
firstRun,
|
firstRun,
|
||||||
hideBalance,
|
hideBalance,
|
||||||
hideFiatBalance,
|
hideFiatBalance,
|
||||||
|
hideOnClose,
|
||||||
redditFrontend,
|
redditFrontend,
|
||||||
showHistorySyncNotice,
|
showHistorySyncNotice,
|
||||||
ignoreUpdateWarning,
|
ignoreUpdateWarning,
|
||||||
|
|||||||
Reference in New Issue
Block a user