5 #if defined(HAVE_CONFIG_H) 19 #include <chainparams.h> 40 #include <QAbstractButton> 41 #include <QAbstractItemView> 42 #include <QApplication> 45 #include <QDesktopServices> 47 #include <QDoubleValidator> 48 #include <QFileDialog> 50 #include <QFontDatabase> 51 #include <QFontMetrics> 52 #include <QGuiApplication> 53 #include <QJsonObject> 55 #include <QKeySequence> 56 #include <QLatin1String> 61 #include <QMouseEvent> 62 #include <QPluginLoader> 63 #include <QProgressDialog> 64 #include <QRegularExpression> 69 #include <QStandardPaths> 71 #include <QTextDocument> 83 #if defined(Q_OS_MACOS) 96 return QLocale::system().toString(date.date(), QLocale::ShortFormat) + QString(
" ") + date.toString(
"hh:mm");
101 return dateTimeStr(QDateTime::fromSecsSinceEpoch(nTime));
106 if (use_embedded_font) {
107 return {
"Roboto Mono"};
109 return QFontDatabase::systemFont(QFontDatabase::FixedFont);
113 static const uint8_t
dummydata[] = {0xeb,0x15,0x23,0x1d,0xfc,0xeb,0x60,0x92,0x58,0x86,0xb6,0x7d,0x06,0x52,0x99,0x92,0x59,0x15,0xae,0xb1,0x72,0xc0,0x66,0x47};
120 for(
int i=0; i<256; ++i) {
125 sourcedata[sourcedata.size()-1] += 1;
132 parent->setFocusProxy(widget);
137 widget->setPlaceholderText(QObject::tr(
"Enter a Bitcoin address (e.g. %1)").arg(
145 QObject::connect(
new QShortcut(shortcut, button), &QShortcut::activated, [button]() { button->animateClick(); });
151 if(!uri.isValid() || uri.scheme() != QString(
"bitcoin"))
157 if (rv.
address.endsWith(
"/")) {
162 QUrlQuery uriQuery(uri);
163 QList<QPair<QString, QString> > items = uriQuery.queryItems();
164 for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++)
166 bool fShouldReturnFalse =
false;
167 if (i->first.startsWith(
"req-"))
169 i->first.remove(0, 4);
170 fShouldReturnFalse =
true;
173 if (i->first ==
"label")
175 rv.
label = i->second;
176 fShouldReturnFalse =
false;
178 if (i->first ==
"message")
181 fShouldReturnFalse =
false;
183 else if (i->first ==
"amount")
185 if(!i->second.isEmpty())
191 fShouldReturnFalse =
false;
194 if (fShouldReturnFalse)
206 QUrl uriInstance(uri);
212 bool bech_32 = info.
address.startsWith(QString::fromStdString(
Params().Bech32HRP() +
"1"));
214 QString
ret = QString(
"bitcoin:%1").arg(bech_32 ? info.
address.toUpper() : info.
address);
223 if (!info.
label.isEmpty())
225 QString lbl(QUrl::toPercentEncoding(info.
label));
226 ret += QString(
"%1label=%2").arg(paramCount == 0 ?
"?" :
"&").arg(lbl);
232 QString
msg(QUrl::toPercentEncoding(info.
message));
233 ret += QString(
"%1message=%2").arg(paramCount == 0 ?
"?" :
"&").arg(
msg);
244 CTxOut txOut(amount, script);
250 QString escaped = str.toHtmlEscaped();
253 escaped = escaped.replace(
"\n",
"<br>\n");
260 return HtmlEscape(QString::fromStdString(str), fMultiLine);
265 if(!view || !view->selectionModel())
267 QModelIndexList selection = view->selectionModel()->selectedRows(column);
269 if(!selection.isEmpty())
276 QList<QModelIndex>
getEntryData(
const QAbstractItemView *view,
int column)
278 if(!view || !view->selectionModel())
279 return QList<QModelIndex>();
280 return view->selectionModel()->selectedRows(column);
286 if (selection.isEmpty())
return false;
287 return !selection.at(0).data(role).toString().isEmpty();
292 const int id = QFontDatabase::addApplicationFont(file_name);
303 QRegularExpression filter_re(QStringLiteral(
".* \\(\\*\\.(.*)[ \\)]"), QRegularExpression::InvertedGreedinessOption);
305 QRegularExpressionMatch
m = filter_re.match(filter);
307 suffix =
m.captured(1);
313 const QString &filter,
314 QString *selectedSuffixOut)
316 QString selectedFilter;
320 myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
332 QFileInfo info(result);
333 if(!result.isEmpty())
335 if(info.suffix().isEmpty() && !selectedSuffix.isEmpty())
338 if(!result.endsWith(
"."))
340 result.append(selectedSuffix);
345 if(selectedSuffixOut)
347 *selectedSuffixOut = selectedSuffix;
353 const QString &filter,
354 QString *selectedSuffixOut)
356 QString selectedFilter;
360 myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
369 if(selectedSuffixOut)
379 if(QThread::currentThread() != qApp->thread())
381 return Qt::BlockingQueuedConnection;
385 return Qt::DirectConnection;
391 QWidget *atW = QApplication::widgetAt(w->mapToGlobal(p));
392 if (!atW)
return false;
393 return atW->window() == w;
401 &&
checkPoint(QPoint(w->width() - 1, w->height() - 1), w)
402 &&
checkPoint(QPoint(w->width() / 2, w->height() / 2), w));
413 if (w->isMinimized()) {
425 QObject::connect(
new QShortcut(QKeySequence(QObject::tr(
"Ctrl+W")), w), &QShortcut::activated, w, &QWidget::close);
434 QDesktopServices::openUrl(QUrl::fromLocalFile(
PathToQString(pathDebug)));
442 std::ofstream configFile{pathConfig, std::ios_base::app};
444 if (!configFile.good())
450 bool res = QDesktopServices::openUrl(QUrl::fromLocalFile(
PathToQString(pathConfig)));
454 res = QProcess::startDetached(
"/usr/bin/open", QStringList{
"-t",
PathToQString(pathConfig)});
461 ToolTipToRichTextFilter::ToolTipToRichTextFilter(
int _size_threshold, QObject *parent) :
463 size_threshold(_size_threshold)
470 if(evt->type() == QEvent::ToolTipChange)
472 QWidget *widget =
static_cast<QWidget*
>(obj);
473 QString tooltip = widget->toolTip();
474 if(tooltip.size() >
size_threshold && !tooltip.startsWith(
"<qt") && !Qt::mightBeRichText(tooltip))
478 tooltip =
"<qt>" +
HtmlEscape(tooltip,
true) +
"</qt>";
479 widget->setToolTip(tooltip);
483 return QObject::eventFilter(obj, evt);
493 if (event->type() == QEvent::FocusOut) {
494 auto focus_out =
static_cast<QFocusEvent*
>(event);
495 if (focus_out->reason() != Qt::PopupFocusReason) {
496 auto label = qobject_cast<QLabel*>(watched);
498 auto flags = label->textInteractionFlags();
499 label->setTextInteractionFlags(Qt::NoTextInteraction);
500 label->setTextInteractionFlags(
flags);
505 return QObject::eventFilter(watched, event);
509 fs::path static StartupShortcutPath()
513 return GetSpecialFolderPath(CSIDL_STARTUP) /
"Bitcoin.lnk";
515 return GetSpecialFolderPath(CSIDL_STARTUP) /
"Bitcoin (testnet).lnk";
528 fs::remove(StartupShortcutPath());
532 CoInitialize(
nullptr);
535 IShellLinkW* psl =
nullptr;
536 HRESULT hres = CoCreateInstance(CLSID_ShellLink,
nullptr,
537 CLSCTX_INPROC_SERVER, IID_IShellLinkW,
538 reinterpret_cast<void**>(&psl));
544 GetModuleFileNameW(
nullptr, pszExePath, ARRAYSIZE(pszExePath));
547 QString strArgs =
"-min";
552 psl->SetPath(pszExePath);
553 PathRemoveFileSpecW(pszExePath);
554 psl->SetWorkingDirectory(pszExePath);
555 psl->SetShowCmd(SW_SHOWMINNOACTIVE);
556 psl->SetArguments(strArgs.toStdWString().c_str());
560 IPersistFile* ppf =
nullptr;
561 hres = psl->QueryInterface(IID_IPersistFile, reinterpret_cast<void**>(&ppf));
565 hres = ppf->Save(StartupShortcutPath().wstring().c_str(), TRUE);
578 #elif defined(Q_OS_LINUX) 585 char* pszConfigHome = getenv(
"XDG_CONFIG_HOME");
586 if (pszConfigHome)
return fs::path(pszConfigHome) /
"autostart";
587 char* pszHome = getenv(
"HOME");
588 if (pszHome)
return fs::path(pszHome) /
".config" /
"autostart";
592 fs::path static GetAutostartFilePath()
596 return GetAutostartDir() /
"bitcoin.desktop";
602 std::ifstream optionFile{GetAutostartFilePath()};
603 if (!optionFile.good())
607 while (!optionFile.eof())
609 getline(optionFile, line);
610 if (line.find(
"Hidden") != std::string::npos &&
611 line.find(
"true") != std::string::npos)
622 fs::remove(GetAutostartFilePath());
626 ssize_t r = readlink(
"/proc/self/exe", pszExePath,
sizeof(pszExePath));
630 pszExePath[r] =
'\0';
634 std::ofstream optionFile{GetAutostartFilePath(),
std::ios_base::out | std::ios_base::trunc};
635 if (!optionFile.good())
639 optionFile <<
"[Desktop Entry]\n";
640 optionFile <<
"Type=Application\n";
642 optionFile <<
"Name=Bitcoin\n";
646 optionFile <<
"Terminal=false\n";
647 optionFile <<
"Hidden=false\n";
662 QClipboard* clipboard = QApplication::clipboard();
663 clipboard->setText(str, QClipboard::Clipboard);
664 if (clipboard->supportsSelection()) {
665 clipboard->setText(str, QClipboard::Selection);
676 return QString::fromStdString(path.
utf8string());
684 case NET_IPV4:
return QObject::tr(
"IPv4",
"network name");
686 case NET_IPV6:
return QObject::tr(
"IPv6",
"network name");
688 case NET_ONION:
return QObject::tr(
"Onion",
"network name");
690 case NET_I2P:
return QObject::tr(
"I2P",
"network name");
692 case NET_CJDNS:
return QObject::tr(
"CJDNS",
"network name");
702 if (prepend_direction) {
706 QObject::tr(
"Inbound") :
709 QObject::tr(
"Outbound") +
" ";
730 const auto d{std::chrono::duration_cast<std::chrono::days>(dur)};
731 const auto h{std::chrono::duration_cast<std::chrono::hours>(dur - d)};
732 const auto m{std::chrono::duration_cast<std::chrono::minutes>(dur - d - h)};
733 const auto s{std::chrono::duration_cast<std::chrono::seconds>(dur - d - h -
m)};
734 QStringList str_list;
735 if (
auto d2{d.count()}) str_list.append(QObject::tr(
"%1 d").arg(d2));
736 if (
auto h2{h.count()}) str_list.append(QObject::tr(
"%1 h").arg(h2));
737 if (
auto m2{
m.count()}) str_list.append(QObject::tr(
"%1 m").arg(m2));
738 const auto s2{s.count()};
739 if (s2 || str_list.empty()) str_list.append(QObject::tr(
"%1 s").arg(s2));
740 return str_list.join(
" ");
745 const auto time_now{GetTime<std::chrono::seconds>()};
746 const auto age{time_now - time_connected};
747 if (age >= 24h)
return QObject::tr(
"%1 d").arg(age / 24h);
748 if (age >= 1h)
return QObject::tr(
"%1 h").arg(age / 1h);
749 if (age >= 1min)
return QObject::tr(
"%1 m").arg(age / 1min);
750 return QObject::tr(
"%1 s").arg(age / 1s);
758 strList.append(QString::fromStdString(flag));
762 return strList.join(
", ");
764 return QObject::tr(
"None");
769 return (ping_time == std::chrono::microseconds::max() || ping_time == 0us) ?
771 QObject::tr(
"%1 ms").arg(QString::number((
int)(
count_microseconds(ping_time) / 1000), 10));
776 return QObject::tr(
"%1 s").arg(QString::number((
int)nTimeOffset, 10));
782 QString timeBehindText;
783 const int HOUR_IN_SECONDS = 60*60;
784 const int DAY_IN_SECONDS = 24*60*60;
785 const int WEEK_IN_SECONDS = 7*24*60*60;
786 const int YEAR_IN_SECONDS = 31556952;
789 timeBehindText = QObject::tr(
"%n second(s)",
"",secs);
791 else if(secs < 2*HOUR_IN_SECONDS)
793 timeBehindText = QObject::tr(
"%n minute(s)",
"",secs/60);
795 else if(secs < 2*DAY_IN_SECONDS)
797 timeBehindText = QObject::tr(
"%n hour(s)",
"",secs/HOUR_IN_SECONDS);
799 else if(secs < 2*WEEK_IN_SECONDS)
801 timeBehindText = QObject::tr(
"%n day(s)",
"",secs/DAY_IN_SECONDS);
803 else if(secs < YEAR_IN_SECONDS)
805 timeBehindText = QObject::tr(
"%n week(s)",
"",secs/WEEK_IN_SECONDS);
809 qint64 years = secs / YEAR_IN_SECONDS;
810 qint64 remainder = secs % YEAR_IN_SECONDS;
811 timeBehindText = QObject::tr(
"%1 and %2").arg(QObject::tr(
"%n year(s)",
"", years)).arg(QObject::tr(
"%n week(s)",
"", remainder/WEEK_IN_SECONDS));
813 return timeBehindText;
819 return QObject::tr("%1 B").arg(bytes); 820 if (bytes < 1'000
'000) 821 return QObject::tr("%1 kB").arg(bytes / 1'000);
822 if (bytes < 1
'000'000
'000) 823 return QObject::tr("%1 MB").arg(bytes / 1'000
'000); 825 return QObject::tr("%1 GB").arg(bytes / 1'000
'000'000);
829 while(font_size >= minPointSize) {
830 font.setPointSizeF(font_size);
831 QFontMetrics fm(font);
841 : QLabel{parent}, m_platform_style{platform_style}
856 if (e->type() == QEvent::PaletteChange) {
860 QLabel::changeEvent(e);
885 if (event->type() == QEvent::KeyPress) {
886 if (static_cast<QKeyEvent*>(event)->key() == Qt::Key_Escape) {
890 return QItemDelegate::eventFilter(
object, event);
897 const int margin =
TextWidth(dialog->fontMetrics(), (
"X"));
898 dialog->resize(dialog->width() + 2 * margin, dialog->height());
904 dialog->setMinimumDuration(0);
907 int TextWidth(
const QFontMetrics& fm,
const QString& text)
909 return fm.horizontalAdvance(text);
915 const std::string qt_link{
"static"};
917 const std::string qt_link{
"dynamic"};
919 #ifdef QT_STATICPLUGIN 920 const std::string plugin_link{
"static"};
922 const std::string plugin_link{
"dynamic"};
924 LogPrintf(
"Qt %s (%s), plugin=%s (%s)\n", qVersion(), qt_link, QGuiApplication::platformName().toStdString(), plugin_link);
925 const auto static_plugins = QPluginLoader::staticPlugins();
926 if (static_plugins.empty()) {
930 for (
const QStaticPlugin& p : static_plugins) {
931 QJsonObject meta_data = p.metaData();
932 const std::string plugin_class = meta_data.take(QString(
"className")).toString().toStdString();
933 const int plugin_version = meta_data.take(QString(
"version")).toInt();
934 LogPrintf(
" %s, version %d\n", plugin_class, plugin_version);
938 LogPrintf(
"Style: %s / %s\n", QApplication::style()->objectName().toStdString(), QApplication::style()->metaObject()->className());
939 LogPrintf(
"System: %s, %s\n", QSysInfo::prettyProductName().toStdString(), QSysInfo::buildAbi().toStdString());
940 for (
const QScreen* s : QGuiApplication::screens()) {
941 LogPrintf(
"Screen: %s %dx%d, pixel ratio=%.1f\n", s->name().toStdString(), s->size().width(), s->size().height(), s->devicePixelRatio());
945 void PopupMenu(QMenu* menu,
const QPoint& point, QAction* at_action)
948 if (QApplication::platformName() ==
"minimal")
return;
949 menu->popup(point, at_action);
954 #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) 955 return date.startOfDay();
957 return QDateTime(date);
963 #if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) 964 return !label->pixmap(Qt::ReturnByValue).isNull();
966 return label->pixmap() !=
nullptr;
976 #if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) 977 return label->pixmap(Qt::ReturnByValue).toImage();
979 return label->pixmap()->toImage();
985 return QString(
source).replace(
987 QLatin1String(
"<a href=\"") + link + QLatin1String(
"\">") + link + QLatin1String(
"</a>"));
991 const std::exception* exception,
992 const QObject* sender,
993 const QObject* receiver)
995 std::string description = sender->metaObject()->className();
997 description += receiver->metaObject()->className();
1003 dialog->setAttribute(Qt::WA_DeleteOnClose);
1004 dialog->setWindowModality(Qt::ApplicationModal);
QString formatPingTime(std::chrono::microseconds ping_time)
Format a CNodeStats.m_last_ping_time into a user-readable string or display N/A, if 0...
QDateTime StartOfDay(const QDate &date)
Returns the start-moment of the day in local time.
AddrFetch connections are short lived connections used to solicit addresses from peers.
bool eventFilter(QObject *obj, QEvent *evt) override
void setThemedPixmap(const QString &image_filename, int width, int height)
Utility functions used by the Bitcoin Qt UI.
void LogQtInfo()
Writes to debug.log short info about the used Qt and the host system.
fs::path GetConfigFilePath() const
Return config file path (read-only)
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get open filename, convenience wrapper for QFileDialog::getOpenFileName.
Inbound connections are those initiated by a peer.
A set of addresses that represent the hash of a string or FQDN.
void mouseReleaseEvent(QMouseEvent *event) override
Dummy value to indicate the number of NET_* constants.
Feeler connections are short-lived connections made to check that a node is alive.
bool IsValidDestinationString(const std::string &str, const CChainParams ¶ms)
void PopupMenu(QMenu *menu, const QPoint &point, QAction *at_action)
Call QMenu::popup() only on supported QT_QPA_PLATFORM.
int TextWidth(const QFontMetrics &fm, const QString &text)
Returns the distance in pixels appropriate for drawing a subsequent character after text...
bool isDust(interfaces::Node &node, const QString &address, const CAmount &amount)
Qt::ConnectionType blockingGUIThreadConnection()
Get connection type to call object slot in GUI thread with invokeMethod.
QString formatBytes(uint64_t bytes)
QString formatTimeOffset(int64_t nTimeOffset)
Format a CNodeCombinedStats.nTimeOffset into a user-readable string.
bool GetStartOnSystemStartup()
std::string EncodeBase58(Span< const unsigned char > input)
Why base-58 instead of standard base-64 encoding?
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
QString HtmlEscape(const QString &str, bool fMultiLine)
std::vector< std::string > serviceFlagsToStr(uint64_t flags)
Convert service flags (a bitmask of NODE_*) to human readable strings.
QString HtmlEscape(const std::string &str, bool fMultiLine)
QFont fixedPitchFont(bool use_embedded_font)
static bool parse(Unit unit, const QString &value, CAmount *val_out)
Parse string to coin amount.
Line edit that can be marked as "invalid" to show input validation feedback.
void ShowModalDialogAsynchronously(QDialog *dialog)
Shows a QDialog instance asynchronously, and deletes it on close.
void PrintExceptionContinue(const std::exception *pex, std::string_view thread_name)
ChainType GetChainType() const
Returns the appropriate chain type from the program arguments.
These are the default connections that we use to connect with the network.
QString formatDurationStr(std::chrono::seconds dur)
Convert seconds into a QString with days, hours, mins, secs.
QString formatBitcoinURI(const SendCoinsRecipient &info)
void bringToFront(QWidget *w)
bool eventFilter(QObject *object, QEvent *event) override
int64_t CAmount
Amount in satoshis (Can be negative)
void mouseReleaseEvent(QMouseEvent *event) override
QString NetworkToQString(Network net)
Convert enum Network to QString.
std::string GetChainTypeString() const
Returns the appropriate chain type string from the program arguments.
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
void changeEvent(QEvent *e) override
fs::path GetDataDirNet() const
Get data directory path with appended network identifier.
bool isObscured(QWidget *w)
qreal calculateIdealFontSize(int width, const QString &text, QFont font, qreal minPointSize, qreal font_size)
We open manual connections to addresses that users explicitly requested via the addnode RPC or the -a...
static QString format(Unit unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD, bool justify=false)
Format as string.
void setClipboard(const QString &str)
bool HasPixmap(const QLabel *label)
Returns true if pixmap has been set.
void handleCloseWindowShortcut(QWidget *w)
fs::path QStringToPath(const QString &path)
Convert QString to OS specific boost path through UTF-8.
constexpr int64_t count_microseconds(std::chrono::microseconds t)
QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction)
Convert enum ConnectionType to QString.
bool eventFilter(QObject *watched, QEvent *event) override
bool hasEntryData(const QAbstractItemView *view, int column, int role)
Returns true if the specified field of the currently selected view entry is not empty.
void clicked(const QPoint &point)
Emitted when the label is clicked.
Base58 entry widget validator, checks for valid characters and removes some whitespace.
An output of a transaction.
static bool create_directories(const std::filesystem::path &p)
Create directory (and if necessary its parents), unless the leaf directory already exists or is a sym...
void copyEntryData(const QAbstractItemView *view, int column, int role)
Copy a field of the currently selected entry of a view to the clipboard.
void PolishProgressDialog(QProgressDialog *dialog)
void PrintSlotException(const std::exception *exception, const QObject *sender, const QObject *receiver)
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
QImage GetImage(const QLabel *label)
std::string utf8string() const
Return a UTF-8 representation of the path as a std::string, for compatibility with code using std::st...
QString dateTimeStr(qint64 nTime)
LabelOutOfFocusEventFilter(QObject *parent)
const CChainParams & Params()
Return the currently selected parameters.
fs::path GetDefaultDataDir()
Serialized script, used inside transaction inputs and outputs.
QString formatServicesStr(quint64 mask)
Format CNodeStats.nServices bitmask into a user-readable string.
bool parseBitcoinURI(QString uri, SendCoinsRecipient *out)
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when ...
static std::string DummyAddress(const CChainParams ¶ms)
void ForceActivation()
Force application activation on macOS.
bool checkPoint(const QPoint &p, const QWidget *w)
std::string ChainTypeToString(ChainType chain)
void setCheckValidator(const QValidator *v)
void LoadFont(const QString &file_name)
Loads the font from the file specified by file_name, aborts if it fails.
ThemedLabel(const PlatformStyle *platform_style, QWidget *parent=nullptr)
ConnectionType
Different types of connections to a peer.
ClickableLabel(const PlatformStyle *platform_style, QWidget *parent=nullptr)
QString MakeHtmlLink(const QString &source, const QString &link)
Replaces a plain text link with an HTML tagged one.
bool IsDust(const CTxOut &txout, const CFeeRate &dustRelayFeeIn)
bool SetStartOnSystemStartup(bool fAutoStart)
void clicked(const QPoint &point)
Emitted when the progressbar is clicked.
QString formatNiceTimeOffset(qint64 secs)
QString FormatPeerAge(std::chrono::seconds time_connected)
Convert peer connection time to a QString denominated in the most relevant unit.
static bool exists(const path &p)
CTxDestination DecodeDestination(const std::string &str, std::string &error_msg, std::vector< int > *error_locations)
QString getDefaultDataDirectory()
Determine default data directory for operating system.
static path u8path(const std::string &utf8_str)
void updateThemedPixmap()
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
Bitcoin address widget validator, checks for a valid bitcoin address.
void AddButtonShortcut(QAbstractButton *button, const QKeySequence &shortcut)
Connects an additional shortcut to a QAbstractButton.
Top-level interface for a bitcoin node (bitcoind process).
const PlatformStyle * m_platform_style
static const uint8_t dummydata[]
QString PathToQString(const fs::path &path)
Convert OS specific boost path to QString through UTF-8.
QString ExtractFirstSuffixFromFilter(const QString &filter)
Extract first suffix from filter pattern "Description (*.foo)" or "Description (*.foo *.bar ...).
We use block-relay-only connections to help prevent against partition attacks.
const std::vector< unsigned char > & Base58Prefix(Base58Type type) const
QList< QModelIndex > getEntryData(const QAbstractItemView *view, int column)
Return a field of the currently selected entry as a QString.
Addresses from these networks are not publicly routable on the global Internet.