InitLib error raise bug fix.
This commit is contained in:
@@ -11,7 +11,7 @@ file(GLOB_RECURSE project_cxx ./src/*.cxx)
|
|||||||
file(GLOB_RECURSE project_cc ./src/*.cc)
|
file(GLOB_RECURSE project_cc ./src/*.cc)
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
set(USE_SHIMLIB ON)
|
set(USE_SHIMLIB OFF)
|
||||||
else()
|
else()
|
||||||
set(USE_SHIMLIB OFF)
|
set(USE_SHIMLIB OFF)
|
||||||
endif()
|
endif()
|
||||||
@@ -70,6 +70,8 @@ endif()
|
|||||||
if(UNIX AND USE_SHIMLIB)
|
if(UNIX AND USE_SHIMLIB)
|
||||||
link_directories(/usr/local/lib64)
|
link_directories(/usr/local/lib64)
|
||||||
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql Qt5::VirtualKeyboard Qt5::Network pthread usct_shim dmapi log4c cunit ctomat hdf5 matio m)
|
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql Qt5::VirtualKeyboard Qt5::Network pthread usct_shim dmapi log4c cunit ctomat hdf5 matio m)
|
||||||
|
elseif(UNIX)
|
||||||
|
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql Qt5::VirtualKeyboard Qt5::Network pthread)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql Qt5::VirtualKeyboard Qt5::Network)
|
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql Qt5::VirtualKeyboard Qt5::Network)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -8,11 +8,14 @@
|
|||||||
#include <QtWidgets/QLabel>
|
#include <QtWidgets/QLabel>
|
||||||
#include "guimacros.h"
|
#include "guimacros.h"
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
|
#include <src/event/EventCenter.h>
|
||||||
#include "db/SQLHelper.h"
|
#include "db/SQLHelper.h"
|
||||||
#include "InputObject.h"
|
#include "InputObject.h"
|
||||||
#include "models/User.h"
|
#include "models/User.h"
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/UserOperationLog.h"
|
||||||
#include "json/jsonobject.h"
|
#include "json/jsonobject.h"
|
||||||
|
#include "guimessagedialog.h"
|
||||||
|
|
||||||
LoginWindow::LoginWindow(QWidget* parent)
|
LoginWindow::LoginWindow(QWidget* parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_pLoginButton(nullptr)
|
, m_pLoginButton(nullptr)
|
||||||
@@ -39,28 +42,8 @@ LoginWindow::~LoginWindow()
|
|||||||
|
|
||||||
void LoginWindow::initUi()
|
void LoginWindow::initUi()
|
||||||
{
|
{
|
||||||
QString style = "*{background-color:#3c3c3c; color:white;margin:0;font-size:16px;}"
|
|
||||||
"QLabel#title{font-Size:98px;color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
|
|
||||||
"stop: 0.0 darkgray, stop: 0.5 lightgray, stop: 1.0 darkgray);}"
|
|
||||||
"QLabel#warn{color:#930000;background:transparent;font-size:20px;}"
|
|
||||||
"QFrame#login_frame_username{min-width:700px;max-width:700px;max-height:500px;min-height:500px;"
|
|
||||||
"border:1px solid #0078d8;border-radius:20px;"
|
|
||||||
"background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,\n"
|
|
||||||
" stop: 0.0 darkgray, stop: 0.5 gray, stop: 1.0 darkgray);"
|
|
||||||
"}"
|
|
||||||
"QLineEdit{min-height:100px;max-height:100px; border:1px solid silver;border-radius:10px;font-size:26px;}"
|
|
||||||
"QLineEdit:enabled{background-color: #515151}"
|
|
||||||
"QComboBox{text-align:center;min-height:100px;max-height:100px; "
|
|
||||||
"border:1px solid silver;border-radius:10px;padding:3px}"
|
|
||||||
"QComboBox:enabled{background-color: #515151}"
|
|
||||||
"QComboBox::drop-down{width:80px;border-radius:10px}"
|
|
||||||
"QComboBox QAbstractItemView{min-width:120px;}"
|
|
||||||
"QComboBox QAbstractItemView::item {min-height:60px;max-height:60px; border:1px solid white;}"
|
|
||||||
"QToolButton{min-height:100px;max-height:100px;border:1px solid #505050;"
|
|
||||||
"border-radius:10%;font-size:26px; font-weight:Bold;padding:5px;}"
|
|
||||||
"QToolButton:hover{background:#505050;}";
|
|
||||||
setStyleSheet(style);
|
|
||||||
|
|
||||||
|
this->setObjectName("loginform");
|
||||||
m_pVMainLayout = new QVBoxLayout(this);
|
m_pVMainLayout = new QVBoxLayout(this);
|
||||||
m_pVMainLayout->setContentsMargins(0, 0, 0, 0);
|
m_pVMainLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
m_pVMainLayout->setSpacing(0);
|
m_pVMainLayout->setSpacing(0);
|
||||||
@@ -100,9 +83,26 @@ void LoginWindow::initUi()
|
|||||||
m_pUserCodeLayout->removeWidget(btnlogin);
|
m_pUserCodeLayout->removeWidget(btnlogin);
|
||||||
m_pUserCodeLayout->addWidget(btnlogin, 0, Qt::AlignCenter);
|
m_pUserCodeLayout->addWidget(btnlogin, 0, Qt::AlignCenter);
|
||||||
m_pLoginButton = btnlogin;
|
m_pLoginButton = btnlogin;
|
||||||
|
btnlogin->setObjectName("btnlogin");
|
||||||
// m_pUserCodeLayout->addWidget(m_pLoginButton, 0, Qt::AlignCenter);
|
// m_pUserCodeLayout->addWidget(m_pLoginButton, 0, Qt::AlignCenter);
|
||||||
m_pVMainLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
m_pVMainLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||||
|
connect(EventCenter::Default(), &EventCenter::DeviceErrorRaise, [=](QObject* parent, QObject* msg) {
|
||||||
|
if (!this->isVisible()) return;
|
||||||
|
//默认旧模式
|
||||||
|
GUIMessageDialog msgDialog(this);
|
||||||
|
msgDialog.setOpacity(1.0);
|
||||||
|
if (msg) {
|
||||||
|
QString* str = (QString*)msg;
|
||||||
|
msgDialog.showMessage(*str);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
msgDialog.showMessage("Something went error!");
|
||||||
|
}
|
||||||
|
msgDialog.stopLoading();
|
||||||
|
msgDialog.showExitButton();
|
||||||
|
// msgDialog.setWindowModality(Q);
|
||||||
|
msgDialog.exec();
|
||||||
|
});
|
||||||
initUserList();
|
initUserList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/UserOperationLog.h"
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
|
#include <src/device/DeviceManager.h>
|
||||||
#include "json/jsonobject.h"
|
#include "json/jsonobject.h"
|
||||||
#include "locker.h"
|
#include "locker.h"
|
||||||
#include "languageswitcher.h"
|
#include "languageswitcher.h"
|
||||||
@@ -89,13 +90,16 @@ int main(int argc, char* argv[])
|
|||||||
Timer.start(1000);
|
Timer.start(1000);
|
||||||
thread.start();
|
thread.start();
|
||||||
w.showFullScreen();
|
w.showFullScreen();
|
||||||
|
DeviceManager::Default()->initDevice();
|
||||||
w.requestLogin();
|
w.requestLogin();
|
||||||
|
|
||||||
int ret = a.exec();
|
int ret = a.exec();
|
||||||
thread.terminate();
|
thread.terminate();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
w.showFullScreen();
|
w.showFullScreen();
|
||||||
|
DeviceManager::Default()->initDevice();
|
||||||
w.requestLogin();
|
w.requestLogin();
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,10 +161,8 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||||||
}
|
}
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
});
|
});
|
||||||
|
GUIErrorHandle::Default()->init();
|
||||||
GUIErrorHandle::Default()->init();
|
l = new LoginWindow(this);
|
||||||
DeviceManager::Default()->initDevice();
|
|
||||||
|
|
||||||
QThread* t = QThread::create([]() {
|
QThread* t = QThread::create([]() {
|
||||||
QThread::sleep(10);
|
QThread::sleep(10);
|
||||||
int f = 0x00100001;
|
int f = 0x00100001;
|
||||||
@@ -183,8 +181,8 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
t->start();
|
t->start();
|
||||||
|
l->showFullScreen();
|
||||||
centerWidgetHide();
|
centerWidgetHide();
|
||||||
|
|
||||||
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
|
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
|
||||||
|
|
||||||
tab->setTabText(0, tr("Select"));
|
tab->setTabText(0, tr("Select"));
|
||||||
@@ -193,8 +191,6 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||||||
tab->setTabText(3, tr("Settings"));
|
tab->setTabText(3, tr("Settings"));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -243,13 +239,14 @@ QTextEdit* MainWindow::getEdit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::requestLogin() {
|
void MainWindow::requestLogin() {
|
||||||
LoginWindow l(this);
|
|
||||||
l.setWindowModality(Qt::WindowModal);
|
l->clearInputData();
|
||||||
l.showFullScreen();
|
l->setWindowModality(Qt::WindowModal);
|
||||||
|
l->showFullScreen();
|
||||||
this->centerWidgetHide();
|
this->centerWidgetHide();
|
||||||
while (l.result() != QDialog::Accepted)
|
while (l->result() != QDialog::Accepted)
|
||||||
{
|
{
|
||||||
l.exec();
|
l->exec();
|
||||||
}
|
}
|
||||||
this->centerWidgetShow();
|
this->centerWidgetShow();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include "StdOutRedirector.h"
|
#include "StdOutRedirector.h"
|
||||||
#include "json/cJSON.h"
|
#include "json/cJSON.h"
|
||||||
|
#include "loginwindow.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
@@ -42,6 +43,7 @@ private:
|
|||||||
bool m_bLoaded = false;
|
bool m_bLoaded = false;
|
||||||
QTabWidget* tab = nullptr;
|
QTabWidget* tab = nullptr;
|
||||||
int admin_tab_index = -1;
|
int admin_tab_index = -1;
|
||||||
|
LoginWindow* l;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user