Skip to content
Bitcoin Roots

v30.3-roots.1 · Commit 5: [PATCH 05/68] feat(qt): preserve Roots identity and GUI support on Core 30.3

src/qt/bitcoingui.cpp

Before: src/qt/bitcoingui.cpp · After: src/qt/bitcoingui.cpp

File metadata
index 9413356b412caecfe368f4931d9463d62bf46def..94069484fc7e584572854ba5dcd61718b7591e87 100644

Download original patch · Release notes

Diff rows 1–48 of 48. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.

src/qt/bitcoingui.cpp CHANGED
@@ -31,6 +31,9 @@
31
31
  #ifdef Q_OS_MACOS
32
32
  #include <qt/macdockiconhandler.h>
33
33
  #endif
34
+ #ifdef BITCOIN_QT_WIN_TASKBAR
35
+ #include <qt/wintaskbarprogress.h>
36
+ #endif
34
37
 
35
38
  #include <chain.h>
36
39
  #include <chainparams.h>
@@ -223,6 +226,10 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
223
226
  #ifdef Q_OS_MACOS
224
227
  m_app_nap_inhibitor = new CAppNapInhibitor;
225
228
  #endif
229
+ #ifdef BITCOIN_QT_WIN_TASKBAR
230
+ m_taskbar_progress = new WinTaskbarProgress(this);
231
+ QApplication::instance()->installNativeEventFilter(m_taskbar_progress);
232
+ #endif
226
233
 
227
234
  GUIUtil::handleCloseWindowShortcut(this);
228
235
  }
@@ -240,6 +247,9 @@ BitcoinGUI::~BitcoinGUI()
240
247
  delete m_app_nap_inhibitor;
241
248
  MacDockIconHandler::cleanup();
242
249
  #endif
250
+ #ifdef BITCOIN_QT_WIN_TASKBAR
251
+ QApplication::instance()->removeNativeEventFilter(m_taskbar_progress);
252
+ #endif
243
253
 
244
254
  delete rpcConsole;
245
255
  }
@@ -1173,6 +1183,9 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
1173
1183
 
1174
1184
  progressBarLabel->setVisible(false);
1175
1185
  progressBar->setVisible(false);
1186
+ #ifdef BITCOIN_QT_WIN_TASKBAR
1187
+ m_taskbar_progress->setVisible(false);
1188
+ #endif
1176
1189
  }
1177
1190
  else
1178
1191
  {
@@ -1183,6 +1196,11 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
1183
1196
  progressBar->setMaximum(1000000000);
1184
1197
  progressBar->setValue(nVerificationProgress * 1000000000.0 + 0.5);
1185
1198
  progressBar->setVisible(true);
1199
+ #ifdef BITCOIN_QT_WIN_TASKBAR
1200
+ m_taskbar_progress->setWindow(this);
1201
+ m_taskbar_progress->setValue(qRound(nVerificationProgress * 100.0));
1202
+ m_taskbar_progress->setVisible(true);
1203
+ #endif
1186
1204
 
1187
1205
  tooltip = tr("Catching up…") + QString("<br>") + tooltip;
1188
1206
  if(count != prevBlocks)