diff --git a/ZeroTierUI/ZeroTierUI.pro b/ZeroTierUI/ZeroTierUI.pro index 6cf342b71..355b06155 100644 --- a/ZeroTierUI/ZeroTierUI.pro +++ b/ZeroTierUI/ZeroTierUI.pro @@ -36,19 +36,18 @@ SOURCES += main.cpp \ ../node/PacketDecoder.cpp \ ../node/Peer.cpp \ ../node/Poly1305.cpp \ + ../node/RoutingTable.cpp \ ../node/Salsa20.cpp \ ../node/Service.cpp \ ../node/SHA512.cpp \ ../node/SocketManager.cpp \ ../node/SoftwareUpdater.cpp \ ../node/Switch.cpp \ - ../node/SysEnv.cpp \ ../node/TcpSocket.cpp \ ../node/Topology.cpp \ ../node/UdpSocket.cpp \ ../node/Utils.cpp \ ../ext/lz4/lz4.c \ - ../ext/lz4/lz4hc.c \ ../node/Dictionary.cpp HEADERS += mainwindow.h \ @@ -99,20 +98,16 @@ HEADERS += mainwindow.h \ ../node/SocketManager.hpp \ ../node/SoftwareUpdater.hpp \ ../node/Switch.hpp \ - ../node/SysEnv.hpp \ + ../node/RoutingTable.hpp \ ../node/TcpSocket.hpp \ ../node/Thread.hpp \ ../node/Topology.hpp \ ../node/UdpSocket.hpp \ ../node/Utils.hpp \ ../ext/lz4/lz4.h \ - ../ext/lz4/lz4hc.h \ ../node/EthernetTap.hpp \ ../node/EthernetTapFactory.hpp -win32:SOURCES += ../node/WindowsEthernetTap.cpp -mac:SOURCES += ../node/UnixEthernetTap.cpp - FORMS += mainwindow.ui \ aboutwindow.ui \ networkwidget.ui \ diff --git a/ZeroTierUI/mainwindow.cpp b/ZeroTierUI/mainwindow.cpp index 9a38bec50..46b5e9e04 100644 --- a/ZeroTierUI/mainwindow.cpp +++ b/ZeroTierUI/mainwindow.cpp @@ -216,8 +216,9 @@ void MainWindow::timerEvent(QTimerEvent *event) // event can be null since code } if (++this->cyclesSinceResponseFromService >= 3) { - if (this->cyclesSinceResponseFromService == 3) + if (this->cyclesSinceResponseFromService == 3) { QMessageBox::warning(this,"Service Not Running","Can't connect to the ZeroTier One service. Is it running?",QMessageBox::Ok); + } ui->noNetworksLabel->setVisible(true); ui->noNetworksLabel->setText("Connecting to Service..."); ui->bottomContainerWidget->setVisible(false); @@ -255,8 +256,8 @@ void MainWindow::customEvent(QEvent *event) std::map< std::string,std::vector > newNetworks; for(unsigned long i=1;iztMessage.size();++i) { std::vector l(ZeroTier::Node::NodeControlClient::splitLine(m->ztMessage[i])); - // 200 listnetworks - if ((l.size() == 9)&&(l[2].length() == 16)) + // 200 listnetworks + if ((l.size() == 10)&&(l[2].length() == 16)) newNetworks[l[2]] = l; } @@ -283,10 +284,11 @@ void MainWindow::customEvent(QEvent *event) alreadyDisplayed.insert(nw->networkId()); std::vector &l = networks[nw->networkId()]; nw->setNetworkName(l[3]); - nw->setStatus(l[4],l[5]); - nw->setNetworkType(l[6]); - nw->setNetworkDeviceName(l[7]); - nw->setIps(l[8]); + nw->setMAC(l[4]); + nw->setStatus(l[5],l[6]); + nw->setNetworkType(l[7]); + nw->setNetworkDeviceName(l[8]); + nw->setIps(l[9]); } } for(std::map< std::string,std::vector >::iterator nwdata(networks.begin());nwdata!=networks.end();++nwdata) { @@ -294,10 +296,11 @@ void MainWindow::customEvent(QEvent *event) std::vector &l = nwdata->second; NetworkWidget *nw = new NetworkWidget((QWidget *)0,nwdata->first); nw->setNetworkName(l[3]); - nw->setStatus(l[4],l[5]); - nw->setNetworkType(l[6]); - nw->setNetworkDeviceName(l[7]); - nw->setIps(l[8]); + nw->setMAC(l[4]); + nw->setStatus(l[5],l[6]); + nw->setNetworkType(l[7]); + nw->setNetworkDeviceName(l[8]); + nw->setIps(l[9]); QListWidgetItem *item = new QListWidgetItem(); item->setSizeHint(nw->sizeHint()); ui->networkListWidget->addItem(item); diff --git a/ZeroTierUI/networkwidget.cpp b/ZeroTierUI/networkwidget.cpp index c667777b5..947f636b1 100644 --- a/ZeroTierUI/networkwidget.cpp +++ b/ZeroTierUI/networkwidget.cpp @@ -53,8 +53,8 @@ NetworkWidget::NetworkWidget(QWidget *parent,const std::string &nwid) : QFontMetrics fm(ui->ipListWidget->font()); int lineHeight = ui->ipListWidget->spacing() + fm.height(); - ui->ipListWidget->setMinimumHeight(lineHeight * 4); - ui->ipListWidget->setMaximumHeight(lineHeight * 4); + ui->ipListWidget->setMinimumHeight(lineHeight * 6); + ui->ipListWidget->setMaximumHeight(lineHeight * 6); #ifdef __APPLE__ QWidgetList widgets = this->findChildren(); @@ -145,6 +145,11 @@ void NetworkWidget::setIps(const std::string &commaSeparatedList) } } +void NetworkWidget::setMAC(const std::string &mac) +{ + ui->macLabel->setText(QString(mac.c_str())); +} + const std::string &NetworkWidget::networkId() { return networkIdStr; diff --git a/ZeroTierUI/networkwidget.h b/ZeroTierUI/networkwidget.h index dc4d965f8..2fb85bcab 100644 --- a/ZeroTierUI/networkwidget.h +++ b/ZeroTierUI/networkwidget.h @@ -50,6 +50,7 @@ public: void setNetworkType(const std::string &type); void setNetworkDeviceName(const std::string &dev); void setIps(const std::string &commaSeparatedList); + void setMAC(const std::string &mac); const std::string &networkId(); diff --git a/ZeroTierUI/networkwidget.ui b/ZeroTierUI/networkwidget.ui index 98f2d80d1..b7ba6d603 100644 --- a/ZeroTierUI/networkwidget.ui +++ b/ZeroTierUI/networkwidget.ui @@ -11,7 +11,7 @@ - + 0 0 @@ -40,6 +40,12 @@ + + + 0 + 0 + + 2 @@ -57,7 +63,13 @@ 0 - + + + + 0 + 0 + + 0 @@ -178,6 +190,12 @@ + + + 0 + 0 + + QFormLayout::ExpandingFieldsGrow @@ -291,7 +309,7 @@ - + @@ -306,7 +324,7 @@ - + @@ -332,6 +350,44 @@ + + + + + 12 + + + + MAC: + + + Qt::PlainText + + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + ? + + + Qt::PlainText + + + @@ -340,6 +396,9 @@ Qt::Vertical + + QSizePolicy::Expanding + 20 diff --git a/make-mac.mk b/make-mac.mk index f420ba928..1c3ed54bc 100644 --- a/make-mac.mk +++ b/make-mac.mk @@ -69,12 +69,16 @@ official: FORCE make -j 4 ZT_OFFICIAL_RELEASE=1 make mac-ui ZT_OFFICIAL_RELEASE=1 ./buildinstaller.sh - mkdir build-ZeroTierOne-dmg + make mac-dmg ZT_OFFICIAL_RELEASE=1 + +mac-dmg: FORCE + mkdir -p build-ZeroTierOne-dmg cd build-ZeroTierOne-dmg ; ln -sf /Applications Applications cp -a "build-ZeroTierUI-release/ZeroTier One.app" build-ZeroTierOne-dmg/ rm -f /tmp/tmp.dmg hdiutil create /tmp/tmp.dmg -ov -volname "ZeroTier One" -fs HFS+ -srcfolder ./build-ZeroTierOne-dmg hdiutil convert /tmp/tmp.dmg -format UDZO -o "ZeroTier One.dmg" + $(CODESIGN) -f -s $(CODESIGN_CERT) "ZeroTier One.dmg" rm -f /tmp/tmp.dmg # For those building from source -- installs signed binary tap driver in system ZT home