diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 242e458..8a65ca9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -122,6 +122,17 @@ MainWindow::MainWindow(QWidget *parent) : // Initialize to the balances tab ui->tabWidget->setCurrentIndex(0); + if (AppDataServer::getInstance()->isAppConnected()) { + auto ads = AppDataServer::getInstance(); + + QString wormholecode = ""; + if (ads->getAllowInternetConnection()) + wormholecode = ads->getWormholeCode(ads->getSecretHex()); + + qDebug() << "MainWindow: createWebsocket with wormholecode=" << wormholecode; + createWebsocket(wormholecode); + } + setupSendTab(); setupTransactionsTab(); setupReceiveTab(); @@ -135,16 +146,6 @@ MainWindow::MainWindow(QWidget *parent) : restoreSavedStates(); - if (AppDataServer::getInstance()->isAppConnected()) { - auto ads = AppDataServer::getInstance(); - - QString wormholecode = ""; - if (ads->getAllowInternetConnection()) - wormholecode = ads->getWormholeCode(ads->getSecretHex()); - - qDebug() << "MainWindow: createWebsocket with wormholecode=" << wormholecode; - createWebsocket(wormholecode); - } } // Send button clicked diff --git a/src/mainwindow.h b/src/mainwindow.h index 98c640e..a29ee74 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -35,9 +35,15 @@ class HushContact { public: - QString name(); - void setName(); + void setName(QString newname) { name = newname; } + QString getName() { return name; } private: + QString name; + QString nickname; + QString zaddr; + QString myZaddr; + int64_t lastSentTime; + int64_t lastReceivedTime; }; @@ -94,6 +100,8 @@ public: Logger* logger; void doClose(); + HushChat getHushChat() { return hushChat; } + void setHushChat(HushChat chat) { hushChat = chat; } private: void closeEvent(QCloseEvent* event); @@ -162,7 +170,7 @@ private: WSServer* wsserver = nullptr; WormholeClient* wormhole = nullptr; - HushContact currentContact; + HushChat hushChat; RPC* rpc = nullptr; QCompleter* labelCompleter = nullptr;