Anoncoin  0.9.4
P2P Digital Currency
anoncoin.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2014 The Bitcoin developers
2 // Copyright (c) 2013-2014 The Anoncoin Core developers
3 // Distributed under the MIT/X11 software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #include <QApplication>
7 #include <QMessageBox>
8 #include <QFile>
9 #include <QDir>
10 #include <QTextStream>
11 
12 #include "anoncoingui.h"
13 // Anoncoin-config.h has been loaded...
14 
15 #include "clientmodel.h"
16 #include "guiconstants.h"
17 #include "guiutil.h"
18 #include "intro.h"
19 #include "optionsmodel.h"
20 #include "splashscreen.h"
21 #include "utilitydialog.h"
22 #include "winshutdownmonitor.h"
23 #ifdef ENABLE_WALLET
24 #include "paymentserver.h"
25 #include "walletmodel.h"
26 #endif
27 
28 #include "init.h"
29 #include "main.h"
30 #include "rpcserver.h"
31 #include "ui_interface.h"
32 #include "util.h"
33 #ifdef ENABLE_WALLET
34 #include "wallet.h"
35 #endif
36 
37 #include <stdint.h>
38 
39 #include <boost/filesystem/operations.hpp>
40 #include <QApplication>
41 #include <QLibraryInfo>
42 #include <QLocale>
43 #include <QMessageBox>
44 #include <QSettings>
45 #include <QTimer>
46 #include <QTranslator>
47 #include <QThread>
48 
49 #if defined(QT_STATICPLUGIN)
50 #include <QtPlugin>
51 #if QT_VERSION < 0x050000
52 Q_IMPORT_PLUGIN(qcncodecs)
53 Q_IMPORT_PLUGIN(qjpcodecs)
54 Q_IMPORT_PLUGIN(qtwcodecs)
55 Q_IMPORT_PLUGIN(qkrcodecs)
56 Q_IMPORT_PLUGIN(qtaccessiblewidgets)
57 #else
58 Q_IMPORT_PLUGIN(AccessibleFactory)
59 #if defined(QT_QPA_PLATFORM_XCB)
60 Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
61 #elif defined(QT_QPA_PLATFORM_WINDOWS)
62 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
63 #elif defined(QT_QPA_PLATFORM_COCOA)
64 Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
65 #endif
66 #endif
67 #endif
68 
69 #if QT_VERSION < 0x050000
70 #include <QTextCodec>
71 #endif
72 
73 // Declare meta types used for QMetaObject::invokeMethod
74 Q_DECLARE_METATYPE(bool*)
75 
76 static void InitMessage(const std::string &message)
77 {
78  LogPrintf("init message: %s\n", message);
79 }
80 
81 /*
82  Translate string to current locale using Qt.
83  */
84 static std::string Translate(const char* psz)
85 {
86  return QCoreApplication::translate("anoncoin-core", psz).toStdString();
87 }
88 
90 static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTranslator, QTranslator &translatorBase, QTranslator &translator)
91 {
92  QSettings settings;
93 
94  // Remove old translators
95  QApplication::removeTranslator(&qtTranslatorBase);
96  QApplication::removeTranslator(&qtTranslator);
97  QApplication::removeTranslator(&translatorBase);
98  QApplication::removeTranslator(&translator);
99 
100  // Get desired locale (e.g. "de_DE")
101  // 1) System default language
102  QString lang_territory = QLocale::system().name();
103  // 2) Language from QSettings
104  QString lang_territory_qsettings = settings.value("language", "").toString();
105  if(!lang_territory_qsettings.isEmpty())
106  lang_territory = lang_territory_qsettings;
107  // 3) -lang command line argument
108  lang_territory = QString::fromStdString(GetArg("-lang", lang_territory.toStdString()));
109 
110  // Convert to "de" only by truncating "_DE"
111  QString lang = lang_territory;
112  lang.truncate(lang_territory.lastIndexOf('_'));
113 
114  // Load language files for configured locale:
115  // - First load the translator for the base language, without territory
116  // - Then load the more specific locale translator
117 
118  // Load e.g. qt_de.qm
119  if (qtTranslatorBase.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
120  QApplication::installTranslator(&qtTranslatorBase);
121 
122  // Load e.g. qt_de_DE.qm
123  if (qtTranslator.load("qt_" + lang_territory, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
124  QApplication::installTranslator(&qtTranslator);
125 
126  // Load e.g. anoncoin_de.qm (shortcut "de" needs to be defined in anoncoin.qrc)
127  if (translatorBase.load(lang, ":/translations/"))
128  QApplication::installTranslator(&translatorBase);
129 
130  // Load e.g. anoncoin_de_DE.qm (shortcut "de_DE" needs to be defined in anoncoin.qrc)
131  if (translator.load(lang_territory, ":/translations/"))
132  QApplication::installTranslator(&translator);
133 }
134 
135 /* qDebug() message handler --> debug.log */
136 #if QT_VERSION < 0x050000
137 void DebugMessageHandler(QtMsgType type, const char *msg)
138 {
139  Q_UNUSED(type);
140  LogPrint("qt", "GUI: %s\n", msg);
141 }
142 #else
143 void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg)
144 {
145  Q_UNUSED(type);
146  Q_UNUSED(context);
147  LogPrint("qt", "GUI: %s\n", qPrintable(msg));
148 }
149 #endif
150 
154 class AnoncoinCoin: public QObject
155 {
156  Q_OBJECT
157 public:
158  explicit AnoncoinCoin();
159 
160 public slots:
161  void initialize();
162  void shutdown();
163 
164 signals:
165  void initializeResult(int retval);
166  void shutdownResult(int retval);
167  void runawayException(const QString &message);
168 
169 private:
170  boost::thread_group threadGroup;
171 
173  void handleRunawayException(std::exception *e);
174 };
175 
177 class AnoncoinApplication: public QApplication
178 {
179  Q_OBJECT
180 public:
181  explicit AnoncoinApplication(int &argc, char **argv);
183 
184 #ifdef ENABLE_WALLET
185  void createPaymentServer();
187 #endif
188  void createOptionsModel();
191  void createWindow(bool isaTestNet);
193  void createSplashScreen(bool isaTestNet);
194 
196  void requestInitialize();
198  void requestShutdown();
199 
201  int getReturnValue() { return returnValue; }
202 
204  WId getMainWinId() const;
205 
206 public slots:
207  void initializeResult(int retval);
208  void shutdownResult(int retval);
210  void handleRunawayException(const QString &message);
211 
212 signals:
213  void requestedInitialize();
214  void requestedShutdown();
215  void stopThread();
216  void splashFinished(QWidget *window);
217 
218 private:
219  QThread *coreThread;
224 #ifdef ENABLE_WALLET
225  PaymentServer* paymentServer;
226  WalletModel *walletModel;
227 #endif
229 
230  void startThread();
231 };
232 
233 #include "anoncoin.moc"
234 
236  QObject()
237 {
238 }
239 
241 {
242  PrintExceptionContinue(e, "Runaway exception");
243  emit runawayException(QString::fromStdString(strMiscWarning));
244 }
245 
247 {
248  try
249  {
250  LogPrintf("Running AppInit2 in thread\n");
251  int rv = AppInit2(threadGroup);
252  if(rv)
253  {
254  /* Start a dummy RPC thread if no RPC thread is active yet
255  * to handle timeouts.
256  */
258  }
259  emit initializeResult(rv);
260  } catch (std::exception& e) {
262  } catch (...) {
264  }
265 }
266 
268 {
269  try
270  {
271  LogPrintf("Running Shutdown in thread\n");
272  threadGroup.interrupt_all();
273  threadGroup.join_all();
274  Shutdown();
275  LogPrintf("Shutdown finished\n");
276  emit shutdownResult(1);
277  } catch (std::exception& e) {
279  } catch (...) {
281  }
282 }
283 
285  QApplication(argc, argv),
286  coreThread(0),
287  optionsModel(0),
288  clientModel(0),
289  window(0),
290  pollShutdownTimer(0),
291 #ifdef ENABLE_WALLET
292  paymentServer(0),
293  walletModel(0),
294 #endif
295  returnValue(0)
296 {
297  setQuitOnLastWindowClosed(false);
298  startThread();
299 }
300 
302 {
303  LogPrintf("Stopping thread\n");
304  emit stopThread();
305  coreThread->wait();
306  LogPrintf("Stopped thread\n");
307 
308  delete window;
309  window = 0;
310 #ifdef ENABLE_WALLET
311  delete paymentServer;
312  paymentServer = 0;
313 #endif
314  delete optionsModel;
315  optionsModel = 0;
316 }
317 
318 #ifdef ENABLE_WALLET
319 void AnoncoinApplication::createPaymentServer()
320 {
321  paymentServer = new PaymentServer(this);
322 }
323 #endif
324 
326 {
327  optionsModel = new OptionsModel();
328 }
329 
331 {
332  window = new AnoncoinGUI(isaTestNet, 0);
333 
334  pollShutdownTimer = new QTimer(window);
335  connect(pollShutdownTimer, SIGNAL(timeout()), window, SLOT(detectShutdown()));
336  pollShutdownTimer->start(200);
337 }
338 
340 {
341  SplashScreen *splash = new SplashScreen(QPixmap(), 0, isaTestNet);
342  splash->setAttribute(Qt::WA_DeleteOnClose);
343  splash->show();
344  connect(this, SIGNAL(splashFinished(QWidget*)), splash, SLOT(slotFinish(QWidget*)));
345 }
346 
348 {
349  coreThread = new QThread(this);
350  AnoncoinCoin *executor = new AnoncoinCoin();
351  executor->moveToThread(coreThread);
352 
353  /* communication to and from thread */
354  connect(executor, SIGNAL(initializeResult(int)), this, SLOT(initializeResult(int)));
355  connect(executor, SIGNAL(shutdownResult(int)), this, SLOT(shutdownResult(int)));
356  connect(executor, SIGNAL(runawayException(QString)), this, SLOT(handleRunawayException(QString)));
357  connect(this, SIGNAL(requestedInitialize()), executor, SLOT(initialize()));
358  connect(this, SIGNAL(requestedShutdown()), executor, SLOT(shutdown()));
359  /* make sure executor object is deleted in its own thread */
360  connect(this, SIGNAL(stopThread()), executor, SLOT(deleteLater()));
361  connect(this, SIGNAL(stopThread()), coreThread, SLOT(quit()));
362 
363  coreThread->start();
364 }
365 
367 {
368  LogPrintf("Requesting initialize\n");
369  emit requestedInitialize();
370 }
371 
373 {
374  LogPrintf("Requesting shutdown\n");
375  window->hide();
377  pollShutdownTimer->stop();
378 
379 #ifdef ENABLE_WALLET
380  window->removeAllWallets();
381  delete walletModel;
382  walletModel = 0;
383 #endif
384  delete clientModel;
385  clientModel = 0;
386 
387  // Show a simple window indicating shutdown status
389 
390  // Request shutdown from core thread
391  emit requestedShutdown();
392 }
393 
395 {
396  LogPrintf("Initialization result: %i\n", retval);
397  // Set exit result: 0 if successful, 1 if failure
398  returnValue = retval ? 0 : 1;
399  if(retval)
400  {
401 #ifdef ENABLE_WALLET
403  paymentServer->setOptionsModel(optionsModel);
404 #endif
405 
406  emit splashFinished(window);
407 
410 
411 #ifdef ENABLE_WALLET
412  if(pwalletMain)
413  {
414  walletModel = new WalletModel(pwalletMain, optionsModel);
415 
416  window->addWallet("~Default", walletModel);
417  window->setCurrentWallet("~Default");
418 
419  connect(walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)),
420  paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray)));
421  }
422 #endif
423 
424  // If -min option passed, start window minimized.
425  if(GetBoolArg("-min", false))
426  {
427  window->showMinimized();
428  }
429  else
430  {
431  window->show();
432  }
433 #ifdef ENABLE_WALLET
434  // Now that initialization/startup is done, process any command-line
435  // anoncoin: URIs or payment requests:
436  connect(paymentServer, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)),
437  window, SLOT(handlePaymentRequest(SendCoinsRecipient)));
438  connect(window, SIGNAL(receivedURI(QString)),
439  paymentServer, SLOT(handleURIOrFile(QString)));
440  connect(paymentServer, SIGNAL(message(QString,QString,unsigned int)),
441  window, SLOT(message(QString,QString,unsigned int)));
442  QTimer::singleShot(100, paymentServer, SLOT(uiReady()));
443 #endif
444  } else {
445  quit(); // Exit main loop
446  }
447 }
448 
450 {
451  LogPrintf("Shutdown result: %i\n", retval);
452  quit(); // Exit main loop after shutdown finished
453 }
454 
456 {
457  QMessageBox::critical(0, "Runaway exception", AnoncoinGUI::tr("A fatal error occurred. Anoncoin can no longer continue safely and will quit.") + QString("\n\n") + message);
458  ::exit(1);
459 }
460 
462 {
463  if (!window)
464  return 0;
465 
466  return window->winId();
467 }
468 
469 #ifndef ANONCOIN_QT_TEST
470 int main(int argc, char *argv[])
471 {
473 
475  // Command-line options take precedence:
476  ParseParameters(argc, argv);
477 
478  // Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory
479 
481 #if QT_VERSION < 0x050000
482  // Internal string conversion is all UTF-8
483  QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
484  QTextCodec::setCodecForCStrings(QTextCodec::codecForTr());
485 #endif
486 
487  Q_INIT_RESOURCE(anoncoin);
488 
490 
491  AnoncoinApplication app(argc, argv);
492 #if QT_VERSION > 0x050100
493  // Generate high-dpi pixmaps
494  QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
495 #endif
496 #ifdef Q_OS_MAC
497  QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
498 #endif
499 
500  // Register meta types used for QMetaObject::invokeMethod
501  qRegisterMetaType< bool* >();
502 
504  // must be set before OptionsModel is initialized or translations are loaded,
505  // as it is used to locate QSettings
506  QApplication::setOrganizationName(QAPP_ORG_NAME);
507  QApplication::setOrganizationDomain(QAPP_ORG_DOMAIN);
508  QApplication::setApplicationName(QAPP_APP_NAME_DEFAULT);
509 
511  // Now that QSettings are accessible, initialize translations
512  QTranslator qtTranslatorBase, qtTranslator, translatorBase, translator;
513  initTranslations(qtTranslatorBase, qtTranslator, translatorBase, translator);
514  uiInterface.Translate.connect(Translate);
515 
516  // Show help message immediately after parsing command-line options (for "-lang") and setting locale,
517  // but before showing splash screen.
518  if (mapArgs.count("-?") || mapArgs.count("--help"))
519  {
520  HelpMessageDialog help(NULL);
521  help.showOrPrint();
522  return 1;
523  }
524 
526  // User language is set up: pick a data directory
528 
531  if (!boost::filesystem::is_directory(GetDataDir(false)))
532  {
533  QMessageBox::critical(0, QObject::tr("Anoncoin"),
534  QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"])));
535  return 1;
536  }
537 
538  // The Custom Anoncoin startup wizard....
539  if (!boost::filesystem::exists(GetConfigFile().string()))
540  {
541  // ToDo: Not linked in yet
542  // Run wizard
543  // runFirstRunWizard();
544  }
545  // Read config after it's potentional written by the wizard.
546  try {
548  } catch(std::exception &e) {
549  QMessageBox::critical(0, QObject::tr("Anoncoin"),
550  QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what()));
551  return false;
552  }
553 
555  // - Do not call Params() before this step
556  // - Do this after parsing the configuration file, as the network can be switched there
557  // - QSettings() will use the new application name after this, resulting in network-specific settings
558  // - Needs to be done before createOptionsModel
559 
560 
561 
562  // With this you can load a Qt Stylesheet file into the GUI to colorize or customize different objects.
563  // By Meeh & GroundRod edits to integrate into v0.9 code as default behavior to load <pathtodatadir>anoncoin.qss
564  // ToDo: Work in progress...
565  QString filename = GUIUtil::boostPathToQString( GetQtStyleFile());
566  QFile file(filename);
567  if( file.exists() ) { // Check if the file exists
568  if ( file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
569  QTextStream in(&file);
570  QString content = "";
571  while (!in.atEnd())
572  content.append(in.readLine());
573  app.setStyleSheet(content); // Load the Stylesheet, not sure what conditions cause an error here, or how it's reported.
574  } else // ...Unlikely the file couldn't be opened, this should never happen
575  QMessageBox::warning( NULL, AnoncoinGUI::tr("Failed to open stylesheet file."),
576  filename.toLocal8Bit().data(),
577  QMessageBox::Ok, QMessageBox::Ok );
578  } else if( mapArgs.count("-style") ) // ...unless the user specifically requested a given file, and it doesn't exist. That would be odd.
579  QMessageBox::warning( NULL, AnoncoinGUI::tr("Failed to find stylesheet file."),
580  filename.toLocal8Bit().data(),
581  QMessageBox::Ok, QMessageBox::Ok );
582  // else don't worry about stylesheets, proceed without error...
583 
584  app.processEvents();
585  app.setQuitOnLastWindowClosed(false);
586 
587  // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause)
589  QMessageBox::critical(0, QObject::tr("Anoncoin"), QObject::tr("Error: Invalid combination of -regtest and -testnet."));
590  return 1;
591  }
592 #ifdef ENABLE_WALLET
593  // Parse URIs on command line -- this can affect Params()
594  if (!PaymentServer::ipcParseCommandLine(argc, argv))
595  exit(0);
596 #endif
597  bool isaTestNet = Params().NetworkID() != CChainParams::MAIN;
598  // Allow for separate UI settings for testnets
599  if (isaTestNet)
600  QApplication::setApplicationName(QAPP_APP_NAME_TESTNET);
601  else
602  QApplication::setApplicationName(QAPP_APP_NAME_DEFAULT);
603  // Re-initialize translations after changing application name (language in network-specific settings can be different)
604  initTranslations(qtTranslatorBase, qtTranslator, translatorBase, translator);
605 
606 #ifdef ENABLE_WALLET
607  // - Do this early as we don't want to bother initializing if we are just calling IPC
609  // - Do this *after* setting up the data directory, as the data directory hash is used in the name
610  // of the server.
611  // - Do this after creating app and setting up translations, so errors are
612  // translated properly.
614  exit(0);
615 
616  // Start up the payment server early, too, so impatient users that click on
617  // anoncoin: links repeatedly have their payment requests routed to this process:
618  app.createPaymentServer();
619 #endif
620 
622  // Install global event filter that makes sure that long tooltips can be word-wrapped
623  app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app));
624 #if QT_VERSION < 0x050000
625  // Install qDebug() message handler to route to debug.log
626  qInstallMsgHandler(DebugMessageHandler);
627 #else
628 #if defined(Q_OS_WIN)
629  // Install global event filter for processing Windows session related Windows messages (WM_QUERYENDSESSION and WM_ENDSESSION)
630  qApp->installNativeEventFilter(new WinShutdownMonitor());
631 #endif
632  // Install qDebug() message handler to route to debug.log
633  qInstallMessageHandler(DebugMessageHandler);
634 #endif
635  // Load GUI settings from QSettings
636  app.createOptionsModel();
637 
638  // Subscribe to global signals from core
639  uiInterface.InitMessage.connect(InitMessage);
640 
641  if (GetBoolArg("-splash", true) && !GetBoolArg("-min", false))
642  app.createSplashScreen(isaTestNet);
643 
644  try
645  {
646  app.createWindow(isaTestNet);
647  app.requestInitialize();
648 #if defined(Q_OS_WIN) && QT_VERSION >= 0x050000
649  WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("Anoncoin Core didn't yet exit safely..."), (HWND)app.getMainWinId());
650 #endif
651  app.exec();
652  app.requestShutdown();
653  app.exec();
654  } catch (std::exception& e) {
655  PrintExceptionContinue(&e, "Runaway exception");
656  app.handleRunawayException(QString::fromStdString(strMiscWarning));
657  } catch (...) {
658  PrintExceptionContinue(NULL, "Runaway exception");
659  app.handleRunawayException(QString::fromStdString(strMiscWarning));
660  }
661  return app.getReturnValue();
662 }
663 #endif // ANONCOIN_QT_TEST
const boost::filesystem::path & GetDataDir(bool fNetSpecific)
Definition: util.cpp:968
CClientUIInterface uiInterface
Definition: util.cpp:100
void handleRunawayException(const QString &message)
Handle runaway exceptions. Shows a message box with the problem and quits the program.
Definition: anoncoin.cpp:455
void handleRunawayException(std::exception *e)
Pass fatal exception message to UI thread.
Definition: anoncoin.cpp:240
Value help(const Array &params, bool fHelp)
Definition: rpcserver.cpp:190
QTimer * pollShutdownTimer
Definition: anoncoin.cpp:223
void shutdown()
Definition: anoncoin.cpp:267
string strMiscWarning
Definition: util.cpp:96
class for the splashscreen with information of the running client
Definition: splashscreen.h:13
void initializeResult(int retval)
OptionsModel * optionsModel
Definition: anoncoin.cpp:220
void DebugMessageHandler(QtMsgType type, const char *msg)
Definition: anoncoin.cpp:137
int getReturnValue()
Get process return value.
Definition: anoncoin.cpp:201
void runawayException(const QString &message)
Anoncoin GUI main class.
Definition: anoncoingui.h:47
static void showShutdownWindow(AnoncoinGUI *window)
"Shutdown" window
bool SelectParamsFromCommandLine()
Looks for -regtest or -testnet and then calls SelectParams as appropriate.
boost::thread_group threadGroup
Definition: anoncoin.cpp:170
AnoncoinGUI * window
Definition: anoncoin.cpp:222
void createWindow(bool isaTestNet)
Create main window.
Definition: anoncoin.cpp:330
static bool ipcParseCommandLine(int argc, char *argv[])
void initialize()
Definition: anoncoin.cpp:246
static bool ipcSendCommandLine()
void SubstituteFonts()
Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text repre...
Definition: guiutil.cpp:388
#define QAPP_ORG_NAME
Definition: guiconstants.h:51
bool GetBoolArg(const std::string &strArg, bool fDefault)
Return boolean argument or default value.
Definition: util.cpp:520
#define LogPrintf(...)
Definition: util.h:118
boost::signals2::signal< std::string(const char *psz)> Translate
Translate a message to the native language of the user.
Definition: ui_interface.h:87
WId getMainWinId() const
Get window identifier of QMainWindow (AnoncoinGUI)
Definition: anoncoin.cpp:461
void createOptionsModel()
Create options model.
Definition: anoncoin.cpp:325
bool AppInit2(boost::thread_group &threadGroup)
Initialize anoncoin.
Definition: init.cpp:420
void Shutdown()
Definition: init.cpp:114
AnoncoinApplication(int &argc, char **argv)
Definition: anoncoin.cpp:284
void PrintExceptionContinue(std::exception *pex, const char *pszThread)
Definition: util.cpp:928
Main Anoncoin application object.
Definition: anoncoin.cpp:177
void ParseParameters(int argc, const char *const argv[])
Definition: util.cpp:460
Model for Anoncoin network client.
Definition: clientmodel.h:45
void createSplashScreen(bool isaTestNet)
Create splash screen.
Definition: anoncoin.cpp:339
boost::filesystem::path GetQtStyleFile()
Definition: util.cpp:1014
void shutdownResult(int retval)
Definition: anoncoin.cpp:449
ClientModel * clientModel
Definition: anoncoin.cpp:221
#define QAPP_APP_NAME_DEFAULT
Definition: guiconstants.h:53
void initializeResult(int retval)
Definition: anoncoin.cpp:394
void ReadConfigFile(map< string, string > &mapSettingsRet, map< string, vector< string > > &mapMultiSettingsRet)
Definition: util.cpp:1021
void splashFinished(QWidget *window)
Interface from Qt to configuration data structure for Anoncoin client.
Definition: optionsmodel.h:27
#define QAPP_ORG_DOMAIN
Definition: guiconstants.h:52
const CChainParams & Params()
Return the currently selected parameters.
Interface to Anoncoin wallet from Qt view code.
Definition: walletmodel.h:97
void setClientModel(ClientModel *clientModel)
Set the client model.
static void pickDataDirectory()
Determine data directory.
Definition: intro.cpp:153
#define QAPP_APP_NAME_TESTNET
Definition: guiconstants.h:54
Class encapsulating Anoncoin Core startup and shutdown.
Definition: anoncoin.cpp:154
void requestShutdown()
Request core shutdown.
Definition: anoncoin.cpp:372
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:101
void shutdownResult(int retval)
"Help message" dialog box
Definition: utilitydialog.h:39
std::string GetArg(const std::string &strArg, const std::string &strDefault)
Return string argument or default value.
Definition: util.cpp:506
QThread * coreThread
Definition: anoncoin.cpp:219
QString boostPathToQString(const boost::filesystem::path &path)
Definition: guiutil.cpp:784
#define ENABLE_WALLET
void SetupEnvironment()
Definition: util.cpp:1394
static void LoadRootCAs(X509_STORE *store=NULL)
map< string, vector< string > > mapMultiArgs
Definition: util.cpp:90
int main(int argc, char *argv[])
Definition: anoncoin.cpp:470
virtual Network NetworkID() const =0
boost::signals2::signal< void(const std::string &message)> InitMessage
Progress message during initialization.
Definition: ui_interface.h:84
CWallet * pwalletMain
map< string, string > mapArgs
Definition: util.cpp:89
void requestInitialize()
Request core initialization.
Definition: anoncoin.cpp:366
boost::filesystem::path GetConfigFile()
Definition: util.cpp:1007
void StartDummyRPCThread()
Definition: rpcserver.cpp:631