summaryrefslogtreecommitdiff
path: root/ZeroTierUI
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-08-19 17:42:17 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-08-19 17:42:17 -0700
commit351b7f3a09cfffa04dc5b62349806f256b9f3d2d (patch)
tree8d91b60f6eaf06892e32a749ab54ec20eff35e36 /ZeroTierUI
parent721625d51248bb7152bce7ed9b5eadab324d43dd (diff)
downloadinfinitytier-351b7f3a09cfffa04dc5b62349806f256b9f3d2d.tar.gz
infinitytier-351b7f3a09cfffa04dc5b62349806f256b9f3d2d.zip
UI stuff and sign .dmg on build.
Diffstat (limited to 'ZeroTierUI')
-rw-r--r--ZeroTierUI/ZeroTierUI.pro9
-rw-r--r--ZeroTierUI/mainwindow.cpp25
-rw-r--r--ZeroTierUI/networkwidget.cpp9
-rw-r--r--ZeroTierUI/networkwidget.h1
-rw-r--r--ZeroTierUI/networkwidget.ui67
5 files changed, 87 insertions, 24 deletions
diff --git a/ZeroTierUI/ZeroTierUI.pro b/ZeroTierUI/ZeroTierUI.pro
index 6cf342b7..355b0615 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 9a38bec5..46b5e9e0 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<std::string> > newNetworks;
for(unsigned long i=1;i<m->ztMessage.size();++i) {
std::vector<std::string> l(ZeroTier::Node::NodeControlClient::splitLine(m->ztMessage[i]));
- // 200 listnetworks <nwid> <name> <status> <config age> <type> <dev> <ips>
- if ((l.size() == 9)&&(l[2].length() == 16))
+ // 200 listnetworks <nwid> <name> <mac> <status> <config age> <type> <dev> <ips>
+ 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<std::string> &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<std::string> >::iterator nwdata(networks.begin());nwdata!=networks.end();++nwdata) {
@@ -294,10 +296,11 @@ void MainWindow::customEvent(QEvent *event)
std::vector<std::string> &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 c667777b..947f636b 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<QWidget*>();
@@ -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 dc4d965f..2fb85bca 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 98f2d80d..b7ba6d60 100644
--- a/ZeroTierUI/networkwidget.ui
+++ b/ZeroTierUI/networkwidget.ui
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -40,6 +40,12 @@
</property>
<item>
<widget class="QWidget" name="leftWidget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>2</number>
@@ -57,7 +63,13 @@
<number>0</number>
</property>
<item>
- <widget class="QWidget" name="widget" native="true">
+ <widget class="QWidget" name="networkInfoWidget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
@@ -178,6 +190,12 @@
</item>
<item>
<widget class="QWidget" name="networkStatsWidget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
@@ -291,7 +309,7 @@
</property>
</widget>
</item>
- <item row="4" column="0">
+ <item row="5" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
@@ -306,7 +324,7 @@
</property>
</widget>
</item>
- <item row="4" column="1">
+ <item row="5" column="1">
<widget class="QLabel" name="deviceLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -332,6 +350,44 @@
</property>
</widget>
</item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_7">
+ <property name="font">
+ <font>
+ <pointsize>12</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>MAC:</string>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QLabel" name="macLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>12</pointsize>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>?</string>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
@@ -340,6 +396,9 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>