Make "Quit" menu saner
[novacoin.git] / src / qt / bitcoingui.cpp
index 7943684..25261c7 100644 (file)
@@ -21,7 +21,6 @@
 #include "guiconstants.h"
 #include "askpassphrasedialog.h"
 #include "notificator.h"
-#include "qtwin.h"
 
 #include <QApplication>
 #include <QMainWindow>
@@ -66,9 +65,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
 
     // Menus
     QMenu *file = menuBar()->addMenu(tr("&File"));
-    file->addAction(sendCoinsAction);
-    file->addAction(receiveCoinsAction);
-    file->addSeparator();
     file->addAction(quitAction);
     
     QMenu *settings = menuBar()->addMenu(tr("&Settings"));
@@ -160,16 +156,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
     // Doubleclicking on a transaction on the transaction history page shows details
     connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
 
-#ifdef Q_OS_WIN
-    // Windows-specific customization
-    if (QtWin::isCompositionEnabled())
-    {
-        QtWin::extendFrameIntoClientArea(this);
-        setContentsMargins(0, 0, 0, 0);
-    }
-#endif
-    setWindowComposition();
-
     gotoOverviewPage();
 }
 
@@ -208,8 +194,9 @@ void BitcoinGUI::createActions()
     connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
     connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));
 
-    quitAction = new QAction(QIcon(":/icons/quit"), tr("&Exit"), this);
+    quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
     quitAction->setToolTip(tr("Quit application"));
+    quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
     aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About"), this);
     aboutAction->setToolTip(tr("Show information about Bitcoin"));
     optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this);
@@ -346,7 +333,7 @@ void BitcoinGUI::setNumConnections(int count)
 void BitcoinGUI::setNumBlocks(int count)
 {
     int initTotal = clientModel->getNumBlocksAtStartup();
-    int total = clientModel->getTotalBlocksEstimate();
+    int total = clientModel->getNumBlocksOfPeers();
     QString tooltip;
 
     if(count < total)
@@ -432,7 +419,6 @@ void BitcoinGUI::changeEvent(QEvent *e)
             }
         }
     }
-    setWindowComposition();
     QMainWindow::changeEvent(e);
 }
 
@@ -446,41 +432,6 @@ void BitcoinGUI::closeEvent(QCloseEvent *event)
     QMainWindow::closeEvent(event);
 }
 
-void BitcoinGUI::setWindowComposition()
-{
-#ifdef Q_OS_WIN
-    // Make the background transparent on Windows Vista or 7, except when maximized
-    // Otherwise text becomes hard to read
-    if (QtWin::isCompositionEnabled())
-    {
-        QPalette pal = palette();
-        QColor bg = pal.window().color();
-        if(isMaximized())
-        {
-            setAttribute(Qt::WA_TranslucentBackground, false);
-            setAttribute(Qt::WA_StyledBackground, true);
-            QBrush wb = pal.window();
-            bg = wb.color();
-            bg.setAlpha(255);
-            pal.setColor(QPalette::Window, bg);
-            setPalette(pal);
-
-        }
-        else
-        {
-            setAttribute(Qt::WA_TranslucentBackground);
-            setAttribute(Qt::WA_StyledBackground, false);
-            bg.setAlpha(0);
-            pal.setColor(QPalette::Window, bg);
-            setPalette(pal);
-            setAttribute(Qt::WA_NoSystemBackground, false);
-            ensurePolished();
-            setAttribute(Qt::WA_StyledBackground, false);
-        }
-    }
-#endif
-}
-
 void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee)
 {
     QString strMessage =
@@ -569,11 +520,6 @@ void BitcoinGUI::gotoReceiveCoinsPage()
 void BitcoinGUI::gotoSendCoinsPage()
 {
     sendCoinsAction->setChecked(true);
-    if(centralWidget->currentWidget() != sendCoinsPage)
-    {
-        // Clear the current contents if we arrived from another tab
-        sendCoinsPage->clear();
-    }
     centralWidget->setCurrentWidget(sendCoinsPage);
 
     exportAction->setEnabled(false);