diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 74bc4ab27..9569af802 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -141,6 +141,7 @@ #define IMAGE_BLOGS ":/images/kblogger.png" #define IMAGE_DHT ":/images/dht16.png" +/*static*/ bool MainWindow::hiddenmode = false; /*static*/ MainWindow *MainWindow::_instance = NULL; @@ -182,6 +183,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags) RsPeerDetails pd; if (rsPeers->getPeerDetails(rsPeers->getOwnId(), pd)) { nameAndLocation = QString("%1 (%2)").arg(QString::fromUtf8(pd.name.c_str())).arg(QString::fromUtf8(pd.location.c_str())); + if(pd.netMode == RS_NETMODE_HIDDEN) + hiddenmode = true; } setWindowTitle(tr("RetroShare %1 a secure decentralized communication platform").arg(Rshare::retroshareVersion(true)) + " - " + nameAndLocation); @@ -242,13 +245,17 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags) statusBar()->addWidget(peerstatus); natstatus = new NATStatus(); - natstatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowNAT", QVariant(true)).toBool()); + if(hiddenmode) natstatus->setVisible(false); + else natstatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowNAT", QVariant(true)).toBool()); statusBar()->addWidget(natstatus); - + natstatus->getNATStatus(); + dhtstatus = new DHTStatus(); - dhtstatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowDHT", QVariant(true)).toBool()); + if(hiddenmode) dhtstatus->setVisible(false); + else dhtstatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowDHT", QVariant(true)).toBool()); statusBar()->addWidget(dhtstatus); - + dhtstatus->getDHTStatus(); + hashingstatus = new HashingStatus(); hashingstatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowHashing", QVariant(true)).toBool()); statusBar()->addPermanentWidget(hashingstatus, 1); @@ -703,11 +710,14 @@ void MainWindow::updateStatus() if (ratesstatus) ratesstatus->getRatesStatus(downKb, upKb); + if(!hiddenmode) + { if (natstatus) natstatus->getNATStatus(); if (dhtstatus) dhtstatus->getDHTStatus(); + } if (discstatus) { discstatus->update(); @@ -1577,10 +1587,13 @@ void MainWindow::setCompactStatusMode(bool compact) //statusComboBox: TODO Show only icon peerstatus->setCompactMode(compact); updateFriends(); + if(!hiddenmode) + { natstatus->setCompactMode(compact); natstatus->getNATStatus(); dhtstatus->setCompactMode(compact); dhtstatus->getDHTStatus(); + } hashingstatus->setCompactMode(compact); ratesstatus->setCompactMode(compact); //opModeStatus: TODO Show only ??? diff --git a/retroshare-gui/src/gui/MainWindow.h b/retroshare-gui/src/gui/MainWindow.h index 0297690ae..b3fc246dc 100644 --- a/retroshare-gui/src/gui/MainWindow.h +++ b/retroshare-gui/src/gui/MainWindow.h @@ -184,6 +184,8 @@ public: ToasterDisable *toasterDisableInstance(); SysTrayStatus *sysTrayStatusInstance(); + static bool hiddenmode; + public slots: void receiveNewArgs(QStringList args); void displayErrorMessage(int,int,const QString&) ; diff --git a/retroshare-gui/src/gui/settings/AppearancePage.cpp b/retroshare-gui/src/gui/settings/AppearancePage.cpp index e5e742c72..5ffa7e10a 100755 --- a/retroshare-gui/src/gui/settings/AppearancePage.cpp +++ b/retroshare-gui/src/gui/settings/AppearancePage.cpp @@ -301,8 +301,15 @@ void AppearancePage::load() whileBlocking(ui.checkBoxDisableSysTrayToolTip)->setChecked(Settings->valueFromGroup("StatusBar", "DisableSysTrayToolTip", QVariant(false)).toBool()); whileBlocking(ui.checkBoxShowStatusStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowStatus", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowPeerStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowPeer", QVariant(true)).toBool()); - whileBlocking(ui.checkBoxShowNATStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowNAT", QVariant(true)).toBool()); - whileBlocking(ui.checkBoxShowDHTStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowDHT", QVariant(true)).toBool()); + if(MainWindow::hiddenmode) { + whileBlocking(ui.checkBoxShowNATStatus)-> setChecked(0); + whileBlocking(ui.checkBoxShowDHTStatus)-> setChecked(0); + ui.checkBoxShowNATStatus->setVisible(false); + ui.checkBoxShowDHTStatus->setVisible(false); + } else { + whileBlocking(ui.checkBoxShowNATStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowNAT", QVariant(true)).toBool()); + whileBlocking(ui.checkBoxShowDHTStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowDHT", QVariant(true)).toBool()); + } whileBlocking(ui.checkBoxShowHashingStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowHashing", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowDiscStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowDisc", QVariant(true)).toBool()); whileBlocking(ui.checkBoxShowRateStatus)-> setChecked(Settings->valueFromGroup("StatusBar", "ShowRate", QVariant(true)).toBool()); diff --git a/retroshare-gui/src/gui/settings/ServerPage.cpp b/retroshare-gui/src/gui/settings/ServerPage.cpp index ae7411c4f..d9b1ff0de 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.cpp +++ b/retroshare-gui/src/gui/settings/ServerPage.cpp @@ -303,7 +303,8 @@ void ServerPage::load() if (mIsHiddenNode) { mHiddenType = detail.hiddenType; - ui.tabWidget->setTabEnabled(1,false) ; + ui.tabWidget->setTabEnabled(1,false) ; // ip filter + ui.tabWidget->setTabEnabled(3,false) ; // relay loadHiddenNode(); return; } @@ -1004,10 +1005,24 @@ void ServerPage::loadHiddenNode() ui.iconlabel_upnp->hide(); ui.label_nat->hide(); + ui.label_warningBandwidth->hide(); + ui.iconlabel_netLimited->hide(); + ui.textlabel_netLimited->hide(); + ui.iconlabel_ext->hide(); + ui.textlabel_ext->hide(); + ui.extPortLabel->hide(); + + ui.ipAddressLabel->hide(); + ui.cleanKnownIPs_PB->hide(); + + ui.ipAddressList->hide(); + ui.allowIpDeterminationCB->hide(); + ui.IPServersLV->hide(); + ui.textlabel_hiddenMode->show(); ui.iconlabel_hiddenMode->show() ; ui.iconlabel_hiddenMode->setPixmap(QPixmap(":/images/ledon1.png")); - + // CHANGE OPTIONS ON whileBlocking(ui.discComboBox)->removeItem(3); whileBlocking(ui.discComboBox)->removeItem(2); diff --git a/retroshare-gui/src/gui/settings/ServerPage.ui b/retroshare-gui/src/gui/settings/ServerPage.ui index 0adb576c6..6ff4723ab 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.ui +++ b/retroshare-gui/src/gui/settings/ServerPage.ui @@ -831,7 +831,7 @@ behind a firewall or a VPN. - <html><head/><body><p>Outgoing Connctions</p><p>Configure your Tor and I2P SOCKS proxy here. <br/>If you prefer to use BOB to automatically manage I2P check the other tab.</p></body></html> + <html><head/><body><p>Configure your Tor and I2P SOCKS proxy here. <br/>If you prefer to use BOB to automatically manage I2P check the other tab.</p></body></html> @@ -1475,7 +1475,7 @@ You can connect to Hidden Nodes, even if you are running a standard Node, so why - <html><head/><body><p>Incoming Connection</p><p>Setup your hidden address (and port if needed)</p></body></html> + <html><head/><body><p>Setup your hidden address (and port if needed)</p></body></html> diff --git a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp index d9c74bf45..d343f4d99 100644 --- a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp +++ b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp @@ -100,7 +100,6 @@ StatisticsWindow::StatisticsWindow(QWidget *parent) : initStackedPage(); connect(ui->stackPages, SIGNAL(currentChanged(int)), this, SLOT(setNewPage(int))); ui->stackPages->setCurrentIndex(0); - int toolSize = Settings->getToolButtonSize(); ui->toolBar->setToolButtonStyle(Settings->getToolButtonStyle()); ui->toolBar->setIconSize(QSize(toolSize,toolSize)); @@ -154,9 +153,19 @@ void StatisticsWindow::initStackedPage() ui->stackPages->add(rttdlg = new RttStatistics(ui->stackPages), action = createPageAction(QIcon(IMAGE_RTT), tr("RTT Statistics"), grp)); - ui->stackPages->add(dhtw = new DhtWindow(ui->stackPages), + bool showdht = true; + RsPeerDetails detail; + if (rsPeers->getPeerDetails(rsPeers->getOwnId(), detail)) + { + if(detail.netMode == RS_NETMODE_HIDDEN) + showdht = false; + } + if(showdht) + { + ui->stackPages->add(dhtw = new DhtWindow(ui->stackPages), action = createPageAction(QIcon(IMAGE_DHT), tr("DHT"), grp)); - + } + /*std::cerr << "Looking for interfaces in existing plugins:" << std::endl; for(int i = 0;inbPlugins();++i) {