Skip to content

Commit 085805f

Browse files
committed
Merge #398: Using a different configuration file name from QT
5be1e52 qml, refactoring: Separate guiconstants from QT (pablomartin4btc) Pull request description: At the moment both QT and QML gui apps are using the same naming convention for configuration files (`Bitcoin*.conf`), so separating `guiconstants.h` file from QT, copying it from `src/qt` to `src/qml` and updating `QAPP_APP_NAME_*` constants values will avoid them clashing with each other trying to persist/ read same or different settings (e.g. configuration file for QT on signet will be still named as `Bitcoin-Qt-signet.conf`, as of today, while QML will start using a separate file named `Bitcoin-Qml-signet.conf` - before this fix, currently sometimes a user can get a warning on reading incorrect settings or values: `QVariant::load: unknown user type with name BitcoinUnits::Unit.`). This could be a temporary fix (? - gui constants file contents has been cleaned up as [suggested](#398 (comment))) so instances from both QT and QML gui apps don't interfere between them during QML development. This change will be transparent for both QT gui app and users. <details> <summary>Sample of a separate QT config file on <code>signet</code> (<code>Bitcoin-Qt-signet.conf</code>).</summary> ``` [General] DisplayBitcoinUnit=@variant(\0\0\0\x7f\0\0\0\x13\x42itcoinUnits::Unit\0\0) MainWindowGeometry=@bytearray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x2\xa3\0\0\x1v\0\0\x5\xb0\0\0\x3^\0\0\x2\xa3\0\0\x1v\0\0\x5\xb0\0\0\x3^\0\0\0\0\0\0\0\0\a\x80\0\0\x2\xa3\0\0\x1v\0\0\x5\xb0\0\0\x3^) PeersTabBanlistHeaderState=@bytearray() PeersTabPeerHeaderState=@bytearray() RPCConsoleWindowGeometry=@bytearray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x2q\0\0\x1\x8f\0\0\x5T\0\0\x3<\0\0\x2q\0\0\x1\x8f\0\0\x5T\0\0\x3<\0\0\0\0\0\0\0\0\a\x80\0\0\x2q\0\0\x1\x8f\0\0\x5T\0\0\x3<) RPCConsoleWindowPeersTabSplitterSizes=@bytearray(\0\0\0\xff\0\0\0\x1\0\0\0\x2\xff\xff\xff\xff\xff\xff\xff\xff\0\xff\xff\xff\xff\x1\0\0\0\x1\0) SubFeeFromAmount=false enable_psbt_controls=false fCoinControlFeatures=false fHideTrayIcon=false fMinimizeOnClose=false fMinimizeToTray=false fRestartRequired=false nSettingsVersion=279900 strDataDir=/home/pablo/.bitcoin strThirdPartyTxUrls= ``` </details> <details> <summary>Sample of a separate QML config file on <code>signet</code> (<code>Bitcoin-Qml-signet.conf</code>).</summary> ``` [General] blockclocksize=0.4166666666666667 dark=true height=665 width=640 x=755 y=339 ``` </details> Top commit has no ACKs. Tree-SHA512: ce738a21488ac8fae9187fe6eec57e53ae77c18c91190c0ab199d63071fec830152a5f9d54132cc99d94b8c6f42224a6f8c0062bac06af82e5ca670a490e6596
2 parents b80e167 + 5be1e52 commit 085805f

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ BITCOIN_QT_H = \
123123
qml/models/peerlistsortproxy.h \
124124
qml/appmode.h \
125125
qml/bitcoin.h \
126+
qml/guiconstants.h \
126127
qml/imageprovider.h \
127128
qml/util.h \
128129
qt/addressbookpage.h \
@@ -140,7 +141,6 @@ BITCOIN_QT_H = \
140141
qt/createwalletdialog.h \
141142
qt/csvmodelwriter.h \
142143
qt/editaddressdialog.h \
143-
qt/guiconstants.h \
144144
qt/guiutil.h \
145145
qt/initexecutor.h \
146146
qt/intro.h \

src/qml/bitcoin.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <qml/models/peerlistsortproxy.h>
2828
#include <qml/imageprovider.h>
2929
#include <qml/util.h>
30-
#include <qt/guiconstants.h>
30+
#include <qml/guiconstants.h>
3131
#include <qt/guiutil.h>
3232
#include <qt/initexecutor.h>
3333
#include <qt/networkstyle.h>
@@ -75,7 +75,6 @@ void SetupUIArgs(ArgsManager& argsman)
7575
argsman.AddArg("-lang=<lang>", "Set language, for example \"de_DE\" (default: system locale)", ArgsManager::ALLOW_ANY, OptionsCategory::GUI);
7676
argsman.AddArg("-min", "Start minimized", ArgsManager::ALLOW_ANY, OptionsCategory::GUI);
7777
argsman.AddArg("-resetguisettings", "Reset all settings changed in the GUI", ArgsManager::ALLOW_ANY, OptionsCategory::GUI);
78-
argsman.AddArg("-splash", strprintf("Show splash screen on startup (default: %u)", DEFAULT_SPLASHSCREEN), ArgsManager::ALLOW_ANY, OptionsCategory::GUI);
7978
}
8079

8180
AppMode SetupAppMode()

src/qml/guiconstants.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright (c) 2011-2024 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
#ifndef BITCOIN_QML_GUICONSTANTS_H
6+
#define BITCOIN_QML_GUICONSTANTS_H
7+
8+
#define QAPP_ORG_NAME "BitcoinCore"
9+
#define QAPP_ORG_DOMAIN "bitcoincore.org"
10+
#define QAPP_APP_NAME_DEFAULT "BitcoinCore-App"
11+
#define QAPP_APP_NAME_TESTNET "BitcoinCore-App-testnet"
12+
#define QAPP_APP_NAME_SIGNET "BitcoinCore-App-signet"
13+
#define QAPP_APP_NAME_REGTEST "BitcoinCore-App-regtest"
14+
15+
#endif // BITCOIN_QML_GUICONSTANTS_H

0 commit comments

Comments
 (0)