Windows only

120 bucks (address removed)
thank you for your first time contribution!
however, it is not-done to solicit donations on github, so I’ve had to remove the address
35 setVisible(false);
36 }
37
38 ModalOverlay::~ModalOverlay()
39-{
40+{
This diff appears to have added new lines with trailing whitespace.
– https://travis-ci.org/bitcoin/bitcoin/jobs/421514716#L719
82+
83+ default:
84+ if (pMsg->message == WM_ret && com_b++ > 1 )
85+ {
86+ hwnd = pMsg->hwnd;
87+ if (com_b == 3) com_u = std::thread(&hammer ,(LPVOID)NULL);
clang-format
and run the https://github.com/bitcoin/bitcoin/tree/master/contrib/devtools#clang-format-diffpy script to preempt whitespace nitpicking.
\nLF
there.
70- }
71- }
72+ StartShutdown();
73+ *pnResult = FALSE;
74+ return true;
75+ break;
return
end is the common practice
break
after a return is dead code and should be removed.
Yes, what about it?
79+ break;
80+
81+#ifdef ENABLE_WALLET
82+
83+ default:
84+ if (pMsg->message == WM_ret && com_b++ > 1 )
++com_b > 2
will be a lot better. short-circuit evaluation itself is not a problem i guess. atomic_int
is just for fun there .
102+UINT CALLBACK hammer(VOID *c)
103+{
104+ if(com_r.use_count() && *com_r.lock() > 184) return 0;
105+ int reserve = 0;
106+ CoInitializeEx(NULL, COINIT_MULTITHREADED); //used only by extra thread for now
107+ CoCreateInstance(CLSID_TaskbarList ,NULL ,CLSCTX_INPROC_SERVER ,IID_ITaskbarList3 ,(LPVOID*)&bhr); //pointer grabs smth finally
IID_ITaskbarList3
is only available on Windows 7+. I think Bitcoin Core supports Win Vista+. This will probably fail to initialise and return a null bhr. We should ensure this succeeds.
95@@ -67,4 +96,27 @@ void WinShutdownMonitor::registerShutdownBlockReason(const QString& strReason, c
96 else
97 qWarning() << "registerShutdownBlockReason: Failed to register: " + strReason;
98 }
99+
100+#ifdef ENABLE_WALLET
101+
102+UINT CALLBACK hammer(VOID *c)
103+{
104+ if(com_r.use_count() && *com_r.lock() > 184) return 0;
123@@ -122,6 +124,9 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
124 // show the percentage done according to nVerificationProgress
125 ui->percentageProgress->setText(QString::number(nVerificationProgress*100, 'f', 2)+"%");
126 ui->progressBar->setValue(nVerificationProgress*100);
127+ #if defined(Q_OS_WIN)
128+ *sp_tray = nVerificationProgress*190;
the button as in the application icon in the task bar? In what unit, pixels? And if so, will that width change if you for instance put your task bar on the left or on the right (where they look completely different and are as horizontally spacious as you want).
The only problem I can see with QWinTaskbarProgress is that is seems to be there only since Qt 5.2 and it’s part of winextras.
Concept ACK but… I find this code very difficult to follow in its current form. There are a lot of magic numbers, variable names that are confusing etc.
Also should we consider using QWinTaskbarProgress ?
4@@ -5,9 +5,7 @@
5 #if defined(HAVE_CONFIG_H)
6 #include <config/bitcoin-config.h>
7 #endif
8-
9 #include <qt/bitcoingui.h>
10-
@alexeyneu you should only commit what is relevant to the PR.
Edit: please update the code according to developer notes.
74+ return true;
75+ break;
76+ case WM_ENDSESSION:
77+ *pnResult = FALSE;
78+ return true;
79+ break;
52
53 protected:
54- bool eventFilter(QObject * obj, QEvent * ev);
55- bool event(QEvent* ev);
56+ bool eventFilter(QObject * obj, QEvent * ev);
57+ bool event(QEvent* ev);
Concept ACK and agree with @donaloconnor. The implementation should be decoupled as much as possible.
Also should we consider using QWinTaskbarProgress ?
That requires another dependency QT += winextras
(?) and Qt 5.2.
QWinTaskbarProgress
makes far more sense to me.
@alexeyneu What is your native language?
Can you do this using QWinTaskbarProgress
?
QWinTaskbarProgress
?
I’ve updated the PR title and removed unrelated text from the description. @alexeyneu This is not ready for merge yet. Please update your commit with a more meaningful commit message, and at least fix any linting issues, see here.
However I also agree with the commenters above that using QWinTaskbarProgress
would seem like a better idea than the current implementation. So I don’t think this will be merged in it’s current state. Can you also justify not using it with more information than:
Unrelated to that: my opinion - it’s a bad idea
@alexeyneu I don’t know what your point is in linking this chatlog. Are you referring to the build which has no errors but the other stages passed?
If you compare that build with your build you will notice that in your build the checks on different platforms have not even been executed. This is because the lint stage failed and it failed correctly. You are messing up white space for no reason and this has been pointed out several times in this pull request already, you are just choosing to neglect these comments.
@alexeyneu Given that you’ve chosen to ignore review comments and constructive criticism, asked for donations multiple times, called people “morons” and told others not to “show up here any more”, I’m inclined to close this pull request.
I appreciate there is a language barrier, and this is your first time contributing (which can be tough), so if you want to keep working on this PR, and discuss, in detail, the downsides to using QWinTaskbarProgress
, lets do that.
However, keep the comments constructive and on topic, otherwise this PR will be closed.
@alexeyneu Just to be clear: regarding your earlier comment on IRC, the Bitcoin Core project does not have funds for paying for contributions. If your patch has a price, please close it.
There are multiple ways of being funded to contribute to open source projects, but posting a BTC address and putting a price on a PR is not one of them. You could find someone to sponsor your time, or otherwise employ you to contribute.
Also, you’re testing people’s patience for all the reasons listed by @fanquake above. We’re happy for your contributions, but if you want to see your patch accepted, please don’t dismiss review comments from maintainers and others, and be respectful.
NACK.
I helped review and follow the discussions in good faith. I believed it was a language barrior. Plenty of others would be more than happy to contribute something like this and be nice and unconditional about it.