26 #define _WIN32_WINNT 0x0501 30 #define _WIN32_IE 0x0501 31 #define WIN32_LEAN_AND_MEAN 1 40 #include <boost/scoped_array.hpp> 42 #include <QAbstractItemView> 43 #include <QApplication> 46 #include <QDesktopServices> 47 #include <QDesktopWidget> 48 #include <QDoubleValidator> 49 #include <QFileDialog> 53 #include <QTextDocument> 55 #include <QMouseEvent> 58 #if QT_VERSION < 0x050000 64 #if QT_VERSION >= 0x50200 65 #include <QFontDatabase> 68 static fs::detail::utf8_codecvt_facet utf8;
71 extern double NSAppKitVersionNumber;
72 #if !defined(NSAppKitVersionNumber10_8) 73 #define NSAppKitVersionNumber10_8 1187 75 #if !defined(NSAppKitVersionNumber10_9) 76 #define NSAppKitVersionNumber10_9 1265 80 #include <QGraphicsDropShadowEffect> 89 #if !defined(Q_OS_MAC) 90 labelSubFont.setFamily(
"Open Sans");
92 labelSubFont.setWeight(QFont::Weight::ExtraLight);
93 labelSubFont.setLetterSpacing(QFont::SpacingType::AbsoluteSpacing, -0.6);
94 labelSubFont.setPixelSize(14);
101 #if !defined(Q_OS_MAC) 102 labelSubFont.setFamily(
"Open Sans");
104 labelSubFont.setWeight(QFont::Weight::Bold);
105 labelSubFont.setLetterSpacing(QFont::SpacingType::AbsoluteSpacing, -0.6);
106 labelSubFont.setPixelSize(14);
113 #if !defined(Q_OS_MAC) 114 labelTopFont.setFamily(
"Open Sans");
116 labelTopFont.setWeight(QFont::Weight::Bold);
117 labelTopFont.setLetterSpacing(QFont::SpacingType::AbsoluteSpacing, -0.6);
118 labelTopFont.setPixelSize(18);
125 #if !defined(Q_OS_MAC) 126 labelTopFont.setFamily(
"Open Sans");
128 labelTopFont.setWeight(weight);
129 labelTopFont.setLetterSpacing(QFont::SpacingType::AbsoluteSpacing, -0.6);
130 labelTopFont.setPixelSize(pxsize);
137 #if !defined(Q_OS_MAC) 138 labelTopFont.setFamily(
"Open Sans");
140 labelTopFont.setWeight(QFont::Weight::Light);
141 labelTopFont.setLetterSpacing(QFont::SpacingType::AbsoluteSpacing, -0.6);
142 labelTopFont.setPixelSize(18);
148 #if defined(Q_OS_MAC) 151 QGraphicsDropShadowEffect *shadow =
new QGraphicsDropShadowEffect;
152 shadow->setBlurRadius(50);
154 shadow->setOffset(8.0);
160 return date.date().toString(Qt::SystemLocaleShortDate) + QString(
" ") + date.toString(
"hh:mm");
165 return dateTimeStr(QDateTime::fromTime_t((qint32)nTime));
170 #if QT_VERSION >= 0x50200 171 return QFontDatabase::systemFont(QFontDatabase::FixedFont);
173 QFont font(
"Monospace");
174 #if QT_VERSION >= 0x040800 175 font.setStyleHint(QFont::Monospace);
177 font.setStyleHint(QFont::TypeWriter);
184 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};
187 static std::string DummyAddress(
const CChainParams ¶ms)
190 sourcedata.insert(sourcedata.end(), dummydata, dummydata +
sizeof(dummydata));
191 for(
int i=0; i<256; ++i) {
192 std::string s =
EncodeBase58(sourcedata.data(), sourcedata.data() + sourcedata.size());
196 sourcedata[sourcedata.size()-1] += 1;
203 parent->setFocusProxy(widget);
206 #if QT_VERSION >= 0x040700 209 widget->setPlaceholderText(QObject::tr(
"Enter a Raven address (e.g. %1)").arg(
210 QString::fromStdString(DummyAddress(
Params()))));
218 QDoubleValidator *amountValidator =
new QDoubleValidator(parent);
219 amountValidator->setDecimals(8);
220 amountValidator->setBottom(0.0);
221 widget->setValidator(amountValidator);
222 widget->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
228 if(!uri.isValid() || uri.scheme() != QString(
"raven"))
234 if (rv.
address.endsWith(
"/")) {
239 #if QT_VERSION < 0x050000 240 QList<QPair<QString, QString> > items = uri.queryItems();
242 QUrlQuery uriQuery(uri);
243 QList<QPair<QString, QString> > items = uriQuery.queryItems();
245 for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++)
247 bool fShouldReturnFalse =
false;
248 if (i->first.startsWith(
"req-"))
250 i->first.remove(0, 4);
251 fShouldReturnFalse =
true;
254 if (i->first ==
"label")
256 rv.
label = i->second;
257 fShouldReturnFalse =
false;
259 if (i->first ==
"message")
262 fShouldReturnFalse =
false;
264 else if (i->first ==
"amount")
266 if(!i->second.isEmpty())
273 fShouldReturnFalse =
false;
276 if (fShouldReturnFalse)
292 if(uri.startsWith(
"raven://", Qt::CaseInsensitive))
294 uri.replace(0, 10,
"raven:");
296 QUrl uriInstance(uri);
302 QString ret = QString(
"raven:%1").arg(info.
address);
311 if (!info.
label.isEmpty())
313 QString lbl(QUrl::toPercentEncoding(info.
label));
314 ret += QString(
"%1label=%2").arg(paramCount == 0 ?
"?" :
"&").arg(lbl);
320 QString msg(QUrl::toPercentEncoding(info.
message));
321 ret += QString(
"%1message=%2").arg(paramCount == 0 ?
"?" :
"&").arg(msg);
332 CTxOut txOut(amount, script);
338 #if QT_VERSION < 0x050000 339 QString escaped = Qt::escape(str);
341 QString escaped = str.toHtmlEscaped();
345 escaped = escaped.replace(
"\n",
"<br>\n");
352 return HtmlEscape(QString::fromStdString(str), fMultiLine);
357 if(!view || !view->selectionModel())
359 QModelIndexList selection = view->selectionModel()->selectedRows(column);
361 if(!selection.isEmpty())
370 if(!view || !view->selectionModel())
371 return QList<QModelIndex>();
372 return view->selectionModel()->selectedRows(column);
376 const QString &filter,
377 QString *selectedSuffixOut)
379 QString selectedFilter;
383 #if QT_VERSION < 0x050000 384 myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
386 myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
397 QRegExp filter_re(
".* \\(\\*\\.(.*)[ \\)]");
398 QString selectedSuffix;
399 if(filter_re.exactMatch(selectedFilter))
401 selectedSuffix = filter_re.cap(1);
405 QFileInfo info(result);
406 if(!result.isEmpty())
408 if(info.suffix().isEmpty() && !selectedSuffix.isEmpty())
411 if(!result.endsWith(
"."))
413 result.append(selectedSuffix);
418 if(selectedSuffixOut)
420 *selectedSuffixOut = selectedSuffix;
426 const QString &filter,
427 QString *selectedSuffixOut)
429 QString selectedFilter;
433 #if QT_VERSION < 0x050000 434 myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
436 myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
446 if(selectedSuffixOut)
449 QRegExp filter_re(
".* \\(\\*\\.(.*)[ \\)]");
450 QString selectedSuffix;
451 if(filter_re.exactMatch(selectedFilter))
453 selectedSuffix = filter_re.cap(1);
455 *selectedSuffixOut = selectedSuffix;
462 if(QThread::currentThread() != qApp->thread())
464 return Qt::BlockingQueuedConnection;
468 return Qt::DirectConnection;
474 QWidget *atW = QApplication::widgetAt(w->mapToGlobal(p));
475 if (!atW)
return false;
476 return atW->topLevelWidget() == w;
484 &&
checkPoint(QPoint(w->width() - 1, w->height() - 1), w)
485 &&
checkPoint(QPoint(w->width() / 2, w->height() / 2), w));
490 fs::path pathDebug =
GetDataDir() /
"debug.log";
493 if (fs::exists(pathDebug))
502 boost::filesystem::ofstream configFile(pathConfig, std::ios_base::app);
504 if (!configFile.good())
510 return QDesktopServices::openUrl(QUrl::fromLocalFile(
boostPathToQString(pathConfig)));
515 #if defined(Q_OS_MAC) 528 #if defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8 529 if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_8)
531 if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_9)
533 QFont::insertSubstitution(
".Lucida Grande UI",
"Lucida Grande");
537 if (language ==
"zh_CN" || language ==
"zh_TW" || language ==
"zh_HK")
538 QFont::insertSubstitution(
".Helvetica Neue DeskInterface",
"Heiti SC");
539 else if (language ==
"ja")
540 QFont::insertSubstitution(
".Helvetica Neue DeskInterface",
"Songti SC");
542 QFont::insertSubstitution(
".Helvetica Neue DeskInterface",
"Lucida Grande");
551 size_threshold(_size_threshold)
558 if(evt->type() == QEvent::ToolTipChange)
560 QWidget *widget =
static_cast<QWidget*
>(obj);
561 QString tooltip = widget->toolTip();
562 if(tooltip.size() >
size_threshold && !tooltip.startsWith(
"<qt") && !Qt::mightBeRichText(tooltip))
566 tooltip =
"<qt>" +
HtmlEscape(tooltip,
true) +
"</qt>";
567 widget->setToolTip(tooltip);
571 return QObject::eventFilter(obj, evt);
576 connect(tableView->horizontalHeader(), SIGNAL(sectionResized(
int,
int,
int)),
this, SLOT(on_sectionResized(
int,
int,
int)));
577 connect(tableView->horizontalHeader(), SIGNAL(geometriesChanged()),
this, SLOT(on_geometriesChanged()));
583 disconnect(tableView->horizontalHeader(), SIGNAL(sectionResized(
int,
int,
int)),
this, SLOT(on_sectionResized(
int,
int,
int)));
584 disconnect(tableView->horizontalHeader(), SIGNAL(geometriesChanged()),
this, SLOT(on_geometriesChanged()));
591 #if QT_VERSION < 0x050000 592 tableView->horizontalHeader()->setResizeMode(logicalIndex, resizeMode);
594 tableView->horizontalHeader()->setSectionResizeMode(logicalIndex, resizeMode);
600 tableView->setColumnWidth(nColumnIndex, width);
601 tableView->horizontalHeader()->resizeSection(nColumnIndex, width);
606 int nColumnsWidthSum = 0;
607 for (
int i = 0; i < columnCount; i++)
609 nColumnsWidthSum += tableView->horizontalHeader()->sectionSize(i);
611 return nColumnsWidthSum;
616 int nResult = lastColumnMinimumWidth;
617 int nTableWidth = tableView->horizontalHeader()->width();
621 int nOtherColsWidth = getColumnsWidth() - tableView->horizontalHeader()->sectionSize(column);
622 nResult = std::max(nResult, nTableWidth - nOtherColsWidth);
631 disconnectViewHeadersSignals();
632 resizeColumn(lastColumnIndex, getAvailableWidthForColumn(lastColumnIndex));
633 connectViewHeadersSignals();
635 int nTableWidth = tableView->horizontalHeader()->width();
636 int nColsWidth = getColumnsWidth();
637 if (nColsWidth > nTableWidth)
639 resizeColumn(secondToLastColumnIndex,getAvailableWidthForColumn(secondToLastColumnIndex));
646 disconnectViewHeadersSignals();
647 resizeColumn(column, getAvailableWidthForColumn(column));
648 connectViewHeadersSignals();
654 adjustTableColumnsWidth();
655 int remainingWidth = getAvailableWidthForColumn(logicalIndex);
656 if (newSize > remainingWidth)
658 resizeColumn(logicalIndex, remainingWidth);
666 if ((getColumnsWidth() - this->tableView->horizontalHeader()->width()) != 0)
668 disconnectViewHeadersSignals();
669 resizeColumn(secondToLastColumnIndex, getAvailableWidthForColumn(secondToLastColumnIndex));
670 connectViewHeadersSignals();
681 lastColumnMinimumWidth(lastColMinimumWidth),
682 allColumnsMinimumWidth(allColsMinimumWidth)
694 fs::path
static StartupShortcutPath()
698 return GetSpecialFolderPath(CSIDL_STARTUP) /
"Raven.lnk";
700 return GetSpecialFolderPath(CSIDL_STARTUP) /
"Raven (testnet).lnk";
701 return GetSpecialFolderPath(CSIDL_STARTUP) /
strprintf(
"Raven (%s).lnk", chain);
707 return fs::exists(StartupShortcutPath());
713 fs::remove(StartupShortcutPath());
717 CoInitialize(
nullptr);
720 IShellLink* psl =
nullptr;
721 HRESULT hres = CoCreateInstance(CLSID_ShellLink,
nullptr,
722 CLSCTX_INPROC_SERVER, IID_IShellLink,
723 reinterpret_cast<void**>(&psl));
729 GetModuleFileName(
nullptr, pszExePath,
sizeof(pszExePath));
732 QString strArgs =
"-min";
737 boost::scoped_array<TCHAR> args(
new TCHAR[strArgs.length() + 1]);
739 strArgs.toWCharArray(args.get());
741 args[strArgs.length()] =
'\0';
745 psl->SetPath(pszExePath);
746 PathRemoveFileSpec(pszExePath);
747 psl->SetWorkingDirectory(pszExePath);
748 psl->SetShowCmd(SW_SHOWMINNOACTIVE);
750 psl->SetArguments(strArgs.toStdString().c_str());
752 psl->SetArguments(args.get());
757 IPersistFile* ppf =
nullptr;
758 hres = psl->QueryInterface(IID_IPersistFile, reinterpret_cast<void**>(&ppf));
763 MultiByteToWideChar(CP_ACP, 0, StartupShortcutPath().
string().c_str(), -1, pwsz,
MAX_PATH);
765 hres = ppf->Save(pwsz, TRUE);
778 #elif defined(Q_OS_LINUX) 783 fs::path
static GetAutostartDir()
785 char* pszConfigHome = getenv(
"XDG_CONFIG_HOME");
786 if (pszConfigHome)
return fs::path(pszConfigHome) /
"autostart";
787 char* pszHome = getenv(
"HOME");
788 if (pszHome)
return fs::path(pszHome) /
".config" /
"autostart";
792 fs::path
static GetAutostartFilePath()
796 return GetAutostartDir() /
"raven.desktop";
797 return GetAutostartDir() /
strprintf(
"raven-%s.lnk", chain);
802 fs::ifstream optionFile(GetAutostartFilePath());
803 if (!optionFile.good())
807 while (!optionFile.eof())
809 getline(optionFile, line);
810 if (line.find(
"Hidden") != std::string::npos &&
811 line.find(
"true") != std::string::npos)
822 fs::remove(GetAutostartFilePath());
826 ssize_t r = readlink(
"/proc/self/exe", pszExePath,
sizeof(pszExePath) - 1);
829 pszExePath[r] =
'\0';
831 fs::create_directories(GetAutostartDir());
833 fs::ofstream optionFile(GetAutostartFilePath(), std::ios_base::out|std::ios_base::trunc);
834 if (!optionFile.good())
838 optionFile <<
"[Desktop Entry]\n";
839 optionFile <<
"Type=Application\n";
841 optionFile <<
"Name=Raven\n";
843 optionFile <<
strprintf(
"Name=Raven (%s)\n", chain);
845 optionFile <<
"Terminal=false\n";
846 optionFile <<
"Hidden=false\n";
853 #elif defined(Q_OS_MAC) 854 #pragma GCC diagnostic push 855 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 858 #include <CoreFoundation/CoreFoundation.h> 859 #include <CoreServices/CoreServices.h> 861 LSSharedFileListItemRef findStartupItemInList(LSSharedFileListRef list, CFURLRef findUrl);
862 LSSharedFileListItemRef findStartupItemInList(LSSharedFileListRef list, CFURLRef findUrl)
864 CFArrayRef listSnapshot = LSSharedFileListCopySnapshot(list,
nullptr);
865 if (listSnapshot ==
nullptr) {
870 for(
int i = 0; i < CFArrayGetCount(listSnapshot); i++) {
871 LSSharedFileListItemRef item = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(listSnapshot, i);
872 UInt32 resolutionFlags = kLSSharedFileListNoUserInteraction | kLSSharedFileListDoNotMountVolumes;
873 CFURLRef currentItemURL =
nullptr;
875 #if defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= 10100 876 if(&LSSharedFileListItemCopyResolvedURL)
877 currentItemURL = LSSharedFileListItemCopyResolvedURL(item, resolutionFlags,
nullptr);
878 #if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED < 10100 880 LSSharedFileListItemResolve(item, resolutionFlags, ¤tItemURL,
nullptr);
883 LSSharedFileListItemResolve(item, resolutionFlags, ¤tItemURL,
nullptr);
887 if (CFEqual(currentItemURL, findUrl)) {
889 CFRelease(listSnapshot);
890 CFRelease(currentItemURL);
893 CFRelease(currentItemURL);
897 CFRelease(listSnapshot);
903 CFURLRef ravenAppUrl = CFBundleCopyBundleURL(CFBundleGetMainBundle());
904 if (ravenAppUrl ==
nullptr) {
908 LSSharedFileListRef loginItems = LSSharedFileListCreate(
nullptr, kLSSharedFileListSessionLoginItems,
nullptr);
909 LSSharedFileListItemRef foundItem = findStartupItemInList(loginItems, ravenAppUrl);
911 CFRelease(ravenAppUrl);
917 CFURLRef ravenAppUrl = CFBundleCopyBundleURL(CFBundleGetMainBundle());
918 if (ravenAppUrl ==
nullptr) {
922 LSSharedFileListRef loginItems = LSSharedFileListCreate(
nullptr, kLSSharedFileListSessionLoginItems,
nullptr);
923 LSSharedFileListItemRef foundItem = findStartupItemInList(loginItems, ravenAppUrl);
925 if(fAutoStart && !foundItem) {
927 LSSharedFileListInsertItemURL(loginItems, kLSSharedFileListItemBeforeFirst,
nullptr,
nullptr, ravenAppUrl,
nullptr,
nullptr);
929 else if(!fAutoStart && foundItem) {
931 LSSharedFileListItemRemove(loginItems, foundItem);
934 CFRelease(ravenAppUrl);
937 #pragma GCC diagnostic pop 947 QApplication::clipboard()->setText(str, QClipboard::Clipboard);
948 QApplication::clipboard()->setText(str, QClipboard::Selection);
953 return fs::path(path.toStdString(), utf8);
958 return QString::fromStdString(path.string(utf8));
964 int days = secs / 86400;
965 int hours = (secs % 86400) / 3600;
966 int mins = (secs % 3600) / 60;
967 int seconds = secs % 60;
970 strList.append(QString(QObject::tr(
"%1 d")).arg(days));
972 strList.append(QString(QObject::tr(
"%1 h")).arg(hours));
974 strList.append(QString(QObject::tr(
"%1 m")).arg(mins));
975 if (seconds || (!days && !hours && !mins))
976 strList.append(QString(QObject::tr(
"%1 s")).arg(seconds));
978 return strList.join(
" ");
986 for (
int i = 0; i < 8; i++) {
987 uint64_t check = 1 << i;
993 strList.append(
"NETWORK");
996 strList.append(
"GETUTXO");
999 strList.append(
"BLOOM");
1002 strList.append(
"WITNESS");
1005 strList.append(
"XTHIN");
1008 strList.append(QString(
"%1[%2]").arg(
"UNKNOWN").arg(check));
1014 return strList.join(
" & ");
1016 return QObject::tr(
"None");
1021 return (dPingTime == std::numeric_limits<int64_t>::max()/1e6 || dPingTime == 0) ? QObject::tr(
"N/A") : QString(QObject::tr(
"%1 ms")).arg(QString::number((
int)(dPingTime * 1000), 10));
1026 return QString(QObject::tr(
"%1 s")).arg(QString::number((
int)nTimeOffset, 10));
1032 QString timeBehindText;
1033 const int HOUR_IN_SECONDS = 60*60;
1034 const int DAY_IN_SECONDS = 24*60*60;
1035 const int WEEK_IN_SECONDS = 7*24*60*60;
1036 const int YEAR_IN_SECONDS = 31556952;
1039 timeBehindText = QObject::tr(
"%n second(s)",
"",secs);
1041 else if(secs < 2*HOUR_IN_SECONDS)
1043 timeBehindText = QObject::tr(
"%n minute(s)",
"",secs/60);
1045 else if(secs < 2*DAY_IN_SECONDS)
1047 timeBehindText = QObject::tr(
"%n hour(s)",
"",secs/HOUR_IN_SECONDS);
1049 else if(secs < 2*WEEK_IN_SECONDS)
1051 timeBehindText = QObject::tr(
"%n day(s)",
"",secs/DAY_IN_SECONDS);
1053 else if(secs < YEAR_IN_SECONDS)
1055 timeBehindText = QObject::tr(
"%n week(s)",
"",secs/WEEK_IN_SECONDS);
1059 qint64 years = secs / YEAR_IN_SECONDS;
1060 qint64 remainder = secs % YEAR_IN_SECONDS;
1061 timeBehindText = QObject::tr(
"%1 and %2").arg(QObject::tr(
"%n year(s)",
"", years)).arg(QObject::tr(
"%n week(s)",
"", remainder/WEEK_IN_SECONDS));
1063 return timeBehindText;
1069 return QString(QObject::tr(
"%1 B")).arg(bytes);
1070 if(bytes < 1024 * 1024)
1071 return QString(QObject::tr(
"%1 KB")).arg(bytes / 1024);
1072 if(bytes < 1024 * 1024 * 1024)
1073 return QString(QObject::tr(
"%1 MB")).arg(bytes / 1024 / 1024);
1075 return QString(QObject::tr(
"%1 GB")).arg(bytes / 1024 / 1024 / 1024);
1080 Q_EMIT clicked(event->pos());
1085 Q_EMIT clicked(event->pos());
1088 void concatenate(QPainter* painter, QString& catString,
int static_width,
int left_side,
int right_size)
1091 int start_name_length = catString.size();
1094 int dots_width = painter->fontMetrics().width(
"...");
1097 static_width += dots_width;
1100 while (catString.size() > 3) {
1102 int text_width = painter->fontMetrics().width(catString);
1105 if (left_side + text_width < right_size - static_width)
1109 catString = catString.left(catString.size() - 1);
1113 if (catString.size() != start_name_length)
1114 catString.append(
"...");
void SubstituteFonts(const QString &language)
void stretchColumnWidth(int column)
bool isDust(const QString &address, const CAmount &amount)
static QString format(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard, const int nAssetUnit=MIN_ASSET_UNITS - 1)
Format as string.
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
const char *const RAVEN_CONF_FILENAME
Utility functions used by the Raven Qt UI.
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get open filename, convenience wrapper for QFileDialog::getOpenFileName.
QList< QModelIndex > getEntryData(QAbstractItemView *view, int column)
Return a field of the currently selected entry as a QString.
void setupAmountWidget(QLineEdit *widget, QWidget *parent)
QGraphicsDropShadowEffect * getShadowEffect()
void concatenate(QPainter *painter, QString &catString, int static_width, int left_side, int right_size)
void setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode)
bool parseRavenURI(const QUrl &uri, SendCoinsRecipient *out)
void on_geometriesChanged()
int secondToLastColumnIndex
CTxDestination DecodeDestination(const std::string &str)
QString dateTimeStr(const QDateTime &date)
std::string EncodeBase58(const unsigned char *pbegin, const unsigned char *pend)
Why base-58 instead of standard base-64 encoding?
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)
Raven address widget validator, checks for a valid raven address.
bool GetStartOnSystemStartup()
ToolTipToRichTextFilter(int size_threshold, QObject *parent=0)
CChainParams defines various tweakable parameters of a given instance of the Raven system...
QString HtmlEscape(const QString &str, bool fMultiLine)
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
void connectViewHeadersSignals()
Line edit that can be marked as "invalid" to show input validation feedback.
int getAvailableWidthForColumn(int column)
static bool parse(int unit, const QString &value, CAmount *val_out)
Parse string to coin amount.
Base58 entry widget validator, checks for valid characters and removes some whitespace.
QFont getTopLabelFontBolded()
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
TableViewLastColumnResizingFixer(QTableView *table, int lastColMinimumWidth, int allColsMinimumWidth, QObject *parent)
Initializes all internal variables and prepares the the resize modes of the last 2 columns of the tab...
int64_t CAmount
Amount in corbies (Can be negative)
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
bool IsValidDestinationString(const std::string &str, const CChainParams ¶ms)
#define COLOR_SHADOW_LIGHT
bool isObscured(QWidget *w)
bool eventFilter(QObject *obj, QEvent *evt)
QString formatDurationStr(int secs)
void setClipboard(const QString &str)
An output of a transaction.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Raven scriptPubKey for the given CTxDestination.
QString formatPingTime(double dPingTime)
void on_sectionResized(int logicalIndex, int oldSize, int newSize)
void mouseReleaseEvent(QMouseEvent *event)
#define COLOR_SHADOW_DARK
void disconnectViewHeadersSignals()
int allColumnsMinimumWidth
QString formatRavenURI(const SendCoinsRecipient &info)
void mouseReleaseEvent(QMouseEvent *event)
fs::path qstringToBoostPath(const QString &path)
const CChainParams & Params()
Return the currently selected parameters.
fs::path GetConfigFile(const std::string &confPath)
Serialized script, used inside transaction inputs and outputs.
QString formatServicesStr(quint64 mask)
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 ...
void adjustTableColumnsWidth()
bool checkPoint(const QPoint &p, const QWidget *w)
std::string ChainNameFromCommandLine()
Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
void setCheckValidator(const QValidator *v)
static const std::string TESTNET
bool IsDust(const CTxOut &txout, const CFeeRate &dustRelayFeeIn)
QFont getTopLabelFont(int weight, int pxsize)
bool SetStartOnSystemStartup(bool fAutoStart)
const fs::path & GetDataDir(bool fNetSpecific)
QString formatNiceTimeOffset(qint64 secs)
QFont getSubLabelFontBolded()
void copyEntryData(QAbstractItemView *view, int column, int role)
Copy a field of the currently selected entry of a view to the clipboard.
QString boostPathToQString(const fs::path &path)
void resizeColumn(int nColumnIndex, int width)
const std::vector< unsigned char > & Base58Prefix(Base58Type type) const