Make "Quit" menu saner
[novacoin.git] / src / qt / bitcoingui.cpp
index 95646b1..25261c7 100644 (file)
@@ -65,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"));
@@ -197,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);
@@ -216,7 +214,7 @@ void BitcoinGUI::createActions()
     connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
     connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
     connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
-    connect(openBitcoinAction, SIGNAL(triggered()), this, SLOT(show()));
+    connect(openBitcoinAction, SIGNAL(triggered()), this, SLOT(showNormal()));
     connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool)));
     connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase()));
 }
@@ -297,9 +295,10 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
 {
     if(reason == QSystemTrayIcon::Trigger)
     {
-        // Doubleclick on system tray icon triggers "open bitcoin"
+        // Click on system tray icon triggers "open bitcoin"
         openBitcoinAction->trigger();
     }
+
 }
 
 void BitcoinGUI::optionsClicked()
@@ -333,15 +332,16 @@ void BitcoinGUI::setNumConnections(int count)
 
 void BitcoinGUI::setNumBlocks(int count)
 {
-    int total = clientModel->getTotalBlocksEstimate();
+    int initTotal = clientModel->getNumBlocksAtStartup();
+    int total = clientModel->getNumBlocksOfPeers();
     QString tooltip;
 
     if(count < total)
     {
         progressBarLabel->setVisible(true);
         progressBar->setVisible(true);
-        progressBar->setMaximum(total);
-        progressBar->setValue(count);
+        progressBar->setMaximum(total - initTotal);
+        progressBar->setValue(count - initTotal);
         tooltip = tr("Downloaded %1 of %2 blocks of transaction history.").arg(count).arg(total);
     }
     else
@@ -414,6 +414,7 @@ void BitcoinGUI::changeEvent(QEvent *e)
             }
             else
             {
+                show();
                 e->accept();
             }
         }
@@ -519,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);