*/
#include "bitcoingui.h"
#include "clientmodel.h"
-#include "util.h"
+#include "walletmodel.h"
+
+#include "headers.h"
#include "init.h"
-#include "main.h"
-#include "externui.h"
#include <QApplication>
#include <QMessageBox>
#include <QThread>
+#include <QLocale>
+#include <QTranslator>
// Need a global reference for the notifications to find the GUI
BitcoinGUI *guiref;
{
Q_INIT_RESOURCE(bitcoin);
QApplication app(argc, argv);
+
+ // Load language file for system locale
+ QString locale = QLocale::system().name();
+ QTranslator translator;
+ translator.load("bitcoin_"+locale);
+ app.installTranslator(&translator);
+
app.setQuitOnLastWindowClosed(false);
try
{
if(AppInit2(argc, argv))
{
- BitcoinGUI window;
- ClientModel model;
- guiref = &window;
- window.setModel(&model);
-
- window.show();
-
- int retval = app.exec();
-
- guiref = 0;
+ {
+ // Put this in a block, so that BitcoinGUI is cleaned up properly before
+ // calling shutdown.
+ BitcoinGUI window;
+ ClientModel clientModel(pwalletMain);
+ WalletModel walletModel(pwalletMain);
+ guiref = &window;
+ window.setClientModel(&clientModel);
+ window.setWalletModel(&walletModel);
+
+ window.show();
+
+ app.exec();
+
+ guiref = 0;
+ }
Shutdown(NULL);
-
- return retval;
}
else
{
} catch (...) {
PrintException(NULL, "Runaway exception");
}
+ return 0;
}