Skip to content

Commit

Permalink
Merge 15587b4 into merged_master (Bitcoin PR bitcoin-core/gui#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
delta1 committed May 10, 2023
2 parents e9f3944 + 15587b4 commit 7aeb30e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@

#include <QApplication>
#include <QDebug>
#include <QFontDatabase>
#include <QLatin1String>
#include <QLibraryInfo>
#include <QLocale>
Expand Down Expand Up @@ -469,7 +468,7 @@ int GuiMain(int argc, char* argv[])
#endif

BitcoinApplication app;
QFontDatabase::addApplicationFont(":/fonts/monospace");
GUIUtil::LoadFont(QStringLiteral(":/fonts/monospace"));

/// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these
// Command-line options take precedence:
Expand Down
6 changes: 6 additions & 0 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,12 @@ bool hasEntryData(const QAbstractItemView *view, int column, int role)
return !selection.at(0).data(role).toString().isEmpty();
}

void LoadFont(const QString& file_name)
{
const int id = QFontDatabase::addApplicationFont(file_name);
assert(id != -1);
}

QString getDefaultDataDirectory()
{
return boostPathToQString(GetDefaultDataDir());
Expand Down
5 changes: 5 additions & 0 deletions src/qt/guiutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ namespace GUIUtil

void setClipboard(const QString& str);

/**
* Loads the font from the file specified by file_name, aborts if it fails.
*/
void LoadFont(const QString& file_name);

/**
* Determine default data directory for operating system.
*/
Expand Down

0 comments on commit 7aeb30e

Please sign in to comment.