Skip to content

Commit 940c669

Browse files
alexeyneualex v
authored andcommitted
default config #407 (#504)
1 parent d4b23bf commit 940c669

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

src/qt/intro.cpp

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ void Intro::pickDataDirectory()
202202
boost::filesystem::detail::copy_file(GUIUtil::qstringToBoostPath(oldWallet),GUIUtil::qstringToBoostPath(dataDir + QDir::separator() + "wallet.dat"),boost::filesystem::detail::none);
203203
SoftSetArg("-zapwallettxes","2");
204204
}
205+
makeDefaultConfF();
206+
205207
WriteConfigFile("addanonserver", "95.183.52.55:3000");
206208
WriteConfigFile("addanonserver", "95.183.52.28:3000");
207209
WriteConfigFile("addanonserver", "95.183.52.29:3000");
@@ -226,6 +228,64 @@ void Intro::pickDataDirectory()
226228
SoftSetArg("-datadir", GUIUtil::qstringToBoostPath(dataDir).string()); // use OS locale for path setting
227229
}
228230

231+
void Intro::makeDefaultConfF()
232+
{
233+
boost::filesystem::ifstream streamConfig(GetConfigFile());
234+
235+
if (streamConfig.good() == false)
236+
{
237+
char t[] = R"(##
238+
## navcoin.conf configuration file. Lines beginning with # are comments.
239+
##
240+
241+
# Network-related settings:
242+
243+
# Run on the test network instead of the real navcoin network.
244+
#testnet=0
245+
246+
# Run a regression test network
247+
#regtest=0
248+
249+
#
250+
# JSON-RPC options (for controlling a running NavCoin/navcoind process)
251+
#
252+
253+
# server=1 tells NavCoin-Qt and navcoind to accept JSON-RPC commands
254+
#server=0
255+
256+
# You must set rpcuser and rpcpassword to secure the JSON-RPC api
257+
#rpcuser=Ulysseys
258+
#rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593
259+
260+
# By default, only RPC connections from localhost are allowed.
261+
262+
# server=1 tells NavCoin-Qt to accept JSON-RPC commands.
263+
# it is also read by navcoind to determine if RPC should be enabled
264+
265+
# Listen for RPC connections on this TCP port:
266+
# it's default port . turns on by below line.
267+
#rpcport=44446
268+
269+
# Transaction Fee Changes in 0.10.0
270+
271+
# Create transactions that have enough fees (or priority) so they are likely to begin confirmation within n blocks (default: 1).
272+
# This setting is over-ridden by the -paytxfee option.
273+
#txconfirmtarget=n
274+
275+
# User interface options
276+
277+
# Start NavCoin minimized
278+
#min=1
279+
280+
# Minimize to the system tray
281+
#minimizetotray=1)";
282+
283+
boost::filesystem::ofstream outStream(GetConfigFile(), std::ios_base::app);
284+
outStream << t ;
285+
outStream.close();
286+
}
287+
}
288+
229289
void Intro::setStatus(int status, const QString &message, quint64 bytesAvailable)
230290
{
231291
switch(status)

src/qt/intro.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class Intro : public QDialog
4444
* Determine default data directory for operating system.
4545
*/
4646
static QString getDefaultDataDirectory();
47+
static void makeDefaultConfF();
4748

4849
Q_SIGNALS:
4950
void requestCheck();

0 commit comments

Comments
 (0)