mirror of
https://github.com/Fishwaldo/ozw-admin.git
synced 2025-03-15 19:31:38 +00:00
Command Line Connections, and a few fixes here and there
This commit is contained in:
parent
fafd196c0b
commit
8a3b527bda
16 changed files with 205 additions and 60 deletions
|
@ -6,6 +6,10 @@ unix {
|
|||
}
|
||||
!macx: QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
}
|
||||
emscripten: {
|
||||
QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
||||
QMAKE_LFLAGS += -g --source-map-base "http://localhost:8000/"
|
||||
}
|
||||
|
||||
unix {
|
||||
CONFIG-= no-pkg-config
|
||||
|
@ -39,7 +43,11 @@ unix {
|
|||
message(" OpenZWave Database Path: $$OZW_DATABASE_PATH")
|
||||
message(" ")
|
||||
INCLUDEPATH+=$$OZW_INCLUDE_PATH
|
||||
LIBS+=$$OZW_LIBS
|
||||
!emscripten {
|
||||
LIBS+=$$OZW_LIBS
|
||||
} else {
|
||||
message(" Not Adding libopenzwave to LIBS")
|
||||
}
|
||||
} else {
|
||||
exists( $$top_srcdir/../open-zwave/cpp/src/) {
|
||||
message("Found OZW in $$absolute_path($$top_srcdir/../open-zwave/)")
|
||||
|
@ -56,7 +64,11 @@ unix {
|
|||
message(" OpenZWave Database Path: $$OZW_DATABASE_PATH")
|
||||
message(" ")
|
||||
INCLUDEPATH+=$$OZW_INCLUDE_PATH
|
||||
LIBS+=$$OZW_LIBS
|
||||
!emscripten {
|
||||
LIBS+=$$OZW_LIBS
|
||||
} else {
|
||||
message(" Not Adding libopenzwave to LIBS")
|
||||
}
|
||||
} else {
|
||||
packagesExist("libopenzwave") {
|
||||
PKGCONFIG += libopenzwave
|
||||
|
@ -72,7 +84,7 @@ unix {
|
|||
error("Can't find OpenZWave Library and Headers");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
!isEmpty(QTOZW_LIB_PATH) {
|
||||
!exists($$QTOZW_LIB_PATH/qt-openzwave/libqt-openzwave.so): error("Can't find libqt-openzwave.so")
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "eventwindow.h"
|
||||
#include "ui_eventwindow.h"
|
||||
#include "util.h"
|
||||
|
||||
|
||||
EventWindow::EventWindow(QWidget *parent) :
|
||||
|
@ -11,10 +12,12 @@ EventWindow::EventWindow(QWidget *parent) :
|
|||
ui(new Ui::EventWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->eventTable->verticalHeader()->hide();
|
||||
ui->eventTable->horizontalHeader()->setStretchLastSection(true);
|
||||
ui->eventTable->setHorizontalHeaderItem(0, new QTableWidgetItem("Time"));
|
||||
ui->eventTable->setHorizontalHeaderItem(1, new QTableWidgetItem("Message"));
|
||||
ui->eventTable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
ui->eventTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ LogWindow::LogWindow(QWidget *parent) :
|
|||
this->ui->logview->verticalHeader()->hide();
|
||||
this->ui->logview->horizontalHeader()->setStretchLastSection(true);
|
||||
this->ui->logview->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
// this->ui->val_system_tbl->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
this->ui->logview->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
// this->ui->logview->resizeColumnsToContents();
|
||||
|
||||
|
||||
|
|
|
@ -2,12 +2,29 @@
|
|||
<ui version="4.0">
|
||||
<class>LogWindow</class>
|
||||
<widget class="QWidget" name="LogWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>280</width>
|
||||
<height>216</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>OZW Log</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTableView" name="logview">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTableWidget::item { padding: 0px }
|
||||
QHeaderView::section:horizontal {margin-right: 2; border: 1px solid}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
|
|
|
@ -41,7 +41,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
#if 1
|
||||
QLoggingCategory::setFilterRules("*.debug=false\n"
|
||||
"qt.remoteobjects.debug=false\n"
|
||||
"qt.remoteobjects.debug=true\n"
|
||||
"qt.remoteobjects.warning=true\n"
|
||||
"ozw.*.debug=true\n"
|
||||
"ozw.library.debug=false\n"
|
||||
|
@ -56,7 +56,46 @@ int main(int argc, char *argv[])
|
|||
QCoreApplication::setApplicationVersion(DEF2STR(APP_VERSION));
|
||||
QApplication a(argc, argv);
|
||||
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription("OpenZWave Admin GUI");
|
||||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
|
||||
QCommandLineOption serialPort(QStringList() << "s" << "serial-port",
|
||||
"AutoStart connecting to the Specified Serial Port of the USB Stick",
|
||||
"serialPort"
|
||||
);
|
||||
parser.addOption(serialPort);
|
||||
|
||||
QCommandLineOption remoteHost(QStringList() << "host",
|
||||
"AutoStart connecting to the Specified Remote Host/Port (1983 is default port)",
|
||||
"host:port"
|
||||
);
|
||||
parser.addOption(remoteHost);
|
||||
|
||||
QCommandLineOption remoteKey(QStringList() << "password",
|
||||
"Remote Host Password (optional)",
|
||||
"password"
|
||||
);
|
||||
parser.addOption(remoteKey);
|
||||
|
||||
|
||||
parser.process(a);
|
||||
|
||||
MainWindow w;
|
||||
w.show();
|
||||
if (parser.isSet(serialPort)) {
|
||||
w.connectToLocal(parser.value(serialPort));
|
||||
} else if (parser.isSet(remoteHost)) {
|
||||
QString key;
|
||||
if (parser.isSet(remoteKey)) {
|
||||
key = parser.value(remoteKey);
|
||||
}
|
||||
QUrl server = QUrl::fromUserInput(parser.value(remoteHost), "");
|
||||
server.setScheme("ws");
|
||||
w.connectToRemote(server, key);
|
||||
}
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
|
|
@ -193,7 +193,6 @@ void MainWindow::openDefaultWindows() {
|
|||
}
|
||||
|
||||
void MainWindow::OpenConnection() {
|
||||
this->connected(true);
|
||||
|
||||
Startup su(this);
|
||||
su.setModal(true);
|
||||
|
@ -201,33 +200,17 @@ void MainWindow::OpenConnection() {
|
|||
if (ret == QDialog::Accepted) {
|
||||
|
||||
if (su.getremote() == true) {
|
||||
qCDebug(ozwadmin) << "Doing Remote Connection:" << su.getremoteHost() << su.getremotePort();
|
||||
QUrl server;
|
||||
server.setHost(su.getremoteHost());
|
||||
server.setPort(su.getremotePort());
|
||||
server.setScheme("ws");
|
||||
qCDebug(ozwadmin) << "Connecting to " << server;
|
||||
startupprogress *sup = new startupprogress(true, this);
|
||||
sup->setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
|
||||
sup->setQTOZWManager(OZWCore::get()->getQTOZWManager());
|
||||
sup->show();
|
||||
OZWCore::get()->getQTOZWManager()->setClientAuth(su.getauthKey());
|
||||
OZWCore::get()->getQTOZWManager()->initilizeReplica(server);
|
||||
OZWCore::get()->settings.setValue("connection/remotehost", su.getremoteHost());
|
||||
OZWCore::get()->settings.setValue("connection/remoteport", su.getremotePort());
|
||||
OZWCore::get()->settings.setValue("connection/authKey", su.getauthKey());
|
||||
connectToRemote(server, su.getauthKey());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
qCDebug(ozwadmin) << "Doing Local Connection: " << su.getserialPort() << su.getstartServer();
|
||||
startupprogress *sup = new startupprogress(false, this);
|
||||
sup->setQTOZWManager(OZWCore::get()->getQTOZWManager());
|
||||
sup->show();
|
||||
OZWCore::get()->getQTOZWManager()->initilizeSource(OZWCore::get()->settings.value("StartServer").toBool());
|
||||
OZWCore::get()->getQTOZWManager()->open(su.getserialPort());
|
||||
OZWCore::get()->settings.setValue("connection/serialport", su.getserialPort());
|
||||
OZWCore::get()->settings.setValue("connection/startserver", su.getstartServer());
|
||||
connectToLocal(su.getserialPort());
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
@ -236,6 +219,29 @@ void MainWindow::OpenConnection() {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::connectToLocal(QString serial) {
|
||||
this->connected(true);
|
||||
OZWCore::get()->settings.setValue("connection/serialport", serial);
|
||||
qCDebug(ozwadmin) << "Doing Local Connection: " << serial << OZWCore::get()->settings.value("StartServer").toBool();
|
||||
startupprogress *sup = new startupprogress(false, this);
|
||||
sup->show();
|
||||
OZWCore::get()->getQTOZWManager()->initilizeSource(OZWCore::get()->settings.value("connection/startserver").toBool());
|
||||
OZWCore::get()->getQTOZWManager()->open(serial);
|
||||
}
|
||||
|
||||
void MainWindow::connectToRemote(QUrl server, QString key) {
|
||||
this->connected(true);
|
||||
OZWCore::get()->settings.setValue("connection/remotehost", server);
|
||||
OZWCore::get()->settings.setValue("connection/authKey", key);
|
||||
qCDebug(ozwadmin) << "Doing Remote Connection:" << server;
|
||||
startupprogress *sup = new startupprogress(true, this);
|
||||
sup->setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
|
||||
sup->show();
|
||||
OZWCore::get()->getQTOZWManager()->setClientAuth(key);
|
||||
OZWCore::get()->getQTOZWManager()->initilizeReplica(server);
|
||||
}
|
||||
|
||||
void MainWindow::CloseConnection() {
|
||||
if (OZWCore::get()->getQTOZWManager()->getConnectionType() == QTOZWManager::connectionType::Local) {
|
||||
OZWCore::get()->getQTOZWManager()->close();
|
||||
|
@ -325,13 +331,13 @@ void MainWindow::setStatusBarMsg(QString Msg) {
|
|||
}
|
||||
|
||||
void MainWindow::remoteConnectionStatus(QTOZWManager::connectionStatus status, QAbstractSocket::SocketError error) {
|
||||
Q_UNUSED(error);
|
||||
qCDebug(ozwadmin) << "Remote Connection Status: " << status << error;
|
||||
if (status == QTOZWManager::connectionStatus::ConnectionErrorState) {
|
||||
openCriticalDialog("Connection Error", "Connection Error");
|
||||
QString errorstr("Connection Error: %1");
|
||||
openCriticalDialog("Connection Error", errorstr.arg(SockErrorToString(error)));
|
||||
CloseConnection();
|
||||
} else if (status == QTOZWManager::connectionStatus::VersionMisMatchError) {
|
||||
openCriticalDialog("Version MisMatch", "The ozwdaemon version is not compatible with this version of ozw-admin");
|
||||
CloseConnection();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,6 +41,8 @@ class MainWindow : public QMainWindow
|
|||
public:
|
||||
explicit MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
void connectToLocal(QString serial);
|
||||
void connectToRemote(QUrl server, QString key);
|
||||
public slots:
|
||||
void OpenConnection();
|
||||
void CloseConnection();
|
||||
|
|
|
@ -78,4 +78,9 @@ void nodeTableWidget::rightClickMenu(QPoint pos)
|
|||
|
||||
void nodeTableWidget::resizeContents() {
|
||||
this->ui->nodeList->resizeColumnsToContents();
|
||||
if (!this->ui->nodeList->selectionModel()->hasSelection()) {
|
||||
if (this->ui->nodeList->model()->rowCount() > 0) {
|
||||
this->ui->nodeList->selectRow(0);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
#-------------------------------------------------
|
||||
|
||||
QT += core gui widgets xml remoteobjects websockets svg
|
||||
#CONFIG += silent
|
||||
CONFIG += silent
|
||||
|
||||
TARGET = ../ozwadmin
|
||||
TEMPLATE = app
|
||||
|
@ -90,7 +90,6 @@ windows {
|
|||
|
||||
INCLUDEPATH += ../devicedb-lib ../ozwadmin-widgets
|
||||
|
||||
|
||||
macx: {
|
||||
LIBS += -framework IOKit -framework CoreFoundation
|
||||
BUNDLE.files = $$OZW_LIB_PATH/libopenzwave-1.6.dylib $$QTOZW_LIB_PATH/libqt-openzwave.1.dylib $$QTOZW_LIB_PATH/../qt-openzwavedatabase/libqt-openzwavedatabase.1.dylib
|
||||
|
|
|
@ -19,6 +19,7 @@ OZWCore *OZWCore::get() {
|
|||
|
||||
|
||||
void OZWCore::initilize() {
|
||||
#ifndef Q_OS_WASM
|
||||
QStringList PossibleDBPaths;
|
||||
PossibleDBPaths << settings.value("openzwave/ConfigPath", QDir::toNativeSeparators("../../../config/")).toString().append("/");
|
||||
PossibleDBPaths << QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
|
||||
|
@ -97,7 +98,10 @@ void OZWCore::initilize() {
|
|||
qCInfo(ozwadmin) << "UserPath is Set from Settings" << m_userpath.absolutePath();
|
||||
settings.setValue("openzwave/UserPath", m_userpath.absolutePath());
|
||||
}
|
||||
|
||||
#else
|
||||
m_configpath = ".";
|
||||
m_userpath = ".";
|
||||
#endif
|
||||
this->m_openzwave = new QTOpenZwave(this, m_configpath, m_userpath);
|
||||
this->m_qtozwmanager = this->m_openzwave->GetManager();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
#include <QMessageBox>
|
||||
#include <QIntValidator>
|
||||
#include <QSettings>
|
||||
#include <QUrl>
|
||||
#include <QDebug>
|
||||
|
||||
#include "startup.h"
|
||||
#include "ui_startup.h"
|
||||
|
||||
#include "ozwcore.h"
|
||||
|
||||
Startup::Startup(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
|
@ -17,18 +19,19 @@ Startup::Startup(QWidget *parent) :
|
|||
ui->remoteport->setMaximumWidth(w+8);
|
||||
QObject::connect(ui->startlocal, &QPushButton::clicked, this, &Startup::localPressed);
|
||||
QObject::connect(ui->startremote, &QPushButton::clicked, this, &Startup::remotePressed);
|
||||
QSettings settings;
|
||||
#if defined(Q_OS_MACOS)
|
||||
ui->serialport->setText(settings.value("connection/serialport", "/dev/cu.SLAB_USBtoUART").toString());
|
||||
ui->serialport->setText(OZWCore::get()->settings.value("connection/serialport", "/dev/cu.SLAB_USBtoUART").toString());
|
||||
#elif defined(Q_OS_WIN)
|
||||
ui->serialport->setText(settings.value("connection/serialport", "COM1").toString());
|
||||
ui->serialport->setText(OZWCore::get()->settings.value("connection/serialport", "COM1").toString());
|
||||
#else
|
||||
ui->serialport->setText(settings.value("connection/serialport", "/dev/ttyUSB0").toString());
|
||||
ui->serialport->setText(OZWCore::get()->settings.value("connection/serialport", "/dev/ttyUSB0").toString());
|
||||
#endif
|
||||
ui->enableserver->setChecked(settings.value("connection/startserver", true).toBool());
|
||||
ui->remotehost->setText(settings.value("connection/remotehost", "localhost").toString());
|
||||
ui->remoteport->setText(settings.value("connection/remoteport", "1983").toString());
|
||||
ui->authKey->setText(settings.value("connection/authKey", "").toString());
|
||||
ui->enableserver->setChecked(OZWCore::get()->settings.value("connection/startserver", true).toBool());
|
||||
QUrl server = QUrl::fromUserInput(OZWCore::get()->settings.value("connection/remotehost", "ws://localhost:1983").toString());
|
||||
qDebug() << server;
|
||||
ui->remotehost->setText(server.host());
|
||||
ui->remoteport->setText(QString::number(server.port()));
|
||||
ui->authKey->setText(OZWCore::get()->settings.value("connection/authKey", "").toString());
|
||||
}
|
||||
|
||||
Startup::~Startup()
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#include <QObject>
|
||||
|
||||
#include "startupprogress.h"
|
||||
#include "ui_startupprogress.h"
|
||||
#include "util.h"
|
||||
#include "ozwcore.h"
|
||||
|
||||
|
||||
startupprogress::startupprogress(bool remote, QWidget *parent) :
|
||||
|
@ -12,6 +14,20 @@ startupprogress::startupprogress(bool remote, QWidget *parent) :
|
|||
ui->setupUi(this);
|
||||
ui->progressBar->setValue(0);
|
||||
ui->label->setText("Starting....");
|
||||
|
||||
/* connect the signals */
|
||||
QObject::connect(OZWCore::get()->getQTOZWManager(), &QTOZWManager::manufacturerSpecificDBReady, this, &startupprogress::manufacturerSpecificDBReady);
|
||||
QObject::connect(OZWCore::get()->getQTOZWManager(), &QTOZWManager::ready, this, &startupprogress::ready);
|
||||
QObject::connect(OZWCore::get()->getQTOZWManager(), &QTOZWManager::starting, this, &startupprogress::starting);
|
||||
QObject::connect(OZWCore::get()->getQTOZWManager(), &QTOZWManager::started, this, &startupprogress::started);
|
||||
QObject::connect(OZWCore::get()->getQTOZWManager(), &QTOZWManager::driverReady, this, &startupprogress::driverReady);
|
||||
QObject::connect(OZWCore::get()->getQTOZWManager(), &QTOZWManager::driverAllNodesQueriedSomeDead, this, &startupprogress::driverAllNodesQueriedSomeDead);
|
||||
QObject::connect(OZWCore::get()->getQTOZWManager(), &QTOZWManager::driverAllNodesQueried, this, &startupprogress::driverAllNodesQueried);
|
||||
QObject::connect(OZWCore::get()->getQTOZWManager(), &QTOZWManager::driverAwakeNodesQueried, this, &startupprogress::driverAwakeNodesQueried);
|
||||
QObject::connect(OZWCore::get()->getQTOZWManager(), &QTOZWManager::ozwNotification, this, &startupprogress::ozwNotification);
|
||||
QObject::connect(OZWCore::get()->getQTOZWManager(), &QTOZWManager::remoteConnectionStatus, this, &startupprogress::remoteConnectionStatus);
|
||||
QObject::connect(this->ui->cancelbtn, &QPushButton::clicked, this, &startupprogress::clicked);
|
||||
|
||||
}
|
||||
|
||||
startupprogress::~startupprogress()
|
||||
|
@ -19,24 +35,6 @@ startupprogress::~startupprogress()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
void startupprogress::setQTOZWManager(QTOZWManager *qtozw)
|
||||
{
|
||||
m_qtozwmanager = qtozw;
|
||||
|
||||
/* connect the signals */
|
||||
QObject::connect(this->m_qtozwmanager, &QTOZWManager::manufacturerSpecificDBReady, this, &startupprogress::manufacturerSpecificDBReady);
|
||||
QObject::connect(this->m_qtozwmanager, &QTOZWManager::ready, this, &startupprogress::ready);
|
||||
QObject::connect(this->m_qtozwmanager, &QTOZWManager::starting, this, &startupprogress::starting);
|
||||
QObject::connect(this->m_qtozwmanager, &QTOZWManager::started, this, &startupprogress::started);
|
||||
QObject::connect(this->m_qtozwmanager, &QTOZWManager::driverReady, this, &startupprogress::driverReady);
|
||||
QObject::connect(this->m_qtozwmanager, &QTOZWManager::driverAllNodesQueriedSomeDead, this, &startupprogress::driverAllNodesQueriedSomeDead);
|
||||
QObject::connect(this->m_qtozwmanager, &QTOZWManager::driverAllNodesQueried, this, &startupprogress::driverAllNodesQueried);
|
||||
QObject::connect(this->m_qtozwmanager, &QTOZWManager::driverAwakeNodesQueried, this, &startupprogress::driverAwakeNodesQueried);
|
||||
QObject::connect(this->m_qtozwmanager, &QTOZWManager::ozwNotification, this, &startupprogress::ozwNotification);
|
||||
QObject::connect(this->m_qtozwmanager, &QTOZWManager::remoteConnectionStatus, this, &startupprogress::remoteConnectionStatus);
|
||||
QObject::connect(this->ui->cancelbtn, &QPushButton::clicked, this, &startupprogress::clicked);
|
||||
}
|
||||
|
||||
void startupprogress::clicked(bool checked) {
|
||||
Q_UNUSED(checked);
|
||||
emit this->cancel();
|
||||
|
@ -96,6 +94,7 @@ void startupprogress::driverAwakeNodesQueried() {
|
|||
this->close();
|
||||
}
|
||||
void startupprogress::ozwNotification(quint8 node, NotificationTypes::QTOZW_Notification_Code event) {
|
||||
Q_UNUSED(node);
|
||||
qCDebug(ozwadmin) << event;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ class startupprogress : public QDialog
|
|||
public:
|
||||
explicit startupprogress(bool remote, QWidget *parent = nullptr);
|
||||
~startupprogress();
|
||||
void setQTOZWManager(QTOZWManager *);
|
||||
|
||||
Q_SIGNALS:
|
||||
void cancel();
|
||||
|
@ -42,7 +41,6 @@ private Q_SLOTS:
|
|||
private:
|
||||
Ui::startupprogress *ui;
|
||||
bool m_remote;
|
||||
QTOZWManager *m_qtozwmanager;
|
||||
};
|
||||
|
||||
#endif // STARTUPPROGRESS_H
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <QObject>
|
||||
#include "util.h"
|
||||
|
||||
const char *nodeBasicStr (qint8 basic)
|
||||
|
@ -31,3 +33,57 @@ const char *nodeBasicStr (qint8 basic)
|
|||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
QString SockErrorToString(QAbstractSocket::SocketError error)
|
||||
{
|
||||
switch (error) {
|
||||
case QAbstractSocket::ConnectionRefusedError:
|
||||
return QObject::tr("Connection Refused");
|
||||
case QAbstractSocket::RemoteHostClosedError:
|
||||
return QObject::tr("Remote Host Closed");
|
||||
case QAbstractSocket::HostNotFoundError:
|
||||
return QObject::tr("Host Not Found");
|
||||
case QAbstractSocket::SocketAccessError:
|
||||
return QObject::tr("Socket Access Error");
|
||||
case QAbstractSocket::SocketResourceError:
|
||||
return QObject::tr("Socket Resource Error");
|
||||
case QAbstractSocket::SocketTimeoutError:
|
||||
return QObject::tr("Socket Timeout");
|
||||
case QAbstractSocket::DatagramTooLargeError:
|
||||
return QObject::tr("Datagram Too Large");
|
||||
case QAbstractSocket::NetworkError:
|
||||
return QObject::tr("Network Error");
|
||||
case QAbstractSocket::AddressInUseError:
|
||||
return QObject::tr("Address In Use");
|
||||
case QAbstractSocket::SocketAddressNotAvailableError:
|
||||
return QObject::tr("Socket Address Not Available");
|
||||
case QAbstractSocket::UnsupportedSocketOperationError:
|
||||
return QObject::tr("Unsupported Socket Operation");
|
||||
case QAbstractSocket::ProxyAuthenticationRequiredError:
|
||||
return QObject::tr("Proxy Authentication Required");
|
||||
case QAbstractSocket::SslHandshakeFailedError:
|
||||
return QObject::tr("SSL Handshake Failed");
|
||||
case QAbstractSocket::UnfinishedSocketOperationError:
|
||||
return QObject::tr("Unfinished Socket Operation");
|
||||
case QAbstractSocket::ProxyConnectionRefusedError:
|
||||
return QObject::tr("Proxy Connection Refused");
|
||||
case QAbstractSocket::ProxyConnectionClosedError:
|
||||
return QObject::tr("Proxy Connection Closed");
|
||||
case QAbstractSocket::ProxyConnectionTimeoutError:
|
||||
return QObject::tr("Proxy Connection Timeout");
|
||||
case QAbstractSocket::ProxyNotFoundError:
|
||||
return QObject::tr("Proxy Not Found");
|
||||
case QAbstractSocket::ProxyProtocolError:
|
||||
return QObject::tr("Proxy Protocol Error");
|
||||
case QAbstractSocket::OperationError:
|
||||
return QObject::tr("Operation Error");
|
||||
case QAbstractSocket::SslInternalError:
|
||||
return QObject::tr("SSL Internal Error");
|
||||
case QAbstractSocket::SslInvalidUserDataError:
|
||||
return QObject::tr("SSL Invalid User/Certificate");
|
||||
case QAbstractSocket::TemporaryError:
|
||||
return QObject::tr("Temporary Error");
|
||||
case QAbstractSocket::UnknownSocketError:
|
||||
return QObject::tr("Unknown Socket Error");
|
||||
}
|
||||
}
|
|
@ -20,8 +20,10 @@
|
|||
#include <QApplication>
|
||||
#include <QCheckBox>
|
||||
#include <QLoggingCategory>
|
||||
#include <QAbstractSocket>
|
||||
|
||||
const char *nodeBasicStr (qint8 basic);
|
||||
QString SockErrorToString(QAbstractSocket::SocketError error);
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(ozwadmin);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ QT += core gui xml svg remoteobjects widgets
|
|||
|
||||
TARGET = ozwadmin-widgets
|
||||
TEMPLATE = lib
|
||||
CONFIG += staticlib
|
||||
CONFIG += staticlib silent
|
||||
|
||||
|
||||
SOURCES += widgets.cpp \
|
||||
|
|
Loading…
Add table
Reference in a new issue