Skip to content

Commit

Permalink
[Qt] small notificator and style changes
Browse files Browse the repository at this point in the history
- remove default arguments for notificator
- re-order some calls to use same ordering in Qt files
- style police changes (spaces, comments and such)
  • Loading branch information
Philip Kaufmann committed Dec 3, 2013
1 parent cf74e8c commit ccd1372
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/qt/bitcoin.cpp
Expand Up @@ -53,7 +53,6 @@ static SplashScreen *splashref;

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

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

ClientModel clientModel(&optionsModel);
window.setClientModel(&clientModel);

WalletModel *walletModel = 0;
if(pwalletMain)
walletModel = new WalletModel(pwalletMain, &optionsModel);

window.setClientModel(&clientModel);
if(walletModel)
{
window.addWallet("~Default", walletModel);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/bitcoingui.cpp
Expand Up @@ -405,7 +405,7 @@ void BitcoinGUI::createTrayIcon(bool fIsTestnet)
trayIcon->show();
#endif

notificator = new Notificator(QApplication::applicationName(), trayIcon);
notificator = new Notificator(QApplication::applicationName(), trayIcon, this);
}

void BitcoinGUI::createTrayIconMenu()
Expand Down
2 changes: 1 addition & 1 deletion src/qt/clientmodel.h
Expand Up @@ -84,7 +84,7 @@ class ClientModel : public QObject
void alertsChanged(const QString &warnings);
void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut);

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

public slots:
Expand Down
1 change: 1 addition & 0 deletions src/qt/guiutil.cpp
Expand Up @@ -32,6 +32,7 @@

#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>

#include <QAbstractItemView>
#include <QApplication>
#include <QClipboard>
Expand Down
5 changes: 2 additions & 3 deletions src/qt/notificator.cpp
Expand Up @@ -4,7 +4,6 @@

#include "notificator.h"


#include <QApplication>
#include <QByteArray>
#include <QIcon>
Expand Down Expand Up @@ -32,7 +31,7 @@
// https://wiki.ubuntu.com/NotificationDevelopmentGuidelines recommends at least 128
const int FREEDESKTOP_NOTIFICATION_ICON_SIZE = 128;

Notificator::Notificator(const QString &programName, QSystemTrayIcon *trayicon, QWidget *parent):
Notificator::Notificator(const QString &programName, QSystemTrayIcon *trayicon, QWidget *parent) :
QObject(parent),
parent(parent),
programName(programName),
Expand All @@ -48,7 +47,7 @@ Notificator::Notificator(const QString &programName, QSystemTrayIcon *trayicon,
}
#ifdef USE_DBUS
interface = new QDBusInterface("org.freedesktop.Notifications",
"/org/freedesktop/Notifications", "org.freedesktop.Notifications");
"/org/freedesktop/Notifications", "org.freedesktop.Notifications");
if(interface->isValid())
{
mode = Freedesktop;
Expand Down
2 changes: 1 addition & 1 deletion src/qt/notificator.h
Expand Up @@ -29,7 +29,7 @@ class Notificator: public QObject
/** Create a new notificator.
@note Ownership of trayIcon is not transferred to this object.
*/
Notificator(const QString &programName=QString(), QSystemTrayIcon *trayIcon=0, QWidget *parent=0);
Notificator(const QString &programName, QSystemTrayIcon *trayIcon, QWidget *parent);
~Notificator();

// Message class
Expand Down
4 changes: 2 additions & 2 deletions src/qt/receivecoinsdialog.cpp
Expand Up @@ -101,11 +101,11 @@ void ReceiveCoinsDialog::on_receiveButton_clicked()
address = model->getAddressTableModel()->addRow(AddressTableModel::Receive, label, "");
}
SendCoinsRecipient info(address, label,
ui->reqAmount->value(), ui->reqMessage->text());
ui->reqAmount->value(), ui->reqMessage->text());
ReceiveRequestDialog *dialog = new ReceiveRequestDialog(this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->setModel(model->getOptionsModel());
dialog->setInfo(info);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
clear();
}
4 changes: 2 additions & 2 deletions src/qt/walletview.cpp
Expand Up @@ -263,8 +263,8 @@ void WalletView::usedSendingAddresses()
if(!walletModel)
return;
AddressBookPage *dlg = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab, this);
dlg->setModel(walletModel->getAddressTableModel());
dlg->setAttribute(Qt::WA_DeleteOnClose);
dlg->setModel(walletModel->getAddressTableModel());
dlg->show();
}

Expand All @@ -273,7 +273,7 @@ void WalletView::usedReceivingAddresses()
if(!walletModel)
return;
AddressBookPage *dlg = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab, this);
dlg->setModel(walletModel->getAddressTableModel());
dlg->setAttribute(Qt::WA_DeleteOnClose);
dlg->setModel(walletModel->getAddressTableModel());
dlg->show();
}
1 change: 1 addition & 0 deletions src/qt/walletview.h
Expand Up @@ -96,6 +96,7 @@ public slots:

/** Re-emit encryption status signal */
void updateEncryptionStatus();

signals:
/** Signal that we want to show the main window */
void showNormalIfMinimized();
Expand Down

0 comments on commit ccd1372

Please sign in to comment.