From 4c38fbae959c69e524e2f7453a221b5f29a5d12f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 10 Feb 2012 08:28:32 +0100 Subject: Enable accessible widgets Qt module on win32, so that people with screen readers such as NVDA can make sense of it. --- bitcoin-qt.pro | 2 +- src/init.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index 19349c708d..790c0751ca 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -62,7 +62,7 @@ contains(USE_SSL, 1) { contains(BITCOIN_NEED_QT_PLUGINS, 1) { DEFINES += BITCOIN_NEED_QT_PLUGINS - QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs + QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets } !windows { diff --git a/src/init.cpp b/src/init.cpp index 3ca0dcf251..51e9ed604e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -20,6 +20,7 @@ Q_IMPORT_PLUGIN(qcncodecs) Q_IMPORT_PLUGIN(qjpcodecs) Q_IMPORT_PLUGIN(qtwcodecs) Q_IMPORT_PLUGIN(qkrcodecs) +Q_IMPORT_PLUGIN(qtaccessiblewidgets) #endif using namespace std; -- cgit v1.2.3 From 6ebb141bf941183aefc652b525c07430b35863ad Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 9 Dec 2011 22:35:57 +0100 Subject: Prevent window from being shown momentarily when using -min - In a previous patch, show() was added to all the page switcher functions. As the contructor calls showOverviewPage(), this means the window is shown in the constructor. - This change prevents this by connecting show() to the signal instead. --- src/qt/bitcoingui.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index f80038c3fb..5d9c0d9f00 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -193,10 +193,15 @@ void BitcoinGUI::createActions() sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); + connect(overviewAction, SIGNAL(triggered()), this, SLOT(show())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); + connect(historyAction, SIGNAL(triggered()), this, SLOT(show())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); + connect(addressBookAction, SIGNAL(triggered()), this, SLOT(show())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); + connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(show())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); + connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(show())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); @@ -598,7 +603,6 @@ void BitcoinGUI::incomingTransaction(const QModelIndex & parent, int start, int void BitcoinGUI::gotoOverviewPage() { - show(); overviewAction->setChecked(true); centralWidget->setCurrentWidget(overviewPage); @@ -608,7 +612,6 @@ void BitcoinGUI::gotoOverviewPage() void BitcoinGUI::gotoHistoryPage() { - show(); historyAction->setChecked(true); centralWidget->setCurrentWidget(transactionsPage); @@ -619,7 +622,6 @@ void BitcoinGUI::gotoHistoryPage() void BitcoinGUI::gotoAddressBookPage() { - show(); addressBookAction->setChecked(true); centralWidget->setCurrentWidget(addressBookPage); @@ -630,7 +632,6 @@ void BitcoinGUI::gotoAddressBookPage() void BitcoinGUI::gotoReceiveCoinsPage() { - show(); receiveCoinsAction->setChecked(true); centralWidget->setCurrentWidget(receiveCoinsPage); @@ -641,7 +642,6 @@ void BitcoinGUI::gotoReceiveCoinsPage() void BitcoinGUI::gotoSendCoinsPage() { - show(); sendCoinsAction->setChecked(true); centralWidget->setCurrentWidget(sendCoinsPage); -- cgit v1.2.3 From 41cde5bbdcf76bda63cb7c55675340726c73b7fc Mon Sep 17 00:00:00 2001 From: Janne Pulkkinen Date: Fri, 3 Feb 2012 20:08:50 +0200 Subject: Fix Minimize to the tray instead of the taskbar --- src/qt/bitcoingui.cpp | 32 ++++++++++++++++++++++---------- src/qt/bitcoingui.h | 4 ++++ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 5d9c0d9f00..cfcff136e0 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -55,6 +55,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), + dummyWidget(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), @@ -84,6 +85,9 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): // Create the tray icon (or setup the dock icon) createTrayIcon(); + // Dummy widget used when restoring window state after minimization + dummyWidget = new QWidget(); + // Create tabs overviewPage = new OverviewPage(); @@ -157,6 +161,7 @@ BitcoinGUI::~BitcoinGUI() #ifdef Q_WS_MAC delete appMenuBar; #endif + delete dummyWidget; } void BitcoinGUI::createActions() @@ -193,15 +198,15 @@ void BitcoinGUI::createActions() sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); - connect(overviewAction, SIGNAL(triggered()), this, SLOT(show())); + connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormal())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); - connect(historyAction, SIGNAL(triggered()), this, SLOT(show())); + connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormal())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); - connect(addressBookAction, SIGNAL(triggered()), this, SLOT(show())); + connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormal())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); - connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(show())); + connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormal())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); - connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(show())); + connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormal())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); @@ -379,10 +384,17 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason) // Click on system tray icon triggers "open bitcoin" openBitcoinAction->trigger(); } - } #endif +void BitcoinGUI::showNormal() +{ + // Reparent window to the desktop (in case it was hidden on minimize) + if(parent() != NULL) + setParent(NULL, Qt::Window); + QMainWindow::showNormal(); +} + void BitcoinGUI::optionsClicked() { if(!clientModel || !clientModel->getOptionsModel()) @@ -524,13 +536,13 @@ void BitcoinGUI::changeEvent(QEvent *e) { if(isMinimized()) { - hide(); - e->ignore(); + // Hiding the window from taskbar + setParent(dummyWidget, Qt::SubWindow); + return; } else { - show(); - e->accept(); + showNormal(); } } } diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 9b672ee809..1338998a98 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -54,6 +54,8 @@ private: QStackedWidget *centralWidget; + QWidget *dummyWidget; + OverviewPage *overviewPage; QWidget *transactionsPage; AddressBookPage *addressBookPage; @@ -107,6 +109,8 @@ public slots: */ void askFee(qint64 nFeeRequired, bool *payFee); + void showNormal(); + private slots: // UI pages void gotoOverviewPage(); -- cgit v1.2.3 From 622f1438dec6f2fc5565597ac1f88c3873549f33 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 15 Feb 2012 20:56:29 +0100 Subject: Bugfix: do not create CAddress for invalid accepts --- src/net.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index 83e7f28c6b..423b754390 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -885,13 +885,17 @@ void ThreadSocketHandler2(void* parg) struct sockaddr_in sockaddr; socklen_t len = sizeof(sockaddr); SOCKET hSocket = accept(hListenSocket, (struct sockaddr*)&sockaddr, &len); - CAddress addr(sockaddr); + CAddress addr; int nInbound = 0; + if (hSocket != INVALID_SOCKET) + addr = CAddress(sockaddr); + CRITICAL_BLOCK(cs_vNodes) BOOST_FOREACH(CNode* pnode, vNodes) if (pnode->fInbound) nInbound++; + if (hSocket == INVALID_SOCKET) { if (WSAGetLastError() != WSAEWOULDBLOCK) -- cgit v1.2.3 From d52397b3c02330d17cde6952e8bbc1c492c06007 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 15 Feb 2012 21:17:15 +0100 Subject: Several shutdown-related fixes * do not let vnThreadsRunning[1] go negative * do not perform locking operations while vnThreadsRunning[1] is decreased * check vnThreadsRunning[1] at exit --- src/net.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 423b754390..a8d3d0b171 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1431,9 +1431,13 @@ void ThreadOpenConnections2(void* parg) int64 nStart = GetTime(); loop { - // Limit outbound connections vnThreadsRunning[1]--; Sleep(500); + vnThreadsRunning[1]++; + if (fShutdown) + return; + + // Limit outbound connections loop { int nOutbound = 0; @@ -1445,13 +1449,12 @@ void ThreadOpenConnections2(void* parg) nMaxOutboundConnections = min(nMaxOutboundConnections, (int)GetArg("-maxconnections", 125)); if (nOutbound < nMaxOutboundConnections) break; + vnThreadsRunning[1]--; Sleep(2000); + vnThreadsRunning[1]++; if (fShutdown) return; } - vnThreadsRunning[1]++; - if (fShutdown) - return; bool fAddSeeds = false; @@ -1845,7 +1848,7 @@ bool StopNode() fShutdown = true; nTransactionsUpdated++; int64 nStart = GetTime(); - while (vnThreadsRunning[0] > 0 || vnThreadsRunning[2] > 0 || vnThreadsRunning[3] > 0 || vnThreadsRunning[4] > 0 + while (vnThreadsRunning[0] > 0 || vnThreadsRunning[1] > 0 || vnThreadsRunning[2] > 0 || vnThreadsRunning[3] > 0 || vnThreadsRunning[4] > 0 #ifdef USE_UPNP || vnThreadsRunning[5] > 0 #endif -- cgit v1.2.3 From 6928794f56738c002fd1e129cb64ffad0533b64f Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 15 Feb 2012 16:05:55 -0500 Subject: Properly include $*_LIB_PATH in makefile.unix --- src/makefile.unix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/makefile.unix b/src/makefile.unix index 53948bcba6..e75dda514f 100644 --- a/src/makefile.unix +++ b/src/makefile.unix @@ -7,7 +7,7 @@ USE_UPNP:=0 DEFS=-DNOPCH DEFS += $(addprefix -I,$(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH)) -LIBS += $(addprefix -l,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH)) +LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH)) LMODE = dynamic LMODE2 = dynamic @@ -21,7 +21,7 @@ else endif # for boost 1.37, add -mt to the boost libraries -LIBS= \ +LIBS += \ -Wl,-B$(LMODE) \ -l boost_system$(BOOST_LIB_SUFFIX) \ -l boost_filesystem$(BOOST_LIB_SUFFIX) \ -- cgit v1.2.3 From 25be0597caebe00f5d47199404574d93d8f76995 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 17 Feb 2012 14:46:06 +0100 Subject: don't allow -daemon in bitcoin-qt (changes only #defines) --- src/init.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 51e9ed604e..bb549ec42b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -209,7 +209,7 @@ bool AppInit2(int argc, char* argv[]) #ifdef GUI " -server \t\t " + _("Accept command line and JSON-RPC commands\n") + #endif -#ifndef WIN32 +#if !defined(WIN32) && !defined(GUI) " -daemon \t\t " + _("Run in the background as a daemon and accept commands\n") + #endif " -testnet \t\t " + _("Use the test network\n") + @@ -248,7 +248,7 @@ bool AppInit2(int argc, char* argv[]) fTestNet = GetBoolArg("-testnet"); fDebug = GetBoolArg("-debug"); -#ifndef WIN32 +#if !defined(WIN32) && !defined(GUI) fDaemon = GetBoolArg("-daemon"); #else fDaemon = false; @@ -279,7 +279,7 @@ bool AppInit2(int argc, char* argv[]) } #endif -#ifndef WIN32 +#if !defined(WIN32) && !defined(GUI) if (fDaemon) { // Daemonize -- cgit v1.2.3