diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-12-12 15:47:00 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-12-12 15:47:00 -0800 |
commit | 9ffda4f955283c50e559c23541567cca5fbf1607 (patch) | |
tree | 12a9a5ac38eaaa2a676c1e6f3d3fbc6495ec4f0f /ZeroTierUI | |
parent | 239c9e46ea7e0279f95197cc2dc62bb1dd69aa8f (diff) | |
download | infinitytier-9ffda4f955283c50e559c23541567cca5fbf1607.tar.gz infinitytier-9ffda4f955283c50e559c23541567cca5fbf1607.zip |
Update Qt build to enable building against local static libraries, rename Network to NetworkWidget to avoid filesystem or object naming collision with Network.o in node/.
Diffstat (limited to 'ZeroTierUI')
-rw-r--r-- | ZeroTierUI/ZeroTierUI.pro | 87 | ||||
-rw-r--r-- | ZeroTierUI/mainwindow.cpp | 10 | ||||
-rw-r--r-- | ZeroTierUI/networkwidget.cpp (renamed from ZeroTierUI/network.cpp) | 26 | ||||
-rw-r--r-- | ZeroTierUI/networkwidget.h (renamed from ZeroTierUI/network.h) | 10 | ||||
-rw-r--r-- | ZeroTierUI/networkwidget.ui (renamed from ZeroTierUI/network.ui) | 4 |
5 files changed, 102 insertions, 35 deletions
diff --git a/ZeroTierUI/ZeroTierUI.pro b/ZeroTierUI/ZeroTierUI.pro index 0bfcb819..245982d3 100644 --- a/ZeroTierUI/ZeroTierUI.pro +++ b/ZeroTierUI/ZeroTierUI.pro @@ -7,25 +7,92 @@ mac:ICON = zt1icon.icns mac:QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 mac:QMAKE_INFO_PLIST = Info.plist -# ZeroTier One must be built before building this, since it links in the -# client code and some stuff from Utils to talk to the running service. -LIBS += ../node/*.o - SOURCES += main.cpp\ mainwindow.cpp \ - network.cpp \ - aboutwindow.cpp + aboutwindow.cpp \ + ../node/C25519.cpp \ + ../node/CertificateOfMembership.cpp \ + ../node/Defaults.cpp \ + ../node/Demarc.cpp \ + ../node/EthernetTap.cpp \ + ../node/HttpClient.cpp \ + ../node/Identity.cpp \ + ../node/InetAddress.cpp \ + ../node/Logger.cpp \ + ../node/Multicaster.cpp \ + ../node/Network.cpp \ + ../node/NetworkConfig.cpp \ + ../node/Node.cpp \ + ../node/NodeConfig.cpp \ + ../node/Packet.cpp \ + ../node/PacketDecoder.cpp \ + ../node/Peer.cpp \ + ../node/Poly1305.cpp \ + ../node/Salsa20.cpp \ + ../node/Service.cpp \ + ../node/SHA512.cpp \ + ../node/SoftwareUpdater.cpp \ + ../node/Switch.cpp \ + ../node/SysEnv.cpp \ + ../node/Topology.cpp \ + ../node/UdpSocket.cpp \ + ../node/Utils.cpp \ + ../ext/lz4/lz4.c \ + ../ext/lz4/lz4hc.c \ + networkwidget.cpp HEADERS += mainwindow.h \ - network.h \ aboutwindow.h \ ../node/Node.hpp \ ../node/Utils.hpp \ - ../node/Defaults.hpp + ../node/Defaults.hpp \ + ../node/Address.hpp \ + ../node/Array.hpp \ + ../node/AtomicCounter.hpp \ + ../node/BandwidthAccount.hpp \ + ../node/Buffer.hpp \ + ../node/C25519.hpp \ + ../node/CertificateOfMembership.hpp \ + ../node/CMWC4096.hpp \ + ../node/Condition.hpp \ + ../node/Constants.hpp \ + ../node/Demarc.hpp \ + ../node/Dictionary.hpp \ + ../node/EthernetTap.hpp \ + ../node/HttpClient.hpp \ + ../node/Identity.hpp \ + ../node/InetAddress.hpp \ + ../node/Logger.hpp \ + ../node/MAC.hpp \ + ../node/Multicaster.hpp \ + ../node/MulticastGroup.hpp \ + ../node/Mutex.hpp \ + ../node/Network.hpp \ + ../node/NetworkConfig.hpp \ + ../node/NodeConfig.hpp \ + ../node/NonCopyable.hpp \ + ../node/Packet.hpp \ + ../node/PacketDecoder.hpp \ + ../node/Peer.hpp \ + ../node/Poly1305.hpp \ + ../node/RuntimeEnvironment.hpp \ + ../node/Salsa20.hpp \ + ../node/Service.hpp \ + ../node/SHA512.hpp \ + ../node/SharedPtr.hpp \ + ../node/SoftwareUpdater.hpp \ + ../node/Switch.hpp \ + ../node/SysEnv.hpp \ + ../node/Thread.hpp \ + ../node/Topology.hpp \ + ../node/UdpSocket.hpp \ + ../ext/lz4/lz4.h \ + ../ext/lz4/lz4hc.h \ + networkwidget.h FORMS += mainwindow.ui \ - network.ui \ - aboutwindow.ui + aboutwindow.ui \ + networkwidget.ui RESOURCES += \ resources.qrc diff --git a/ZeroTierUI/mainwindow.cpp b/ZeroTierUI/mainwindow.cpp index 6e972c73..afc981c6 100644 --- a/ZeroTierUI/mainwindow.cpp +++ b/ZeroTierUI/mainwindow.cpp @@ -1,6 +1,6 @@ #include "mainwindow.h" #include "aboutwindow.h" -#include "network.h" +#include "networkwidget.h" #include "ui_mainwindow.h" #include <string> @@ -143,13 +143,13 @@ void MainWindow::customEvent(QEvent *event) byNwid[l[2]] = l; } - std::map< std::string,std::pair<int,Network *> > existingByNwid; + std::map< std::string,std::pair<int,NetworkWidget *> > existingByNwid; for(int r=0;r<ui->networkListWidget->count();++r) { - Network *nw = (Network *)ui->networkListWidget->itemWidget(ui->networkListWidget->item(r)); + NetworkWidget *nw = (NetworkWidget *)ui->networkListWidget->itemWidget(ui->networkListWidget->item(r)); existingByNwid[nw->networkId()] = std::make_pair(r,nw); } - for(std::map< std::string,std::pair<int,Network *> >::iterator i(existingByNwid.begin());i!=existingByNwid.end();++i) { + for(std::map< std::string,std::pair<int,NetworkWidget *> >::iterator i(existingByNwid.begin());i!=existingByNwid.end();++i) { if (byNwid.count(i->first)) { std::vector<std::string> &l = byNwid[i->first]; i->second.second->setNetworkName(l[3]); @@ -165,7 +165,7 @@ void MainWindow::customEvent(QEvent *event) for(std::map< std::string,std::vector<std::string> >::iterator i(byNwid.begin());i!=byNwid.end();++i) { if (!existingByNwid.count(i->first)) { std::vector<std::string> &l = i->second; - Network *nw = new Network((QWidget *)0,i->first); + NetworkWidget *nw = new NetworkWidget((QWidget *)0,i->first); nw->setNetworkName(l[3]); nw->setStatus(l[4],l[5]); nw->setNetworkType(l[6]); diff --git a/ZeroTierUI/network.cpp b/ZeroTierUI/networkwidget.cpp index e23bc6ba..3b461d80 100644 --- a/ZeroTierUI/network.cpp +++ b/ZeroTierUI/networkwidget.cpp @@ -1,6 +1,6 @@ -#include "network.h" +#include "networkwidget.h" #include "mainwindow.h" -#include "ui_network.h" +#include "ui_networkwidget.h" #include <QClipboard> #include <QString> @@ -10,9 +10,9 @@ #include <QList> #include <QMessageBox> -Network::Network(QWidget *parent,const std::string &nwid) : +NetworkWidget::NetworkWidget(QWidget *parent,const std::string &nwid) : QWidget(parent), - ui(new Ui::Network), + ui(new Ui::NetworkWidget), networkIdStr(nwid) { ui->setupUi(this); @@ -23,12 +23,12 @@ Network::Network(QWidget *parent,const std::string &nwid) : ui->ipListWidget->setMaximumHeight(lineHeight * 3); } -Network::~Network() +NetworkWidget::~NetworkWidget() { delete ui; } -void Network::setStatus(const std::string &status,const std::string &age) +void NetworkWidget::setStatus(const std::string &status,const std::string &age) { ui->statusLabel->setText(QString(status.c_str())); if (status == "OK") @@ -36,12 +36,12 @@ void Network::setStatus(const std::string &status,const std::string &age) else ui->ageLabel->setText(QString()); } -void Network::setNetworkName(const std::string &name) +void NetworkWidget::setNetworkName(const std::string &name) { ui->nameLabel->setText(QString(name.c_str())); } -void Network::setNetworkType(const std::string &type) +void NetworkWidget::setNetworkType(const std::string &type) { ui->networkTypeLabel->setText(QString(type.c_str())); if (type == "?") @@ -53,12 +53,12 @@ void Network::setNetworkType(const std::string &type) else ui->networkTypeLabel->setToolTip(QString()); } -void Network::setNetworkDeviceName(const std::string &dev) +void NetworkWidget::setNetworkDeviceName(const std::string &dev) { ui->deviceLabel->setText(QString(dev.c_str())); } -void Network::setIps(const std::string &commaSeparatedList) +void NetworkWidget::setIps(const std::string &commaSeparatedList) { QStringList ips(QString(commaSeparatedList.c_str()).split(QChar(','),QString::SkipEmptyParts)); if (commaSeparatedList == "-") @@ -87,12 +87,12 @@ void Network::setIps(const std::string &commaSeparatedList) } } -const std::string &Network::networkId() +const std::string &NetworkWidget::networkId() { return networkIdStr; } -void Network::on_leaveNetworkButton_clicked() +void NetworkWidget::on_leaveNetworkButton_clicked() { if (QMessageBox::question(this,"Leave Network?",QString("Are you sure you want to leave network '") + networkIdStr.c_str() + "'?",QMessageBox::No,QMessageBox::Yes) == QMessageBox::Yes) { zeroTierClient->send((QString("leave ") + networkIdStr.c_str()).toStdString()); @@ -100,7 +100,7 @@ void Network::on_leaveNetworkButton_clicked() } } -void Network::on_networkIdPushButton_clicked() +void NetworkWidget::on_networkIdPushButton_clicked() { QApplication::clipboard()->setText(ui->networkIdPushButton->text()); } diff --git a/ZeroTierUI/network.h b/ZeroTierUI/networkwidget.h index a50354af..2d1e7a87 100644 --- a/ZeroTierUI/network.h +++ b/ZeroTierUI/networkwidget.h @@ -6,16 +6,16 @@ #include <QWidget> namespace Ui { -class Network; +class NetworkWidget; } -class Network : public QWidget +class NetworkWidget : public QWidget { Q_OBJECT public: - explicit Network(QWidget *parent = 0,const std::string &nwid = std::string()); - virtual ~Network(); + explicit NetworkWidget(QWidget *parent = 0,const std::string &nwid = std::string()); + virtual ~NetworkWidget(); void setStatus(const std::string &status,const std::string &age); void setNetworkName(const std::string &name); @@ -30,7 +30,7 @@ private slots: void on_networkIdPushButton_clicked(); private: - Ui::Network *ui; + Ui::NetworkWidget *ui; std::string networkIdStr; }; diff --git a/ZeroTierUI/network.ui b/ZeroTierUI/networkwidget.ui index e6dc6524..b0bd2c51 100644 --- a/ZeroTierUI/network.ui +++ b/ZeroTierUI/networkwidget.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>Network</class> - <widget class="QWidget" name="Network"> + <class>NetworkWidget</class> + <widget class="QWidget" name="NetworkWidget"> <property name="geometry"> <rect> <x>0</x> |