parent
1eefcaf70d
commit
30b3e39d3d
3 changed files with 1 additions and 52 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -61,7 +61,6 @@ Release
|
|||
# Autogenerated Qt artifacts
|
||||
packaging
|
||||
qrc_resources.cpp
|
||||
qt_system
|
||||
resources.qrc.depends
|
||||
|
||||
# Autogenerated Flatbuffers source files
|
||||
|
|
|
@ -38,8 +38,7 @@ add_custom_target(
|
|||
'${PROJECT_SOURCE_DIR}/nano/nano_rpc/*'
|
||||
'${PROJECT_SOURCE_DIR}/nano/rpc_test/*'
|
||||
'${PROJECT_SOURCE_DIR}/nano/qt_test/*' '${PROJECT_SOURCE_DIR}/nano/qt/*'
|
||||
'${PROJECT_SOURCE_DIR}/nano/test_common/*'
|
||||
'${PROJECT_SOURCE_DIR}/nano/qt_system/*' --output-file
|
||||
'${PROJECT_SOURCE_DIR}/nano/test_common/*' --output-file
|
||||
${PROJECT_SOURCE_DIR}/coverage/lcov.info -q
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
DEPENDS coverage_tests)
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
#include <nano/crypto_lib/random_pool.hpp>
|
||||
#include <nano/lib/config.hpp>
|
||||
#include <nano/lib/threading.hpp>
|
||||
#include <nano/node/common.hpp>
|
||||
#include <nano/qt/qt.hpp>
|
||||
#include <nano/test_common/system.hpp>
|
||||
|
||||
#include <boost/format.hpp>
|
||||
|
||||
#include <thread>
|
||||
int main (int argc, char ** argv)
|
||||
{
|
||||
nano::force_nano_dev_network ();
|
||||
nano::node_singleton_memory_pool_purge_guard memory_pool_cleanup_guard;
|
||||
QApplication application (argc, argv);
|
||||
QCoreApplication::setOrganizationName ("Nano");
|
||||
QCoreApplication::setOrganizationDomain ("nano.org");
|
||||
QCoreApplication::setApplicationName ("Nano Wallet");
|
||||
nano_qt::eventloop_processor processor;
|
||||
const uint16_t count (16);
|
||||
nano::system system (count);
|
||||
nano::thread_runner runner (system.io_ctx, system.nodes[0]->config.io_threads);
|
||||
std::unique_ptr<QTabWidget> client_tabs (new QTabWidget);
|
||||
std::vector<std::unique_ptr<nano_qt::wallet>> guis;
|
||||
for (auto i (0); i < count; ++i)
|
||||
{
|
||||
auto wallet (system.nodes[i]->wallets.create (nano::random_wallet_id ()));
|
||||
nano::keypair key;
|
||||
wallet->insert_adhoc (key.prv);
|
||||
guis.push_back (std::make_unique<nano_qt::wallet> (application, processor, *system.nodes[i], wallet, key.pub));
|
||||
client_tabs->addTab (guis.back ()->client_window, boost::str (boost::format ("Wallet %1%") % i).c_str ());
|
||||
}
|
||||
client_tabs->show ();
|
||||
QObject::connect (&application, &QApplication::aboutToQuit, [&] () {
|
||||
system.stop ();
|
||||
});
|
||||
int result;
|
||||
try
|
||||
{
|
||||
result = application.exec ();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
result = -1;
|
||||
debug_assert (false);
|
||||
}
|
||||
runner.join ();
|
||||
return result;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue