Skip to content

Commit ccd1372

Browse files
author
Philip Kaufmann
committed
[Qt] small notificator and style changes
- remove default arguments for notificator - re-order some calls to use same ordering in Qt files - style police changes (spaces, comments and such)
1 parent cf74e8c commit ccd1372

File tree

9 files changed

+14
-13
lines changed

9 files changed

+14
-13
lines changed

src/qt/bitcoin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ static SplashScreen *splashref;
5353

5454
static bool ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)
5555
{
56-
// Message from network thread
5756
if(guiref)
5857
{
5958
bool modal = (style & CClientUIInterface::MODAL);
@@ -160,7 +159,7 @@ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTrans
160159

161160
/* qDebug() message handler --> debug.log */
162161
#if QT_VERSION < 0x050000
163-
void DebugMessageHandler(QtMsgType type, const char * msg)
162+
void DebugMessageHandler(QtMsgType type, const char *msg)
164163
{
165164
Q_UNUSED(type);
166165
LogPrint("qt", "Bitcoin-Qt: %s\n", msg);
@@ -313,11 +312,12 @@ int main(int argc, char *argv[])
313312
splash.finish(&window);
314313

315314
ClientModel clientModel(&optionsModel);
315+
window.setClientModel(&clientModel);
316+
316317
WalletModel *walletModel = 0;
317318
if(pwalletMain)
318319
walletModel = new WalletModel(pwalletMain, &optionsModel);
319320

320-
window.setClientModel(&clientModel);
321321
if(walletModel)
322322
{
323323
window.addWallet("~Default", walletModel);

src/qt/bitcoingui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ void BitcoinGUI::createTrayIcon(bool fIsTestnet)
405405
trayIcon->show();
406406
#endif
407407

408-
notificator = new Notificator(QApplication::applicationName(), trayIcon);
408+
notificator = new Notificator(QApplication::applicationName(), trayIcon, this);
409409
}
410410

411411
void BitcoinGUI::createTrayIconMenu()

src/qt/clientmodel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class ClientModel : public QObject
8484
void alertsChanged(const QString &warnings);
8585
void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut);
8686

87-
//! Asynchronous message notification
87+
//! Fired when a message should be reported to the user
8888
void message(const QString &title, const QString &message, unsigned int style);
8989

9090
public slots:

src/qt/guiutil.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
#include <boost/filesystem.hpp>
3434
#include <boost/filesystem/fstream.hpp>
35+
3536
#include <QAbstractItemView>
3637
#include <QApplication>
3738
#include <QClipboard>

src/qt/notificator.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#include "notificator.h"
66

7-
87
#include <QApplication>
98
#include <QByteArray>
109
#include <QIcon>
@@ -32,7 +31,7 @@
3231
// https://wiki.ubuntu.com/NotificationDevelopmentGuidelines recommends at least 128
3332
const int FREEDESKTOP_NOTIFICATION_ICON_SIZE = 128;
3433

35-
Notificator::Notificator(const QString &programName, QSystemTrayIcon *trayicon, QWidget *parent):
34+
Notificator::Notificator(const QString &programName, QSystemTrayIcon *trayicon, QWidget *parent) :
3635
QObject(parent),
3736
parent(parent),
3837
programName(programName),
@@ -48,7 +47,7 @@ Notificator::Notificator(const QString &programName, QSystemTrayIcon *trayicon,
4847
}
4948
#ifdef USE_DBUS
5049
interface = new QDBusInterface("org.freedesktop.Notifications",
51-
"/org/freedesktop/Notifications", "org.freedesktop.Notifications");
50+
"/org/freedesktop/Notifications", "org.freedesktop.Notifications");
5251
if(interface->isValid())
5352
{
5453
mode = Freedesktop;

src/qt/notificator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Notificator: public QObject
2929
/** Create a new notificator.
3030
@note Ownership of trayIcon is not transferred to this object.
3131
*/
32-
Notificator(const QString &programName=QString(), QSystemTrayIcon *trayIcon=0, QWidget *parent=0);
32+
Notificator(const QString &programName, QSystemTrayIcon *trayIcon, QWidget *parent);
3333
~Notificator();
3434

3535
// Message class

src/qt/receivecoinsdialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ void ReceiveCoinsDialog::on_receiveButton_clicked()
101101
address = model->getAddressTableModel()->addRow(AddressTableModel::Receive, label, "");
102102
}
103103
SendCoinsRecipient info(address, label,
104-
ui->reqAmount->value(), ui->reqMessage->text());
104+
ui->reqAmount->value(), ui->reqMessage->text());
105105
ReceiveRequestDialog *dialog = new ReceiveRequestDialog(this);
106+
dialog->setAttribute(Qt::WA_DeleteOnClose);
106107
dialog->setModel(model->getOptionsModel());
107108
dialog->setInfo(info);
108-
dialog->setAttribute(Qt::WA_DeleteOnClose);
109109
dialog->show();
110110
clear();
111111
}

src/qt/walletview.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ void WalletView::usedSendingAddresses()
263263
if(!walletModel)
264264
return;
265265
AddressBookPage *dlg = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab, this);
266-
dlg->setModel(walletModel->getAddressTableModel());
267266
dlg->setAttribute(Qt::WA_DeleteOnClose);
267+
dlg->setModel(walletModel->getAddressTableModel());
268268
dlg->show();
269269
}
270270

@@ -273,7 +273,7 @@ void WalletView::usedReceivingAddresses()
273273
if(!walletModel)
274274
return;
275275
AddressBookPage *dlg = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab, this);
276-
dlg->setModel(walletModel->getAddressTableModel());
277276
dlg->setAttribute(Qt::WA_DeleteOnClose);
277+
dlg->setModel(walletModel->getAddressTableModel());
278278
dlg->show();
279279
}

src/qt/walletview.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public slots:
9696

9797
/** Re-emit encryption status signal */
9898
void updateEncryptionStatus();
99+
99100
signals:
100101
/** Signal that we want to show the main window */
101102
void showNormalIfMinimized();

0 commit comments

Comments
 (0)