Просмотр исходного кода

#IQRV #comment 移除QT内容第一阶段

80374374 1 год назад
Родитель
Сommit
5e9fa74154
100 измененных файлов с 0 добавлено и 10057 удалено
  1. 0 10
      CMakeLists.txt
  2. 0 6
      Framework/CMakeLists.txt
  3. 0 78
      Framework/spshell/CMakeLists.txt
  4. 0 165
      Framework/spshell/PollCenter.cpp
  5. 0 62
      Framework/spshell/PollCenter.h
  6. 0 155
      Framework/spshell/QtBootSender.cpp
  7. 0 61
      Framework/spshell/QtBootSender.h
  8. 0 89
      Framework/spshell/QtMessageSender.cpp
  9. 0 30
      Framework/spshell/QtMessageSender.h
  10. 0 166
      Framework/spshell/Widgets/BootGlobal.h
  11. 0 21
      Framework/spshell/Widgets/BootSplashScreen.cpp
  12. 0 29
      Framework/spshell/Widgets/BootSplashScreen.h
  13. 0 284
      Framework/spshell/Widgets/BootWidget.cpp
  14. 0 56
      Framework/spshell/Widgets/BootWidget.h
  15. 0 20
      Framework/spshell/Widgets/BootWidget.ui
  16. 0 34
      Framework/spshell/Widgets/CustomImportInterface.h
  17. 0 119
      Framework/spshell/Widgets/OperaThread.hpp
  18. 0 62
      Framework/spshell/Widgets/QConsoleListWidget.cpp
  19. 0 38
      Framework/spshell/Widgets/QConsoleListWidget.h
  20. 0 202
      Framework/spshell/Widgets/QInfoListWidget.cpp
  21. 0 177
      Framework/spshell/Widgets/QInfoListWidget.h
  22. 0 206
      Framework/spshell/Widgets/QRvcItemModel.hpp
  23. 0 64
      Framework/spshell/Widgets/QtMessageInfo.h
  24. 0 31
      Framework/spshell/Widgets/RvcSettings.h
  25. 0 34
      Framework/spshell/Widgets/cpuwidget.cpp
  26. 0 21
      Framework/spshell/Widgets/cpuwidget.h
  27. 0 24
      Framework/spshell/Widgets/dialogappversion.cpp
  28. 0 21
      Framework/spshell/Widgets/dialogappversion.h
  29. 0 215
      Framework/spshell/Widgets/dialogconfig.cpp
  30. 0 35
      Framework/spshell/Widgets/dialogconfig.h
  31. 0 111
      Framework/spshell/Widgets/floatwidget/Overlay.cpp
  32. 0 55
      Framework/spshell/Widgets/floatwidget/Overlay.h
  33. 0 148
      Framework/spshell/Widgets/floatwidget/SwipeGestureRecognizer.cpp
  34. 0 43
      Framework/spshell/Widgets/floatwidget/SwipeGestureRecognizer.h
  35. 0 581
      Framework/spshell/Widgets/floatwidget/widget.cpp
  36. 0 115
      Framework/spshell/Widgets/floatwidget/widget.h
  37. 0 24
      Framework/spshell/Widgets/floatwidget/widget.ui
  38. 0 1671
      Framework/spshell/Widgets/mainwindow.cpp
  39. 0 310
      Framework/spshell/Widgets/mainwindow.h
  40. 0 570
      Framework/spshell/Widgets/mainwindow.ui
  41. 0 58
      Framework/spshell/Widgets/memorywidget.cpp
  42. 0 22
      Framework/spshell/Widgets/memorywidget.h
  43. 0 92
      Framework/spshell/Widgets/mlabel.cpp
  44. 0 28
      Framework/spshell/Widgets/mlabel.h
  45. 0 251
      Framework/spshell/Widgets/performwidget.cpp
  46. 0 64
      Framework/spshell/Widgets/performwidget.h
  47. 0 24
      Framework/spshell/Widgets/performwidget.ui
  48. 0 50
      Framework/spshell/Widgets/res.qrc
  49. 0 89
      Framework/spshell/Widgets/res/ErrorCode.md
  50. BIN
      Framework/spshell/Widgets/res/FavIcon.ico
  51. BIN
      Framework/spshell/Widgets/res/Logo.png
  52. BIN
      Framework/spshell/Widgets/res/bg.png
  53. BIN
      Framework/spshell/Widgets/res/bgactive.png
  54. BIN
      Framework/spshell/Widgets/res/fatcow/contrast_high.png
  55. BIN
      Framework/spshell/Widgets/res/fatcow/contrast_low.png
  56. BIN
      Framework/spshell/Widgets/res/fatcow/control_cursor.png
  57. BIN
      Framework/spshell/Widgets/res/fatcow/control_cursor_blue.png
  58. BIN
      Framework/spshell/Widgets/res/fatcow/control_eject.png
  59. BIN
      Framework/spshell/Widgets/res/fatcow/control_eject_blue.png
  60. BIN
      Framework/spshell/Widgets/res/fatcow/control_end.png
  61. BIN
      Framework/spshell/Widgets/res/fatcow/control_end_blue.png
  62. BIN
      Framework/spshell/Widgets/res/fatcow/control_fastforward.png
  63. BIN
      Framework/spshell/Widgets/res/fatcow/control_fastforward_blue.png
  64. BIN
      Framework/spshell/Widgets/res/fatcow/control_pause.png
  65. BIN
      Framework/spshell/Widgets/res/fatcow/control_pause_blue.png
  66. BIN
      Framework/spshell/Widgets/res/fatcow/control_play.png
  67. BIN
      Framework/spshell/Widgets/res/fatcow/control_play_blue.png
  68. BIN
      Framework/spshell/Widgets/res/fatcow/control_power.png
  69. BIN
      Framework/spshell/Widgets/res/fatcow/control_power_blue.png
  70. BIN
      Framework/spshell/Widgets/res/fatcow/control_repeat.png
  71. BIN
      Framework/spshell/Widgets/res/fatcow/control_repeat_blue.png
  72. BIN
      Framework/spshell/Widgets/res/fatcow/control_rewind.png
  73. BIN
      Framework/spshell/Widgets/res/fatcow/control_rewind_blue.png
  74. BIN
      Framework/spshell/Widgets/res/fatcow/control_start.png
  75. BIN
      Framework/spshell/Widgets/res/fatcow/control_start_blue.png
  76. BIN
      Framework/spshell/Widgets/res/fatcow/control_stop.png
  77. BIN
      Framework/spshell/Widgets/res/fatcow/control_stop_blue.png
  78. BIN
      Framework/spshell/Widgets/res/fatcow/cross.png
  79. BIN
      Framework/spshell/Widgets/res/fatcow/file_extension_log.png
  80. BIN
      Framework/spshell/Widgets/res/fatcow/format_painter.png
  81. BIN
      Framework/spshell/Widgets/res/fatcow/lcd_tv_test.png
  82. BIN
      Framework/spshell/Widgets/res/fatcow/page_delete.png
  83. BIN
      Framework/spshell/Widgets/res/fatcow/zoom_layer.png
  84. 0 3
      Framework/spshell/Widgets/res/forms/input.txt
  85. 0 95
      Framework/spshell/Widgets/res/forms/textfinder.ui
  86. 0 131
      Framework/spshell/Widgets/res/set_nopass_priviledge.sh
  87. 0 9
      Framework/spshell/Widgets/res/spexplorerauto.desktop
  88. BIN
      Framework/spshell/Widgets/res/splash.png
  89. 0 1176
      Framework/spshell/Widgets/res/sys_errcode.html
  90. 0 1193
      Framework/spshell/Widgets/res/version_history.html
  91. 0 173
      Framework/spshell/Widgets/rootform.cpp
  92. 0 31
      Framework/spshell/Widgets/rootform.h
  93. 0 85
      Framework/spshell/Widgets/rootform.ui
  94. 0 129
      Framework/spshell/Widgets/subnormalconfig.cpp
  95. 0 32
      Framework/spshell/Widgets/subnormalconfig.h
  96. 0 32
      Framework/spshell/Widgets/subnormalconfig.ui
  97. 0 30
      Framework/spshell/Widgets/sysinfo.cpp
  98. 0 23
      Framework/spshell/Widgets/sysinfo.h
  99. 0 71
      Framework/spshell/Widgets/sysinfolinuximpl.cpp
  100. 0 23
      Framework/spshell/Widgets/sysinfolinuximpl.h

+ 0 - 10
CMakeLists.txt

@@ -738,10 +738,6 @@ else(MSVC)
 	file(GLOB VENDOR_ROOT_CONFIG_FILES "${CMAKE_SOURCE_DIR}/addin/hardwarecfg/UOS/root-*.ini")
 	install(FILES ${VENDOR_ROOT_CONFIG_FILES} DESTINATION "${PACK_INSTALL_RUN_DIR}/hardwarecfg" COMPONENT scripts)
 	install(PROGRAMS "${CMAKE_SOURCE_DIR}/addin/startup_scripts/spshellstart.sh" DESTINATION "${RVC_RUNTIME_PATH}" COMPONENT scripts)
-
-
-	file(GLOB LICENSE_FILES "${CMAKE_SOURCE_DIR}/addin/licenses/UOS/*")
-	install(FILES ${LICENSE_FILES} DESTINATION "${RVC_RESOURCE_PATH}/License" COMPONENT scripts)
 endif(MSVC)
 
 if(DEVOPS_ON)
@@ -757,11 +753,6 @@ else()
 endif(DEVOPS_ON)
 
 list(REMOVE_DUPLICATES RVC_CONAN_DEP_LIBS)
-if(CONAN_LIB_DIRS_QT)
-	message(STATUS "remote qt dir:${CONAN_LIB_DIRS_QT}")
-	list(REMOVE_ITEM RVC_CONAN_DEP_LIBS ${CONAN_LIB_DIRS_QT})# 1.0.5-dev5
-	list(REMOVE_ITEM RVC_CONAN_DEP_LIBS ${CONAN_BIN_DIRS_QT})# 1.0.5-dev5
-endif(CONAN_LIB_DIRS_QT)
 
 if(MSVC)
 	if(CONAN_BIN_DIRS_CEFCLIENT_MUTABLE)
@@ -811,7 +802,6 @@ foreach(bin_dir ${RVC_CONAN_DEP_LIBS})
 	endforeach()
 	list(FILTER RVC_CONAN_BIN_FILES EXCLUDE REGEX ".*\\.a$")
 	list(FILTER RVC_CONAN_BIN_FILES EXCLUDE REGEX ".*\\.lib$")
-	# list(FILTER RVC_CONAN_BIN_FILES EXCLUDE REGEX ".*libQt5Charts.so*")
 	install(PROGRAMS ${RVC_CONAN_BIN_FILES} DESTINATION "${RVC_RUNTIME_PATH}" COMPONENT libraries)
 endforeach()
 install(DIRECTORY "${CMAKE_SOURCE_DIR}/addin/res" DESTINATION "${PACK_INSTALL_PREFIX_CUR_VER}" COMPONENT scripts )

+ 0 - 6
Framework/CMakeLists.txt

@@ -1,11 +1,5 @@
 set(RVC_CONAN_DEP_LIBS2)
 
-if(MSVC)
-set(WITH_QT_GUI OFF)
-else()
-set(WITH_QT_GUI OFF)
-endif(MSVC)
-
 set(KYSM_LIBRARY_NAME ${CONAN_LIBS_LIBKYSM})
 set(OPENSSL_INCLUDE_DIR ${CONAN_INCLUDE_DIRS_OPENSSL})
 set(OPENSSL_LIB_DIR ${CONAN_LIB_DIRS_OPENSSL})

+ 0 - 78
Framework/spshell/CMakeLists.txt

@@ -1,33 +1,6 @@
 set(MODULE_NAME "spshell")
 set(MODULE_PREFIX "SPSHELL")
 
-if(WITH_QT_GUI)
-message(STATUS "build spshell with QT GUI")
-set(CMAKE_AUTOUIC ON)
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-
-if(ARCH_AARCH64)
-    if(NOT CONAN_EXPORTED)
-        conan_cmake_run(REQUIRES qt/5.11.3@LR04.02_ThirdParty/testing BASIC_SETUP 
-        CMAKE_TARGETS BUILD missing)
-    endif(NOT CONAN_EXPORTED)
-    set(QT5_HINT_PATH ${CONAN_QT_ROOT})
-else()
-if(MSVC)
-    set(QT5_HINT_PATH "C:/Qt/Qt5.14.2/5.14.2/msvc2017/")
-else()
-    set(QT5_HINT_PATH "/opt/Qt5.14.2/5.14.2/gcc_64/lib/cmake/")
-endif(MSVC)
-endif(ARCH_AARCH64)
-
-find_package(Qt5 COMPONENTS Widgets REQUIRED 
-    HINTS ${QT5_HINT_PATH} NO_SYSTEM_ENVIRONMENT_PATH )
-
-find_package(Qt5Charts HINTS ${QT5_HINT_PATH} NO_SYSTEM_ENVIRONMENT_PATH )
-find_package(Qt5UiTools HINTS ${QT5_HINT_PATH} NO_SYSTEM_ENVIRONMENT_PATH )
-
-endif(WITH_QT_GUI)
 
 set(${MODULE_PREFIX}_SRCS
 	app.cpp
@@ -40,14 +13,6 @@ set(${MODULE_PREFIX}_SRCS
 	TelnetServer.cpp
 )
 
-if(WITH_QT_GUI)
-list(APPEND ${MODULE_PREFIX}_SRCS
-    QtBootSender.cpp
-    PollCenter.cpp
-)
-endif(WITH_QT_GUI)
-
-
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
 
 if (WIN32)
@@ -67,35 +32,9 @@ include_directories(${RVCFRAMEWORK_SOURCES_DIR})
 include_directories(${RVCFRAMEWORK_SOURCES_DIR}/spbase)
 include_directories(${RVCFRAMEWORK_SOURCES_DIR}/libtoolkit)
 
-if(WITH_QT_GUI)
-
-file(GLOB QT_SRCS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
-    "${CMAKE_CURRENT_SOURCE_DIR}/Widgets/*" 
-    "${CMAKE_CURRENT_SOURCE_DIR}/Widgets/treemodel/*"
-    "${CMAKE_CURRENT_SOURCE_DIR}/Widgets/floatwidget/*")
-
-    if(NOT WIN32)
-        list(REMOVE_ITEM QT_SRCS 
-            Widgets/sysinfowindowsimpl.cpp
-            Widgets/sysinfowindowsimpl.h
-            )
-    else()
-        list(REMOVE_ITEM QT_SRCS 
-            Widgets/sysinfolinuximpl.cpp
-            Widgets/sysinfolinuximpl.h
-            )
-    endif(NOT WIN32)
-
-list(APPEND ${MODULE_PREFIX}_SRCS ${QT_SRCS})
-
-endif(WITH_QT_GUI)
 
 add_executable(${MODULE_NAME} WIN32 ${${MODULE_PREFIX}_SRCS})
 
-if(WITH_QT_GUI)
-    target_compile_definitions(${MODULE_NAME} PRIVATE "WITH_QT")
-endif(WITH_QT_GUI)
-
 if(MSVC)
 # run as administration privilidege
 set_target_properties(${MODULE_NAME}  
@@ -107,10 +46,6 @@ target_include_directories(${MODULE_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
 target_include_directories(${MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
 target_include_directories(${MODULE_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Widgets)
 
-if(WITH_QT_GUI)
-set_target_properties(${MODULE_NAME} PROPERTIES AUTOMOC TRUE)
-endif(WITH_QT_GUI)
-
 list(APPEND ${MODULE_PREFIX}_LIBS libtoolkit spbase)
 if(MSVC)
     # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
@@ -123,10 +58,6 @@ else()
     list(APPEND ${MODULE_PREFIX}_LIBS winpr)
 endif()
 
-if(WITH_QT_GUI)
-    list(APPEND ${MODULE_PREFIX}_LIBS Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Charts Qt5::UiTools)
-endif(WITH_QT_GUI)
-
 target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
 
 install(TARGETS ${MODULE_NAME} 
@@ -138,12 +69,3 @@ install(TARGETS ${MODULE_NAME}
 if (WITH_PDB_SAVE AND MSVC)
     install(FILES ${RVC_PDB_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${RVC_PDBSAVE_PATH} COMPONENT symbols)
 endif()
-
-#不再在bin目录下附带QT相关的内容
-if(FALSE AND WITH_QT_GUI AND ARCH_AARCH64)
-    file(GLOB LACK_QT_FILES "${CONAN_LIB_DIRS_QT}/libQt5Charts.so*" "${CONAN_LIB_DIRS_QT}/libQt5DBus.so*")
-    install(PROGRAMS ${LACK_QT_FILES} DESTINATION "${RVC_RUNTIME_PATH}" COMPONENT libraries)
-     if(CONAN_EXPORTED)
-        file(COPY ${LACK_QT_FILES} DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
-     endif(CONAN_EXPORTED)
-endif(FALSE AND WITH_QT_GUI AND ARCH_AARCH64)

+ 0 - 165
Framework/spshell/PollCenter.cpp

@@ -1,165 +0,0 @@
-#include "PollCenter.h"
-#include "SpBase.h"
-#include "app.h"
-#include "QtBootSender.h"
-#include <QThread>
-#include "dbgutil.h"
-class ClearThread : public QThread
-{
-public:
-    ClearThread(int code):exitCode(code) {
-    }
-    virtual void run()
-    {
-        app_stop(EXIT_FROM_QT + exitCode);
-    }
-private:
-    int exitCode;
-};
-
-
-void Poller::OnPoll()
-{
-    LOG_FUNCTION();
-    //TODO: deal with rc 
-    int rc = app_run();
-    app_term();
-    emit Finished(rc);
-}
-
-static const char* GetTerminalInfo()
-{
-    const char* defaultInfo = "RVC Terminal Application";
-    static char szInfo[256] = {};
-    if (szInfo[0] != 0)
-        return szInfo;
-    auto env = sp_get_env();
-    if (env == NULL) {
-        return defaultInfo;
-    }
-
-    auto cfg = env->cfg;
-    if (cfg == NULL) {
-        return defaultInfo;
-    }
-
-    sprintf(szInfo, "%s  %s %s  V%d.%d.%d.%d",
-            cfg->root_ini->terminal_no == NULL ? "" : cfg->root_ini->terminal_no,
-            cfg->root_ini->machine_type == NULL ? "" : cfg->root_ini->machine_type,
-            cfg->root_ini->site == NULL ? "" : cfg->root_ini->site,
-            cfg->install_ini->install_version.major,
-            cfg->install_ini->install_version.minor,
-            cfg->install_ini->install_version.revision,
-            cfg->install_ini->install_version.build);
-
-    return szInfo;
-}
-
-static int GetTotalEntityCount()
-{
-    auto env = sp_get_env();
-    if (env == NULL) {
-        return 0;
-    }
-    auto cfg = env->cfg;
-    if (cfg == NULL) {
-        return 0;
-    }
-    return cfg->shell_ini->arr_entity->nelts;
-}
-
-Center::Center(int& argc, char** argv) 
-    :QApplication(argc, argv)
-    ,mWidget(nullptr),mWindow(nullptr), stopFlag(NoInit)
-{
-
-}
-
-void Center::Init()
-{
-    LOG_FUNCTION();
-    QPixmap pixmap(":/res/splash.png");
-    mSplashScreen = new BootSplashScreen(pixmap, 0);
-    mSplashScreen->show();
-
-    mPoller = new Poller();
-    mPoller->moveToThread(&mPollThread);
-
-    connect(this, &Center::StartPoll, mPoller, &Poller::OnPoll);
-    connect(&mPollThread, &QThread::finished, mPoller, &QObject::deleteLater);
-    connect(mPoller, &Poller::Finished, this, &Center::OnFinishedReceived);
-}
-
-int Center::Run()
-{
-    LOG_FUNCTION();
-#ifndef WITH_MAIN_WINDOW
-    mWidget = new BootWidget(QString(GetTerminalInfo()), GetTotalEntityCount());
-    processEvents();
-    mWidget->show();
-    mSplashScreen->finish(mWidget);
-#else
-    mWindow = new MainWindow(QString(GetTerminalInfo()), GetTotalEntityCount());
-    processEvents();
-    mWindow->show();
-    mSplashScreen->finish(mWindow);
-#endif //WITH_MAIN_WINDOW
-
-    TOOLKIT_ASSERT(get_app_instance() != nullptr);
-    TOOLKIT_ASSERT(get_app_instance()->bsc_gui != nullptr);
-    TOOLKIT_ASSERT(get_app_instance()->bsc_gui->gui_inst != nullptr);
-#ifndef WITH_MAIN_WINDOW
-    connect((QtBootSender*)(get_app_instance()->bsc_gui->gui_inst),
-                          &QtBootSender::ShowMessage, mWidget, &BootWidget::ReceiveMessage);
-    connect((QtBootSender*)(get_app_instance()->bsc_gui->gui_inst),
-            &QtBootSender::ShowMessageVariant, mWidget, &BootWidget::ReceiveMessageVariant
-            //, Qt::DirectConnection);
-            , Qt::QueuedConnection);
-            //, Qt::BlockingQueuedConnection);
-#else
-    connect((QtBootSender*)(get_app_instance()->bsc_gui->gui_inst),
-                          &QtBootSender::ShowMessage, mWindow, &MainWindow::ReceiveMessage);
-    connect((QtBootSender*)(get_app_instance()->bsc_gui->gui_inst),
-            &QtBootSender::ShowMessageVariant, mWindow, &MainWindow::ReceiveMessageVariant
-            //, Qt::DirectConnection);
-            , Qt::QueuedConnection);
-            //, Qt::BlockingQueuedConnection);
-    connect((QtBootSender*)(get_app_instance()->bsc_gui->gui_inst),
-            &QtBootSender::SendEntityStateChange, mWindow, &MainWindow::ReceiveEntityVariant
-            , Qt::QueuedConnection);
-#endif
-
-    mPollThread.start();
-    emit StartPoll();
-    const int exitCode = exec();
-    if (stopFlag == NoInit) {
-        stopFlag = StopFromGUI;
-        ClearThread* t = new ClearThread(exitCode);
-        t->start();
-        //app_stop();
-        while (stopFlag != StopFinished) {
-            Sleep(200);
-            this->processEvents();
-        }
-        delete t;
-    }
-    return exitCode;
-}
-
-void Center::OnFinishedReceived(int result)
-{
-    LOG_FUNCTION();
-    if (stopFlag == NoInit) {
-        stopFlag = StopFromPoll;
-        this->exit(result);
-    } else {
-        stopFlag = StopFinished;
-    }
-    //exit(result);
-}
-
-Center::~Center()
-{
-    mPollThread.quit();
-    mPollThread.wait();
-}

+ 0 - 62
Framework/spshell/PollCenter.h

@@ -1,62 +0,0 @@
-#ifndef _RVC_SPSHELL_POLL_CENTER_H_
-#define _RVC_SPSHELL_POLL_CENTER_H_
-
-#include <Widgets/BootSplashScreen.h>
-#include <Widgets/BootWidget.h>
-#include <Widgets/mainwindow.h>
-#include <QApplication>
-#include <QObject>
-#include <QThread>
-
-#define WITH_MAIN_WINDOW 1
-
-class Poller : public QObject
-{
-    Q_OBJECT
-
-public:
-    explicit Poller(QObject* parent = nullptr) : QObject(parent)
-    {
-    }
-    ~Poller() {}
-signals:
-    void Finished(int exitCode);
-
-public slots:
-
-    void OnPoll();
-};
-
-class Center : public QApplication
-{
-    Q_OBJECT
-public:
-    Center(int& argc, char** argv);
-    ~Center(); 
-
-    int Run();
-    BootWidget* mWidget;
-    MainWindow* mWindow;
-    BootSplashScreen* GetSplash() { return mSplashScreen; }
-    void Init();
-signals:
-    void StartPoll();
-    void EndPoll(int exitCode);
-
-public slots:
-    void OnFinishedReceived(int result);
-
-private:
-    QThread mPollThread;
-    Poller* mPoller;
-    BootSplashScreen* mSplashScreen;
-    enum StopEnum
-    {
-        NoInit,
-        StopFromPoll,
-        StopFromGUI,
-        StopFinished
-    } stopFlag;
-};
-
-#endif /*_RVC_SPSHELL_POLL_CENTER_H_*/

+ 0 - 155
Framework/spshell/QtBootSender.cpp

@@ -1,155 +0,0 @@
-#include "QtBootSender.h"
-#include "memutil.h"
-#include "charset.h"
-#include "sp_env.h"
-
-int qt_gui_create_format(sp_gui_format_t** p_gui)
-{
-    int result = 0;
-    sp_gui_format_t* gui = ZALLOC_T(sp_gui_format_t);
-    if (gui != nullptr) {
-        gui->gui_inst = (void*)(new QtBootSender());
-        gui->display = &qt_gui_display;
-        gui->hide = &qt_gui_undisplay;
-        gui->show_entity_info = &qt_gui_show_entity_info;
-        gui->show_running_info = &qt_gui_show_running_info;
-        gui->post_message = &qt_gui_post_message;
-        *p_gui = gui;
-    }
-    return result;
-}
-
-void qt_gui_destroy_format(sp_gui_format_t* p_gui)
-{
-    if (p_gui->gui_inst) {
-        delete ((QtBootSender*)p_gui->gui_inst);
-    }
-    FREE(p_gui);
-}
-
-namespace
-{
-MessageType MappingTypeFromGUI2Msg(int type)
-{
-    switch (type) {
-    case GUI_DISPLAY_ELEM_LOG_DEBUG:
-    case GUI_DISPLAY_ELEM_LOG_EVENT:
-        return TextEvent;
-        break;
-    case GUI_DISPLAY_ELEM_LOG_WARN:
-        return TextWarn;
-        break;
-    case GUI_DISPLAY_ELEM_LOG_ERROR:
-        return TextError;
-        break;
-    case GUI_DISPLAY_ELEM_LOG_FATAL:
-        return TextFatal;
-        break;
-    case GUI_DISPLAY_ELEM_BLUESCREEN:
-        return DisplayBlueScreen;
-        break;
-    case GUI_DISPLAY_ELEM_FATAL_ERROR:
-        return TextFatal;
-        break;
-    case GUI_DISPLAY_ELEM_FATAL_BLOCK:
-        return TextBlock;
-        break;
-    case GUI_DISPLAY_ELEM_NOTIFY_INFO:
-        return TextNotifyInfo;
-        break;
-    case GUI_DISPLAY_ELEM_NOTIFY_WARN:
-        return TextNotifyWarn;
-        break;
-    case GUI_DISPLAY_ELEM_NOTIFY_ERROR:
-        return TextNotifyError;
-        break;
-    case GUI_DISPLAY_ELEM_STARTUP_INFO:
-        return ModStartupInfo;
-        break;
-    case GUI_DISPLAY_ELEM_LOG_OTHER:
-        return StageChangeInfo;
-    default:
-        return MsgTypeMax;
-        break;
-    }
-}
-}
-
-int qt_gui_show_running_info(void* gui, const char* msg, int type)
-{
-    QtBootSender* senderInst = (QtBootSender*)gui;
-#if defined(_MSC_VER)
-    senderInst->SendShowMessage(msg, MappingTypeFromGUI2Msg(type));
-#else
-    bool done = false;
-    if (!toolkit_detect_utf8_str(msg)) {
-        const int len = toolkit_gbk2utf8((char*)msg, strlen(msg) + 1, NULL, 0);
-        if (len > 0) {
-            char* temp = CALLOC_T(len, char);
-            memset(temp, 0, len);
-            if (toolkit_gbk2utf8((char*)msg, strlen(msg) + 1, temp, len) > 0) {
-                senderInst->SendShowMessage(temp, MappingTypeFromGUI2Msg(type));
-                done = true;
-            }
-            FREE(temp);
-        }
-    }
-    if (!done) {
-        senderInst->SendShowMessage(msg, MappingTypeFromGUI2Msg(type));
-    }
-#endif //_MSC_VER
-    return 0;
-}
-
-int qt_gui_show_entity_info(void* gui, const char* entity, int state)
-{
-    QtBootSender* senderInst = (QtBootSender*)gui;
-	sp_env_t *env = sp_get_env();
-    QEntityActiveInfo entityInfo;
-    entityInfo.entityName = entity;
-    entityInfo.entityState = static_cast<EntityState>(state);
-	sp_mod_mgr_t *mod_mgr = env->mod_mgr;
-	sp_entity_t *ent = sp_mod_mgr_find_entity_by_name(mod_mgr, entity);
-	if (ent) {
-        entityInfo.entityDevId = ent->instance_id;
-        entityInfo.entityState = static_cast<EntityState>(ent->state);
-        entityInfo.entityPID = ent->mod->process.pid;
-    	sp_cfg_shell_entity_t *cfg_ent = sp_cfg_get_entity_by_idx(env->cfg, ent->cfg->idx);
-        if(cfg_ent) {
-            char szv[64] = {0};
-            sprintf(szv, "V%d.%d.%d", cfg_ent->version.major, cfg_ent->version.minor, cfg_ent->version.revision);
-            entityInfo.entityVerStr = szv;
-        } else {
-            entityInfo.entityVerStr = "V0.0.0";
-        }
-    } else {
-        entityInfo.entityDevId = 0;
-        entityInfo.entityPID = 0;
-        entityInfo.entityVerStr = "V0.0.0";
-    }
-
-    senderInst->SendEntityInfo(entityInfo);
-
-    return 0;
-}
-
-int qt_gui_display(void* gui)
-{
-    QtBootSender* senderInst = (QtBootSender*)gui;
-    senderInst->SendShowMessage("", DisplayShow);
-    return 0;
-}
-
-int qt_gui_undisplay(void* gui)
-{
-    QtBootSender* senderInst = (QtBootSender*)gui;
-    senderInst->SendShowMessage("", DisplayHide);
-    return 0;
-}
-
-void qt_gui_post_message(void* gui, unsigned long param1, unsigned long param2)
-{
-    QtBootSender* senderInst = (QtBootSender*)gui;
-    senderInst->SendShowMessage("", MappingTypeFromGUI2Msg(param1), (int)param2);
-    return;
-}

+ 0 - 61
Framework/spshell/QtBootSender.h

@@ -1,61 +0,0 @@
-#ifndef _RVC_QT_BOOT_SENDER_H__
-#define _RVC_QT_BOOT_SENDER_H__
-
-#include "sp_gui_def.h"
-
-#include <Widgets/QtMessageInfo.h>
-#include <Widgets/BootWidget.h>
-
-#include <QApplication>
-#include <QObject>
-
-#include "SpBase.h"
-
-int qt_gui_create_format(sp_gui_format_t** p_gui);
-void qt_gui_destroy_format(sp_gui_format_t* p_gui);
-
-// type: 0 normal msg; 1 bluescreen; 2 fatal error
-int qt_gui_show_running_info(void* gui, const char* msg, int type);
-int qt_gui_show_entity_info(void* gui, const char* entity, int state);
-int qt_gui_display(void* gui);
-int qt_gui_undisplay(void* gui);
-void qt_gui_post_message(void* gui, unsigned long param1, unsigned long param2);
-
-class QtBootSender : public QObject
-{
-    Q_OBJECT
-
-public:
-
-    QtBootSender(QObject* parent = nullptr) :QObject(parent) 
-    {
-    }
-    ~QtBootSender() {}
-
-    void SendShowMessage(const char* msg, MessageType type = TextEvent, int param1 = 0, int param2 = 0)
-    {
-        QtMessageInfo message;
-        message.content = QString(msg);
-        message.type = type;
-        message.param1 = param1;
-        message.param2 = param2;
-        QVariant var;
-        var.setValue(message);
-        emit ShowMessageVariant(var);
-    }
-
-    void SendEntityInfo(QEntityActiveInfo info)
-    {
-        QVariant var;
-        var.setValue(info);
-        emit SendEntityStateChange(var);
-    }
-
-signals:
-    void SendEntityStateChange(QVariant entityInfo);
-    void ShowMessage(const QtMessageInfo* meesage); 
-    void ShowMessageVariant(QVariant info);
-};
-
-
-#endif //_RVC_QT_BOOT_SENDER_H__

+ 0 - 89
Framework/spshell/QtMessageSender.cpp

@@ -1,89 +0,0 @@
-#include "QtMessageSender.h"
-#include "QtBootSender.h"
-
-#include <thread>
-
-#include "Widgets/BootWidget.h"
-#include "MessageSender.h"
-
-#include <QApplication>
-
-#include "SpBase.h"
-#include "memutil.h"
-
-int qt_gui_create_format(sp_gui_format_t** p_gui)
-{
-    int result = 0;
-    sp_gui_format_t* gui = ZALLOC_T(sp_gui_format_t);
-    if (gui != nullptr) {
-        gui->gui_inst = (void*)(new QtBootSender());
-        gui->display = &qt_gui_display;
-        gui->hide = &qt_gui_undisplay;
-        gui->show_entity_info = &qt_gui_show_entity_info;
-        gui->show_running_info = &qt_gui_show_running_info;
-        gui->post_message = &qt_gui_post_message;
-        *p_gui = gui;
-    }
-    return result;
-}
-
-void qt_gui_destroy_format(sp_gui_format_t* p_gui)
-{
-    if (p_gui->gui_inst) {
-        delete p_gui->gui_inst;
-    }
-    FREE(p_gui);
-}
-
-int qt_gui_show_running_info(void* gui, const char* msg, int type)
-{
-    QtMessageInfo message{ QString(msg), TextEvent };
-    QtBootSender* senderInst = (QtBootSender*)gui;
-    emit senderInst->ShowMessage(message);
-    return 0;
-}
-
-int qt_gui_show_entity_info(void* gui, const char* entity, int state)
-{
-    return 0;
-}
-
-int qt_gui_display(void* gui)
-{
-    return 0;
-}
-
-int qt_gui_undisplay(void* gui)
-{
-    return 0;
-}
-
-void qt_gui_post_message(void* gui, unsigned long param1, unsigned long param2)
-{
-
-}
-
-QtMessageSender::QtMessageSender():mWinInitialized(false), sender(nullptr) {
-
-    //sender = new QtBootSender();
-    kSenderInst = new QtBootSender();
-    std::thread uiThread(QtWinThread, this);
-    uiThread.detach();
-    Sleep(300);
-}
-
-QtMessageSender::~QtMessageSender()
-{
-    if (sender) {
-        delete sender;
-        sender = nullptr;
-    }
-}
-
-void QtMessageSender::ShowMessage(const SP::UI::MessageInfo& msg)
-{
-    QtMessageInfo message{ QString(msg.content.GetData()), msg.type };
-    if (kSenderInst) {
-        emit kSenderInst->ShowMessage(message);
-    }
-}

+ 0 - 30
Framework/spshell/QtMessageSender.h

@@ -1,30 +0,0 @@
-#ifndef _RVC_QT_MESSAGE_SENDER_H_
-#define _RVC_QT_MESSAGE_SENDER_H_
-
-#include "MessageSender.h"
-
-class IQtProxy
-{
-public:
-    virtual ~IQtProxy() {}
-};
-
-class QtMessageSender : public SP::UI::ITextSender
-{
-
-public:
-
-    QtMessageSender();
-    ~QtMessageSender();
-
-    void ShowMessage(const SP::UI::MessageInfo& meesage);
-
-private:
-    IQtProxy* sender;
-    bool mWinInitialized;
-};
-
-
-
-
-#endif //_RVC_QT_MESSAGE_SENDER_H_

+ 0 - 166
Framework/spshell/Widgets/BootGlobal.h

@@ -1,166 +0,0 @@
-#ifndef BOOTGLOBAL_H
-#define BOOTGLOBAL_H
-
-#include <QCoreApplication>
-#include <QWidget>
-#include <QColor>
-#include <QLayout>
-#include <QTextCodec>
-#include <QProcess>
-#include <QDebug>
-#include <QMessageBox>
-#include <QStandardPaths>
-#include <QDir>
-
-inline static QColor GetLeftBackgoundColor()
-{
-    return QColor(101, 105, 108, 255); //#65696C
-}
-
-inline static QColor GetRightBackgoundColor()
-{
-    return QColor(161, 163, 165, 255); //#A1A3A5
-}
-
-inline static QColor GetGlobalBackgoundColor()
-{
-    return QColor(161, 163, 165, 255); //#A1A3A5
-}
-
-inline static QColor GetConsoleFrontColor()
-{
-    return QColor(0, 255, 0, 255); //#00FF00
-}
-
-inline static QString GetLogoPicPath()
-{
-    return ":/Pics/res/Logo.png";
-}
-
-inline static void SetWidgetBackgroundColor(QWidget* widget, QColor color)
-{
-    QPalette labelPalette;
-    labelPalette.setColor(QPalette::Background, color);
-    widget->setAutoFillBackground(true);
-    widget->setPalette(labelPalette);
-}
-
-inline static void SlimLayout(QLayout *layout)
-{
-    layout->setContentsMargins(0, 0, 0, 0);
-    //layout->setMargin(0);
-    layout->setSpacing(0);
-}
-
-inline static QString ByteArrayToUnicode(const QByteArray &array)
-{
-    QTextCodec::ConverterState state;
-    QString text = QTextCodec::codecForName("UTF-8")->toUnicode(array.constData(), array.size(), &state);
-    // 如果转换时无效字符数量大于0,说明编码格式不对
-    if (state.invalidChars > 0){
-        text = QTextCodec::codecForName("GBK")->toUnicode(array);
-    }
-    return text;
-}
-
-inline static QString FakeUnicodeToUnicode(const QString& str)
-{
-    QByteArray bytes = str.toUtf8();
-    return ByteArrayToUnicode(bytes);
-}
-
-inline static bool ExtractResFile(QWidget* parent, const QString& resFileName, const QString& destPath)
-{
-    bool result = true;
-    QFile autoRunCfgIn(resFileName);
-    if (!autoRunCfgIn.open(QIODevice::ReadOnly | QIODevice::Text)) {
-        QString content = QString("提取文件 %1 失败:%2").arg(resFileName).arg(autoRunCfgIn.errorString());
-        QMessageBox::critical(parent, "错误", content, QMessageBox::Yes);
-        return false;
-    }
-    QTextStream in(&autoRunCfgIn);
-    QFile autoRunCfgOut(destPath);
-    if (!autoRunCfgOut.open(QIODevice::WriteOnly | QIODevice::Text)) {
-        autoRunCfgIn.close();
-        qDebug() << "open " << destPath << " for write failed" << endl;
-        QString content = QString("写入文件 %1 失败:%2").arg(destPath).arg(autoRunCfgOut.errorString());
-        QMessageBox::critical(parent, "错误", content, QMessageBox::Yes);
-        return false;
-    }
-    QTextStream out(&autoRunCfgOut);
-    while (!in.atEnd())
-        out << in.readAll();
-
-    autoRunCfgOut.close();
-    autoRunCfgIn.close();
-
-    result = QFile::setPermissions(destPath, QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ExeOwner
-                                   | QFileDevice::ReadUser | QFileDevice::WriteUser | QFileDevice::ExeUser
-                                   | QFileDevice::ReadGroup | QFileDevice::ReadOther
-                                   | QFileDevice::ExeGroup | QFileDevice::ExeOther);
-
-    return result;
-}
-
-inline static QStringList ExecuteShellScripts(QWidget* parent, QString shellCmd)
-{
-
-    qDebug() << __FUNCTION__ << ": " << shellCmd;
-
-    QStringList results, options;
-    QProcess* subScriptsProcess = new QProcess(parent);
-    subScriptsProcess->setProcessChannelMode(QProcess::MergedChannels);
-    subScriptsProcess->start("sh", QStringList() << "-c" << shellCmd);
-    subScriptsProcess->waitForFinished();
-    QString str(subScriptsProcess->readAllStandardOutput());
-    results << QString::number(subScriptsProcess->exitCode());
-    qDebug() << results;
-    results << subScriptsProcess->program() << subScriptsProcess->arguments();
-    results << str;
-    QMessageBox::warning(parent, "Run Shell Scripts Info", results.join("\n"), QMessageBox::Ok);
-    delete subScriptsProcess;
-    return results;
-}
-
-inline static QString getUserName()
-{
-    QString result;
-
-    QProcessEnvironment envs = QProcessEnvironment::systemEnvironment();
-    if (envs.contains("SUDO_USER")) {
-        result = envs.value("SUDO_USER");
-    }
-
-    if (result.isNull() || result.isEmpty()) {
-        result = envs.value("USER");
-    }
-
-    return result;
-}
-
-inline static QString getFrameworkConfigPath()
-{
-    QString appDir = QCoreApplication::applicationDirPath();
-
-#ifdef Q_WS_WIN32
-
-    if (appDir.endsWith("\\bin")) {
-        appDir = appDir.left(appDir.length() - QString("\\bin").length());
-        appDir += "\\cfg";
-    }
-    QString configFileName = appDir + "\\SpShell.ini";
-
-#else
-
-    if (appDir.endsWith("/bin")) {
-        appDir = appDir.left(appDir.length() - QString("/bin").length());
-        appDir += "/cfg";
-    }
-    QString configFileName = appDir + "/SpShell.ini";
-
-#endif
-
-    return configFileName;
-}
-
-#endif // BOOTGLOBAL_H

+ 0 - 21
Framework/spshell/Widgets/BootSplashScreen.cpp

@@ -1,21 +0,0 @@
-#include "BootSplashScreen.h"
-
-BootSplashScreen::BootSplashScreen(QPixmap& pixmap, int elapseTime)
-    : QSplashScreen(pixmap)
-    , mProgressBar(nullptr),mElapseTime(elapseTime)
-{
-    //mProgressBar = new QProgressBar(this);
-    //mProgressBar->setGeometry(0, pixmap.height() - 50, pixmap.width(), 30);
-    //mProgressBar->setRange(0, 100);
-    //mProgressBar->setValue(0);
-
-    setCursor(Qt::BlankCursor);
-    setFont(QFont("宋体", 14));
-}
-
-BootSplashScreen::~BootSplashScreen()
-{
-
-}
-
-

+ 0 - 29
Framework/spshell/Widgets/BootSplashScreen.h

@@ -1,29 +0,0 @@
-#ifndef BOOTSPLASHSCREEN_H
-#define BOOTSPLASHSCREEN_H
-
-#include <QSplashScreen>
-#include <QPixmap>
-#include <QProgressBar>
-#include <QList>
-#include <QtGlobal>
-
-
-class BootSplashScreen : public QSplashScreen
-{
-    Q_OBJECT
-public:
-    BootSplashScreen(QPixmap& pixmap, int elapseTime);
-    ~BootSplashScreen();
-
-private:
-    QProgressBar* mProgressBar;
-    int mElapseTime;
-
-private:
-    void SetProgress();
-
-private:
-    void slotUpdateProgress();
-};
-
-#endif // BOOTSPLASHSCREEN_H

+ 0 - 284
Framework/spshell/Widgets/BootWidget.cpp

@@ -1,284 +0,0 @@
-#include "BootWidget.h"
-#include "BootGlobal.h"
-#include "ui_BootWidget.h"
-
-#include <QLabel>
-#include <QScreen>
-#include <QDateTime>
-
-#include "SpBase.h"
-
-BootWidget::BootWidget(QString systemInfo, int totalEntityCount, QWidget *parent)
-    : QWidget(parent),mSplitter(NULL),mListEvtLog(NULL), mSystemInfo(systemInfo)
-	,mListImportantTip(NULL),mLogoLabel(NULL),mEntityBootTotalLabel(NULL),mEntityBootingLabel(NULL)
-    , mEntityTotalCount(totalEntityCount), mEntityBootedCount(0)
-{
-    setWindowIcon(QIcon(":/res/FavIcon.ico"));
-    setMinimumSize(1920, 1080);
-    SetFullMode();
-    Init();
-}
-
-BootWidget::~BootWidget()
-{
-
-}
-
-void BootWidget::SetFullMode()
-{
-    setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
-    setAttribute(Qt::WA_TranslucentBackground);
-
-    /*
-    setWindowFlags(Qt::Window | Qt::FramelessWindowHint
-                   | Qt::WindowStaysOnTopHint|Qt::Tool
-                   |Qt::X11BypassWindowManagerHint);
-    */
-
-    //setParent(nullptr);
-
-    QList<QScreen *> listScreens =  QGuiApplication::screens();  //多显示器
-    QRect rect = listScreens.at(0)->geometry();
-    const int desktopWidth = rect.width();
-    const int desktopHeight = rect.height();
-    setMinimumSize(desktopWidth, desktopHeight);
-}
-
-void BootWidget::Demo_FulfillLog()
-{
-    for(int i=1; i<=20; ++i)
-    {
-        QString str = QString(QStringLiteral("我是第%1串字符串")).arg(i);
-        QBaseListWidgetItem* item = new QErrorListWidgetItem(str);
-        // 为啥子类不能直接调用父类的接口??
-        item->AppentToWidget(mListEvtLog);
-    }
-}
-
-void BootWidget::Demo_FulfillFatalMsg()
-{
-    for(int i=1; i<1024; ++i)
-    {
-        QString str = QString(QStringLiteral("我是第%1串字符串")).arg(i);
-        QBaseListWidgetItem* item = new QTipListWidgetItem(str);
-        item->AppentToWidget(mListImportantTip);
-    }
-}
-
-void BootWidget::RefreshInfoAboutEntity()
-{
-    int totalBootedEntity(0);
-    QString failedEntityInfo;
-    for (int i = 0; i < mBootEntitiesInfo.size(); ++i) {
-        if ((mBootEntitiesInfo[i].entityState >= Idle && mBootEntitiesInfo[i].entityState <= Pause)
-                       || mBootEntitiesInfo[i].entityState == Passed || mBootEntitiesInfo[i].entityState == Failed) {
-            totalBootedEntity++;
-        } else if (mBootEntitiesInfo[i].entityState == Lost) {
-            failedEntityInfo += QString(QStringLiteral("模块[%1]启动失败\r\n")).arg(mBootEntitiesInfo[i].entityName);
-        }
-    }
-    QString totalEntityBootInfo = QString(QStringLiteral("%1/%2 个模块启动成功")).arg(totalBootedEntity).arg(mEntityTotalCount);
-    mEntityBootTotalLabel->setText(totalEntityBootInfo);
-    mEntityBootFailedLabel->setText(failedEntityInfo);
-}
-
-void BootWidget::Init()
-{
-    QFont font;
-    font.setFamily(QStringLiteral("微软雅黑"));
-    //font.setPointSize(12);
-    this->setFont(font);
-
-    auto *layoutCenter = new QHBoxLayout(this);
-    auto *layoutLeft = new QVBoxLayout(this);
-    auto *layoutRight = new QVBoxLayout(this);
-    auto *layoutRightArea = new QVBoxLayout(this);
-
-    SlimLayout(layoutCenter);
-    SlimLayout(layoutLeft);
-    SlimLayout(layoutRight);
-    SlimLayout(layoutRightArea);
-
-    layoutRight->addLayout(layoutRightArea);
-
-    mListEvtLog = new QLeftInfoListWidget(this);
-    layoutLeft->addWidget(mListEvtLog);
-
-    //Demo_FulfillLog();
-
-    // LOGO
-    mLogoLabel = new QLabel(this);
-    QPixmap logoPixmap(GetLogoPicPath());
-    if(false)
-    {
-        const int labelWidth = mLogoLabel->width();
-        const int labelHeight = mLogoLabel->height();
-        //logoPixmap = logoPixmap.scaled(labelWidth, labelHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-        logoPixmap = logoPixmap.scaled(labelWidth, labelHeight, Qt::KeepAspectRatio);
-    } else {
-        //const int pixWidth = logoPixmap.width();
-        //const int pixlHeight = logoPixmap.height();
-        //mLogoLabel->resize(pixWidth, pixlHeight);
-    }
-    mLogoLabel->setAlignment(Qt::AlignCenter);
-    mLogoLabel->setPixmap(logoPixmap);
-    //mLogoLabel->setScaledContents(true);
-    SetWidgetBackgroundColor(mLogoLabel, GetRightBackgoundColor());
-
-    // TerminalInfo
-    QLabel* terminalLabel = new QLabel(this);
-    QFont terminalFont;
-    terminalFont.setFamily(QStringLiteral("微软雅黑"));
-    terminalFont.setPointSize(12);
-    terminalLabel->setFont(terminalFont);
-    terminalLabel->setText(mSystemInfo);
-    terminalLabel->setAlignment(Qt::AlignCenter);
-    SetWidgetBackgroundColor(terminalLabel, GetRightBackgoundColor());
-
-
-    // Entity boot information
-    mEntityBootTotalLabel = new QLabel(this);
-    //equals: entityBootLabel->setText(QString::fromLocal8Bit(("11/55 个模块启动成功")));
-    mEntityBootTotalLabel->setText(QStringLiteral("11/55 个模块启动成功"));
-    mEntityBootTotalLabel->setAlignment(Qt::AlignCenter);
-    QFont fontLabel;
-    fontLabel.setBold(true);
-    fontLabel.setPointSize(12);
-    mEntityBootTotalLabel->setFont(fontLabel);
-    //entityBootLabel->setStyleSheet("font-size:40px;font-style:blod");
-    SetWidgetBackgroundColor(mEntityBootTotalLabel, GetRightBackgoundColor());
-    // no effect.
-    //entityBootLabel->setContentsMargins(0,1000,0,1000);
-    mEntityBootTotalLabel->setMargin(10);
-
-    // Entity startup information
-    {
-        mEntityBootingLabel = new QLabel(this);
-        mEntityBootingLabel->setText(QStringLiteral("正在启动 mod_Browser..."));
-        mEntityBootingLabel->setAlignment(Qt::AlignCenter);
-        fontLabel.setBold(false);
-        fontLabel.setPointSize(12);
-        mEntityBootingLabel->setFont(fontLabel);
-        mEntityBootingLabel->setMargin(5);
-        QPalette pe;
-        pe.setColor(QPalette::Background, GetRightBackgoundColor());
-        pe.setColor(QPalette::Foreground, Qt::white);
-        mEntityBootingLabel->setAutoFillBackground(true);
-        mEntityBootingLabel->setPalette(pe);
-    }
-    {
-        mEntityBootFailedLabel = new QLabel(this);
-        mEntityBootFailedLabel->setText(QStringLiteral("实体[mod_Browser]启动失败"));
-        mEntityBootFailedLabel->setAlignment(Qt::AlignCenter);
-        fontLabel.setBold(false);
-        fontLabel.setPointSize(11);
-        mEntityBootFailedLabel->setFont(fontLabel);
-        mEntityBootFailedLabel->setMargin(5);
-        QPalette pe;
-
-        pe.setColor(QPalette::Background, GetRightBackgoundColor());
-        pe.setColor(QPalette::Foreground, Qt::darkRed);
-        mEntityBootFailedLabel->setAutoFillBackground(true);
-        mEntityBootFailedLabel->setPalette(pe);
-    }
-
-    layoutRightArea->addWidget(mLogoLabel);
-    layoutRightArea->addWidget(terminalLabel);
-    layoutRightArea->addWidget(mEntityBootTotalLabel);
-    layoutRightArea->addWidget(mEntityBootingLabel);
-    layoutRightArea->addWidget(mEntityBootFailedLabel);
-
-    mListImportantTip = new QRightInfoListWidget(this);
-    layoutRightArea->addWidget(mListImportantTip);
-
-    //Demo_FulfillFatalMsg();
-
-    layoutCenter->addLayout(layoutLeft);
-    layoutCenter->addLayout(layoutRight);
-    layoutCenter->setStretch(0, 80);
-    layoutCenter->setStretch(1, 20);
-
-    this->setLayout(layoutCenter);
-}
-
-void BootWidget::paintEvent(QPaintEvent *event)
-{
-    /*
-    QPixmap logoPixmap(GetLogoPicPath());
-    const int pixWidth = logoPixmap.width();
-    const int pixlHeight = logoPixmap.height();
-
-    const int labelWidth = mLogoLabel->width();
-    const int newLabelHeight = labelWidth / (pixWidth / pixlHeight);
-    mLogoLabel->resize(labelWidth, newLabelHeight);
-    */
-}
-
-void BootWidget::ReceiveMessage(const QtMessageInfo* message)
-{
-    QBaseListWidgetItem* item = new QErrorListWidgetItem(message->content);
-    item->AppentToWidget(mListEvtLog);
-}
-
-namespace
-{
-QString CoverWithTimePrefix(QString content)
-{
-    QDateTime time = QDateTime::currentDateTime();
-    QString buffer = time.toString("[hh:mm:ss]");
-    QString result = QString("%1 %2").arg(buffer).arg(content);
-    return result;
-}
-}
-
-void BootWidget::ReceiveMessageVariant(QVariant info)
-{
-    //LOG_FUNCTION();
-
-    //mMutex4BootEntities.lock();
-    QtMessageInfo message = info.value<QtMessageInfo>();
-    if (message.type == TextNormal || message.type == TextEvent) {
-        QBaseListWidgetItem* item = new QInfoListWidgetItem(CoverWithTimePrefix(message.content));
-        item->AppentToWidget(mListEvtLog);
-    } else if (message.type == TextWarn) {
-        QBaseListWidgetItem* item = new QWarnListWidgetItem(CoverWithTimePrefix(message.content));
-        item->AppentToWidget(mListEvtLog);
-    } else if (message.type == TextError) {
-        QBaseListWidgetItem* item = new QErrorListWidgetItem(CoverWithTimePrefix(message.content));
-        item->AppentToWidget(mListEvtLog);
-    } else if (message.type == TextFatal || message.type == TextBlock) {
-        QBaseListWidgetItem* item = new QTipListWidgetItem(message.content);
-        item->AppentToWidget(mListImportantTip);
-   
-    } else if (message.type == ModBootInfo) { //entity boot info
-        if (message.content.length() == 0 || message.param1 > Failed) {
-            //mMutex4BootEntities.unlock();
-            return;
-        }
-        
-        int localEntityIndex = -1;
-        for (int i = 0; i < mBootEntitiesInfo.size(); ++i) {
-            if (mBootEntitiesInfo.at(i).entityName == message.content) {
-                localEntityIndex = i;
-                break;
-            }
-        }
-        if (localEntityIndex != -1) {
-            if (mBootEntitiesInfo[localEntityIndex].entityState != message.param1) {
-               // const auto previousState = mBootEntitiesInfo[localEntityIndex].entityState;
-                const auto currState = static_cast<EntityState>(message.param1);
-                mBootEntitiesInfo[localEntityIndex].entityState = currState;
-            }
-        } else {
-            EntityBootInfo newEntityInfo;
-            newEntityInfo.entityName = message.content;
-            newEntityInfo.entityState = static_cast<EntityState>(message.param1);
-            mBootEntitiesInfo.push_back(newEntityInfo);
-        }
-        RefreshInfoAboutEntity();
-    } else if (message.type == ModStartupInfo) {
-        mEntityBootingLabel->setText(message.content);
-    }
-    //mMutex4BootEntities.unlock();
-}
-

+ 0 - 56
Framework/spshell/Widgets/BootWidget.h

@@ -1,56 +0,0 @@
-#ifndef BOOTWIDGET_H
-#define BOOTWIDGET_H
-
-#include <QWidget>
-#include <QSplitter>
-#include <QPlainTextEdit>
-#include <QLabel>
-#include <QMetaType>
-#include <QVector>
-#include <QMutex>
-
-#include "QInfoListWidget.h"
-#include "QtMessageInfo.h"
-#include "QRvcItemModel.hpp"
-
-
-class BootWidget : public QWidget
-{
-    Q_OBJECT
-
-public:
-    BootWidget(QString systemInfo, int totalEntityCount, QWidget *parent = nullptr);
-    ~BootWidget();
-
-    void paintEvent(QPaintEvent *event);
-
-public slots:
-    void ReceiveMessage(const QtMessageInfo* message);
-    void ReceiveMessageVariant(QVariant info);
-private:
-    void Init();
-    void SetFullMode();
-
-    void Demo_FulfillLog();
-    void Demo_FulfillFatalMsg();
-    void RefreshInfoAboutEntity();
-
-private:
-    QSplitter *mSplitter;
-    QLeftInfoListWidget *mListEvtLog;
-    QRightInfoListWidget *mListImportantTip;
-
-    QLabel* mLogoLabel;
-    QLabel* mEntityBootTotalLabel;
-    QLabel* mEntityBootingLabel;
-    QLabel* mEntityBootFailedLabel;
-
-    QPlainTextEdit* mTextEidtFatalMsg;
-    QString mSystemInfo;
-
-    QVector< EntityBootInfo> mBootEntitiesInfo;
-    int mEntityTotalCount;
-    int mEntityBootedCount;
-    QMutex mMutex4BootEntities;
-};
-#endif // BOOTWIDGET_H

+ 0 - 20
Framework/spshell/Widgets/BootWidget.ui

@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>BootWidget</class>
- <widget class="QWidget" name="BootWidget">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>800</width>
-    <height>600</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>BootWidget</string>
-  </property>
-  <layout class="QHBoxLayout" name="horizontalLayout_2"/>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 0 - 34
Framework/spshell/Widgets/CustomImportInterface.h

@@ -1,34 +0,0 @@
-#ifndef CUSTOMIMPORTINTERFACE_H
-#define CUSTOMIMPORTINTERFACE_H
-
-#include <QObject>
-#include <QWidget>
-#include <QString>
-#include <QVariantList>
-#include <QVariant>
-
-enum InterfaceType
-{
-    WidgetType
-};
-
-class CustomImportInterface
-{
-public:
-    virtual ~CustomImportInterface() = default;
-    virtual QString getVersion() = 0;
-    virtual InterfaceType getType() = 0;
-    virtual QString getDisplayText() = 0;
-    virtual QWidget* getComponent(QWidget *parent, const QStringList& param) = 0;
-    virtual QVariantList getMoreDetail() = 0;
-};
-
-
-QT_BEGIN_NAMESPACE
-
-#define CustomInterface_iid "org.cmbchina.rvcterminal.CustomImportInterface/1.0"
-
-Q_DECLARE_INTERFACE(CustomImportInterface, CustomInterface_iid)
-QT_END_NAMESPACE
-
-#endif // CUSTOMIMPORTINTERFACE_H

+ 0 - 119
Framework/spshell/Widgets/OperaThread.hpp

@@ -1,119 +0,0 @@
-#ifndef RVC_SPSHELL_OPERATION_THREAD_H__
-#define RVC_SPSHELL_OPERATION_THREAD_H__
-
-#include <QThread>
-#include <QString>
-#include <QDebug>
-
-#include <string>
-#ifdef WITH_QT
-#include "SpShellConsole.h"
-#endif //WITH_QT
-
-#include "QRvcItemModel.hpp"
-
-static inline std::string Q2Str(const QString& str)
-{
-    std::string ss = str.toStdString();
-    return ss;
-    //QByteArray ba = mE->entityName.toLatin1();
-    //const char *ent = ba.data();
-}
-
-static inline QString Str2Q(const std::string& str)
-{
-    QString qs = QString::fromStdString(str);
-    return qs;
-}
-
-struct Threadee
-{
-    QString entityName;
-    QString cmdLine;
-    DealType dealType;
-};
- 
-class OperatThread : public QThread
-{
-    Q_OBJECT
-
-signals:
-    void OperateResult(int opt_type, int result, const QString& message);    
-
-public:
-    OperatThread(Threadee* ee, QObject* parent)
-    :mE(ee),QThread(parent)
-    {
-
-    }
-    ~OperatThread()
-    {
-        if(mE) {
-            delete mE;
-            mE = nullptr;
-        }
-    }
-
-    void run()
-    {
-        doSomething();
-    }
-    bool doSomething()
-    {
-        qDebug() << "OperatTheard doing" << endl;
-
-        std::string result;
-#ifdef WITH_QT
-        if(mE != nullptr) {
-            std::string str = mE->entityName.toStdString();
-            QByteArray ba = mE->entityName.toLatin1();
-            const char *ent = ba.data();
-            //const char* ent = str.c_str();
-            switch (mE->dealType)
-            {
-            case Deal_Start:
-                {
-                    if (!mE->cmdLine.isNull() && !mE->cmdLine.isEmpty()) {
-                        QByteArray line = mE->cmdLine.toLatin1();
-                        const char* params = line.data();
-                        result = mConsole.StartEntity(ent, params);
-                    } else {
-                        result = mConsole.StartEntity(ent);
-                    }
-                }
-                break;
-            case Deal_Close:
-                result = mConsole.StopEntity(ent);
-                break;
-            case Deal_Pause:
-                result = mConsole.PauseEntity(ent);
-                break;
-            case Deal_Continue:
-                result = mConsole.ContinueEntity(ent);
-                break;
-            case Deal_Kill:
-                result = mConsole.TerminateEntity(ent);
-                break;
-            case Deal_Test:
-                result = mConsole.TestEntity(ent);
-                break;
-            default:
-                result = "none";
-                break;
-            }
-        }
-#endif //WITH_QT
-        const bool flag = (result.find("succeed") != std::string::npos);
-        emit OperateResult(1, flag ? 0 : -1, mE->entityName);
-        return flag;
-    }
-    
-private:
-    Threadee* mE;
-#ifdef WITH_QT
-    CSpShellConsole mConsole;
-#endif //WITH_QT
-};
-
-
-#endif //RVC_SPSHELL_OPERATION_THREAD_H__

+ 0 - 62
Framework/spshell/Widgets/QConsoleListWidget.cpp

@@ -1,62 +0,0 @@
-#include "QConsoleListWidget.h"
-#include <QScroller>
-#include <QCryptographicHash>
-#include <QDebug>
-
-void QConsoleListWidget::PostInit()
-{
-    qDebug("QConsoleListWidget::PostInit()");
-    this->setStyleSheet("QListWidget{background:#000000;outline:0px;}" //去除选中时的虚线
-                        //"QListWidget::item{color:#00FF00;}"
-                        "QListWidget::item:selected,QListWidget::item:hover{background: #000000;}");
-    this->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
-
-    /* 设置鼠标左键拖动 */
-    //QScroller::grabGesture(this, QScroller::LeftMouseButtonGesture);
-}
-
-void QConsoleListWidget::RemoveDuplicateItem()
-{
-    if(this->count() > reservedItemCount) {
-        int idx = this->count() - 1;
-        while (idx >= reservedItemCount)
-        {
-            auto item = this->takeItem(idx);
-            this->removeItemWidget(item);
-            idx--;
-        }
-    }
-    QListWidgetItem* newItem = currentItem(); //this->item(0);
-    QString content = newItem->text();
-    QString subContent = content.mid(QString("[hh:mm:ss] ").length()); //timestamp prefix length
-    QByteArray hashData = QCryptographicHash::hash(subContent.toLocal8Bit(), QCryptographicHash::Md5);
-    content = hashData.toHex();
-    newItem->setWhatsThis(content);
-    int selectIdx = -1;
-    for (int idx = 0; idx < this->count(); ++idx) {
-        QListWidgetItem* oldItem = this->item(idx);
-        if (oldItem != newItem) {
-            QVariant value = oldItem->data(Qt::WhatsThisRole);
-            if (!value.isNull() && value.isValid()) {
-                if (content == value.toString()) {
-                    selectIdx = idx;
-                    break;
-                }
-            } 
-        }
-    }
-    if (selectIdx != -1) {
-        auto item = this->takeItem(selectIdx);
-        this->removeItemWidget(item);
-    }
-}
-
-void QFatalListWidget::PostInit()
-{
-    qDebug("QFatalListWidget::PostInit()");
-    this->setStyleSheet("QListWidget{background:#F5F5F5;outline:0px;}" //去除选中时的虚线
-                        //"QListWidget::item{color:#00FF00;}"
-                        "QListWidget::item:selected,QListWidget::item:hover{background: #F5F5F5;}");
-    this->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
-
-}

+ 0 - 38
Framework/spshell/Widgets/QConsoleListWidget.h

@@ -1,38 +0,0 @@
-#ifndef QCONSOLELISTWIDGET_H
-#define QCONSOLELISTWIDGET_H
-
-#include "QInfoListWidget.h"
-
-class QConsoleListWidget : public QInfoListWidget
-{
-    Q_OBJECT
-public:
-    QConsoleListWidget(QWidget* parent = nullptr)
-        :QInfoListWidget(parent),reservedItemCount(100)
-        {
-            PostInit();
-        }
-    virtual ~QConsoleListWidget() {}
-
-    virtual void PostInit() override;
-
-    void RemoveDuplicateItem() override;
-
-protected:
-    unsigned int reservedItemCount;
-};
-
-class QFatalListWidget : public QConsoleListWidget
-{
-    Q_OBJECT
-public:
-    QFatalListWidget(QWidget* parent = nullptr)
-        :QConsoleListWidget(parent)
-        {
-            PostInit();
-        }
-    virtual ~QFatalListWidget() {}
-    virtual void PostInit() override;
-};
-
-#endif // QCONSOLELISTWIDGET_H

+ 0 - 202
Framework/spshell/Widgets/QInfoListWidget.cpp

@@ -1,202 +0,0 @@
-#include "QInfoListWidget.h"
-#include "BootGlobal.h"
-#include <QScrollBar>
-
-
-//static const QColor g_sLeftBackgroundColor = QColor(101, 105, 108, 255); //#65696C
-//static const QColor g_sRightBackgroundColor = QColor(161, 163, 165, 255); //#A1A3A5
-
-namespace  {
-
-int ColorDodge(int primaryColor, int secondaryColors)
-{
-    if(secondaryColors >= 255) {
-        return 255;
-    }
-    //基色 +(基色 * 混合色)/(255 - 混合色)= 结果色
-    int result = (primaryColor + (uint)(primaryColor * secondaryColors) / (255 - secondaryColors));
-    if(result > 255) {
-        result = 255;
-    } else if(result < 0) {
-        result = 0;
-    }
-    return result;
-}
-
-QColor GetSortedDisplayColor(const QListWidget* parent)
-{
-    const int stepMax = 100;
-    const int currItemsCount = parent->count();
-
-    const int j = (stepMax - currItemsCount % stepMax);
-    const int gradientR = ColorDodge(205, j);
-    const int gradientG = ColorDodge(38, j);
-    const int gradientB = ColorDodge(38, j);
-    return QColor(gradientR, gradientG, gradientB, 255);
-}
-
-}
-
-
-QBaseListWidgetItem::QBaseListWidgetItem(const QString &text, InfoType it, LevelType lt)
-    :QListWidgetItem(text),infoType(it),levelType(lt)
-{
-    setFlags(Qt::ItemIsEnabled | Qt::NoItemFlags);
-
-}
-
-void QBaseListWidgetItem::AppentToWidget(QInfoListWidget* container, bool insertFront)
-{
-    if(insertFront)
-    {
-        container->insertItem(0, this);
-        container->setCurrentRow(0);
-    } else {
-        container->addItem(this);
-        container->setCurrentRow(container->count()-1);
-    }
-    setForeground(FrontColor());
-    setBackground(BackgroundColor());
-    QFont font;
-    font.setFamily(QStringLiteral("微软雅黑"));
-    font.setPointSize(10);
-    this->setFont(font);
-    if(insertFront) {
-        container->RemoveDuplicateItem();
-    }
-}
-
-QColor QBaseListWidgetItem::FrontColor() const
-{
-    auto colorValue = Qt::black;
-    return QColor(Qt::GlobalColor(colorValue));
-}
-
-QColor QBaseListWidgetItem::BackgroundColor() const
-{
-    return GetLeftBackgoundColor();
-}
-
-QInfoListWidgetItem::QInfoListWidgetItem(const QString &text, LevelType lt)
-    :QBaseListWidgetItem(text, Info, lt)
-{
-
-}
-
-QColor QWarnListWidgetItem::FrontColor() const
-{
-    auto colorValue = Qt::white;
-    return QColor(colorValue);
-}
-
-QColor QLightWarnListWidgetItem::FrontColor() const
-{
-    auto colorValue = Qt::yellow;
-    return QColor(colorValue);
-}
-
-QColor QLightWarnListWidgetItem::BackgroundColor() const
-{
-    auto colorValue = Qt::black;
-    return QColor(colorValue);
-}
-
-QColor QErrorListWidgetItem::FrontColor() const
-{
-    auto colorValue = Qt::darkRed;
-    return QColor(colorValue);
-}
-
-QColor QLightErrorListWidgetItem::FrontColor() const
-{
-    auto colorValue = Qt::red;
-    return QColor(colorValue);
-}
-
-QColor QLightErrorListWidgetItem::BackgroundColor() const
-{
-    auto colorValue = Qt::black;
-    return QColor(colorValue);
-}
-
-QColor QTipErrorListWidgetItem::FrontColor() const
-{
-    auto colorValue = Qt::red;
-    return QColor(colorValue);
-}
-
-QColor QTipErrorListWidgetItem::BackgroundColor() const
-{
-    return QColor(245, 245, 245, 255);
-}
-
-
-QColor QTipListWidgetItem::FrontColor() const
-{
-    QListWidget* parent = listWidget();
-    if(parent != nullptr)
-        return GetSortedDisplayColor(parent);
-    auto colorValue = Qt::darkRed;
-    return QColor(colorValue);
-}
-
-QColor QTipListWidgetItem::BackgroundColor() const
-{
-    return GetRightBackgoundColor();
-}
-
-QColor QConsoleListWidgetItem::FrontColor() const
-{
-    return GetConsoleFrontColor();
-}
-
-QColor QConsoleListWidgetItem::BackgroundColor() const
-{
-    auto colorValue = Qt::black;
-    return QColor(colorValue);
-}
-
-
-QInfoListWidget::QInfoListWidget(QWidget* parent)
-    :QListWidget(parent)
-{
-    Init();
-}
-
-void QInfoListWidget::Init()
-{
-    this->setViewMode(QListView::ListMode);
-    this->setFlow(QListView::TopToBottom);
-    this->setSortingEnabled(false);
-    // Hide the scrollbar
-    this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-    this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-    /*disable hightlight when cursor hover*/
-    this->setStyleSheet("QListWidget::item:hover{background: transparent;}");
-    /*hide border*/
-    this->setFrameShape(QListWidget::NoFrame);
-}
-
-void QInfoListWidget::WheelEvent(QWheelEvent* event)
-{
-    int degress = event->angleDelta().ry() * 0.5;
-    if(event->orientation() == Qt::Vertical)
-        verticalScrollBar()->setValue(verticalScrollBar()->value() - degress);
-    event->accept();
-}
-
-void QLeftInfoListWidget::PostInit()
-{
-    qDebug("QLeftInfoListWidget::PostInit()");
-    this->setStyleSheet("QListWidget{background: #65696C;outline:0px;}"
-                        "QListWidget::item{padding-top:1px; padding-bottom:1px;}"
-                        "QListWidget::item:hover{background: #65696C;}");
-}
-
-void QRightInfoListWidget::PostInit()
-{
-    qDebug("QRightInfoListWidget::PostInit()");
-    //SetWidgetBackgroundColor(this, GetRightBackgoundColor());
-    this->setStyleSheet("QListWidget{background: #A1A3A5;outline:0px;}" //去除选中时的虚线
-                        "QListWidget::item:selected,QListWidget::item:hover{background: #A1A3A5;}");
-}

+ 0 - 177
Framework/spshell/Widgets/QInfoListWidget.h

@@ -1,177 +0,0 @@
-#ifndef QINFOLISTWIDGET_H
-#define QINFOLISTWIDGET_H
-
-#include <QWidget>
-#include <QListWidget>
-#include <QWheelEvent>
-
-
-enum InfoType {
-    Info,
-    Event,
-    Warning,
-    Error,
-    Succeed
-};
-
-enum LevelType {
-    None,
-    Lower,
-    Normal,
-    Higher
-};
-
-
-class QInfoListWidget;
-
-
-class QBaseListWidgetItem : public QListWidgetItem
-{
-public:
-    QBaseListWidgetItem(const QString &text, InfoType it, LevelType lt);
-    virtual ~QBaseListWidgetItem() {}
-
-    void AppentToWidget(QInfoListWidget* container, bool insertFront = true);
-
-protected:
-    virtual QColor FrontColor() const;
-    virtual QColor BackgroundColor() const;
-    InfoType infoType;
-    LevelType levelType;
-};
-
-class QInfoListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QInfoListWidgetItem(const QString &text, LevelType lt = None);
-    virtual ~QInfoListWidgetItem() {}
-};
-
-class QWarnListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QWarnListWidgetItem(const QString& text, LevelType lt = None) 
-        :QBaseListWidgetItem(text, InfoType::Warning, lt) {}
-    virtual ~QWarnListWidgetItem() {}
-private:
-    QColor FrontColor() const;
-};
-
-class QLightWarnListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QLightWarnListWidgetItem(const QString& text, LevelType lt = None)
-        :QBaseListWidgetItem(text, InfoType::Warning, lt) {}
-    virtual ~QLightWarnListWidgetItem() {}
-private:
-    QColor FrontColor() const;
-    QColor BackgroundColor() const;
-};
-
-class QErrorListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QErrorListWidgetItem(const QString &text, LevelType lt = None)
-        :QBaseListWidgetItem(text, InfoType::Error, lt){}
-    virtual ~QErrorListWidgetItem() {}
-
-private:
-    QColor FrontColor() const;
-};
-
-class QLightErrorListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QLightErrorListWidgetItem(const QString &text, LevelType lt = None)
-        :QBaseListWidgetItem(text, InfoType::Error, lt){}
-    virtual ~QLightErrorListWidgetItem() {}
-
-private:
-    QColor FrontColor() const;
-    QColor BackgroundColor() const;
-};
-
-class QTipErrorListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QTipErrorListWidgetItem(const QString &text, LevelType lt = None)
-        :QBaseListWidgetItem(text, InfoType::Error, lt){}
-    virtual ~QTipErrorListWidgetItem() {}
-
-private:
-    QColor FrontColor() const;
-    QColor BackgroundColor() const;
-};
-
-class QTipListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QTipListWidgetItem(const QString &text)
-        :QBaseListWidgetItem(text, InfoType::Error, Higher){
-        setTextAlignment(Qt::AlignCenter);
-    }
-    virtual ~QTipListWidgetItem() {}
-
-private:
-    QColor FrontColor() const;
-    QColor BackgroundColor() const;
-};
-
-class QConsoleListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QConsoleListWidgetItem(const QString &text)
-        :QBaseListWidgetItem(text, InfoType::Info, None)
-    {
-
-    }
-    virtual ~QConsoleListWidgetItem() {}
-
-private:
-    QColor FrontColor() const;
-    QColor BackgroundColor() const;
-};
-
-
-class QInfoListWidget : public QListWidget
-{
-    Q_OBJECT
-public:
-    QInfoListWidget(QWidget* parent = nullptr);
-    virtual ~QInfoListWidget() {}
-
-    virtual void PostInit() { qDebug("parent::PostInit"); }
-
-    virtual void RemoveDuplicateItem() 
-    {
-
-    }
-
-protected:
-    void Init();
-    void WheelEvent(QWheelEvent* event);
-};
-
-class QLeftInfoListWidget : public QInfoListWidget
-{
-    Q_OBJECT
-public:
-    QLeftInfoListWidget(QWidget* parent = nullptr)
-        :QInfoListWidget(parent){PostInit();}
-    virtual ~QLeftInfoListWidget() {}
-
-    virtual void PostInit() override;
-};
-
-class QRightInfoListWidget : public QInfoListWidget
-{
-    Q_OBJECT
-public:
-    QRightInfoListWidget(QWidget* parent = nullptr)
-        :QInfoListWidget(parent){PostInit();}
-    virtual ~QRightInfoListWidget() {}
-
-    virtual void PostInit() override;
-};
-
-#endif // QINFOLISTWIDGET_H

+ 0 - 206
Framework/spshell/Widgets/QRvcItemModel.hpp

@@ -1,206 +0,0 @@
-#ifndef QRVCITEMMODEL_HPP
-#define QRVCITEMMODEL_HPP
-
-#include <QVariant>
-#include <QStandardItemModel>
-
-enum EntityState
-{
-    NoStart = 0,
-    Starting,
-    Idle,
-    Busy,
-    Pause,
-    UnLoading,
-    Lost,
-    Close,
-    Killed,
-    Passed,
-    Failed,
-    All
-};
-
-enum EntityStartType
-{
-    Auto,
-    Manual
-};
-
-
-enum DealType {
-    Deal_Start,
-    Deal_Close,
-    Deal_Pause,
-    Deal_Continue,
-    Deal_Kill,
-    Deal_Test
-};
-
-static inline QString MappingSatus2String(const EntityState& state)
-{
-    static QString mappingTable[] = {"NoStart", "Starting", "Idle", "Busy", "Pause", "UnLoading", "Lost", "Close", "Killed", "Passed", "Failed", "All"};
-    return mappingTable[(int)state];
-}
-
-static inline EntityState MappingString2Status(const QString& state)
-{
-    static QString mappingTable[] = {"NoStart", "Starting", "Idle", "Busy", "Pause", "UnLoading", "Lost", "Close", "Killed", "Passed", "Failed", "All"};
-    if(state.isNull() || state.isEmpty())
-        return NoStart;
-    for(int i=0; i<sizeof(mappingTable)/sizeof(mappingTable[0]); ++i)
-    {
-        if(mappingTable[i].compare(state) == 0)
-            return EntityState(i);
-    }
-    return NoStart;
-}
-
-static inline QString MappingStartType2String(const EntityStartType& type)
-{
-    static QString mappingTable[] = {"auto", "manual"};
-    return mappingTable[(int)type];
-}
-
-static inline EntityStartType MappingString2StartType(const QString& type)
-{
-    static QString mappingTable[] = {"auto", "manual"};
-    if(type.isNull() || type.isEmpty())
-        return Manual;
-    for(int i=0; i<sizeof(mappingTable)/sizeof(mappingTable[0]); ++i)
-    {
-        if(mappingTable[i].compare(type) == 0)
-            return EntityStartType(i);
-    }
-    return Manual;
-}
-
-static inline QColor MappingStatus2Color(const EntityState& state)
-{
-    switch (state) {
-    case Lost:
-        return QColor (240,128,128);
-    break;
-    case NoStart:
-        return QColor (245,245,245);
-    break;
-    case Starting:
-    case UnLoading:
-        return QColor (250,250,210);
-    break;
-    case Busy:
-        return QColor (255,255,0);
-    break;
-    case Pause:
-        return QColor (255,218,185);
-    break;
-    case Close:
-    case Killed:
-        return QColor (230,230,250);
-        break;
-    case Passed:
-        return QColor (124,252,0);
-        break;
-    case Failed:
-        return QColor (240,128,128);
-        break;
-    case Idle:
-    case All:
-    default:
-        return QColor (255,250,250);
-    break;
-    }
-}
-
-static inline QVariant MappingStatus2Color(const QString& statusString)
-{
-    //QColor (244,164,96);//
-    if(statusString.compare("Lost") == 0)
-        return QColor (240,128,128); //QColor(Qt::red);
-    else if(statusString.compare("NoStart") == 0)
-        return QColor (245,245,245);//QColor(Qt::lightGray);
-    else if(statusString.compare("Pending") == 0 
-           || statusString.compare("Starting") == 0 
-           || statusString.compare("UnLoading") == 0)
-        return QColor (250,250,210);//QColor(Qt::yellow);
-    else if(statusString.compare("Close") == 0 || statusString.compare("Killed") == 0)
-        return QColor (230,230,250);//QColor(Qt::darkGray);
-    else if(statusString.compare("Pause") == 0)
-        return QColor (255,218,185);//QColor(Qt::blue);
-    else
-        return QVariant();
-}
-
-struct EntityBootInfo
-{
-    QString entityName;
-    EntityState entityState;
-};
-
-struct EntityInfo
-{
-    QString entityName;
-    EntityStartType startType;
-    EntityState state;
-    int pid;
-    QString version;
-
-    bool IsValid() const {
-        return (!entityName.isEmpty());
-    }
-
-    EntityInfo(const EntityInfo& rhs)
-        :entityName(rhs.entityName)
-        ,startType(rhs.startType)
-        ,state(rhs.state)
-        ,pid(rhs.pid)
-        ,version(rhs.version) {}
-
-    EntityInfo(const QString& entityName, EntityStartType startType, EntityState entityState, int pid, const QString& ver)
-        :entityName(entityName)
-        ,startType(startType)
-        ,state(entityState)
-        ,pid(pid)
-        ,version(ver) {}
-};
-
-
-struct EntityRunInfo : public EntityInfo
-{
-    QString startupTimeStr;
-    int fds;
-    EntityRunInfo(const EntityInfo& rhs):EntityInfo(rhs),startupTimeStr("NA"),fds(-1)
-    {}
-
-};
-
-
-class RvcItemModel : public QStandardItemModel
-{
-public:
-    RvcItemModel() {}
-
-    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const
-    {
-        if (!index.isValid())
-            return QVariant();
-
-        if (role == Qt::TextAlignmentRole)
-        {
-            return int(Qt::AlignLeft | Qt::AlignVCenter);
-        }
-        else if (role == Qt::DisplayRole)
-        {
-              return QStandardItemModel::data(index, role);
-        }
-        else if(role == Qt::BackgroundColorRole)
-        {
-            const QString str=this->QStandardItemModel::data(this->index(index.row(),2)).toString();
-            return MappingStatus2Color(str);
-
-        }
-
-        return QVariant();
-    }
-};
-
-#endif // QRVCITEMMODEL_HPP

+ 0 - 64
Framework/spshell/Widgets/QtMessageInfo.h

@@ -1,64 +0,0 @@
-#ifndef RVC_QT_MESSAGE_INFO_H__
-#define RVC_QT_MESSAGE_INFO_H__
-
-#include <QMetaType>
-#include <QString>
-#include <QRvcItemModel.hpp>
-
-struct TerminalInfo
-{
-    QString serialNumber;
-    QString site;
-    QString version;
-};
-
-struct BootInfo
-{
-    uint8_t bootedNum;
-    uint8_t totalBootNum;
-};
-
-enum MessageType
-{
-    TextNormal,
-    TextEvent,
-    TextWarn,
-    TextError,
-    TextFatal,
-    TextBlock,
-    TextNotifyInfo,
-    TextNotifyWarn,
-    TextNotifyError,
-
-    ModStartupInfo,
-    ModBootInfo,
-    ModBootError,
-    DisplayShow,
-    DisplayHide,
-    DisplayBlueScreen,
-    StageChangeInfo,
-    MsgTypeMax
-};
-
-struct QtMessageInfo
-{
-    MessageType type;
-    QString content;
-    int param1;
-    int param2;
-};
-
-struct QEntityActiveInfo
-{
-    QString entityName;
-    EntityState entityState;
-    int entityDevId;
-    int entityPID;
-    QString entityVerStr;
-};
-
-Q_DECLARE_METATYPE(QtMessageInfo)
-Q_DECLARE_METATYPE(QEntityActiveInfo)
-
-#endif // !RVC_QT_MESSAGE_INFO_H__
-

+ 0 - 31
Framework/spshell/Widgets/RvcSettings.h

@@ -1,31 +0,0 @@
-#ifndef RVC_SPSHELL_QT_SETTINGS
-#define RVC_SPSHELL_QT_SETTINGS
-
-#include <QSettings>
-
-#pragma once
-
-class RvcSettings : public QSettings
-{
-public:
-
-    RvcSettings(const QString& fileName, Format format, QObject* parent = nullptr)
-        :QSettings(fileName, format, parent)
-    {
-
-    }
-
-    void SetConfigData(QString strNodeName, QString strKeyName, QVariant varValue)
-    {
-        setValue(QString("/%1/%2").arg(strNodeName).arg(strKeyName), varValue);
-    }
-
-    QVariant GetConfigData(QString strNodeName, QString strKeyName)
-    {
-        QVariant qvar = -1;
-        qvar = value(QString("/%1/%2").arg(strNodeName).arg(strKeyName));
-        return qvar;
-    }
-};
-
-#endif //RVC_SPSHELL_QT_SETTINGS

+ 0 - 34
Framework/spshell/Widgets/cpuwidget.cpp

@@ -1,34 +0,0 @@
-#include "cpuwidget.h"
-#include "sysinfo.h"
-
-using namespace QtCharts;
-
-CpuWidget::CpuWidget(QWidget* parent) :
-#ifdef __arm__
-    SysInfoWidget(parent, 3000, 3000),
-#else
-    SysInfoWidget(parent, 1000, 1000),
-#endif
-
-    mSeries(new QPieSeries(this))
-{
-    mSeries->setHoleSize(0.35);
-    mSeries->append("CPU Load", 0.0);
-    mSeries->append("CPU Free", 0.0);
-    mSeries->setLabelsVisible();
-
-    QChart* chart = chartView().chart();
-    chart->addSeries(mSeries);
-    chart->setTitle("CPU average load");
-}
-
-void CpuWidget::updateSeries()
-{
-    double cpuLoadAverage = SysInfo::instance().cpuLoadAverage();
-    QChart* chart = chartView().chart();
-    QString str = QString("CPU average load %1%").arg(QString::number(cpuLoadAverage,'f',2));
-    chart->setTitle(str);
-    mSeries->clear();
-    mSeries->append("Load", cpuLoadAverage);
-    mSeries->append("Free", 100.0 - cpuLoadAverage);
-}

+ 0 - 21
Framework/spshell/Widgets/cpuwidget.h

@@ -1,21 +0,0 @@
-#ifndef CPUWIDGET_H
-#define CPUWIDGET_H
-
-#include <QtCharts/QPieSeries>
-
-#include "sysinfowidget.h"
-
-class CpuWidget : public SysInfoWidget
-{
-    Q_OBJECT
-public:
-    explicit CpuWidget(QWidget* parent = 0);
-
-protected slots:
-    void updateSeries() override;
-
-private:
-    QtCharts::QPieSeries* mSeries;
-};
-
-#endif // CPUWIDGET_H

+ 0 - 24
Framework/spshell/Widgets/dialogappversion.cpp

@@ -1,24 +0,0 @@
-#include "dialogappversion.h"
-#include "textedit.h"
-#include <QHBoxLayout>
-#include <QLibraryInfo>
-
-DialogAppVersion::DialogAppVersion(QString contentPath, QString titleText, QWidget *parent)
-    :QDialog(parent)
-{
-    textViewer = new TextEdit;
-    textViewer->setContents(contentPath);
-
-    QHBoxLayout *contentLayout = new QHBoxLayout;
-    contentLayout->setMargin(0);
-    contentLayout->setContentsMargins(0,0,0,0);
-    contentLayout->addWidget(textViewer);
-    setLayout(contentLayout);
-
-    setWindowTitle(titleText);
-    resize(1024, 640);
-}
-
-DialogAppVersion::~DialogAppVersion() {}
-
-

+ 0 - 21
Framework/spshell/Widgets/dialogappversion.h

@@ -1,21 +0,0 @@
-#ifndef DIALOGAPPVERSION_H
-#define DIALOGAPPVERSION_H
-
-
-#include <QDialog>
-
-class TextEdit;
-
-class DialogAppVersion : public QDialog
-{
-Q_OBJECT
-
-public:
-    explicit DialogAppVersion(QString contentPath, QString titleText="", QWidget *parent = 0);
-    ~DialogAppVersion();
-
-private:
-    TextEdit *textViewer;
-};
-
-#endif // DIALOGAPPVERSION_H

+ 0 - 215
Framework/spshell/Widgets/dialogconfig.cpp

@@ -1,215 +0,0 @@
-#include "dialogconfig.h"
-#include <QFile>
-#include <QDirModel>
-#include <QHBoxLayout>
-#include <QSplitter>
-#include <QDebug>
-#include <QStandardItemModel>
-#include <QPluginLoader>
-#include <QCoreApplication>
-#include <rootform.h>
-#include <subnormalconfig.h>
-
-#include "CustomImportInterface.h"
-
-#define TreeNodeDataId (Qt::UserRole + 2)
-enum TreeNodeMask
-{
-  NormalConfig,
-  RootIniConfig,
-  CustomConfig
-};
-
-DialogConfig::DialogConfig(DialogInParam* inParam, QWidget *parent)
-    :QDialog(parent),mCustomParentNode(nullptr)
-{
-
-    Qt::WindowFlags windowFlag  = Qt::Dialog;
-    windowFlag  |= Qt::WindowMinimizeButtonHint;
-    windowFlag  |= Qt::WindowMaximizeButtonHint;
-    windowFlag  |= Qt::WindowCloseButtonHint;
-    setWindowFlags(windowFlag);
-
-    QSplitter* splitterMain = new QSplitter(Qt::Horizontal, this);
-    splitterMain->setOpaqueResize(true);
-
-    mTreeView = new QTreeView(splitterMain);
-    mTreeView->setHeaderHidden(true);
-    QStandardItemModel* model = new QStandardItemModel(mTreeView);
-    mTreeView->setModel(model);
-
-    QStandardItem* itemNormal = new QStandardItem("通用设置");
-    itemNormal->setData(NormalConfig, TreeNodeDataId);
-    model->appendRow(itemNormal);
-    QStandardItem* item1 = new QStandardItem("终端设置");
-    model->appendRow(item1);
-    QStandardItem* itemRoot = new QStandardItem("Root.ini设置");
-    itemRoot->setData(RootIniConfig, TreeNodeDataId);
-    item1->appendRow(itemRoot);
-    connect(mTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &DialogConfig::mainTreeSelectionChanged);
-    //connect(mTreeView, SIGNAL(clicked(const QModelIndex)), this, SLOT(mainTreeViewDoubleClick(const QModelIndex)));
-
-    ////////////////////////////////////////////////////
-    QWidget *mainWidget = new QWidget(splitterMain);
-    QVBoxLayout* mainLayout = new QVBoxLayout(mainWidget);
-    //mainLayout->setSpacing(6);
-    //mainLayout->setContentsMargins(11, 11, 11, 11);
-
-    mainWidget->setLayout(mainLayout);
-    splitterMain->addWidget(mainWidget);
-
-    mStackWidget = new QStackedWidget(mainWidget);
-    mainLayout->addWidget(mStackWidget);
-    SubNormalConfig* subNormalWidget = new SubNormalConfig(mainWidget);
-    mStackWidget->addWidget(subNormalWidget);
-    RootForm* rootWidget = new RootForm(inParam->rootIniPath, mStackWidget);
-    mStackWidget->addWidget(rootWidget);
-
-    LoadPlguins();
-
-    splitterMain->setStretchFactor(1, 1);
-    splitterMain->setStretchFactor(2, 1);
-
-    QHBoxLayout *contentLayout = new QHBoxLayout;
-    contentLayout->setMargin(0);
-    contentLayout->setContentsMargins(0,0,0,0);
-    contentLayout->addWidget(splitterMain);
-    setLayout(contentLayout);
-
-    resize(1024, 640);
-    setWindowTitle(tr("选项"));
-}
-
-bool DialogConfig::LoadPlguins()
-{
-    int pluginCount = 0;
-#ifdef WITH_QT
-    QDir pluginsDir(QCoreApplication::applicationDirPath());
-    pluginsDir.cd("plugins");
-    qDebug() << "plugin dir: " << pluginsDir.absolutePath() << endl;
-#ifdef Q_WS_WIN32
-        const QStringList entries = pluginsDir.entryList(QStringList() << "*.dll", QDir::Files);
-#else
-        const QStringList entries = pluginsDir.entryList(QStringList() << "*.so", QDir::Files);
-#endif
-
-    for (const QString &fileName : entries) {
-        QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName));
-        qDebug() << "plugin file: " << pluginsDir.absoluteFilePath(fileName) << endl;
-        QObject *plugin = pluginLoader.instance();
-        if (plugin) {
-            qDebug() << "class name: " << plugin->metaObject()->className() << endl;
-            const QMetaObject* mode = plugin->metaObject()->superClass();
-            while (mode != nullptr) {
-                qDebug() << "super class name: " << mode->className();
-                mode = mode->superClass();
-            }
-
-            CustomImportInterface* pluginItem = qobject_cast<CustomImportInterface *>(plugin);
-            if (pluginItem) {
-                QStringList empty;
-                empty << "HelloHia";
-                QWidget* customWidget = pluginItem->getComponent(this, empty);
-                if(customWidget != nullptr) {
-                    mStackWidget->addWidget(customWidget);
-                    if(mCustomParentNode == nullptr) {
-                        mCustomParentNode = new QStandardItem("自定义");
-                        QStandardItemModel* treeModel = reinterpret_cast<QStandardItemModel*>(mTreeView->model());
-                        treeModel->appendRow(mCustomParentNode);
-                    }
-                    QString pluginTitle = pluginItem->getDisplayText();
-                    QStandardItem* menuItem = new QStandardItem(pluginTitle);
-                    menuItem->setData(CustomConfig + pluginCount, TreeNodeDataId);
-                    mCustomParentNode->appendRow(menuItem);
-                    pluginCount++;
-                } else {
-                    qDebug() << "getComponent failed:" << endl;
-                }
-            } else {
-                qDebug() << "dynamic_cast qobject cast failed:" << endl;
-            }
-        } else {
-            qDebug() << "plug instance failed: " << pluginLoader.errorString() << endl;
-        }
-        pluginLoader.unload();
-    }
-
-#else
-
-    QString fileName = "D:/Projects/Qt/build-MediaDevDetect-Desktop_Qt_5_14_2_MSVC2017_32bit-Debug/debug/MediaDevDetect.dll";
-    QPluginLoader pluginLoader(fileName);
-    QObject *plugin = pluginLoader.instance();
-    if (plugin) {
-        CustomImportInterface* pluginItem = qobject_cast<CustomImportInterface *>(plugin);
-        if (pluginItem) {
-            QStringList empty;
-            empty << "HelloHia";
-            QWidget* customWidget = pluginItem->getComponent(this, empty);
-            if(customWidget != nullptr) {
-                QString pluginTitle = pluginItem->getDisplayText();
-                mStackWidget->addWidget(customWidget);
-                if(mCustomParentNode == nullptr) {
-                    mCustomParentNode = new QStandardItem("Custom");
-                    QStandardItemModel* temp = reinterpret_cast<QStandardItemModel*>(mTreeView->model());
-                    temp->appendRow(mCustomParentNode);
-                }
-                QStandardItem* menuItem = new QStandardItem(pluginTitle);
-                menuItem->setData(CustomConfig + pluginCount, TreeNodeDataId);
-                mCustomParentNode->appendRow(menuItem);
-                pluginCount++;
-            }
-        }
-    }
-    pluginLoader.unload();
-#endif
-
-    return false;
-}
-
-void DialogConfig::mainTreeSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
-{
-    qDebug() << "Enter DialogConfig::mainTreeSelectionChanged" << endl;
-    QItemSelectionModel *selections = mTreeView->selectionModel();
-    QModelIndexList indexes = selections->selectedIndexes();
-    foreach(QModelIndex index, indexes)
-    {
-        //从索引index获取item指针,mModel是tree的数据Model,这里是QStandardItemModel*类型
-        QStandardItem* item = ((QStandardItemModel*)mTreeView->model())->itemFromIndex(index);
-        if (item && index.data(TreeNodeDataId).isValid())
-        {
-            qDebug() << "Enter " << item->text() << " " << index.row() << " " << index.column() << " " << index.data(TreeNodeDataId) << endl;
-            TreeNodeMask menuID = static_cast<TreeNodeMask>(index.data(TreeNodeDataId).toInt());
-            bool done = true;
-            switch(menuID) {
-            case RootIniConfig:
-                mStackWidget->setCurrentIndex(RootIniConfig);
-                done = true;
-                break;
-            case NormalConfig:
-                mStackWidget->setCurrentIndex(NormalConfig);
-
-                break;
-            default:
-                mStackWidget->setCurrentIndex(menuID);
-                done = false;
-                break;
-
-
-            }
-            if(done) {
-                break;
-            }
-        }
-    }
-}
-
-void DialogConfig::mainTreeViewDoubleClick(const QModelIndex index)
-{
-    QAbstractItemModel* m=(QAbstractItemModel*)index.model();
-    for(int columnIndex = 0; columnIndex < m->columnCount(); columnIndex++)
-    {
-        QModelIndex x=m->index(index.row(),columnIndex);
-        QString s= x.data().toString();
-        qDebug() << "mainTreeViewDoubleClick " << s << " " << x.internalId() << endl;
-    }
-}

+ 0 - 35
Framework/spshell/Widgets/dialogconfig.h

@@ -1,35 +0,0 @@
-#ifndef DIALOGCONFIG_H
-#define DIALOGCONFIG_H
-
-#include <QWidget>
-#include <QDialog>
-#include <QTreeView>
-#include <QStackedWidget>
-#include <QStandardItem>
-
-struct DialogInParam
-{
-    QString rootIniPath;
-};
-
-class DialogConfig : public QDialog
-{
-    Q_OBJECT
-public:
-    DialogConfig(DialogInParam* inParam, QWidget *parent);
-    ~DialogConfig() {}
-
-private slots:
-    void mainTreeSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
-    void mainTreeViewDoubleClick(const QModelIndex);
-
-private:
-    bool LoadPlguins();
-
-private:
-    QTreeView* mTreeView;
-    QStackedWidget* mStackWidget;
-    QStandardItem *mCustomParentNode;
-};
-
-#endif // DIALOGCONFIG_H

+ 0 - 111
Framework/spshell/Widgets/floatwidget/Overlay.cpp

@@ -1,111 +0,0 @@
-#include "Overlay.h"
-
-#include <QPainter>
-#include <QPen>
-#include <QDebug>
-#include <QResizeEvent>
-
-Overlay::Overlay(QWidget *parent)
-    : QWidget(parent)
-{
-    setPalette(Qt::transparent);
-    setAttribute(Qt::WA_NoSystemBackground);
-    setAttribute(Qt::WA_TransparentForMouseEvents);
-    newParent();
-
-}
-
-Overlay::~Overlay()
-{
-
-}
-
-void Overlay::paintEvent(QPaintEvent *event)
-{
-    QPainter painter(this);
-    painter.setRenderHint(QPainter::Antialiasing);
-    //X
-    painter.setPen(QPen(Qt::red));
-    painter.drawLine(width()/8, height()/8, 7*width()/8, 7*height()/8);
-    painter.drawLine(width()/8, 7*height()/8, 7*width()/8, height()/8);
-    //Test String
-    painter.setFont({"arial,helvetica", 48});
-    painter.drawText(rect(), "TEST 1234", Qt::AlignHCenter | Qt::AlignTop);
-
-    qDebug() << "Overlay::paintEvent";
-}
-
-void Overlay::resizeEvent ( QResizeEvent * event ) {
-    QWidget::resizeEvent( event );
-    qDebug() << "Overlay::resizeEvent old=" << event->oldSize() << "  new=" << event->size();
-}
-
-void Overlay::newParent()
-{
-    if ( !parent() )
-        return;
-    parent()->installEventFilter(this);
-    raise();
-}
-
-bool Overlay::eventFilter(QObject *obj, QEvent *ev)
-{
-    if (obj == parent()) {
-        if (ev->type() == QEvent::Resize)
-            resize(static_cast<QResizeEvent*>(ev)->size());
-        else if (ev->type() == QEvent::ChildAdded)
-            raise();
-    }
-    return QWidget::eventFilter(obj, ev);
-}
-
-bool Overlay::event(QEvent *ev)
-{
-    if (ev->type() == QEvent::ParentAboutToChange) {
-        if ( parent() )
-            parent()->removeEventFilter(this);
-    } else {
-        if (ev->type() == QEvent::ParentChange)
-            newParent();
-    }
-    return QWidget::event(ev);
-}
-
-/* =========================== */
-MessageOverlay::MessageOverlay(QWidget *parent, const int drawAlignFlags, const QColor &textColor)
-    : Overlay(parent)
-{
-    m_drawAlignFlags = drawAlignFlags;
-    m_textColor = textColor;
-}
-
-MessageOverlay::~MessageOverlay()
-{
-
-}
-void MessageOverlay::showMessage(const QString msg, const int forSeconds)
-{
-    m_text = msg;
-    m_visible = true;
-    if ( forSeconds > 0 )
-        QTimer::singleShot(forSeconds * 1000, this, SLOT(hideMessage()));
-}
-
-void MessageOverlay::hideMessage()
-{
-    m_visible = false;
-    update();
-}
-
-void MessageOverlay::paintEvent(QPaintEvent *event)
-{
-    QPainter painter(this);
-    if ( m_visible ) {
-        painter.setPen(m_textColor);
-        QFont f;
-        f.setPointSize(36);
-        //painter.setFont({"arial,helvetica", 18});
-        painter.setFont(f);
-        painter.drawText(rect(), m_drawAlignFlags, m_text);
-    }
-}

+ 0 - 55
Framework/spshell/Widgets/floatwidget/Overlay.h

@@ -1,55 +0,0 @@
-#ifndef OVERLAY_H
-#define OVERLAY_H
-
-#include <QWidget>
-#include <QTimer>
-
-/**
- * @brief Overlay Widget
- * Works in Android, IOS, Linux, Windows and MacOS (Catalina, not on HighSierra)
- */
-class Overlay : public QWidget
-{
-    Q_OBJECT
-public:
-    explicit Overlay(QWidget *parent = 0);
-    virtual ~Overlay();
-    
-signals:
-    
-public slots:
-
-protected:
-    void paintEvent(QPaintEvent *event) override;
-    void resizeEvent(QResizeEvent *event) override;
-
-    //! installs the event filter
-    void newParent();
-    //! catches resize and child events from parent widget
-    bool eventFilter(QObject *obj, QEvent *ev) override;
-    //! tracks parent widget changes
-    bool event(QEvent *ev) override;
-
-};
-
-class MessageOverlay : public Overlay
-{
-    Q_OBJECT
-public:
-    explicit MessageOverlay(QWidget *parent = nullptr,
-                            const int drawAlignFlags=Qt::AlignHCenter | Qt::AlignJustify,
-                            const QColor &textColor=QColor(Qt::red));
-    virtual ~MessageOverlay();
-public slots:
-    void showMessage (const QString msg, const int forSeconds=0);
-    void hideMessage ();
-protected:
-    void paintEvent(QPaintEvent *event) override;
-
-    bool m_visible = false;
-    QString m_text;
-    QColor m_textColor = QColor (Qt::red);
-    int m_drawAlignFlags = Qt::AlignHCenter | Qt::AlignJustify;
-};
-
-#endif // OVERLAY_H

+ 0 - 148
Framework/spshell/Widgets/floatwidget/SwipeGestureRecognizer.cpp

@@ -1,148 +0,0 @@
-#include <QMouseEvent>
-#include <QDebug>
-
-#include <math.h>
-#include "SwipeGestureRecognizer.h"
-
-SwipeGestureRecognizer::SwipeGestureRecognizer()
-{
-}
-
-bool
-SwipeGestureRecognizer::IsValidMove(int dx, int dy)
-{
-   // The moved distance is to small to count as not just a glitch.
-   if ((qAbs(dx) < MINIMUM_DISTANCE) && (qAbs(dy) < MINIMUM_DISTANCE)) {
-       //qDebug() << "invalide dx " << dx << " dy " << dy;
-      return false;
-   }
-
-   return true;
-}
-
-
-// virtual
-QGesture*
-SwipeGestureRecognizer::create(QObject* pTarget)
-{
-   qDebug("SwipeGestureRecognizer::create() called");
-   QGesture *pGesture = new QSwipeGesture(pTarget);
-   return pGesture;
-}
-
-
-// virtual
-QGestureRecognizer::Result
-SwipeGestureRecognizer::recognize(QGesture* pGesture, QObject *pWatched, QEvent *pEvent)
-{
-   QGestureRecognizer::Result result = QGestureRecognizer::Ignore;
-   QSwipeGesture *pSwipe = static_cast<QSwipeGesture*>(pGesture);
-
-   switch(pEvent->type()) {
-      case QEvent::MouseButtonPress: {
-         QMouseEvent* pMouseEvent = static_cast<QMouseEvent*>(pEvent);
-         pSwipe->setProperty("startPoint", pMouseEvent->screenPos());// localPos());
-         result = QGestureRecognizer::MayBeGesture;
-         qDebug() << "Swipe gesture started (start point=" <<  pSwipe->property("startPoint").toPointF() <<  ")";
-      }
-      break;
-      case QEvent::MouseButtonRelease: {
-         QMouseEvent* pMouseEvent = static_cast<QMouseEvent*>(pEvent);
-         const QVariant& propValue = pSwipe->property("startPoint");
-         QPointF startPoint = propValue.toPointF();
-         //Returns the position of the mouse cursor as a QPointF, relative to the widget or item that received the event.
-         QPointF endPoint = pMouseEvent->screenPos(); //localPos();
-         qDebug() << "Swipe gesture ended (end point=" <<  endPoint <<  ")";
-         // process distance and direction
-         int dx = endPoint.x() - startPoint.x();
-         int dy = endPoint.y() - startPoint.y();
-
-         //bugfix: startPoint.isNull because we sometimes get false events with startpoint 0 -> wrong swipe detected!
-         if ( (!IsValidMove(dx, dy)) || ( startPoint.isNull() ) ) {
-            // Just a click, so no gesture.
-            result = QGestureRecognizer::CancelGesture;
-            qDebug("Swipe gesture canceled");
-         } else {
-            // Compute the angle.
-            qDebug() << " startPoint= " << startPoint << " endPoint=" << endPoint << " dx=" << dx << " dy=" << dy;
-            qreal angle = ComputeAngle(dx, dy);
-            pSwipe->setSwipeAngle(angle);
-            result = QGestureRecognizer::FinishGesture;
-            qDebug("Swipe gesture finished");
-         }
-      }
-      break;
-      default:
-        break;
-   }
-
-   return result;
-}
-
-void
-SwipeGestureRecognizer::reset(QGesture *pGesture)
-{
-   pGesture->setProperty("startPoint", QVariant(QVariant::Invalid));
-   parent::reset(pGesture);
-}
-
-qreal
-SwipeGestureRecognizer::ComputeAngle(int dx, int dy)
-{
-   double PI = 3.14159265;
-
-   // Need to convert from screen coordinates direction
-   // into classical coordinates direction.
-   dy = -dy;
-
-   double result = atan2((double)dy, (double)dx) ;
-   result = (result * 180) / PI;
-
-   // Always return positive angle.
-   if (result < 0) {
-      result += 360;
-   }
-
-   return result;
-}
-
-
-
-/*
-==========================================================================
-*/
-
-QSwipeGesture::SwipeDirection
-SwipeGestureUtil::GetHorizontalDirection(QSwipeGesture *pSwipeGesture)
-{
-   qreal angle = pSwipeGesture->swipeAngle();
-   if (0 <= angle && angle <= 45) {
-      return QSwipeGesture::Right;
-   }
-
-   if (135 <= angle && angle <= 225) {
-      return QSwipeGesture::Left;
-   }
-
-   if (315 <= angle && angle <= 360) {
-      return QSwipeGesture::Right;
-   }
-
-   return QSwipeGesture::NoDirection;
-}
-
-QSwipeGesture::SwipeDirection
-SwipeGestureUtil::GetVerticalDirection(QSwipeGesture *pSwipeGesture)
-{
-   qreal angle = pSwipeGesture->swipeAngle();
-
-   if (45 < angle && angle < 135) {
-      return QSwipeGesture::Up;
-   }
-
-   if (225 < angle && angle < 315) {
-      return QSwipeGesture::Down;
-   }
-
-   return QSwipeGesture::NoDirection;
-}

+ 0 - 43
Framework/spshell/Widgets/floatwidget/SwipeGestureRecognizer.h

@@ -1,43 +0,0 @@
-#ifndef SWIPEGESTURERECOGNIZER_H
-#define SWIPEGESTURERECOGNIZER_H
-
-#include <QGestureRecognizer>
-#include <QSwipeGesture>
-
-/**
- * @brief The SwipeGestureRecognizer class
- * needed because the defalt implementation of swipe is a little bit odd: it only triggers on 3 finger swipes! (5.3)
- *
- * http://developer.android.com/design/patterns/gestures.html
- * http://qt-project.org/doc/qt-5/gestures-overview.html
- */
-class SwipeGestureRecognizer : public QGestureRecognizer
-{
-public:
-    SwipeGestureRecognizer();
-
-
-private:
-   static const int MINIMUM_DISTANCE = 10;
-
-   typedef QGestureRecognizer parent;
-
-   bool IsValidMove(int dx, int dy);
-
-   qreal ComputeAngle(int dx, int dy);
-
-   virtual QGesture* create(QObject* pTarget);
-
-   virtual QGestureRecognizer::Result recognize(QGesture* pGesture, QObject *pWatched, QEvent *pEvent);
-
-   void reset (QGesture *pGesture);
-};
-
-
-class SwipeGestureUtil {
-public:
-    static QSwipeGesture::SwipeDirection GetHorizontalDirection(QSwipeGesture *pSwipeGesture);
-    static QSwipeGesture::SwipeDirection GetVerticalDirection(QSwipeGesture *pSwipeGesture);
-};
-
-#endif // SWIPEGESTURERECOGNIZER_H

+ 0 - 581
Framework/spshell/Widgets/floatwidget/widget.cpp

@@ -1,581 +0,0 @@
-#include "widget.h"
-#include "ui_widget.h"
-#include <QMouseEvent>
-#include <QLabel>
-#include <QPainter>
-#include <QApplication>
-#include <QDesktopWidget>
-#include <QDebug>
-#include <QPropertyAnimation>
-#include <QProcess>
-#include <QMessageBox>
-
-#ifdef WITH_QT
-#include "BootGlobal.h"
-#include "RvcSettings.h"
-#endif // WITH_QT
-
-
-inline static QColor GetBackgoundColor()
-{
-    return QColor(161, 163, 165, 255);
-}
-
-inline static QRect GetScreenRect()
-{
-    QDesktopWidget* desk = QApplication::desktop();
-    QRect rect = desk->screenGeometry(desk->primaryScreen());
-    return rect;
-}
-
-const int SHOW_EDGE_WIDTH = 15;
-const int DEFAULT_WIDTH = 40;
-const int CONTINUE_PRESS_INTERVAL = 5000;
-const int CONTINUE_UNPRESS_INTERVAL = 20000;
-const int CONTINUE_HEATBEAT_INTERVAL = 60000;
-
-static bool initialize_once = false;
-
-Widget::Widget(QWidget *parent)
-    : QWidget(parent)
-    , ui(new Ui::Widget),floatWidget(nullptr),mClipMenu(nullptr),mMainBtn(nullptr)
-    ,mPressContinueTimer(nullptr),mHiddenTimer(nullptr), mHeatbeatTimer(nullptr),mText("ClickMe")
-    ,mCenter(DEFAULT_WIDTH,DEFAULT_WIDTH),mRadius(DEFAULT_WIDTH),mPress(false)
-    , mEdgeStatus(EG_NORMAL),mRecognizer(nullptr),currGraph(0)
-    ,mQuickCmd(""), mCorrectCmd(true)
-{
-    init();
-}
-
-Widget::Widget(const QString text, QPoint center, int radius, QWidget *parent)
-    : QWidget(parent)
-    , ui(new Ui::Widget),floatWidget(nullptr),mClipMenu(nullptr),mMainBtn(nullptr)
-    ,mPressContinueTimer(nullptr),mHiddenTimer(nullptr), mHeatbeatTimer(nullptr), mText(text)
-    ,mCenter(center),mRadius(radius),mPress(false)
-    , mEdgeStatus(EG_NORMAL),mRecognizer(nullptr),currGraph(0)
-    , mQuickCmd(""), mCorrectCmd(true)
-{
-    init();
-}
-
-
-Widget::~Widget()
-{
-    delete ui;
-}
-
-void Widget::init()
-{
-    ui->setupUi(this);
-    setAutoFillBackground(false);
-    QPalette p = palette();
-    p.setBrush(QPalette::Background, QBrush(":/res/bg.png"));
-    setPalette(p);
-
-    mBeginTimerPos.setX(-1);
-    mBeginTimerPos.setY(-1);
-
-    this->setMouseTracking(true);
-    //this->installEventFilter(this);
-
-    resize(DEFAULT_WIDTH*2, DEFAULT_WIDTH*2);
-    QString styleStr = QString("QWidget{border-radius:%1px;background-color:rgba(0,255,0,200)}").arg(DEFAULT_WIDTH);
-    this->setStyleSheet(styleStr);
-
-    mPress = false;
-    mBeginPos = this->pos();
-    this->setWindowFlags(Qt::Tool | Qt::X11BypassWindowManagerHint
-                         | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowStaysOnTopHint);
-    this->setAttribute(Qt::WA_TranslucentBackground, true);
-
-    mClipMenu = new QMenu(this);
-
-    topOverlay = new MessageOverlay (QApplication::activeWindow(), Qt::AlignJustify);
-    topOverlay->showMessage (QString("Test-Overlay Message"), 10);
-    middleOverlay = new MessageOverlay (nullptr, Qt::AlignVCenter | Qt::AlignHCenter);
-    middleOverlay->showMessage (QString("Test-Overlay Message"), 10);
-    bottomOverlay = new MessageOverlay (nullptr, Qt::AlignBottom | Qt::AlignHCenter);
-    bottomOverlay->showMessage (QString("Test-Overlay Message"), 10);
-
-    registerGesture();
-
-    connect(this, SIGNAL(edgeUpdate()), SLOT(dealWithEdgeUpdate()));
-    connect(this, SIGNAL(popupSettings()), SLOT(dealWithPopupSettings()));
-    resetPos();
-    initQuickMenu();
-}
-
-void Widget::refreshPaint(int refreshType)
-{
-    QPixmap map;
-
-    QPainter p(this);
-    p.setRenderHint(QPainter::Antialiasing);
-    p.setBackgroundMode(Qt::TransparentMode);
-    if(refreshType == 1) {
-        map.load(":/res/bgactive.png");
-        p.setBrush(Qt::red);
-    } else if(refreshType == 2) {
-        map.load(":/res/bg.png");
-        p.setBrush(GetBackgoundColor());
-    } else if(refreshType == 3) {
-        map.load(":/res/bgin.png");
-        p.setBrush(Qt::red);
-    }
-    //map.fill(Qt::transparent);
-    //map.fill(qRgba(255,255,255,0));
-
-    p.setPen(Qt::NoPen);
-
-    QRect rect = this->rect();
-    rect.setWidth(mRadius*2);
-    rect.setHeight(mRadius*2);
-    p.setRenderHint(QPainter::SmoothPixmapTransform, true);
-    p.drawPixmap(rect, map);
-}
-
-void Widget::simulateMouseLease()
-{
-    auto pos = this->pos();//QCursor::pos();
-    QMouseEvent* evtMsLease = new QMouseEvent(QEvent::MouseButtonRelease, pos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
-    QApplication::sendEvent(this,evtMsLease);
-}
-
-void Widget::paintEvent(QPaintEvent *event)
-{
-    qDebug() << __FUNCTION__;
-
-    if(mPress) {
-        refreshPaint(1);
-    } else {
-        refreshPaint(2);
-    }
-
-    if(!initialize_once) {
-        initialize_once = true;
-       // emit edgeUpdate();
-    }
-}
-
-bool Widget::eventFilter(QObject *obj, QEvent *event)
-{
-    if (event->type() == QEvent::MouseButtonPress) {
-        QMouseEvent* mouseEvent = (QMouseEvent*)event;
-        if (mouseEvent->buttons() & Qt::LeftButton) {
-            const QPoint p = mouseEvent->pos();
-            QString s = "x= " + QString::number(p.x()) + " y= " + QString::number(p.y());
-            qDebug() << "mouse left btn press: " << s;
-        }
-    }
-    return QWidget::eventFilter(obj, event);
-}
-
-void Widget::swiperTriggered(QSwipeGesture *gesture)
-{
-    bool result = false;
-
-    if (gesture->state() == Qt::GestureFinished) {
-       qDebug("Swipe angle: %f", gesture->swipeAngle());
-       switch (SwipeGestureUtil::GetHorizontalDirection(gesture)) {
-          case QSwipeGesture::Left:
-             qDebug("Swipe Left detected");
-             //topOverlay->showMessage("Swipe Left detected",5);
-             result = true;
-             break;
-          case QSwipeGesture::Right:
-             qDebug("Swipe Right detected");
-             result = true;
-             break;
-          default:
-             break;
-       }
-       switch (SwipeGestureUtil::GetVerticalDirection(gesture)) {
-          case QSwipeGesture::Up:
-             qDebug("Swipe Up detected");
-             result = true;
-             break;
-          case QSwipeGesture::Down:
-             qDebug("Swipe Down detected");
-             result = true;
-             break;
-          default:
-             break;
-       }
-    }
-    return;
-}
-
-bool Widget::gestureEvent(QGestureEvent *event)
-{
-    qDebug() << "gestureEvent():" << event->gestures().size();
-    if(QGesture* swipe = event->gesture(Qt::SwipeGesture)) {
-        swiperTriggered(static_cast<QSwipeGesture*>(swipe));
-        qDebug() << "swipe";
-    } else if(QGesture* pan = event->gesture(Qt::PanGesture)) {
-        qDebug() << "pan";
-    } else if (QGesture *pinch = event->gesture(Qt::PinchGesture)) {
-        qDebug() << "pinch";
-     } else if (QGesture *tap = event->gesture(Qt::TapGesture)) {
-        qDebug() << "tap";
-    } else if (QGesture *tapAndHold = event->gesture(Qt::TapAndHoldGesture)) {
-        qDebug() << "tap and hold";
-    }
-    return true;
-}
-
-void Widget::registerGesture()
-{
-    mRecognizer = new SwipeGestureRecognizer();
-    mGestType = QGestureRecognizer::registerRecognizer(mRecognizer);
-    grabGesture(mGestType);
-}
-
-void Widget::mousePressEvent(QMouseEvent *event)
-{
-    if(isContains(event->pos()))
-    {
-        setWindowOpacity(1);
-        if(!mPress) {
-            mPress = true;
-            mBeginPos = event->pos();
-            mBeginTimerPos = this->pos();
-            if (mPressContinueTimer) {
-                mPressContinueTimer->stop();
-                mPressContinueTimer->start();
-            }
-        }
-        update();
-    }
-
-    QWidget::mousePressEvent(event);
-}
-
-void Widget::mouseReleaseEvent(QMouseEvent *event)
-{
-    qDebug() << __FUNCTION__ << mPress;
-
-    setWindowOpacity(0.7);
-
-    if(mPress) {
-        mPress = false;
-    }
-
-    update();
-
-    //if(isContains(event->pos()))
-    //    emit clicked();
-
-    if(y() <= 0)
-        mEdgeStatus = EG_TOP;
-    else if(GetScreenRect().width() < (this->x() + width())) {
-        mEdgeStatus = EG_RIGHT;
-    } else if(x() <= 0)
-        mEdgeStatus = EG_LEFT;
-    else
-        mEdgeStatus = EG_NORMAL;
-
-    if (mEdgeStatus != EG_LEFT && mHiddenTimer) {
-        qDebug() << "Schedule restore timer!";
-        mHiddenTimer->stop();
-        mHiddenTimer->start();
-    }
-
-    QWidget::mouseReleaseEvent(event);
-}
-
-void Widget::mouseMoveEvent(QMouseEvent *event)
-{
-    if(mPress && event->buttons() & Qt::LeftButton) {
-        this->move(event->pos() - mBeginPos + this->pos());
-    }
-
-    QWidget::mouseMoveEvent(event);
-}
-
-
-void Widget::enterEvent(QEvent* event)
-{
-    qDebug() << __FUNCTION__;
-
-    //edgeOut();
-
-    if (mMainBtn) {
-        QPoint point = this->pos();
-        point.rx() = point.x() + mMainBtn->width() - DEFAULT_WIDTH;
-        point.ry() = point.y() + mMainBtn->height() - DEFAULT_WIDTH;
-        mMainBtn->move(point);
-    }
-
-    QWidget::enterEvent(event);
-}
-
-void Widget::leaveEvent(QEvent* event)
-{
-
-    qDebug() << __FUNCTION__;
-
-    //edgeIn();
-
-    QWidget::leaveEvent(event);
-}
-
-bool Widget::event(QEvent* event)
-{
-    if (event->type() == QEvent::Gesture) {
-        return gestureEvent(static_cast<QGestureEvent*>(event));
-    }
-    return QWidget::event(event);
-}
-
-void Widget::contextMenuEvent(QContextMenuEvent *event)
-{
-    this->setCursor(Qt::ArrowCursor);
-    mClipMenu->exec(cursor().pos());
-}
-
-void Widget::closeEvent(QCloseEvent *event)
-{
-    this->close();
-}
-
-
-bool Widget::resetPosEhance()
-{
-    if (mPress) {
-        //simulateMouseLease();
-    }
-
-    if(mEdgeStatus != EG_LEFT) {
-        resetPos();
-        return true;
-    }
-    return false;
-}
-
-void Widget::initQuickMenu()
-{
-#ifdef WITH_QT
-    const QString configFileName = getFrameworkConfigPath();
-    QFileInfo fileInfo(configFileName);
-    if (fileInfo.exists()) {
-        RvcSettings* settings = new RvcSettings(configFileName, QSettings::IniFormat);
-        settings->setIniCodec("UTF-8");
-        QString cmdValue = settings->GetConfigData("QuickShortcut", "CmdLine").toString();
-        cmdValue = cmdValue.trimmed();
-        if (cmdValue.isNull() || cmdValue.isEmpty()) {
-            mCorrectCmd = false;
-            mQuickCmd = "未配置";
-        } else {
-            mCorrectCmd = true;
-            mQuickCmd = cmdValue;
-        }
-    } else {
-        mCorrectCmd = false;
-        mQuickCmd = "配置文件缺失";
-    }
-#endif // WITH_QT
-
-    mHiddenTimer = new QTimer(this);
-    mHiddenTimer->setSingleShot(true);
-    connect(mHiddenTimer, SIGNAL(timeout()), this, SLOT(HandleHiddenTimeout()));
-    mHiddenTimer->setInterval(CONTINUE_UNPRESS_INTERVAL);
-
-    mPressContinueTimer = new QTimer(this);
-    mPressContinueTimer->setSingleShot(true);
-    connect(mPressContinueTimer, SIGNAL(timeout()), this, SLOT(HandleTimeout()));
-    mPressContinueTimer->setInterval(CONTINUE_PRESS_INTERVAL);
-
-    mHeatbeatTimer = new QTimer(this);
-    connect(mHeatbeatTimer, SIGNAL(timeout()), this, SLOT(HeatbeatTimeout()));
-    mHeatbeatTimer->setInterval(CONTINUE_HEATBEAT_INTERVAL);
-}
-
-void Widget::resetPos()
-{
-    QRect rect = GetScreenRect();
-    const int wd = rect.width();
-    const int ht = rect.height();
-
-    this->move(0, ht / 3 - this->height() / 2);
-    mEdgeStatus = EG_LEFT;
-    emit edgeUpdate();
-}
-
-void Widget::forceClose()
-{
-    qApp->exit();
-    //this->close();
-}
-
-bool Widget::isContains(QPoint pos)
-{
-    return (mCenter.x() - mRadius < pos.x()
-            && mCenter.x() + mRadius > pos.x()
-            && mCenter.y() - mRadius < pos.y()
-            && mCenter.y() + mRadius > pos.y());
-
-}
-
-#define ABS_MIN_DISTANCE 2
-static bool isAllowDistance(const QPoint& a, const QPoint& b)
-{
-    if (abs(a.x() - b.x()) < ABS_MIN_DISTANCE && abs(a.y() - b.y()) < ABS_MIN_DISTANCE) {
-        return true;
-    }
-    return false;
-}
-
-void Widget::HeatbeatTimeout()
-{
-    qDebug() << "HeatbeatTimeout!" << mPress;
-    if (!mPress) {
-        if (!mHiddenTimer->isActive()) {
-            if (resetPosEhance()) {
-                //simulateMouseLease();
-            }
-        }
-    }
-}
-
-void Widget::HandleTimeout()
-{
-    qDebug() << "HandleTimeout!" << mPress;
-    if(mPress) {
-
-        if(isAllowDistance(this->pos(), mBeginTimerPos)) {
-        //if(this->pos() == mBeginTimerPos) {
-            qDebug() << "Trigger!";
-            mBeginTimerPos.setX(-1);
-            mBeginTimerPos.setY(-1);
-
-            emit popupSettings();
-
-        } else {
-            mBeginTimerPos = this->pos();
-            mPressContinueTimer->start();
-        }
-    } else {
-        mBeginTimerPos.setX(-1);
-        mBeginTimerPos.setY(-1);
-    }
-}
-
-void Widget::HandleHiddenTimeout()
-{
-    qDebug() << __FUNCTION__;
-    resetPosEhance();
-}
-
-void Widget::dealWithEdgeUpdate()
-{
-    qDebug() << __FUNCTION__ << " " << mEdgeStatus;
-    edgeIn();
-}
-
-void Widget::dealWithPopupSettings()
-{
-    qDebug() << __FUNCTION__;
-
-#ifdef WITH_QT
-
-    if (mCorrectCmd) {
-        QProcess* process = new QProcess(this);
-        QString appDir = QCoreApplication::applicationDirPath();
-
-#ifdef Q_WS_WIN32
-        if (appDir.endsWith("\\bin")) {
-            appDir = appDir.left(appDir.length() - QString("\\bin").length());
-            process->setWorkingDirectory(appDir);
-        }
-#else
-        if (appDir.endsWith("/bin")) {
-            appDir = appDir.left(appDir.length() - QString("/bin").length());
-            process->setWorkingDirectory(appDir);
-        }
-#endif
-
-        process->setStandardOutputFile(QProcess::nullDevice());
-        process->setStandardErrorFile(QProcess::nullDevice());
-        bool result = process->startDetached(mQuickCmd);
-        if (!result) {
-            QMessageBox::critical(nullptr, "错误", QString("唤出快捷菜单失败:%1").arg(process->errorString()));
-        } else {
-            resetPosEhance();
-            simulateMouseLease();
-        }
-        delete process;
-    } else {
-        QString tmp = QString("唤出快捷菜单失败:%1").arg(mQuickCmd);
-        QMessageBox::critical(nullptr, "错误", tmp);
-    }
-
-#else
-    resetPosEhance();
-    QMessageBox::information(nullptr, "提示", "这是唤起快捷菜单的测试说明!");
-
-#endif // WITH_QT
-
-}
-
-void Widget::edgeIn()
-{
-    QPropertyAnimation* ani = new QPropertyAnimation(this, "geometry");
-    ani->setDuration(100);
-    ani->setStartValue(QRect(this->x(), this->y(), width(), height()));
-
-
-    switch (mEdgeStatus) {
-        case EG_TOP:
-
-        ani->setEndValue(QRect(pos().x(), -height() + SHOW_EDGE_WIDTH, width(), height()));
-        ani->start(QAbstractAnimation::DeleteWhenStopped);
-
-        //setGeometry(pos().x(), -height() + SHOW_EDGE_WIDTH, width(), height());
-        break;
-    case EG_LEFT:
-
-        ani->setEndValue(QRect(-width() + SHOW_EDGE_WIDTH, pos().y(), width(), height()));
-        ani->start(QAbstractAnimation::DeleteWhenStopped);
-
-        //setGeometry(-width() + SHOW_EDGE_WIDTH, pos().y(), width(), height());
-        break;
-    case EG_RIGHT:
-
-        ani->setEndValue(QRect(GetScreenRect().width() - width() + SHOW_EDGE_WIDTH, pos().y(), width(), height()));
-        ani->start(QAbstractAnimation::DeleteWhenStopped);
-
-        //setGeometry(QApplication::desktop()->width() - SHOW_EDGE_WIDTH, pos().y(), width(), height());
-        break;
-    case EG_NORMAL:
-    default:
-        break;
-    }
-}
-
-void Widget::edgeOut()
-{
-    QPropertyAnimation* ani = new QPropertyAnimation(this, "geometry");
-    ani->setDuration(100);
-    ani->setStartValue(QRect(this->x(), this->y(), width(), height()));
-
-    switch (mEdgeStatus) {
-        case EG_TOP:
-        ani->setEndValue(QRect(pos().x(), -SHOW_EDGE_WIDTH, width(), height()));
-        ani->start(QAbstractAnimation::DeleteWhenStopped);
-        //setGeometry(pos().x(), -SHOW_EDGE_WIDTH, width(), height());
-        break;
-    case EG_LEFT:
-        ani->setEndValue(QRect(-SHOW_EDGE_WIDTH, y(), width(), height()));
-        ani->start(QAbstractAnimation::DeleteWhenStopped);
-        //setGeometry(-SHOW_EDGE_WIDTH, y(), width(), height());
-        break;
-    case EG_RIGHT:
-        ani->setEndValue(QRect(GetScreenRect().width() - width() + SHOW_EDGE_WIDTH, y(), width(), height()));
-        ani->start(QAbstractAnimation::DeleteWhenStopped);
-        //setGeometry(QApplication::desktop()->width() - width() + SHOW_EDGE_WIDTH, y(), width(), height());
-        break;
-    case EG_NORMAL:
-    default:
-        break;
-    }
-}

+ 0 - 115
Framework/spshell/Widgets/floatwidget/widget.h

@@ -1,115 +0,0 @@
-#ifndef WIDGET_H
-#define WIDGET_H
-
-#include <QWidget>
-#include <QMenu>
-#include <QPushButton>
-#include <QVBoxLayout>
-#include <QTimer>
-#include <QPointer>
-#include "SwipeGestureRecognizer.h"
-#include "Overlay.h"
-
-enum EG_ENUM {
-    EG_NORMAL,
-    EG_TOP,
-    EG_RIGHT,
-    EG_LEFT,
-    EG_BOTTOM
-};
-
-QT_BEGIN_NAMESPACE
-namespace Ui { class Widget; }
-QT_END_NAMESPACE
-
-class Widget : public QWidget
-{
-    Q_OBJECT
-
-public:
-    Widget(QWidget *parent = nullptr);
-    Widget(const QString text, QPoint center, int radius,  QWidget *parent = nullptr);
-    ~Widget();
-
-    void paintEvent(QPaintEvent *event);
-
-    void mousePressEvent(QMouseEvent *);
-    void mouseReleaseEvent(QMouseEvent *event);
-    void mouseMoveEvent(QMouseEvent *);
-
-    void contextMenuEvent(QContextMenuEvent *event);
-    void closeEvent(QCloseEvent *event);
-
-    void init();
-    bool isContains(QPoint pos);
-
-private slots:
-        void HandleTimeout();
-        void HeatbeatTimeout();
-
-        void forceClose();
-        void dealWithEdgeUpdate();
-        void HandleHiddenTimeout();
-        void dealWithPopupSettings();
-
-protected:
-    void enterEvent(QEvent *event);
-    void leaveEvent(QEvent *event);
-    bool event(QEvent *event);
-
-signals:
-    void clicked();
-    void edgeUpdate();
-    void popupSettings();
-
-protected:
-    bool eventFilter(QObject *obj, QEvent *event);
-
-private:
-    void swiperTriggered(QSwipeGesture* gesture);
-    bool gestureEvent(QGestureEvent* event);
-    void registerGesture();
-    void edgeOut();
-    void edgeIn();
-    void resetPos();
-    bool resetPosEhance();
-    void initQuickMenu();
-    void refreshPaint(int refreshType);
-
-    void simulateMouseLease();
-
-private:
-    Ui::Widget *ui;
-    QPoint dragPosition;
-    bool showColon;
-    QWidget* floatWidget;
-    QMenu* mClipMenu;
-    QPushButton* mMainBtn;
-    QTimer* mPressContinueTimer;
-    QTimer* mHiddenTimer;
-    QTimer* mHeatbeatTimer;
-    QPoint mBeginTimerPos;
-
-    QString mText;
-    QPoint  mCenter;
-    QPoint mBeginPos;
-    int mRadius;
-    int mOpacity;
-
-    bool mPress;
-    EG_ENUM mEdgeStatus;
-
-    SwipeGestureRecognizer* mRecognizer;
-    Qt::GestureType mGestType;
-    int currGraph;
-
-    QPointer<Overlay> testOverlay = nullptr;
-    QPointer<MessageOverlay> topOverlay = nullptr;
-    QPointer<MessageOverlay> middleOverlay = nullptr;
-    QPointer<MessageOverlay> bottomOverlay = nullptr;
-
-    QString mQuickCmd;
-    bool mCorrectCmd;
-
-};
-#endif // WIDGET_H

+ 0 - 24
Framework/spshell/Widgets/floatwidget/widget.ui

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Widget</class>
- <widget class="QWidget" name="Widget">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>222</width>
-    <height>202</height>
-   </rect>
-  </property>
-  <property name="font">
-   <font>
-    <stylestrategy>PreferAntialias</stylestrategy>
-   </font>
-  </property>
-  <property name="windowTitle">
-   <string>Widget</string>
-  </property>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 0 - 1671
Framework/spshell/Widgets/mainwindow.cpp

@@ -1,1671 +0,0 @@
-#include "mainwindow.h"
-#include "ui_mainwindow.h"
-#include <QHeaderView>
-#include <QDebug>
-#include <QMessageBox>
-#include <QDate>
-#include <QDateTime>
-#include <QDir>
-#include <QFile>
-#include <QFileInfo>
-#include <QDesktopWidget>
-#include <QTextCodec>
-#include <QProcess>
-#include <QFileDialog>
-#include <QStandardPaths>
-
-#include <QPropertyAnimation>
-
-#include <QJsonDocument>
-#include <QJsonObject>
-#include <QJsonArray>
-
-#include "dialogappversion.h"
-#include "dialogconfig.h"
-#include "sysinfo.h"
-#include "textfinder.h"
-#include "textedit.h"
-#include "BootGlobal.h"
-
-#define ENTITY_COLUMN_NAME 0
-#define ENTITY_COLUMN_STATUS 1
-#define ENTITY_COLUMN_PID 2
-#define ENTITY_COLUMN_VERSION 3
-#define ENTITY_COLUMN_BOOTTIME 4
-#define MAX_ENTITY_LIST_COLUMN 5
-
-
-//Mapping to SpBase::FrameworkStateEnum
-#define FRAMEWORK_STATE_NOTINIT 0
-#define FRAMEWORK_STATE_NOCONFIG 1
-#define FRAMEWORK_STATE_BOOTING 2
-#define FRAMEWORK_STATE_RUNNING 3
-#define FRAMEWORK_STATE_SERVING 4
-#define FRAMEWORK_STATE_BREAKDOWN 5
-#define FRAMEWORK_STATE_REPAIRING 6
-#define FRAMEWORK_STATE_UPGRADING 7
-#define FRAMEWORK_STATE_ROOLLBACKING 8
-#define FRAMEWORK_STATE_RECOVING 9
-#define FRAMEWORK_STATE_NOTDISTURB 10
-
-#define STARTUP_SCRIPT "spexplorer.sh"
-
-#ifdef DEVOPS_ON_ST /*DevOps流水线编译,ST环境*/
-#define RVC_TITLE_STRING "RVC Terminal Application STver."
-#elif defined(DEVOPS_ON_UAT)/*DevOps流水线编译,UAT环境*/
-#define RVC_TITLE_STRING "RVC Terminal Application UATver."
-#elif defined(DEVOPS_ON_PRD)/*DevOps流水线编译,PRD环境*/
-#define RVC_TITLE_STRING "RVC Terminal Application"
-#elif defined(DEVOPS_ON_DEV)/*DevOps流水线编译,Dev环境*/
-#define RVC_TITLE_STRING "RVC Terminal Application DEVver."
-#else/*本地编译等非DevOps环境编译的版本*/
-#define RVC_TITLE_STRING "RVC Terminal Application TESTver."
-#endif
-
-void setRowBackground(const QBrush& brush, QAbstractItemModel* model, int row, const QModelIndex& parent = QModelIndex())
-{
-    if (!model || row < 0 || row >= model->rowCount(parent))
-        return;
-    if (parent.isValid() && parent.model() != model)
-        return;
-    for (int i = 0; i < model->columnCount(parent); ++i)
-        Q_ASSUME(model->setData(model->index(row, i, parent), brush, Qt::BackgroundRole));
-}
-
-static QString EntityInfoHeaderString()
-{
-    return QString("实体名称\t状态\t进程号\t版本\t启动时间\t文件句柄数");
-}
-
-static QString EntityRunInfoToString(const EntityRunInfo& entity)
-{
-    QString result = QString("%1\t%2\t%3\t%4\t%5\t%6")
-            .arg(entity.entityName)
-            .arg(MappingSatus2String(entity.state))
-            .arg(entity.pid)
-            .arg(entity.version)
-            .arg(entity.startupTimeStr)
-            .arg(entity.fds);
-
-    return result;
-}
-
-MainWindow::MainWindow(QWidget* parent)
-    : QMainWindow(parent)
-    , ui(new Ui::MainWindow), mSicon(nullptr), mSilent(false)
-    , mIdleEntityCount(0), mTotalEntityCount(0), mFloatWidget(nullptr)
-{
-    this->Init(RVC_TITLE_STRING);
-}
-
-MainWindow::MainWindow(QString systemInfo, int totalEntityCount, QWidget* parent)
-    : QMainWindow(parent)
-    , ui(new Ui::MainWindow), mSicon(nullptr), mSilent(false)
-    , mIdleEntityCount(0), mTotalEntityCount(0), mFloatWidget(nullptr)
-{
-    this->Init(systemInfo);
-}
-
-void MainWindow::Init(QString title)
-{
-    ui->setupUi(this);
-    setWindowIcon(QIcon(":/res/FavIcon.ico"));
-    if (title.startsWith(RVC_TITLE_STRING)) {
-        setWindowTitle(title);
-    } else {
-        setWindowTitle(QString(RVC_TITLE_STRING " [%1]").arg(title));
-    }
-
-    QPropertyAnimation* animation = new QPropertyAnimation(this, "windowOpacity");
-    animation->setDuration(800);
-    animation->setStartValue(0);
-    animation->setEndValue(1);
-    animation->start();
-
-    //QTextCodec* codec = QTextCodec::codecForName("GBK");
-    //QTextCodec::setCodecForLocale(codec);
-
-
-    this->setMinimumSize(1068, 720);
-    QDesktopWidget* desk = QApplication::desktop();
-    //const int curScreenIdx = desk->screenNumber(this);
-    const int curScreenIdx = desk->primaryScreen();
-    QRect rect = desk->screenGeometry(curScreenIdx);
-    const int wd = rect.width();
-    const int ht = rect.height();
-    this->move((wd - width()) / 2, (ht - height()) / 2);
-
-    ui->splitter->setStretchFactor(0, 1);
-    ui->splitter->setStretchFactor(1, 6);
-    ui->splitter->setStretchFactor(2, 3);
-
-    InitSystemTrayIcon();
-
-    InitEntitiesView();
-#ifndef WITH_QT
-    Test_EntityList();
-    Test_EventLog();
-#endif
-    QStringList selections;
-    for (EntityState i = NoStart; i <= All;) {
-        selections << MappingSatus2String(i);
-        i = EntityState(i + 1);
-    }
-
-    ui->comboBoxStatus->addItems(selections);
-    ui->comboBoxStatus->setCurrentIndex((int)All);
-
-    connect(ui->comboBoxStatus, SIGNAL(currentIndexChanged(int)), this, SLOT(DisplayEntities()));
-    connect(ui->tableWidgetEntities->horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(SortEntityItem(int)));
-
-    InitMenuAction();
-    InitStatusBar();
-
-    connect(ui->pushButtonEntStart, SIGNAL(clicked()), this, SLOT(StartEntity()));
-    connect(ui->pushButtonEntClose, SIGNAL(clicked()), this, SLOT(TerminateEntity()));
-    connect(ui->pushButtonEntPause, SIGNAL(clicked()), this, SLOT(PauseEntity()));
-    connect(ui->pushButtonEntContinue, SIGNAL(clicked()), this, SLOT(ContinueEntity()));
-    connect(ui->pushButtonEntKill, SIGNAL(clicked()), this, SLOT(KillEntity()));
-    connect(ui->pushButtonEntTest, SIGNAL(clicked()), this, SLOT(TestEntity()));
-    connect(ui->pushButtonEntLogView, SIGNAL(clicked()), this, SLOT(LogView()));
-    connect(ui->pushButtonClearRunCfg, SIGNAL(clicked()), this, SLOT(RemoveEntityRuninfoConfigFile()));
-    SysInfo::instance().init();
-    QHBoxLayout* cpuLayout = new QHBoxLayout();
-    cpuLayout->setContentsMargins(0, 0, 0, 0);
-    cpuLayout->setSpacing(0);
-    cpuLayout->setMargin(0);
-    ui->tab4CPU->setLayout(cpuLayout);
-    ui->tab4CPU->layout()->addWidget(&mCpuWidget);
-
-    QHBoxLayout* memoryLayout = new QHBoxLayout();
-    memoryLayout->setContentsMargins(0, 0, 0, 0);
-    ui->tab4Memory->setLayout(memoryLayout);
-    ui->tab4Memory->layout()->addWidget(&mMemoryWidget);
-
-    mPerformWidge = new PerformWidget(this);
-    QHBoxLayout* monitorLayout = new QHBoxLayout();
-    monitorLayout->setContentsMargins(0, 0, 0, 0);
-    monitorLayout->addWidget(mPerformWidge);
-    ui->tab4Monitor->setLayout(monitorLayout);
-
-#if 1//#ifdef WITH_QT
-    QWidget* w = ui->splitterMain->widget(1);
-    if (w != nullptr) {
-        w->setParent(nullptr);
-        w->deleteLater();
-    }
-#endif
-
-    /*
-    QStringList arguments = QApplication::arguments();
-    if (arguments.contains("--debug") || arguments.contains("-D")) {
-        QTimer* tm = new QTimer(this);
-        connect(tm, SIGNAL(timeout()), this, SLOT(RecordEntitySnapshot()));
-        tm->start(3000);
-    }
-    */
-
-    //InitFloatWidget();
-}
-
-QAction* MainWindow::CreateMenuAction(QString text, QKeySequence keyShot, QString toolTipText, void (MainWindow::* method)())
-{
-    QAction* action = new QAction(text, this);
-    action->setShortcut(keyShot);
-    //action->setStatusTip(toolTipText);
-    //connect(clearAct, SIGNAL(triggered()), textViewer, SLOT(clear()));
-    connect(action, &QAction::triggered, this, method);
-    return action;
-}
-
-void MainWindow::ProcessStarted()
-{
-    qDebug() << "process started! ";
-}
-
-void MainWindow::GetSubProcessMsg()
-{
-
-}
-
-void MainWindow::TriggerAdditionMenu(QAction* action)
-{
-    qDebug() << "menu: " << action->text();
-    RvcAdditionAction* pAct = reinterpret_cast<RvcAdditionAction*>(action);
-    switch (pAct->userData.type) {
-    case BootEntity:
-    {
-        StartEntityFromCustom(pAct->userData.entityName, pAct->userData.cmdLine);
-    }
-    break;
-    case RunShellScript:
-        break;
-    case CreatesSubProcess:
-    default:
-    {
-        QProcess* process = new QProcess(this);
-        //connect(process, SIGNAL(readyReadStandardOutput()), this, SLOT(GetSubProcessMsg()));
-        //connect(process, SIGNAL(started()), this, SLOT(ProcessStarted()));
-        QString appDir = QCoreApplication::applicationDirPath();
-#ifdef Q_WS_WIN32
-        if (appDir.endsWith("\\bin")) {
-            appDir = appDir.left(appDir.length() - QString("\\bin").length());
-            process->setWorkingDirectory(appDir);
-        }
-#else
-        if (appDir.endsWith("/bin")) {
-            appDir = appDir.left(appDir.length() - QString("/bin").length());
-            process->setWorkingDirectory(appDir);
-        }
-#endif
-        process->setStandardOutputFile(QProcess::nullDevice());
-        process->setStandardErrorFile(QProcess::nullDevice());
-        qDebug() << "start process: " << pAct->userData.cmdLine;
-        process->startDetached(pAct->userData.cmdLine);
-        //process->waitForFinished(1000);
-        delete process;
-    }
-    break;
-    }
-}
-
-void MainWindow::InitMenuAction()
-{
-    QMenu* mainMenu = menuBar()->addMenu(QString::fromUtf8("菜单(&M)"));
-    //mainMenu->addAction(CreateMenuAction(QString::fromUtf8("初始化(&I)"), tr("Alt+I"), QString::fromUtf8("初始化终端")
-    //                                     , &MainWindow::InitializeTerminal));
-    mainMenu->addAction(CreateMenuAction(QString::fromUtf8("重启当前版本(&T)"), tr("Alt+T"), QString::fromUtf8("重启可视柜台终端应用")
-                                         , &MainWindow::RestartApp));
-    mainMenu->addAction(CreateMenuAction(QString::fromUtf8("重启应用(&R)"), tr("Alt+R"), QString::fromUtf8("通过读取 active.txt 重启可视柜台终端应用")
-                                         , &MainWindow::RestartAppThroughSpShell));
-    QMenu* sysConfigMenu = mainMenu->addMenu(QString::fromUtf8("关机"));
-    sysConfigMenu->addAction(CreateMenuAction(QString::fromUtf8("重启(&P)"), tr("Alt+P"), QString::fromUtf8("重启操作系统")
-                                              , &MainWindow::RestartSystem));
-    sysConfigMenu->addAction(CreateMenuAction(QString::fromUtf8("关机(&D)"), tr("Alt+D"), QString::fromUtf8("关闭计算机")
-                                              , &MainWindow::ShutdownSystem));
-    mainMenu->addAction(CreateMenuAction(QString::fromUtf8("退出应用(&Q)"), tr("Alt+Q"), QString::fromUtf8("退出可视柜台终端应用")
-                                         , &MainWindow::QuitApp));
-
-    QMenu* configMenu = menuBar()->addMenu(QString::fromUtf8("配置(&C)"));
-    configMenu->addAction(CreateMenuAction(QString::fromUtf8("加载控件(&L)"), tr("Alt+L"), QString::fromUtf8("动态加载控件")
-                                           , &MainWindow::LoadCustomPlguins));
-
-
-    QMenu* toolMenu = menuBar()->addMenu(QString::fromUtf8("工具(&T)"));
-    toolMenu->addAction(CreateMenuAction(QString::fromUtf8("选项(&O)"), tr("Alt+O"), QString::fromUtf8("相关选项设置")
-                                         , &MainWindow::ConfigApp));
-    toolMenu->addAction(CreateMenuAction(QString::fromUtf8("导出快照(&S)"), tr("Alt+S"), QString::fromUtf8("导出实体即时信息快照")
-                                         , &MainWindow::ExportEntitySnapshot));
-
-    QMenu* addMenu = menuBar()->addMenu(QString::fromUtf8("附加(&A)"));
-
-    const QString configFileName = getFrameworkConfigPath();
-    qDebug() << "config file name: " << configFileName;
-    QFileInfo fileInfo(configFileName);
-    if (fileInfo.exists()) {
-        RvcSettings* settings = new RvcSettings(configFileName, QSettings::IniFormat);
-        settings->setIniCodec("UTF-8");
-        int menuCount = settings->GetConfigData("Menu", "Count").toInt();
-        qDebug() << "menu count: " << menuCount;
-        int validIdx = 1;
-        for (int i = 1; i <= menuCount; ++i) {
-
-            QString strIdx = QString::number(i);
-            QString subMenuName = settings->GetConfigData("Menu", strIdx).toString();
-            QString textName = settings->GetConfigData(subMenuName, "TextName").toString();
-            const int exeType = settings->GetConfigData(subMenuName, "Type").toInt();
-            const auto excuteEnum = static_cast<ExecuteType>(exeType);
-            QString cmdLine = settings->GetConfigData(subMenuName, "CmdLine").toString();
-            if (cmdLine.isNull() || cmdLine.isEmpty()) {
-                continue;
-            }
-
-            QString strQuick = QString("Alt+%1").arg(validIdx++);
-            qDebug() << subMenuName << " " << textName << " " << strIdx << " " << cmdLine << " " << strQuick;
-            QString menuName = (!textName.isNull() && !textName.isEmpty()) ? textName : cmdLine;
-            RvcAdditionAction* action = new RvcAdditionAction(menuName, this);
-            action->setShortcut(strQuick);
-            //action->setStatusTip(cmdLine);
-
-            action->userData.type = excuteEnum;
-            cmdLine = cmdLine.trimmed();
-            if (excuteEnum == BootEntity && -1 != cmdLine.indexOf('\t')) {
-                const int idx = cmdLine.indexOf('\t');
-                QStringList params = cmdLine.split("\t");
-                action->userData.entityName = params.at(0);
-                action->userData.cmdLine = cmdLine.mid(idx + 1);
-
-            } else if (excuteEnum == BootEntity) {
-                action->userData.entityName = cmdLine;
-                action->userData.cmdLine = "";
-            } else {
-                action->userData.cmdLine = cmdLine;
-            }
-            addMenu->addAction(action);
-        }
-        if (menuCount > 0) {
-            connect(addMenu, SIGNAL(triggered(QAction*)), this, SLOT(TriggerAdditionMenu(QAction*)));
-        }
-    }
-
-    QMenu* helpMenu = menuBar()->addMenu(QString::fromUtf8("帮助(&H)"));
-    helpMenu->addAction(CreateMenuAction(QString::fromUtf8("关于应用(&A)"), tr("Alt+A"), QString::fromUtf8("可视柜台终端应用版本更新记录")
-                                         , &MainWindow::VersionView));
-    helpMenu->addAction(CreateMenuAction(QString::fromUtf8("错误码对照表(&A)"), tr("Alt+E"), QString::fromUtf8("ErrorCode错误码对照表")
-                                         , &MainWindow::ErrorCodeView));
-}
-
-void MainWindow::ConfigApp()
-{
-    qDebug() << "Enter ConfigApp" << endl;
-#ifdef WITH_QT
-    std::string path = CSpShellConsole::GetRootConfigPath();
-    DialogInParam param;
-    param.rootIniPath = path.c_str();
-    DialogConfig dial(&param, this);
-#else
-    DialogInParam param;
-    param.rootIniPath = "D:\\Run\\hardwarecfg\\root.ini";
-    DialogConfig dial(&param, this);
-#endif
-    dial.exec();
-}
-
-void MainWindow::QuitApp()
-{
-    qDebug() << "Enter QuitApp" << endl;
-#ifdef WITH_QT
-    qApp->exit(APP_EXIT_CODE_QUIT); //or exit
-#else
-    exit(APP_EXIT_CODE_QUIT);
-#endif
-    qDebug() << "Leave QuitApp" << endl;
-}
-
-
-static void ClearArguments(const QString& program, QStringList& arguments)
-{
-    if (arguments.contains(program)) {
-        arguments.removeOne(program);
-    }
-    if (arguments.contains("--restart")) {
-        arguments.removeOne("--restart");
-    }
-    if (arguments.contains("-R")) {
-        arguments.removeOne("-R");
-    }
-    if (!arguments.contains("-Rwait")) {
-        arguments.append("-Rwait");
-    }
-}
-
-void MainWindow::RestartApp()
-{
-    qDebug() << "Enter RestartApp" << endl;
-    qint64 nextProcID(0);
-    QString program = QApplication::applicationFilePath();
-    QStringList arguments = QApplication::arguments();
-    QString workingDirectory = QDir::currentPath();
-
-    ClearArguments(program, arguments);
-
-    qDebug() << "Program: " << program << " " << arguments << " " << workingDirectory << endl;
-    bool result = QProcess::startDetached(program, arguments, workingDirectory, &nextProcID);
-    qDebug() << "Program result: " << result << " " << nextProcID;
-    QApplication::exit(APP_EXIT_CODE_RESTART_CURR);
-}
-
-void MainWindow::RestartSystem()
-{
-    QString str = "确定要重启系统吗?";
-    QMessageBox::StandardButton rb = QMessageBox::question(NULL, "Warning", str,
-                                                           QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
-    if (rb == QMessageBox::Yes) {
-        QProcess::startDetached("sudo shutdown -r now");
-    }
-}
-
-void MainWindow::ShutdownSystem()
-{
-    QString str = "确定要关机吗?";
-    QMessageBox::StandardButton rb = QMessageBox::question(NULL, "Warning", str,
-                                                           QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
-    if (rb == QMessageBox::Yes) {
-        QProcess::startDetached("sudo shutdown --poweroff now");
-    }
-}
-
-/**  该接口暂且放弃使用,因为使用QT创建子进程会继承文件句柄,改用 RestartAppThroughSpShell 与框架重启公用一套接口*/
-void MainWindow::RestartAppThroughActive()
-{
-    qDebug() << "Enter " << __FUNCTION__ << endl;
-    qint64 nextProcID(0);
-    QString program = QApplication::applicationFilePath();
-    QStringList arguments = QApplication::arguments();
-    QString workingDirectory = QDir::currentPath();
-
-    QString newProgrm = program;
-    QString newWorkingDirectory = workingDirectory;
-    QDir versionDir = QDir::current();
-    versionDir.cdUp();
-
-#if 0
-
-    QString activeFilePath = versionDir.filePath("active.txt");
-    QFile activeFile(activeFilePath);
-
-    if (!activeFile.exists()) {
-        QMessageBox::critical(this, "错误", QString("文件 %1 不存在!").arg(activeFilePath));
-        return;
-    }
-
-    if (!activeFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
-        QMessageBox::critical(this, "错误", QString("打开文件 %1 失败:%2").arg(activeFilePath).arg(activeFile.errorString()));
-        return;
-    }
-
-    QByteArray versionContent = activeFile.readAll();
-    versionContent = versionContent.trimmed();
-    activeFile.close();
-
-    if (versionContent.isEmpty() || versionContent.isNull()) {
-        QMessageBox::critical(this, "错误", QString("文件 %1 内容为空!").arg(activeFilePath));
-        return;
-    }
-
-    QStringList programPaths = program.split("/");
-
-
-    QString curVersion = programPaths[programPaths.size() - 3];
-    if (curVersion == QString(versionContent)) {
-        qDebug() << "Detect is the same version: " << (QString)versionContent;
-    } else {
-        qDebug() << "Detect diff version, from " << curVersion << " to " << (QString)versionContent;
-
-        programPaths.replace(programPaths.size() - 3/*x.y.z/bin/spshell*/, versionContent);
-        newProgrm = programPaths.join("/");
-        QStringList workingPaths = workingDirectory.split("/");
-        workingPaths.replace(workingPaths.size() - 1/*/x.y.z*/, versionContent);
-        newWorkingDirectory = workingPaths.join("/");
-    }
-
-#else
-
-    QString scriptFilePath = versionDir.filePath(STARTUP_SCRIPT);
-    QFile scriptFile(scriptFilePath);
-    if (!scriptFile.exists()) {
-        QMessageBox::critical(this, "错误", QString("启动脚本 %1 不存在!").arg(scriptFilePath));
-        return;
-    }
-    auto permitt = scriptFile.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ExeOwner
-                                             | QFileDevice::ReadUser | QFileDevice::WriteUser | QFileDevice::ExeUser
-                                             | QFileDevice::ReadGroup | QFileDevice::ReadOther
-                                             | QFileDevice::ExeGroup | QFileDevice::ExeOther);
-    if (!permitt) {
-        QMessageBox::critical(this, "错误", QString("设置 %1 文件权限失败:%2!").arg(scriptFilePath).arg(scriptFile.errorString()));
-        return;
-    }
-
-    newProgrm = scriptFilePath;
-    newWorkingDirectory = versionDir.currentPath();
-
-#endif
-
-    ClearArguments(program, arguments);
-
-    qunsetenv("LD_LIBRARY_PATH");
-    qDebug() << "newProgrm: " << newProgrm << " " << arguments << " " << newWorkingDirectory << endl;
-    bool result = QProcess::startDetached(newProgrm, arguments, newWorkingDirectory, &nextProcID);
-    qDebug() << "Program result: " << result << " " << nextProcID;
-    QApplication::exit();
-}
-
-void MainWindow::RestartAppThroughSpShell()
-{
-    qDebug() << "Enter " << __FUNCTION__ << endl;
-    qint64 nextProcID(0);
-    QString program = QApplication::applicationFilePath();
-    QStringList arguments = QApplication::arguments();
-    QString workingDirectory = QDir::currentPath();
-
-    QString newProgrm = program;
-    QString newWorkingDirectory = workingDirectory;
-    QDir versionDir = QDir::current();
-    versionDir.cdUp();
-
-    QString scriptFilePath = versionDir.filePath(STARTUP_SCRIPT);
-    QFile scriptFile(scriptFilePath);
-    if (!scriptFile.exists()) {
-        QMessageBox::critical(this, "错误", QString("启动脚本 %1 不存在!").arg(scriptFilePath));
-        return;
-    }
-    auto permitt = scriptFile.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ExeOwner
-                                             | QFileDevice::ReadUser | QFileDevice::WriteUser | QFileDevice::ExeUser
-                                             | QFileDevice::ReadGroup | QFileDevice::ReadOther
-                                             | QFileDevice::ExeGroup | QFileDevice::ExeOther);
-    if (!permitt) {
-        QMessageBox::critical(this, "错误", QString("设置 %1 文件权限失败:%2!").arg(scriptFilePath).arg(scriptFile.errorString()));
-        return;
-    }
-
-#ifdef WITH_QT
-    int result = CSpShellConsole::RestartApplication();
-    if (result != 0) {
-        QMessageBox::critical(this, "错误", QString("执行重启请求失败!"));
-        return;
-    }
-#endif
-    QApplication::exit(APP_EXIT_CODE_RESTART_ACTIVE);
-}
-
-void MainWindow::InitializeTerminal()
-{
-    LogView();
-}
-
-void MainWindow::LogView()
-{
-    qDebug() << "Enter LogView" << endl;
-    auto enti = GetCurrentSelectedEntity();
-#ifdef WITH_QT
-    if (!enti.entityName.isEmpty()) {
-        std::string path = CSpShellConsole::GetEntityLogPath(Q2Str(enti.entityName).c_str());
-        TextFinder textFinder(Str2Q(path), enti.entityName, this);
-        textFinder.exec();
-    }
-#endif
-}
-
-void MainWindow::ErrorCodeView()
-{
-
-    qDebug() << "Enter ErrorCodeView" << endl;
-#if 1
-    DialogAppVersion dial(QLatin1String(":/res/sys_errcode.html"), ("系统错误码对照表"), this);
-    dial.exec();
-#else
-    TextEdit mw;
-    QDesktopWidget* desk = QApplication::desktop();
-    const int curScreenIdx = desk->primaryScreen();
-    QRect rect = desk->screenGeometry(curScreenIdx);
-    const int wd = rect.width();
-    const int ht = rect.height();
-    mw.resize(wd / 2, (ht * 2) / 3);
-    mw.move((wd - mw.width()) / 2,
-            (ht - mw.height()) / 2);
-
-    mw.setContents(QLatin1String(":/res/sys_errcode.html"));
-    mw.show();
-#endif
-
-    //TextEdit textEdit(this);
-    //textEdit.setContents(":/res/sys_errcode.html");
-    //textEdit.show();
-}
-
-void MainWindow::RemoveEntityRuninfoConfigFile()
-{
-    auto enti = GetCurrentSelectedEntity();
-#ifdef WITH_QT
-    if (!enti.entityName.isEmpty()) {
-        std::string path = CSpShellConsole::GetEntityRTPath(Q2Str(enti.entityName).c_str());
-        if (!path.empty()) {
-            QFile file(path.c_str());
-            if (file.exists()) {
-                QString str = QString("确定要删除 %1 实体运行时文件?").arg(enti.entityName);
-                QMessageBox::StandardButton rb = QMessageBox::question(NULL, "Warning", str,
-                                                                       QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
-                if (rb == QMessageBox::Yes) {
-                    if (QFile::remove(path.c_str())) {
-                        QMessageBox::information(this, "提示", "删除成功!请重启应用或实体以立即生效!");
-                    } else {
-                        QMessageBox::warning(this, "错误", QString("%1: 删除运行时文件 %2 失败!")
-                                             .arg(enti.entityName).arg(path.c_str()));
-                    }
-                }
-            } else {
-                QMessageBox::warning(this, "提示", QString("%1: %2 运行时文件不存在!").arg(enti.entityName).arg(path.c_str()));
-            }
-        } else {
-            QMessageBox::critical(this, "错误", QString("%1: 获取运行时文件路径失败!").arg(enti.entityName));
-        }
-    } else {
-        QMessageBox::critical(this, "错误", "无法获取实体名称,请选中实体列表所在行!");
-    }
-#endif
-}
-
-void MainWindow::VersionView()
-{
-    qDebug() << "Enter VersionView" << endl;
-    DialogAppVersion dial(QLatin1String(":/res/version_history.html"), ("关于可视柜台终端应用程序"), this);
-    dial.exec();
-}
-
-void MainWindow::DisplayEntities()
-{
-
-    EntityState filterState = EntityState(ui->comboBoxStatus->currentIndex());
-    QString str = MappingSatus2String(filterState);
-
-    if (filterState == All)
-        str = "";
-
-    auto entities = ui->tableWidgetEntities->findItems(str, Qt::MatchExactly);
-    const int rows = ui->tableWidgetEntities->rowCount();
-    qDebug() << "Enter DisplayEntities " << str << " " << rows << "!" << endl;
-    for (int i = 0; i < rows; ++i) {
-        const auto strStatus = ui->tableWidgetEntities->item(i, ENTITY_COLUMN_STATUS)->text();
-        ui->tableWidgetEntities->setRowHidden(i, !str.isEmpty() && strStatus.compare(str) != 0);
-    }
-}
-
-void MainWindow::ResetAllEntityOperateBtnState(bool enable)
-{
-    ui->pushButtonEntStart->setEnabled(enable);
-    ui->pushButtonEntClose->setEnabled(enable);
-    ui->pushButtonEntPause->setEnabled(enable);
-    ui->pushButtonEntContinue->setEnabled(enable);
-    ui->pushButtonEntKill->setEnabled(enable);
-    ui->pushButtonEntTest->setEnabled(enable);
-}
-
-void MainWindow::StartEntityFromCustom(const QString& entityName, const QString& cmdLine)
-{
-    qDebug() << "Enter StartEntityFromCustom " << entityName << " " << cmdLine << "!" << endl;
-
-    const int entityRow = FindEntityRowIndex(entityName);
-    EntityInfo entityInfo = GetEntityInfoByRowIndex(entityRow);
-    if (entityInfo.IsValid()) {
-        const auto curState = entityInfo.state;
-        if (curState != NoStart && curState != Killed && curState != Close) {
-            QString str = QString("%1 实体目前处于运行状态,是否要强制重启?").arg(entityName);
-            QMessageBox::StandardButton rb = QMessageBox::question(this, "确认", str,
-                                                                   QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
-            if (rb == QMessageBox::Yes) {
-                const int result = DealWithEntity(entityInfo, Deal_Kill, "", false);
-                if (result != 0) {
-                    QMessageBox::critical(this, "错误", QString("终止旧实体例程 %1 失败!").arg(entityInfo.entityName));
-                    return;
-                }
-            } else {
-                return;
-            }
-        }
-    }
-
-    Threadee* nE = new Threadee();
-    nE->dealType = Deal_Start;
-    nE->entityName = entityName;
-    nE->cmdLine = cmdLine;
-    OperatThread* ot = new OperatThread(nE, nullptr);
-    connect(ot, &QThread::finished, ot, &QObject::deleteLater);
-    connect(ot, &OperatThread::OperateResult, this, &MainWindow::ReceiveCustomOperatResult);
-    ot->start();
-}
-
-void MainWindow::UpdateEntityOperateBtnState(EntityState currState)
-{
-    switch (currState) {
-    case Idle:
-        ResetAllEntityOperateBtnState();
-        ui->pushButtonEntStart->setEnabled(false);
-        ui->pushButtonEntContinue->setEnabled(false);
-        break;
-    case NoStart:
-        ResetAllEntityOperateBtnState(false);
-        ui->pushButtonEntStart->setEnabled(true);
-        break;
-    case Starting:
-        ResetAllEntityOperateBtnState(false);
-        ui->pushButtonEntKill->setEnabled(true);
-        break;
-    case Busy:
-        ResetAllEntityOperateBtnState(false);
-        ui->pushButtonEntKill->setEnabled(true);
-        break;
-    case Pause:
-        ResetAllEntityOperateBtnState(false);
-        ui->pushButtonEntContinue->setEnabled(true);
-        ui->pushButtonEntKill->setEnabled(true);
-        break;
-    case UnLoading:
-        ResetAllEntityOperateBtnState(false);
-        break;
-    case Lost:
-        ResetAllEntityOperateBtnState(false);
-        ui->pushButtonEntKill->setEnabled(true);
-        break;
-    case Close:
-    case Killed:
-        ResetAllEntityOperateBtnState(false);
-        ui->pushButtonEntStart->setEnabled(true);
-        break;
-    case Passed:
-    case Failed:
-        ResetAllEntityOperateBtnState();
-        ui->pushButtonEntStart->setEnabled(false);
-        ui->pushButtonEntContinue->setEnabled(false);
-        break;
-    default:
-        ResetAllEntityOperateBtnState(false);
-    }
-}
-
-void MainWindow::EntitySelectionChanged()
-{
-    const QTableWidgetItem* currentItem = ui->tableWidgetEntities->currentItem();
-    qDebug() << QString("Enter EntitySelectionChanged: ") << currentItem->text();
-    //ShowMessage(currentItem->text(), 0);
-    UpdateEntityOperateBtnState(GetCurrentSelectedEntity().state);
-}
-
-void MainWindow::SortEntityItem(int n)
-{
-    static bool sortStatus[MAX_ENTITY_LIST_COLUMN] = { false };
-    ui->tableWidgetEntities->sortItems(n, (sortStatus[n] ? Qt::AscendingOrder : Qt::DescendingOrder));
-    sortStatus[n] = !sortStatus[n];
-}
-
-QTableWidgetItem* MainWindow::FindEnityWidgetItem(QString entityName)
-{
-    auto entities = ui->tableWidgetEntities->findItems(entityName, Qt::MatchExactly);
-    if (entities.count() > 0)
-        return entities[0];
-    return nullptr;
-}
-
-int MainWindow::FindEntityRowIndex(QString entityName)
-{
-    int result = -1;
-    auto item = FindEnityWidgetItem(entityName);
-    if (item)
-        result = item->row();
-    return result;
-}
-
-void MainWindow::RemindEntityStateChangeWith(QString entityName, bool bEnd)
-{
-    const int row = FindEntityRowIndex(entityName);
-    if (row >= 0) {
-        qDebug() << entityName << " " << bEnd << endl;
-        if (bEnd)
-            UpdateItemBackgroundColor(row, MappingString2Status(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_STATUS)->text()));
-        else
-            UpdateItemBackgroundColor(row, Idle);
-    }
-}
-
-void MainWindow::RemindEntityStateChange(int row, EntityState previousState, EntityState currState)
-{
-    UpdateItemBackgroundColor(row, currState);
-#ifndef  NDEBUG
-    if (currState == Lost) {
-        QString info("Entity ");
-        QString entity(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_NAME)->text());
-        info.append(entity);
-        info += " 's State from ";
-        info += MappingSatus2String(previousState);
-        info += " to ";
-        info += MappingSatus2String(currState);
-        Note(info, EntityFire, entity, true);
-    }
-#endif //NDEBUG
-    (new RichTimer(this, ui->tableWidgetEntities->item(row, ENTITY_COLUMN_NAME)->text()));
-}
-
-void MainWindow::TriggerEntityState(int row, EntityState state, int pid, bool filcker)
-{
-    const EntityState previousState = MappingString2Status(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_STATUS)->text());
-    if (pid == -1/*for entity reset*/ && (previousState != Passed && previousState != Failed)) {
-        return;
-    }
-    ui->tableWidgetEntities->item(row, ENTITY_COLUMN_STATUS)->setText(MappingSatus2String(state));
-    if (state == Close || state == NoStart) {
-        ui->tableWidgetEntities->item(row, ENTITY_COLUMN_PID)->setText("0");
-    } else if (pid > 0) {
-        ui->tableWidgetEntities->item(row, ENTITY_COLUMN_PID)->setText(QString::number(pid));
-    }
-    if ((state == Idle) && (previousState == NoStart
-                            || previousState == Starting
-                            || previousState == UnLoading
-                            || previousState == Lost
-                            || previousState == Close
-                            || previousState == Killed
-                            )) {
-        QDateTime currentTime = QDateTime::currentDateTime();
-        QString currentTimeStr = currentTime.toString("MM-dd-hh:mm:ss.zzz");
-        ui->tableWidgetEntities->item(row, ENTITY_COLUMN_BOOTTIME)->setText(currentTimeStr);
-    }
-
-    if (state != previousState) {
-        if (state == Idle) {
-            mIdleEntityCount++;
-        } else if (previousState == Idle) {
-            mIdleEntityCount--;
-        }
-        UpdateEntityStatistics();
-    }
-
-    if (filcker) {
-        RemindEntityStateChange(row, previousState, state);
-        ui->tableWidgetEntities->setCurrentItem(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_NAME));
-        qDebug() << "emit entity select change." << endl;
-        emit ui->tableWidgetEntities->itemSelectionChanged();
-    } else {
-        RemindEntityStateChangeWith(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_NAME)->text(), true);
-    }
-}
-
-int MainWindow::TriggerEntityState(QTableWidgetItem* item, EntityState state, int pid, bool flicker)
-{
-    if (!item)
-        return -1;
-    TriggerEntityState(item->row(), state, pid, flicker);
-    return 0;
-}
-
-int MainWindow::TriggerEntityState(QString entityName, EntityState state, int pid, bool flicker)
-{
-    const int row = FindEntityRowIndex(entityName);
-    if (row >= 0) {
-        TriggerEntityState(row, state, pid, flicker);
-    }
-    return 0;
-}
-
-
-int MainWindow::DealWithEntity(const EntityInfo& entity, DealType dealType, QString extendParam, bool multiThread)
-{
-    qDebug() << "Deal with entity: " << entity.entityName << " with " << QString::number(dealType) << endl;
-
-    int result = -1;
-
-    if (!entity.entityName.isEmpty()) {
-        Threadee* nE = new Threadee();
-        nE->dealType = dealType;
-        nE->entityName = entity.entityName;
-        nE->cmdLine = extendParam;
-        OperatThread* ot = new OperatThread(nE, nullptr);
-
-        if (multiThread) {
-            if (dealType == Deal_Test) {
-                connect(ot, &OperatThread::OperateResult, this, &MainWindow::ReceiveOperatResult);
-            }
-            connect(ot, &QThread::finished, ot, &QObject::deleteLater);
-            ot->start();
-            result = -1 /*forbid changing entity state at screen*/;
-        } else {
-            bool ret = ot->doSomething();
-            result = ret ? 0 : -1;
-        }
-    }
-    return result;
-}
-
-void MainWindow::StartEntity()
-{
-    int optResult = DealWithEntity(GetCurrentSelectedEntity(), Deal_Start);
-    if (optResult == 0) {
-        TriggerEntityState(GetCurrentSelectedEntity().entityName, Idle, 8888);
-    }
-}
-
-void MainWindow::PauseEntity()
-{
-    int optResult = DealWithEntity(GetCurrentSelectedEntity(), Deal_Pause);
-    if (optResult == 0) {
-        TriggerEntityState(GetCurrentSelectedEntity().entityName, Pause);
-    }
-}
-
-void MainWindow::ContinueEntity()
-{
-    int optResult = DealWithEntity(GetCurrentSelectedEntity(), Deal_Continue);
-    if (optResult == 0) {
-        TriggerEntityState(GetCurrentSelectedEntity().entityName, Idle);
-    }
-}
-
-void MainWindow::TerminateEntity()
-{
-    int optResult = DealWithEntity(GetCurrentSelectedEntity(), Deal_Close);
-    if (optResult == 0) {
-        TriggerEntityState(GetCurrentSelectedEntity().entityName, Close);
-    }
-}
-
-void MainWindow::KillEntity()
-{
-    int optResult = DealWithEntity(GetCurrentSelectedEntity(), Deal_Kill);
-    if (optResult == 0) {
-        TriggerEntityState(GetCurrentSelectedEntity().entityName, Killed);
-    }
-}
-
-void MainWindow::TestEntity()
-{
-    int optResult = DealWithEntity(GetCurrentSelectedEntity(), Deal_Test);
-    if (optResult == 0) {
-        TriggerEntityState(GetCurrentSelectedEntity().entityName, Passed);
-    }
-}
-
-QString MainWindow::GetPerfStorePath()
-{
-#ifdef WITH_QT
-        std::string path = CSpShellConsole::GetTempPath();
-#else
-        std::string path = "C:\\rvc\\temp";
-#endif
-
-        if (!path.empty()) {
-            QDir tempDir(path.c_str());
-            tempDir.mkpath(QString("perf"));
-            if (tempDir.cd("perf")) {
-                return tempDir.absolutePath();
-            } else {
-                qDebug() << "cd " << tempDir.path() << " failed";
-                return QString(path.c_str());
-            }
-        }
-}
-
-QStringList MainWindow::ExecuteShellScripts(QString shellCmd)
-{
-    QStringList results;
-    QProcess* subScriptsProcess = new QProcess(this);
-    subScriptsProcess->setProcessChannelMode(QProcess::MergedChannels);
-    subScriptsProcess->start("sh", QStringList() << "-c" << shellCmd);
-    subScriptsProcess->waitForFinished();
-    QString str(subScriptsProcess->readAllStandardOutput());
-    results << str;
-    results << QString::number(subScriptsProcess->exitCode());
-    QMessageBox::warning(this, "Run ShellScripts Info", results.join("\t"), QMessageBox::Ok);
-    delete subScriptsProcess;
-    return QStringList() << str;
-}
-
-void MainWindow::RecordEntitySnapshot()
-{
-    qDebug() << "Enter " << __FUNCTION__;
-
-#if 0
-    QPixmap p = mPerformWidge->grab();
-    QString filePathName = GetPerfStorePath();
-    filePathName += "/EntityPerf_";
-    filePathName += QDateTime::currentDateTime().toString("yyyyMMdd-hhmmsszzz");
-    filePathName += ".png";
-    if (!p.save(filePathName, "png")) {
-        qDebug() << "save widget screen failed";
-    }
-#endif
-
-    ExportEntityInfo(false);
-}
-
-void MainWindow::ExportEntityInfo(bool fromBtnClick)
-{
-    QTableWidget* table = ui->tableWidgetEntities;
-    QString fileName;
-
-    if (fromBtnClick) {
-        fileName = QFileDialog::getSaveFileName(table,
-                                                "保存"
-                                                , QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)
-                                                , "文本文件(*.txt)");
-    } else {
-        QDir tempDir(GetPerfStorePath());
-        QDateTime currTime = QDateTime::currentDateTime();
-        QString currTimeString = currTime.toString("yyyyMMdd");
-        QString filePureName = currTimeString + "_EntityInfo.txt";
-        fileName = tempDir.filePath(filePureName);
-        qDebug() << "entity info file path: " << fileName;
-    }
-
-    QFile file(fileName);
-    if (!file.open(fromBtnClick ? (QIODevice::ReadWrite | QIODevice::Text) : (QIODevice::ReadWrite | QIODevice::Append))) {
-        if (fromBtnClick) QMessageBox::warning(this, tr("错误"), tr("<font size='12' color='red'>打开文件失败,数据保存失败!</font>"));
-        else qDebug() << "打开文件失败,数据保存失败! " << file.errorString();
-        return;
-
-    }
-
-    if (!file.isReadable()) {
-        if (fromBtnClick) QMessageBox::warning(this, tr("错误"), tr("<font size='12' color='red'>该文件不可读,数据保存失败!</font>"));
-        else qDebug() << "该文件不可读,数据保存失败! " << file.errorString();
-
-    } else {
-
-        QTextStream out(&file);
-        // const int colCounts = table->columnCount();
-        const int rowCounts = table->rowCount();
-
-        for (int i = 0; i < rowCounts; ++i) {
-            const EntityInfo entityInfo = GetEntityInfoByRowIndex(i);
-            EntityRunInfo entityRunInfo(entityInfo);
-            entityRunInfo.startupTimeStr = ui->tableWidgetEntities->item(i, ENTITY_COLUMN_BOOTTIME)->text();
-            entityRunInfo.fds = PerformWidget::GetProcessFds(entityRunInfo.pid);
-            if (i == 0) {
-                QString currentTime = QDateTime::currentDateTime().toString("yyyy.MM.dd hh:mm:ss.zzz");
-                QString timestamp = QString("\n\nRecord at: %1\n").arg(currentTime);
-                file.write(timestamp.toUtf8());
-                QString header = EntityInfoHeaderString();
-                file.write(header.toUtf8());
-            }
-            QString str = "\n";
-            str += EntityRunInfoToString(entityRunInfo);
-            file.write(str.toUtf8());
-        }
-
-        if (fromBtnClick) QMessageBox::warning(this, tr("信息"), tr("<font size='12' color='green'>实体信息保存成功!</font>"));
-        else qDebug() << "实体信息保存成功!";
-    }
-
-    file.close();
-}
-
-void MainWindow::ExportEntitySnapshot()
-{
-    ExportEntityInfo(true);
-}
-
-
-void MainWindow::Test_EventLog()
-{
-    {
-        for (int i = 0; i < 100; ++i) {
-            QString str = QString(("我是第%1串字符串字符串字符串字-------符串字符串"
-                                   "字符串字-------符串字符串字串字-------符符串字符"
-                                   "串字符串串字-------符字串字符字串字符字串字符字串"
-                                   "字符字串字符字串字-------符符串字串字-------符符"
-                                   "串字符串字串字-------符符串字符串字符串")).arg(i);
-            QtMessageInfo info{ (MessageType)(int)(i % int(MsgTypeMax)) , str,0, 0 };
-            InsertConsole(info);
-        }
-
-    }
-}
-
-EntityInfo MainWindow::GetEntityInfoByRowIndex(int row)
-{
-    if (row == -1)
-        return (EntityInfo{ "", Manual, NoStart, 0, "" });
-
-    return EntityInfo{ ui->tableWidgetEntities->item(row, ENTITY_COLUMN_NAME)->text(), MappingString2StartType(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_STATUS)->text()),
-                MappingString2Status(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_STATUS)->text()),
-                ui->tableWidgetEntities->item(row, ENTITY_COLUMN_PID)->text().toInt(), ui->tableWidgetEntities->item(row, ENTITY_COLUMN_VERSION)->text() };
-}
-
-EntityInfo MainWindow::GetCurrentSelectedEntity()
-{
-    const QTableWidgetItem* currentItem = ui->tableWidgetEntities->currentItem();
-    if (currentItem) {
-        auto item = GetEntityInfoByRowIndex(currentItem->row());
-        return item;
-    }
-    return GetEntityInfoByRowIndex(-1);
-
-}
-
-void MainWindow::AddEntityEntry(const EntityInfo& entityInst)
-{
-    const int currCows = ui->tableWidgetEntities->rowCount();
-
-    ui->tableWidgetEntities->insertRow(currCows);
-    ui->tableWidgetEntities->setItem(currCows, ENTITY_COLUMN_NAME, new QTableWidgetItem(entityInst.entityName));
-    //ui->tableWidgetEntities->setItem(currCows, 1, new QTableWidgetItem(MappingStartType2String(entityInst.startType)));
-    ui->tableWidgetEntities->setItem(currCows, ENTITY_COLUMN_STATUS, new QTableWidgetItem(MappingSatus2String(entityInst.state)));
-    ui->tableWidgetEntities->setItem(currCows, ENTITY_COLUMN_PID, new QTableWidgetItem(QString::number(entityInst.pid)));
-    ui->tableWidgetEntities->setItem(currCows, ENTITY_COLUMN_VERSION, new QTableWidgetItem(entityInst.version));
-
-    if (entityInst.state == Starting || entityInst.state == Idle) {
-        QDateTime currentTime = QDateTime::currentDateTime();
-        QString currentTimeStr = currentTime.toString("MM-dd-hh:mm:ss.zzz");
-        ui->tableWidgetEntities->setItem(currCows, ENTITY_COLUMN_BOOTTIME, new QTableWidgetItem(currentTimeStr));
-    } else {
-        ui->tableWidgetEntities->setItem(currCows, ENTITY_COLUMN_BOOTTIME, new QTableWidgetItem("未知"));
-    }
-
-    mTotalEntityCount++;
-    if (entityInst.state == Idle)
-        mIdleEntityCount++;
-    UpdateEntityStatistics();
-
-    UpdateItemBackgroundColor(currCows, entityInst.state);
-
-}
-
-void MainWindow::UpdateItemBackgroundColor(int row, EntityState state)
-{
-    const int columnCount = ui->tableWidgetEntities->columnCount();
-    auto curColor = MappingStatus2Color(state);
-    qDebug() << "uptate row background color" << endl;
-#if 0
-    for (int col = 0; col < columnCount; ++col) {
-        QTableWidgetItem* item = ui->tableWidgetEntities->item(row, col);
-        item->setBackground(QBrush(curColor));
-        //QPalette palette = item->palette();
-        //palette.setBrush(QPalette::Base, curColor);
-        //item->setPalette(palette);
-    }
-#else
-    setRowBackground(QBrush(curColor), ui->tableWidgetEntities->model(), row);
-#endif
-}
-
-void MainWindow::Test_EntityList()
-{
-
-    AddEntityEntry(EntityInfo{ "MobileDial", Manual, Idle, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "IEBrowser", Manual, NoStart, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "Browser", Manual, Lost, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "HelloClient", Manual, Starting, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "HelloService", Manual, Busy, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "PortbleScanner", Manual, Pause, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "HealthManager", Manual, UnLoading, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "MediaController", Manual, Close, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "GPIO", Manual, Killed, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "CardIssuer", Manual, Passed, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "DeviceSwitch", Manual, Failed, 123, "V1.2.3" });
-
-
-    if (-1 != FindEntityRowIndex("NoExist")) {
-        QMessageBox::warning(this, "", "NoExist", QMessageBox::Ok);
-    }
-    if (1 == FindEntityRowIndex("MobileDial")) {
-        QMessageBox::warning(this, "", "NoExist", QMessageBox::Ok);
-    }
-}
-
-bool MainWindow::LoadPlguins()
-{
-    return false;
-}
-
-void MainWindow::LoadCustomPlguins()
-{
-#ifndef WITH_QT
-    static bool sw = false;
-    if (!sw) {
-        this->setWindowState(Qt::WindowMinimized);
-    } else {
-        this->setWindowState((this->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
-    }
-    sw = !sw;
-#else
-    bool result = LoadPlguins();
-    if (result) {
-
-    }
-#endif
-
-}
-
-void MainWindow::EntityItemContextMenu(QPoint pos)
-{
-    auto index = ui->tableWidgetEntities->indexAt(pos);
-    if (index.isValid()) {
-        mEntityPopMenu->exec(QCursor::pos()); // 菜单出现的位置为当前鼠标的位置
-    }
-}
-
-void MainWindow::InitEntitiesView()
-{
-    ui->labelEntCalculate->setText("");
-    ui->tableWidgetEntities->setColumnCount(MAX_ENTITY_LIST_COLUMN);
-    QStringList header;
-    header << "名称" << "状态" << "进程号" << "版本" << "最近启动时间";
-    ui->tableWidgetEntities->setHorizontalHeaderLabels(header);
-
-    ui->tableWidgetEntities->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
-    ui->tableWidgetEntities->setEditTriggers(QAbstractItemView::NoEditTriggers);
-    ui->tableWidgetEntities->setSelectionBehavior(QAbstractItemView::SelectRows);
-    ui->tableWidgetEntities->setSelectionMode(QAbstractItemView::SingleSelection);
-    //ui->tableWidgetEntities->setSelectionModel(mEntitySelectedModel);
-    ui->tableWidgetEntities->verticalHeader()->hide();
-
-    ui->tableWidgetEntities->resizeColumnToContents(1);
-    ui->tableWidgetEntities->horizontalHeader()->setStretchLastSection(true);
-    ui->tableWidgetEntities->horizontalHeader()->setVisible(true);
-    ui->tableWidgetEntities->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft | Qt::AlignVCenter);
-    ui->tableWidgetEntities->setStyleSheet("selection-background-color:#1E90FF;");
-    connect(ui->tableWidgetEntities, SIGNAL(itemSelectionChanged()), this, SLOT(EntitySelectionChanged()));
-
-    /*
-    ui->tableWidgetEntities->setContextMenuPolicy(Qt::CustomContextMenu);
-    mEntityPopMenu = new QMenu(ui->tableWidgetEntities);
-    QAction *actionUpdateInfo = new QAction();
-    QAction *actionDelInfo = new QAction();
-    actionUpdateInfo ->setText(QString("修改"));
-    actionDelInfo ->setText(QString("删除"));
-    mEntityPopMenu->addAction(actionUpdateInfo);
-    mEntityPopMenu->addAction(actionDelInfo);
-
-    connect(ui->tableWidgetEntities, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(EntityItemContextMenu(QPoint)));
-    */
-
-    mEntityStateChangeReminder = new QTimer(this);
-    mEntityStateChangeReminder->setSingleShot(true);
-
-    //connect(mEntityStateChangeReminder, SIGNAL(timeout()),this, SLOT(RemindEntityStateChange()));
-}
-
-void MainWindow::InitStatusBar()
-{
-    mToolsTip = new QLabel("", this);
-    QFont ft;
-    ft.setPointSize(10);
-    mToolsTip->setFont(ft);
-
-    QPalette pa;
-    pa.setColor(QPalette::WindowText, QColor(105, 105, 105));
-    mToolsTip->setPalette(pa);
-    mToolsTip->setStyleSheet("QLabel {padding: 0px 1px 2px 2px;}");
-
-    statusBar()->addPermanentWidget(mToolsTip);
-
-    TimeDateTimer* timer = new TimeDateTimer(this);
-    timer->Start(1000);
-
-    //mStatusLabel = new MLabel(this);
-    //mStatusLabel->setStyleSheet("QLabel {padding: -10px 2px 2px 1px;}");
-    //statusBar()->addWidget(mStatusLabel);
-}
-
-void MainWindow::TimeUpdate(const QString& timeStr)
-{
-    //qDebug() << "enter TimeUpdate" << endl;
-    mToolsTip->setText(timeStr);
-}
-
-void MainWindow::ShowStatusMessage(QString message, int messageType)
-{
-    Q_UNUSED(messageType);
-    //statusBar()->setStyleSheet("color:green");
-
-    QFontMetrics fontMetrics(statusBar()->font());
-    int fontSize = fontMetrics.width(message);
-    if (fontSize > statusBar()->width()) {
-        message = fontMetrics.elidedText(message, Qt::ElideRight, statusBar()->width());
-    }
-    statusBar()->showMessage(message);
-
-    //mStatusLabel->setText(message);
-}
-
-void MainWindow::OnTrayIconActivated(QSystemTrayIcon::ActivationReason activeRson)
-{
-    switch (activeRson) {
-        // 单击托盘显示窗口
-    case QSystemTrayIcon::Trigger:
-    {
-        showNormal();
-        raise();
-        activateWindow();
-        break;
-    }
-    // 双击
-    case QSystemTrayIcon::DoubleClick:
-    {
-        // ...
-        break;
-    }
-    default:
-        break;
-    }
-}
-
-void MainWindow::messageClicked()
-{
-#ifndef WITH_QT
-    QMessageBox::information(nullptr, tr("Systray"),
-                             tr("Sorry, I already gave what help I could.\n"
-                                "Maybe you should try asking a human?"));
-#endif
-}
-
-void MainWindow::InitSystemTrayIcon()
-{
-    if (QSystemTrayIcon::supportsMessages() && mSicon == nullptr) {
-        mSicon = new QSystemTrayIcon(this);
-        QMenu* menusystemTray = new QMenu(this);
-        menusystemTray->addAction(tr("Show/Hide"));
-        menusystemTray->addAction(tr("About"));
-        menusystemTray->addAction(tr("Quit"));
-        mSicon->setIcon(QIcon(":/res/FavIcon.ico"));
-        mSicon->setToolTip(QString::fromUtf8("RVC Terminal Manager"));
-        mSicon->setContextMenu(menusystemTray);
-        connect(mSicon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(OnTrayIconActivated(QSystemTrayIcon::ActivationReason)));
-        connect(mSicon, &QSystemTrayIcon::messageClicked, this, &MainWindow::messageClicked);
-        mSicon->show();
-
-    }
-}
-
-void MainWindow::Note(QString info, NoteSrcType srcType, QString srcEntity, bool bForce)
-{
-    qDebug() << "Note: " << srcEntity << " " << info << endl;
-
-#ifdef WITH_QT
-    if (mSicon && (bForce || CanDisturb())) {
-        if (srcEntity.isEmpty()) srcEntity = RVC_TITLE_STRING;
-        int showDelayTime = 10000;
-        if (srcType == BootStage) {
-            showDelayTime = 15000;
-        }
-        QSystemTrayIcon::MessageIcon msgIcon = QSystemTrayIcon::MessageIcon(QSystemTrayIcon::Critical);
-        mSicon->showMessage(srcEntity, info, msgIcon, showDelayTime);
-    }
-#endif
-}
-
-void MainWindow::closeEvent(QCloseEvent* event)
-{
-    showMinimized();
-    event->ignore();
-}
-
-namespace
-{
-QString CoverWithTimePrefix(QString content)
-{
-    QDateTime time = QDateTime::currentDateTime();
-    QString buffer = time.toString("[hh:mm:ss]");
-    QString result = QString("%1 %2").arg(buffer).arg(content);
-    return result;
-}
-}
-
-void MainWindow::ReceiveMessage(const QtMessageInfo* message)
-{
-    if (!InsertConsole(*message)) {
-        QBaseListWidgetItem* item = new QConsoleListWidgetItem(CoverWithTimePrefix(message->content));
-        item->AppentToWidget(ui->listWidgetEventLog);
-    }
-}
-
-void MainWindow::ReceiveEntityVariant(QVariant info)
-{
-    QEntityActiveInfo entityInfo = info.value<QEntityActiveInfo>();
-    int localEntityIndex = -1;
-    for (int i = 0; i < mBootEntitiesInfo.size(); ++i) {
-        if (mBootEntitiesInfo.at(i).entityName == entityInfo.entityName) {
-            localEntityIndex = i;
-            break;
-        }
-    }
-    if (localEntityIndex != -1) {
-        if (mBootEntitiesInfo[localEntityIndex].entityState != entityInfo.entityState) {
-            const auto currState = entityInfo.entityState;
-            mBootEntitiesInfo[localEntityIndex].entityState = currState;
-            TriggerEntityState(entityInfo.entityName, currState, entityInfo.entityPID);
-        }
-    } else {
-        EntityBootInfo newEntityInfo;
-        newEntityInfo.entityName = entityInfo.entityName;
-        newEntityInfo.entityState = entityInfo.entityState;
-        mBootEntitiesInfo.push_back(newEntityInfo);
-
-        AddEntityEntry(EntityInfo{ entityInfo.entityName, Manual,
-                       entityInfo.entityState, entityInfo.entityPID, entityInfo.entityVerStr });
-    }
-}
-
-void MainWindow::ReceiveCustomOperatResult(int action, int result, const QString& message)
-{
-    qDebug() << "deal with custom operation result: " << message << " result " << result << endl;
-}
-
-void MainWindow::ReceiveOperatResult(int action, int result, const QString& message)
-{
-    qDebug() << "deal with operation result: " << message << " result " << result << endl;
-    for (int i = 0; i < mBootEntitiesInfo.size(); ++i) {
-        if (mBootEntitiesInfo.at(i).entityName == message) {
-            const auto& entityInfo = mBootEntitiesInfo.at(i);
-            (new EntityStateRecoverTimer(this, entityInfo.entityName, entityInfo.entityState));
-            TriggerEntityState(entityInfo.entityName, result == 0 ? Passed : Failed, 0);
-            break;
-        }
-    }
-}
-
-void MainWindow::UpdateEntityStatistics()
-{
-    QString text = QString("(正在运行%1个模块,其中%2个正常)").arg(mTotalEntityCount).arg(mIdleEntityCount);
-    qDebug() << mTotalEntityCount << " " << mIdleEntityCount;
-    qDebug() << text;
-    ui->labelEntCalculate->setText(text);
-}
-
-void MainWindow::NotifyLogMessage(MessageType type, const QString& title, const QString& message)
-{
-    QString contentMessage = message;
-    QJsonParseError parseError;
-    QJsonDocument jsonDoc = QJsonDocument::fromJson(message.toUtf8(), &parseError);
-    if (parseError.error == QJsonParseError::NoError) {
-        QJsonObject jsonObject = jsonDoc.object();
-        if (jsonObject.contains(QStringLiteral("errmsg"))) {
-            contentMessage = jsonObject["errmsg"].toString();
-        }
-    }
-
-    if (CanDisturb()) {
-        switch (type) {
-        case TextNotifyInfo:
-            QMessageBox::information(this, title, contentMessage);
-            break;
-        case TextNotifyWarn:
-            QMessageBox::warning(this, title, contentMessage);
-            break;
-        case TextNotifyError:
-            QMessageBox::critical(this, title, contentMessage);
-            break;
-        default:
-            break;
-        }
-    } else {
-        ShowStatusMessage(contentMessage, type);
-    }
-}
-
-
-static bool GetInterestPointWithRegex(const QString& origin, QString& entiName, QString& content)
-{
-    QRegExp rx("^\\[(\\D+)\\]\\s{0,1}(E|W|F|I|D|T):\\s{0,1}\\{(.*)\\}\\(sc:(0x[A-Za-z0-9]+),\\s{0,1}uc:(0x[A-Za-z0-9]+)\\)$");
-    const int pos = rx.indexIn(origin);
-    if (pos > -1) {
-        entiName = rx.cap(1);
-        content = rx.cap(3);
-        QString systemCode = rx.cap(4);
-        QString userCode = rx.cap(5);
-        return true;
-    }
-    return false;
-}
-
-bool MainWindow::InsertConsole(const QtMessageInfo& message)
-{
-    QString content = message.content; //FakeUnicodeToUnicode(message.content);
-    bool dealed = true;
-    if (message.type == TextNormal || message.type == TextEvent) {
-        QBaseListWidgetItem* item = new QConsoleListWidgetItem(CoverWithTimePrefix(content));
-        item->AppentToWidget(ui->listWidgetEventLog);
-    } else if (message.type == TextWarn) {
-        QBaseListWidgetItem* item = new QLightWarnListWidgetItem(CoverWithTimePrefix(content));
-        item->AppentToWidget(ui->listWidgetEventLog);
-    } else if (message.type == TextError) {
-        QBaseListWidgetItem* item = new QLightErrorListWidgetItem(CoverWithTimePrefix(content));
-        item->AppentToWidget(ui->listWidgetEventLog);
-    } else if (message.type == TextFatal || message.type == TextBlock
-               || (message.type >= TextNotifyInfo && message.type <= TextNotifyError)) {
-        QString entityName;
-        const int  existIdx = content.indexOf(":][:");
-        if (-1 != existIdx) {
-            entityName = content.mid(0, existIdx);
-            content = content.mid(existIdx + QString(":][:").length());
-        }
-        
-#ifndef WITH_QT
-        QBaseListWidgetItem* item2 = new QTipErrorListWidgetItem(CoverWithTimePrefix(content));
-        item2->AppentToWidget(ui->listWidgetFatalLog);
-#endif
-        
-        if (message.type == TextFatal || message.type == TextBlock) {
-            if (-1 == existIdx) { GetInterestPointWithRegex(content, entityName, content); }
-#ifndef  NDEBUG
-            Note(content, BootStage, entityName, true);
-#endif //NDEBUG
-        } else {
-#ifdef WITH_QT
-            NotifyLogMessage(message.type, entityName, content);
-#endif
-        }
-    } else {
-        dealed = false;
-    }
-    return dealed;
-}
-
-void MainWindow::ReceiveMessageVariant(QVariant info)
-{
-    QtMessageInfo message = info.value<QtMessageInfo>();
-    if (InsertConsole(message)) {
-        //empty
-    } else if (message.type == ModBootInfo) { //entity boot info
-        if (message.content.length() == 0 || message.param1 > Failed) {
-            return;
-        }
-
-        int localEntityIndex = -1;
-        for (int i = 0; i < mBootEntitiesInfo.size(); ++i) {
-            if (mBootEntitiesInfo.at(i).entityName == message.content) {
-                localEntityIndex = i;
-                break;
-            }
-        }
-        if (localEntityIndex != -1) {
-            if (mBootEntitiesInfo[localEntityIndex].entityState != message.param1) {
-                // const auto previousState = mBootEntitiesInfo[localEntityIndex].entityState;
-                const auto currState = static_cast<EntityState>(message.param1);
-                mBootEntitiesInfo[localEntityIndex].entityState = currState;
-
-                TriggerEntityState(message.content, currState, 0);
-            }
-        } else {
-            EntityBootInfo newEntityInfo;
-            newEntityInfo.entityName = message.content;
-            newEntityInfo.entityState = static_cast<EntityState>(message.param1);
-            mBootEntitiesInfo.push_back(newEntityInfo);
-
-            AddEntityEntry(EntityInfo{ message.content, Manual, static_cast<EntityState>(message.param1), 123, "V1.2.3" });
-        }
-    } else if (message.type == ModStartupInfo) {
-        //ShowMessage(QString::fromLocal8Bit(message.content), message.type);
-        ShowStatusMessage(message.content, message.type);
-
-    } else if (message.type == DisplayShow) {
-        this->setWindowState((this->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
-
-    } else if (message.type == DisplayHide) {
-        this->setWindowState(Qt::WindowMinimized);
-
-    } else if (message.type == StageChangeInfo) {
-        const bool oldSilent = mSilent;
-        if (message.param1 == FRAMEWORK_STATE_RUNNING
-            || message.param1 == FRAMEWORK_STATE_SERVING
-            || message.param1 == FRAMEWORK_STATE_NOTDISTURB
-            || message.param1 == FRAMEWORK_STATE_NOCONFIG) {
-            mSilent = true;
-        } else {
-            mSilent = false;
-        }
-        if (mSilent != oldSilent) {
-            OnSilentStateChange(mSilent);
-        }
-    }
-}
-
-bool MainWindow::CanDisturb() const
-{
-    if (!mSilent) {
-        return true;
-    }
-
-    Qt::WindowStates states = this->windowState();
-    if (!(states & Qt::WindowMinimized) && (states & Qt::WindowActive)) {
-        return true;
-    }
-
-    return false;
-}
-
-void MainWindow::OnSilentStateChange(bool beSilent)
-{
-
-}
-
-void MainWindow::InitFloatWidget()
-{
-    QDesktopWidget* desk = QApplication::desktop();
-    QRect rect = desk->screenGeometry(desk->primaryScreen());
-    const int wd = rect.width();
-    const int ht = rect.height();
-
-    mFloatWidget = new Widget();
-    mFloatWidget->show();
-
-}
-
-MainWindow::~MainWindow()
-{
-    delete ui;
-}
-
-void RichTimer::HandleTimeout(bool toStop)
-{
-    mTimes++;
-    mWin->RemindEntityStateChangeWith(mEntityName, toStop ? true : !(mTimes % 2));
-    if (toStop) {
-        killTimer(mTimerID);
-        delete this;
-    }
-}
-
-void EntityStateRecoverTimer::HandleTimeout()
-{
-    qDebug() << "reset entity state to " << MappingSatus2String(mState) << endl;
-    mWin->TriggerEntityState(mEntityName, mState, -1, false);
-    killTimer(mTimerID);
-    delete this;
-}
-
-void TimeDateTimer::Start(int interval)
-{
-    mTimer->start(interval);
-    connect(mTimer, SIGNAL(timeout()), this, SLOT(HandleTimeout()));
-}
-
-void TimeDateTimer::Stop()
-{
-    mTimer->stop();
-}
-
-void TimeDateTimer::HandleTimeout()
-{
-    mSeconds++;
-    if (mSeconds == 60) {
-        mMinutes++;
-        mSeconds = 0;
-    }
-    if (mMinutes == 60) {
-        mHours++;
-        mMinutes = 0;
-    }
-    if (mHours == 24) {
-        mDays++;
-        mHours = 0;
-    }
-    mWin->TimeUpdate(GetCurrentRunTimeString());
-}
-

+ 0 - 310
Framework/spshell/Widgets/mainwindow.h

@@ -1,310 +0,0 @@
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include <QDebug>
-#include <QItemSelectionModel>
-#include <QLabel>
-#include <QMainWindow>
-#include <QSortFilterProxyModel>
-#include <QSystemTrayIcon>
-#include <QTableWidget>
-#include <QTextEdit>
-#include <QTimer>
-#include <QTimerEvent>
-#include <QAction>
-#include <QSystemTrayIcon>
-#include <QAtomicInteger>
-
-#include "RvcSettings.h"
-#include "QRvcItemModel.hpp"
-#include "QtMessageInfo.h"
-
-#include "sysinfowidget.h"
-#include "cpuwidget.h"
-#include "performwidget.h"
-#include "memorywidget.h"
-#include "OperaThread.hpp"
-#include "mlabel.h"
-#include "floatwidget/widget.h"
-
-#define APP_EXIT_CODE_QUIT 0
-#define APP_EXIT_CODE_RESTART_CURR 1
-#define APP_EXIT_CODE_RESTART_ACTIVE 2
-
-QT_BEGIN_NAMESPACE
-namespace Ui { class MainWindow; }
-QT_END_NAMESPACE
-
-
-class MainWindow;
-
-class RichTimer : public QObject
-{
-
-    Q_OBJECT
-public:
-    explicit RichTimer(MainWindow *parent, QString entityName)
-        :QObject((QObject*)parent)
-        ,mWin(parent)
-        ,mEntityName(entityName)
-        ,mTimes(0)
-    {
-        mTimerID = startTimer(300);
-    }
-    virtual void timerEvent(QTimerEvent *event)
-    {
-        if(event->timerId() == mTimerID){
-            HandleTimeout(mTimes == 7);
-        }
-    }
-private:
-    void HandleTimeout(bool toStop);
-    int mTimerID;
-    MainWindow* mWin;
-    QString mEntityName;
-    int mTimes;
-};
-
-class EntityStateRecoverTimer : public QObject
-{
-
-    Q_OBJECT
-public:
-    explicit EntityStateRecoverTimer(MainWindow *parent, QString entityName, EntityState restoreState)
-        :QObject((QObject*)parent)
-        ,mWin(parent)
-        ,mEntityName(entityName)
-        ,mState(restoreState)
-        ,mTimes(0)
-    {
-        mTimerID = startTimer(10000);
-    }
-    virtual void timerEvent( QTimerEvent *event)
-    {
-
-        if(event->timerId() == mTimerID) {
-            HandleTimeout();
-        }
-    }
-private:
-    void HandleTimeout();
-    int mTimerID;
-    MainWindow* mWin;
-    QString mEntityName;
-    EntityState mState;
-    int mTimes;
-};
-
-class TimeDateTimer : public QObject
-{
-    Q_OBJECT
-public:
-    explicit TimeDateTimer(QObject *parent = 0)
-        :QObject(parent)
-        ,mWin(reinterpret_cast<MainWindow*>(parent))
-        ,mDays(0),mHours(0),mMinutes(0),mSeconds(0){
-        mTimer = new QTimer(this);
-    }
-    ~TimeDateTimer(){Stop();}
-    void Start(int interval);
-    void Stop();
-
-private slots:
-        void HandleTimeout();
-
-private:
-    QString GetCurrentRunTimeString()
-    {
-        QString result;
-        if(mDays == 0)
-            result = QString(QStringLiteral("elapsed: %1:%2:%3")).arg(mHours,2,10,QLatin1Char('0'))
-                    .arg(mMinutes,2,10,QLatin1Char('0'))
-                    .arg(mSeconds,2,10,QLatin1Char('0'));
-        else
-            result = QString(QStringLiteral("elapsed: %1 day - %2:%3:%4")).arg(mDays,2,10,QLatin1Char('0'))
-                    .arg(mHours,2,10,QLatin1Char('0'))
-                    .arg(mMinutes,2,10,QLatin1Char('0'))
-                    .arg(mSeconds,2,10,QLatin1Char('0'));
-        return result;
-    }
-
-    MainWindow* mWin;
-    int mDays;
-    int mHours;
-    int mMinutes;
-    int mSeconds;
-    QTimer *mTimer;
-};
-
-enum ExecuteType {
-    CreatesSubProcess = 0,
-    BootEntity,
-    RunShellScript
-};
-
-
-
-class RvcAdditionAction : public QAction
-{
-public:
-    explicit RvcAdditionAction(QObject *parent = nullptr)
-        :QAction(parent) {}
-    explicit RvcAdditionAction(const QString &text, QObject *parent = nullptr)
-        :QAction(text, parent) {}
-    explicit RvcAdditionAction(const QIcon &icon, const QString &text, QObject *parent = nullptr)
-        :QAction(icon, text, parent) {}
-
-    struct AdditionMenuInfo {
-        ExecuteType type;
-        QString cmdLine;
-        QString entityName;
-    } userData;
-};
-
-class MainWindow : public QMainWindow
-{
-    Q_OBJECT
-
-public:
-    MainWindow(QWidget *parent = nullptr);
-    MainWindow(QString systemInfo, int totalEntityCount, QWidget *parent = nullptr);
-    ~MainWindow();
-
-    bool CanDisturb() const;
-
-protected:
-    void closeEvent(QCloseEvent *event) override;
-
-private:
-    void Init(QString title);
-    void Test_EntityList();
-    void Test_EventLog();
-    void InitMenuAction();
-    void InitStatusBar();
-    void InitEntitiesView();
-    void AddEntityEntry(const EntityInfo& entityInst);
-    void InitSystemTrayIcon();
-
-    int TriggerEntityState(QString entityName, EntityState state, int pid = 0, bool flicker = true);
-    int TriggerEntityState(QTableWidgetItem* item, EntityState state, int pid = 0, bool flicker = true);
-    void TriggerEntityState(int row, EntityState state, int pid, bool flicker = true);
-    int FindEntityRowIndex(QString entityName);
-
-    void ShowStatusMessage(QString message, int messageType);
-
-    int DealWithEntity(const EntityInfo& entity, DealType dealType, QString extendParam = "", bool multiThread = true);
-    void UpdateEntityOperateBtnState(EntityState currState);
-    void ResetAllEntityOperateBtnState(bool enable=true);
-    void StartEntityFromCustom(const QString& entityName, const QString& cmdLine);
-    bool LoadPlguins();
-    void OnSilentStateChange(bool beSilent);
-
-    void InitFloatWidget();
-
-public slots:
-    void ReceiveMessage(const QtMessageInfo* message);
-    void ReceiveMessageVariant(QVariant info);
-    void ReceiveEntityVariant(QVariant info);
-    void ReceiveOperatResult(int action, int result, const QString& message);
-    void ReceiveCustomOperatResult(int action, int result, const QString& message);
-
-    void EntityItemContextMenu(QPoint pos);
-private slots:
-
-    void LoadCustomPlguins();
-
-    void DisplayEntities();
-    void EntitySelectionChanged();
-
-    void StartEntity();
-    void PauseEntity();
-    void ContinueEntity();
-    void TerminateEntity();
-    void KillEntity();
-    void TestEntity();
-
-    void SortEntityItem(int n);
-    void RemindEntityStateChange(int row, EntityState previousState, EntityState currState);
-
-    void OnTrayIconActivated(QSystemTrayIcon::ActivationReason activeRson);
-
-    void ConfigApp();
-    void QuitApp();
-    void RestartApp();
-    void RestartSystem();
-    void ShutdownSystem();
-    void RestartAppThroughActive();
-    void RestartAppThroughSpShell();
-    void InitializeTerminal();
-    void VersionView();
-    void LogView();
-    void ErrorCodeView();
-    void RemoveEntityRuninfoConfigFile();
-
-    void TriggerAdditionMenu(QAction* action);
-    void ProcessStarted();
-    void GetSubProcessMsg();
-
-    void messageClicked();
-
-    void ExportEntitySnapshot();
-
-    void RecordEntitySnapshot();
-
-private:
-
-    EntityInfo GetCurrentSelectedEntity();
-    EntityInfo GetEntityInfoByRowIndex(int row);
-    QTableWidgetItem* FindEnityWidgetItem(QString entityName);
-    void UpdateItemBackgroundColor(int row, EntityState state);
-
-    enum NoteSrcType {
-      BootStage,
-      EntityFire
-    };
-    void Note(QString info, NoteSrcType srcType, QString srcEntity, bool bForce = false);
-
-    QAction* CreateMenuAction(QString text, QKeySequence keyShot, QString toolTipText, void (MainWindow::*)());
-    bool InsertConsole(const QtMessageInfo& message);
-    /*弹窗显示信息*/
-    void NotifyLogMessage(MessageType type, const QString& title, const QString& message);
-    void UpdateEntityStatistics();
-    void ExportEntityInfo(bool fromBtnClick);
-
-    QString GetPerfStorePath();
-
-    QStringList ExecuteShellScripts(QString shellCmd);
-    
-private:
-
-    Ui::MainWindow *ui;
-    RvcItemModel* mEntityModel;
-    QItemSelectionModel *mEntitySelectedModel;
-    QSortFilterProxyModel* mEntityFilterModel;
-    QLabel *mToolsTip;
-    MLabel* mStatusLabel;
-    QTimer *mEntityStateChangeReminder;
-    QMenu *mEntityPopMenu;
-    friend RichTimer;
-    friend EntityStateRecoverTimer;
-
-    void RemindEntityStateChangeWith(QString entityName, bool bEnd);
-    friend TimeDateTimer;
-    void TimeUpdate(const QString& timeStr);
-
-    CpuWidget mCpuWidget;
-    MemoryWidget mMemoryWidget;
-    PerformWidget* mPerformWidge;
-
-    QVector< EntityBootInfo> mBootEntitiesInfo;
-
-    QSystemTrayIcon *mSicon;
-    bool mSilent;
-
-    QAtomicInteger<quint32> mIdleEntityCount;
-    QAtomicInteger<quint32> mTotalEntityCount;
-
-    Widget* mFloatWidget;
-
-};
-#endif // MAINWINDOW_H

+ 0 - 570
Framework/spshell/Widgets/mainwindow.ui

@@ -1,570 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>1068</width>
-    <height>720</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>RVC Terminal GUIConsole</string>
-  </property>
-  <widget class="QWidget" name="centralWidget">
-   <layout class="QHBoxLayout" name="horizontalLayout_2">
-    <item>
-     <widget class="QSplitter" name="splitterMain">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <widget class="QTabWidget" name="tabWidget">
-       <property name="currentIndex">
-        <number>0</number>
-       </property>
-       <widget class="QWidget" name="tabEntityManagement">
-        <attribute name="title">
-         <string>实体管理</string>
-        </attribute>
-        <layout class="QGridLayout" name="horizontalLayout_18">
-         <item row="0" column="0">
-          <widget class="QSplitter" name="splitter">
-           <property name="orientation">
-            <enum>Qt::Vertical</enum>
-           </property>
-           <widget class="QWidget" name="layoutWidget1">
-            <layout class="QVBoxLayout" name="verticalLayoutListControl">
-             <property name="spacing">
-              <number>2</number>
-             </property>
-             <item>
-              <layout class="QHBoxLayout" name="horizontalLayout">
-               <property name="spacing">
-                <number>4</number>
-               </property>
-               <property name="sizeConstraint">
-                <enum>QLayout::SetDefaultConstraint</enum>
-               </property>
-               <property name="leftMargin">
-                <number>0</number>
-               </property>
-               <property name="topMargin">
-                <number>2</number>
-               </property>
-               <property name="bottomMargin">
-                <number>2</number>
-               </property>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntStart">
-                 <property name="sizePolicy">
-                  <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-                   <horstretch>0</horstretch>
-                   <verstretch>0</verstretch>
-                  </sizepolicy>
-                 </property>
-                 <property name="minimumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>启动实体</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/control_play_blue.png</normaloff>:/icons/res/fatcow/control_play_blue.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="autoDefault">
-                  <bool>false</bool>
-                 </property>
-                 <property name="default">
-                  <bool>false</bool>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntClose">
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>关闭实体</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/control_stop_blue.png</normaloff>:/icons/res/fatcow/control_stop_blue.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="shortcut">
-                  <string>Ctrl+S</string>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntContinue">
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>恢复实体</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/control_end_blue.png</normaloff>:/icons/res/fatcow/control_end_blue.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntPause">
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>暂停实体</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/control_pause_blue.png</normaloff>:/icons/res/fatcow/control_pause_blue.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntKill">
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>停止实体</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/control_power_blue.png</normaloff>:/icons/res/fatcow/control_power_blue.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntTest">
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>测试实体</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/lcd_tv_test.png</normaloff>:/icons/res/fatcow/lcd_tv_test.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntLogView">
-                 <property name="minimumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>查看实体日志</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/file_extension_log.png</normaloff>:/icons/res/fatcow/file_extension_log.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonClearRunCfg">
-                 <property name="minimumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>清除实体运行时文件</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/page_delete.png</normaloff>:/icons/res/fatcow/page_delete.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <spacer name="horizontalSpacer">
-                 <property name="orientation">
-                  <enum>Qt::Horizontal</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>40</width>
-                   <height>20</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-              </layout>
-             </item>
-             <item>
-              <layout class="QHBoxLayout" name="horizontalLayout_17">
-               <property name="spacing">
-                <number>4</number>
-               </property>
-               <property name="sizeConstraint">
-                <enum>QLayout::SetDefaultConstraint</enum>
-               </property>
-               <property name="topMargin">
-                <number>2</number>
-               </property>
-               <property name="bottomMargin">
-                <number>2</number>
-               </property>
-               <item>
-                <widget class="QLabel" name="labelEntCalculate">
-                 <property name="styleSheet">
-                  <string notr="true">color:rgb(100, 100, 100)</string>
-                 </property>
-                 <property name="text">
-                  <string>(正在运行00个模块,其中00个正常)</string>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QLabel" name="labelStatus">
-                 <property name="text">
-                  <string>状态</string>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QComboBox" name="comboBoxStatus"/>
-               </item>
-               <item>
-                <spacer name="horizontalSpacer_4">
-                 <property name="orientation">
-                  <enum>Qt::Horizontal</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>40</width>
-                   <height>20</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-              </layout>
-             </item>
-            </layout>
-           </widget>
-           <widget class="QTableWidget" name="tableWidgetEntities">
-            <property name="maximumSize">
-             <size>
-              <width>16777215</width>
-              <height>16777215</height>
-             </size>
-            </property>
-            <property name="font">
-             <font>
-              <pointsize>9</pointsize>
-             </font>
-            </property>
-            <attribute name="horizontalHeaderVisible">
-             <bool>false</bool>
-            </attribute>
-            <attribute name="verticalHeaderVisible">
-             <bool>false</bool>
-            </attribute>
-            <attribute name="verticalHeaderDefaultSectionSize">
-             <number>25</number>
-            </attribute>
-           </widget>
-           <widget class="QConsoleListWidget" name="listWidgetEventLog">
-            <property name="maximumSize">
-             <size>
-              <width>16777215</width>
-              <height>16777215</height>
-             </size>
-            </property>
-            <property name="font">
-             <font>
-              <pointsize>8</pointsize>
-             </font>
-            </property>
-            <property name="cursor" stdset="0">
-             <cursorShape>IBeamCursor</cursorShape>
-            </property>
-            <property name="mouseTracking">
-             <bool>true</bool>
-            </property>
-            <property name="tabletTracking">
-             <bool>true</bool>
-            </property>
-            <property name="verticalScrollBarPolicy">
-             <enum>Qt::ScrollBarAlwaysOff</enum>
-            </property>
-            <property name="verticalScrollMode">
-             <enum>QAbstractItemView::ScrollPerPixel</enum>
-            </property>
-           </widget>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-       <widget class="QWidget" name="tabResourceManagement">
-        <attribute name="title">
-         <string>性能资源</string>
-        </attribute>
-        <layout class="QVBoxLayout" name="verticalLayout_10">
-         <item>
-          <layout class="QVBoxLayout" name="verticalLayout">
-           <item>
-            <widget class="QTabWidget" name="tabWidgetResource">
-             <property name="tabPosition">
-              <enum>QTabWidget::West</enum>
-             </property>
-             <property name="currentIndex">
-              <number>0</number>
-             </property>
-             <widget class="QWidget" name="tab4Monitor">
-              <attribute name="title">
-               <string>Monitor</string>
-              </attribute>
-             </widget>
-             <widget class="QWidget" name="tab4CPU">
-              <attribute name="title">
-               <string>CPU</string>
-              </attribute>
-             </widget>
-             <widget class="QWidget" name="tab4Memory">
-              <attribute name="title">
-               <string>内存</string>
-              </attribute>
-             </widget>
-            </widget>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </widget>
-       <widget class="QWidget" name="tabSettog">
-        <attribute name="title">
-         <string>系统日志</string>
-        </attribute>
-        <layout class="QVBoxLayout" name="verticalLayout_2">
-         <item>
-          <widget class="QTableView" name="view"/>
-         </item>
-        </layout>
-       </widget>
-      </widget>
-      <widget class="QFatalListWidget" name="listWidgetFatalLog">
-       <property name="maximumSize">
-        <size>
-         <width>16777215</width>
-         <height>16777215</height>
-        </size>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>8</pointsize>
-        </font>
-       </property>
-       <property name="cursor" stdset="0">
-        <cursorShape>IBeamCursor</cursorShape>
-       </property>
-       <property name="mouseTracking">
-        <bool>true</bool>
-       </property>
-       <property name="tabletTracking">
-        <bool>true</bool>
-       </property>
-       <property name="verticalScrollBarPolicy">
-        <enum>Qt::ScrollBarAlwaysOff</enum>
-       </property>
-       <property name="verticalScrollMode">
-        <enum>QAbstractItemView::ScrollPerPixel</enum>
-       </property>
-      </widget>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QToolBar" name="mainToolBar">
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-  </widget>
-  <widget class="QMenuBar" name="menubar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>1068</width>
-     <height>23</height>
-    </rect>
-   </property>
-  </widget>
-  <widget class="QStatusBar" name="statusBar"/>
-  <action name="actionInitialize">
-   <property name="text">
-    <string>终端初始化</string>
-   </property>
-  </action>
-  <action name="actionRestartFrmw">
-   <property name="text">
-    <string>重启应用</string>
-   </property>
-  </action>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <customwidgets>
-  <customwidget>
-   <class>QConsoleListWidget</class>
-   <extends>QListWidget</extends>
-   <header location="global">QConsoleListWidget.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QFatalListWidget</class>
-   <extends>QListWidget</extends>
-   <header>QConsoleListWidget.h</header>
-  </customwidget>
- </customwidgets>
- <resources>
-  <include location="res.qrc"/>
- </resources>
- <connections/>
-</ui>

+ 0 - 58
Framework/spshell/Widgets/memorywidget.cpp

@@ -1,58 +0,0 @@
-#include "memorywidget.h"
-
-#include <QtCharts/QAreaSeries>
-#include <QPen>
-#include <QLinearGradient>
-#include <QDebug>
-
-#include "sysinfo.h"
-
-using namespace QtCharts;
-
-const int CHART_X_RANGE_COUNT = 50;
-const int CHART_X_RANGE_MAX = CHART_X_RANGE_COUNT - 1;
-const int COLOR_DARK_BLUE = 0x209fdf;
-const int COLOR_LIGHT_BLUE = 0xbfdfef;
-const int PEN_WIDTH = 3;
-
-MemoryWidget::MemoryWidget(QWidget *parent) :
-    #ifdef __arm__
-        SysInfoWidget(parent, 1200, 3000),
-    #else
-        SysInfoWidget(parent, 1200, 1000),
-    #endif
-    mSeries(new QLineSeries(this)),
-    mPointPositionX(0)
-{
-    QPen pen(COLOR_DARK_BLUE);
-    pen.setWidth(PEN_WIDTH);
-
-    QLinearGradient gradient(QPointF(0, 0), QPointF(0, 1));
-    gradient.setColorAt(1.0, COLOR_DARK_BLUE);
-    gradient.setColorAt(0.0, COLOR_LIGHT_BLUE);
-    gradient.setCoordinateMode(QGradient::ObjectBoundingMode);
-
-    QAreaSeries* areaSeries = new QAreaSeries(mSeries);
-    areaSeries->setPen(pen);
-    areaSeries->setBrush(gradient);
-
-    QChart* chart = chartView().chart();
-    chart->addSeries(areaSeries);
-    chart->setTitle("Memory used");
-    chart->createDefaultAxes();
-    chart->axisX()->setRange(0, CHART_X_RANGE_MAX);
-    chart->axisX()->setVisible(false);
-    chart->axisY()->setRange(0, 100);
-}
-
-void MemoryWidget::updateSeries()
-{
-    double memoryUsed = SysInfo::instance().memoryUsed();
-    //qDebug() << memoryUsed << endl;
-    mSeries->append(mPointPositionX++, memoryUsed);
-    if (mSeries->count() > CHART_X_RANGE_COUNT) {
-        QChart* chart = chartView().chart();
-        chart->scroll(chart->plotArea().width() / CHART_X_RANGE_MAX, 0);
-        mSeries->remove(0);
-    }
-}

+ 0 - 22
Framework/spshell/Widgets/memorywidget.h

@@ -1,22 +0,0 @@
-#ifndef MEMORYWIDGET_H
-#define MEMORYWIDGET_H
-
-#include <QtCharts/QLineSeries>
-
-#include "sysinfowidget.h"
-
-class MemoryWidget : public SysInfoWidget
-{
-    Q_OBJECT
-public:
-    explicit MemoryWidget(QWidget *parent = nullptr);
-
-protected slots:
-    void updateSeries() override;
-
-private:
-    QtCharts::QLineSeries* mSeries;
-    qint64 mPointPositionX;
-};
-
-#endif // MEMORYWIDGET_H

+ 0 - 92
Framework/spshell/Widgets/mlabel.cpp

@@ -1,92 +0,0 @@
-#include "mlabel.h"
-#include <QPainter>
-#include <QTimer>
-#include <QFontMetrics>
-#include <QTimerEvent>
-
-const QString strSpace("   ");
-
-MLabel::MLabel(QWidget *parent) : QLabel(parent),left(0),timerId(-1),fontSize(10)
-{
-    setStyleSheet(QString("color:black;"));
-}
-
-void MLabel::setText(const QString & txt)
-{
-    QLabel::setText(txt);
-    upateLabelRollingState();
-}
-
-void MLabel::paintEvent(QPaintEvent *e)
-{
-    QPainter p(this);
-    QRect rc = rect();
-    rc.setHeight(rc.height() - 2);
-    rc.setWidth(rc.width() - 2);
-    QFont ft = font();
-    ft.setPointSize(fontSize);
-    p.setFont(ft);
-    p.setPen(QPen(Qt::black));
-
-    //  设置绘制文字的开始位置,也就是将文字往左移动多少
-    rc.setLeft(rc.left() - left);
-
-    //  如果文字已经显示到末尾,则再添加一遍文字,做出循环滚动的效果
-    QString strText = text();
-    if (timerId >= 0) {
-        strText += strSpace + text();
-    }
-    //  绘制文字
-    p.drawText(rc, Qt::AlignVCenter, strText);
-}
-
-void MLabel::timerEvent(QTimerEvent *e)
-{
-    if (e->timerId() == timerId && isVisible()) {
-        //  每次左移1个像素
-        left += 1;
-
-        //  判断是否已经完成一遍循环,完成则恢复起始位置,重新开始循环
-        QFont ft = font();
-        ft.setPointSize(fontSize);
-        QFontMetrics fm(ft);
-        const int txtWidth = fm.width(text());
-        const int spaceWidth = fm.width(strSpace);
-
-        if ((txtWidth + spaceWidth) < left) {
-            left = 0;
-        }
-
-        repaint();
-    }
-
-    QLabel::timerEvent(e);
-}
-
-void MLabel::resizeEvent(QResizeEvent *e)
-{
-    QLabel::resizeEvent(e);
-    upateLabelRollingState();
-}
-
-void MLabel::upateLabelRollingState()
-{
-    //  获取文本大小,小于文本框长度,则无需滚动
-    QFont ft = font();
-    ft.setPointSize(fontSize);
-    QFontMetrics fm(ft);
-    int nW = fm.width(text());
-
-    left = 0;
-    //  开启文本框滚动
-    if (nW > width()) {
-        timerId = startTimer(100);
-    }
-    //  关闭文本框滚动
-    else {
-        if (timerId >= 0) {
-            killTimer(timerId);
-            timerId = -1;
-        }
-    }
-}

+ 0 - 28
Framework/spshell/Widgets/mlabel.h

@@ -1,28 +0,0 @@
-#ifndef MLABEL_H
-#define MLABEL_H
-
-#include <QLabel>
-
-class MLabel : public QLabel
-{
-    Q_OBJECT
-public:
-    MLabel(QWidget* parent = NULL);
-
-public slots:
-    void setText(const QString&);
-
-protected:
-    virtual void paintEvent(QPaintEvent* e);
-    virtual void timerEvent(QTimerEvent* e);
-    virtual void resizeEvent(QResizeEvent* e);
-
-    void upateLabelRollingState();
-
-private:
-    int left;
-    int timerId;
-    int fontSize;
-};
-
-#endif // MLABEL_H

+ 0 - 251
Framework/spshell/Widgets/performwidget.cpp

@@ -1,251 +0,0 @@
-#include "performwidget.h"
-#include "ui_performwidget.h"
-
-#define COLUMN_NAME_INDEX   0
-#define COLUMN_PID_INDEX    1
-#define COLUMN_CPU_INDEX    2
-#define COLUMN_MEM_INDEX    3
-#define COLUMN_COMMAND_INDEX    4
-#define COLUMN_FDS_INDEX    5
-#define MAX_PERFORM_LIST_COLUMN 6
-
-//RUSER      PID %CPU %MEM COMMAND         COMMAND
-#define RAW_RUSER_INDEX   0
-#define RAW_PID_INDEX    1
-#define RAW_CPU_INDEX    2
-#define RAW_MEM_INDEX    3
-#define RAW_COMMAND_INDEX    4
-#define RAW_FDS_INDEX    5
-
-PerformWidget::PerformWidget(QWidget *parent)
-    : QWidget(parent)
-    , ui(new Ui::PerformWidget)
-{
-    ui->setupUi(this);
-
-    ui->performTableWidget->setColumnCount(MAX_PERFORM_LIST_COLUMN);
-    QStringList header;
-#ifdef WITH_QT
-    header << "名称"  << "进程号" << "CPU[%]" << "内存[%]" << "命令" << "文件句柄数";
-#else
-    header << "Name"  << "PIC" << "CPU[%]" << "MEM[%]" << "CMD" << "Fds" ;
-#endif
-
-    ui->performTableWidget->setHorizontalHeaderLabels(header);
-
-    ui->performTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
-    //ui->performTableWidget->horizontalHeader()->setSectionResizeMode(COLUMN_PID_INDEX, QHeaderView::ResizeToContents);
-    //ui->performTableWidget->horizontalHeader()->setSectionResizeMode(COLUMN_CPU_INDEX, QHeaderView::ResizeToContents);
-    //ui->performTableWidget->horizontalHeader()->setSectionResizeMode(COLUMN_MEM_INDEX, QHeaderView::ResizeToContents);
-    ui->performTableWidget->resizeColumnToContents(0);
-
-    ui->performTableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
-    ui->performTableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
-    ui->performTableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
-    ui->performTableWidget->verticalHeader()->hide();
-    ui->performTableWidget->horizontalHeader()->setStretchLastSection(true);
-    ui->performTableWidget->horizontalHeader()->setVisible(true);
-    ui->performTableWidget->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft | Qt::AlignVCenter);
-    ui->performTableWidget->setStyleSheet("selection-background-color:#1E90FF;");
-    ui->performTableWidget->setFrameShape(QFrame::NoFrame);
-
-    connect(ui->performTableWidget->horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(sortByColumn(int)));
-
-    cmd = CPU_SORT;
-    process = new QProcess(this);
-    pro = new QProcess(this);
-    timer = new QTimer(this);
-    timer->setInterval(3000);
-    timer->setSingleShot(true);
-    connect(timer,SIGNAL(timeout()),this,SLOT(GetPerformInfo()));
-    GetPerformInfo();
-}
-
-int PerformWidget::GetProcessFds(int processID)
-{
-#ifdef Q_OS_WIN32
-    return 0;
-#else
-    QProcess* proc = new QProcess();
-    int result = GetProcessFdsImpl(proc, processID);
-    delete proc;
-    return result;
-#endif
-}
-
-int PerformWidget::GetProcessFdsImpl(QProcess* proc, int processID)
-{
-    proc->start("/bin/bash");
-    if (proc->waitForStarted(3000)) {
-        QString cmd = QString(FD_CALCU_SPRINT_STR).arg(processID);
-        qDebug() << __FUNCTION__ << cmd;
-        proc->write(cmd.toLatin1());
-        proc->closeWriteChannel();
-        if (proc->waitForFinished(3000)) {
-            QString result = proc->readAllStandardOutput();
-            if (!result.isEmpty()) {
-                bool ok = false;
-                int res = result.toInt(&ok, 10);
-                qDebug() << __FUNCTION__ << ": result=" << res;
-                if (ok) return res;
-                return -1;
-            } else {
-                qDebug() << __FUNCTION__ << ": empty";
-            }
-        } else {
-            qDebug() << __FUNCTION__ << ":@1 " << proc->errorString();
-        }
-    } else {
-        qDebug() << __FUNCTION__ << ":@2  " << proc->errorString();
-    }
-    return -1;
-}
-
-void PerformWidget::UpdateMemUsed()
-{
-    pro->start("free -m");
-    if(pro->waitForStarted(2000))
-    {
-        if(pro->waitForFinished(1000))
-        {
-            QString result = pro->readAllStandardOutput();
-            if(!result.isEmpty())
-            {
-                memused = 0;
-                qint64 total, used;
-                total = 0;
-                used = 0;
-                reg.setPattern("\\d+.+");
-                QString tmp = reg.match(result).captured(0);
-                QStringList list = tmp.split(QRegularExpression(" +"));
-                result = list.at(0); //total
-                tmp = list.at(5); //available
-                total = result.toLongLong();
-                used = tmp.toLongLong();
-                memused = used * 1000 / total;
-                memused = 1000 - memused;
-                int m = memused % 10;
-                memused /= 10;
-                if (m >= 5) memused += 1;
-            }
-        }
-    }
-}
-
-void PerformWidget::sortByColumn(int selColumn)
-{
-    //ui->performTableWidget->sortItems(selColumn, Qt::AscendingOrder);
-    if (selColumn == COLUMN_CPU_INDEX || selColumn == COLUMN_MEM_INDEX) {
-        if (selColumn == COLUMN_CPU_INDEX) {
-            if (cmd == CPU_SORT)  return;
-            cmd = CPU_SORT;
-        } else if (selColumn == COLUMN_MEM_INDEX) {
-            if (cmd == MEM_SORT)  return;
-            cmd = MEM_SORT;
-        }
-        GetPerformInfo();
-    }
-}
-
-bool PerformWidget::GetPerformInfo()
-{
-    timer->stop();
-
-    ui->performTableWidget->clearContents();
-
-    process->start("/bin/bash");
-    if(process->waitForStarted(3000)) {
-        process->write(cmd.toLatin1());
-        process->closeWriteChannel();
-        process->waitForFinished(3000);
-        QString result = process->readAllStandardOutput();
-        QRegularExpression reg;
-        reg.setPattern(" +");
-        result = result.replace(reg," ");
-        QStringList elemList = result.split("\n");
-        elemList.removeFirst();
-        elemList.removeLast();
-        ui->performTableWidget->setRowCount(elemList.length());
-        for(int i=0;i< elemList.length();i++) {
-            QString line = elemList.at(i);
-            QStringList elems = line.split(" ");
-            QString strPID = elems.at(RAW_PID_INDEX);
-            bool root = false, related = false;
-            for(int j=0; j<ui->performTableWidget->columnCount(); j++) {
-                QTableWidgetItem* item = new QTableWidgetItem;
-                item->setBackground((i % 2 != 0) ? QColor("#f5f5f5") : QColor("#ffffff"));
-                if(j== COLUMN_NAME_INDEX) {
-                    item->setWhatsThis(strPID);
-                    line = elems.at(RAW_COMMAND_INDEX);
-                    if (line.compare("spshell", Qt::CaseInsensitive) == 0 
-                        || line.compare("sphost", Qt::CaseInsensitive) == 0
-                        || line.compare("cefclient", Qt::CaseInsensitive) == 0
-                        || line.compare("guardian", Qt::CaseInsensitive) == 0) {
-                        related = true;
-                        item->setForeground(QBrush(Qt::red));
-
-                        if (line.compare("sphost", Qt::CaseInsensitive) == 0 && elems.count() > 7 && elems.at(7).startsWith("mod_")) {
-                            line = elems.at(7);
-                        }
-                    }
-
-                    item->setToolTip(line);
-                    item->setText(line);
-                }
-                else if (j == COLUMN_PID_INDEX) {
-                    item->setTextAlignment(Qt::AlignHCenter);
-                    item->setText(elems.at(RAW_PID_INDEX));
-                }
-                else if (j == COLUMN_CPU_INDEX) {
-                    item->setTextAlignment(Qt::AlignHCenter);
-                    item->setText(elems.at(RAW_CPU_INDEX));
-                }
-                else if (j == COLUMN_MEM_INDEX) {
-                    item->setTextAlignment(Qt::AlignHCenter);
-                    item->setText(elems.at(RAW_MEM_INDEX));
-                }
-                else if(j== COLUMN_COMMAND_INDEX)
-                {
-                    line = elems.mid(5).join(" ");
-                    item->setText(line);
-                    item->setToolTip(line);
-                } else if(j == COLUMN_FDS_INDEX) {
-                    if (related) {
-                        int fds = GetProcessFdsImpl(pro, strPID.toInt());
-                        item->setText(QString::number(fds));
-                    } else {
-                        item->setText("NA");
-                    }
-
-                }
-                ui->performTableWidget->setItem(i, j, item);
-            }
-        }
-    }
-
-    timer->start();
-
-    return true;
-}
-
-PerformWidget::~PerformWidget()
-{
-    delete ui;
-}
-
-bool PerformWidget::pidselected(const QString &pid)
-{
-    QString sel;
-    for(int i=0;i<selected.length();i++)
-    {
-        sel=selected.at(i);
-        if(pid==sel) {
-            listupdate2freshselected.append(sel);
-            return true;
-        }
-    }
-    return false;
-}
-
-
-

+ 0 - 64
Framework/spshell/Widgets/performwidget.h

@@ -1,64 +0,0 @@
-#ifndef PERFORMWIDGET_H
-#define PERFORMWIDGET_H
-
-#include <QWidget>
-#include <QTimer>
-#include<QDesktopWidget>
-#include<QProcess>
-#include<QRegularExpression>
-#include<QDebug>
-#include<QTableWidgetItem>
-#include<QMouseEvent>
-
-#define CPU_SORT "ps ax -o \"%u %p %C\" -o pmem -o \"%c %a\" --sort=-%cpu|head -21"
-#define MEM_SORT "ps ax -o \"%u %p %C\" -o pmem -o \"%c %a\" --sort=-pmem|head -21"
-#define BG_color "#monitorwindow{ background-color:%1; }\
-                #pushButton{ color:%2; }"
-
-#define FD_CALCU_SPRINT_STR "lsof -p %1 | wc -l"
-
-#define LOW "rgb(50, 162, 106)"
-#define MID "rgb(233, 119, 57)"
-#define HIGH "rgb(179, 10, 13)"
-
-QT_BEGIN_NAMESPACE
-namespace Ui { class PerformWidget; }
-QT_END_NAMESPACE
-
-class PerformWidget : public QWidget
-{
-    Q_OBJECT
-
-public:
-    PerformWidget(QWidget *parent = nullptr);
-    ~PerformWidget();
-
-    static int GetProcessFds(int processID);
-signals:
-    void opencpu();
-
-private:
-
-    static int GetProcessFdsImpl(QProcess* pro, int processID);
-
-public slots:
-    bool GetPerformInfo();
-    void UpdateMemUsed();
-    void sortByColumn(int selColumn);
-private:
-    Ui::PerformWidget *ui;
-    QPoint oldpos;
-    void makelist();
-    bool pidselected(const QString&);
-    QTimer *timer;
-    QProcess *process;
-    QProcess *pro;
-    QStringList selectedpid;
-    QString cmd;
-    QString pressed;
-    QStringList selected;
-    QStringList listupdate2freshselected;
-    int memused;
-    QRegularExpression reg;
-};
-#endif // PERFORMWIDGET_H

+ 0 - 24
Framework/spshell/Widgets/performwidget.ui

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PerformWidget</class>
- <widget class="QWidget" name="PerformWidget">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>800</width>
-    <height>600</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>PerformWidget</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0">
-    <widget class="QTableWidget" name="performTableWidget"/>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 0 - 50
Framework/spshell/Widgets/res.qrc

@@ -1,50 +0,0 @@
-<RCC>
-    <qresource prefix="/Pics">
-        <file>res/Logo.png</file>
-    </qresource>
-    <qresource prefix="/icons">
-        <file>res/fatcow/contrast_high.png</file>
-        <file>res/fatcow/contrast_low.png</file>
-        <file>res/fatcow/control_cursor.png</file>
-        <file>res/fatcow/control_cursor_blue.png</file>
-        <file>res/fatcow/control_eject.png</file>
-        <file>res/fatcow/control_eject_blue.png</file>
-        <file>res/fatcow/control_end.png</file>
-        <file>res/fatcow/control_end_blue.png</file>
-        <file>res/fatcow/control_fastforward.png</file>
-        <file>res/fatcow/control_fastforward_blue.png</file>
-        <file>res/fatcow/control_pause.png</file>
-        <file>res/fatcow/control_pause_blue.png</file>
-        <file>res/fatcow/control_play.png</file>
-        <file>res/fatcow/control_play_blue.png</file>
-        <file>res/fatcow/control_power.png</file>
-        <file>res/fatcow/control_power_blue.png</file>
-        <file>res/fatcow/control_repeat.png</file>
-        <file>res/fatcow/control_repeat_blue.png</file>
-        <file>res/fatcow/control_rewind.png</file>
-        <file>res/fatcow/control_rewind_blue.png</file>
-        <file>res/fatcow/control_start.png</file>
-        <file>res/fatcow/control_start_blue.png</file>
-        <file>res/fatcow/control_stop.png</file>
-        <file>res/fatcow/control_stop_blue.png</file>
-        <file>res/fatcow/zoom_layer.png</file>
-        <file>res/fatcow/file_extension_log.png</file>
-        <file>res/fatcow/lcd_tv_test.png</file>
-        <file>res/fatcow/format_painter.png</file>
-        <file>res/fatcow/page_delete.png</file>
-        <file>res/fatcow/cross.png</file>
-    </qresource>
-    <qresource prefix="/doc"/>
-    <qresource prefix="/">
-        <file>res/bg.png</file>
-        <file>res/bgactive.png</file>
-        <file>res/FavIcon.ico</file>
-        <file>res/splash.png</file>
-        <file>res/version_history.html</file>
-        <file>res/forms/input.txt</file>
-        <file>res/forms/textfinder.ui</file>
-        <file>res/sys_errcode.html</file>
-        <file>res/spexplorerauto.desktop</file>
-        <file>res/set_nopass_priviledge.sh</file>
-    </qresource>
-</RCC>

+ 0 - 89
Framework/spshell/Widgets/res/ErrorCode.md

@@ -1,89 +0,0 @@
-| 错误码 | 十进制(十六进制) |
-| ---- | ---- |
-| Error_Succeed | 0(0x00000000) |
-| Error_DataCheck | 100(0x00000064) |
-| Error_Null | 101(0x00000065) |
-| Error_Param | 102(0x00000066) |
-| Error_Overflow | 103(0x00000067) |
-| Error_TooSmallBuffer | 104(0x00000068) |
-| Error_NotIntegrated | 105(0x00000069) |
-| Error_CheckSum | 106(0x0000006A) |
-| Error_MisMatched | 107(0x0000006B) |
-| Error_Deprecated | 108(0x0000006C) |
-| Error_TargetBeing | 512(0x00000200) |
-| Error_NoTarget | 513(0x00000201) |
-| Error_NoDefine | 514(0x00000202) |
-| Error_NotImpl | 515(0x00000203) |
-| Error_NotExist | 516(0x00000204) |
-| Error_Duplication | 517(0x00000205) |
-| Error_Unregisted | 518(0x00000206) |
-| Error_AlreadyExist | 519(0x00000207) |
-| Error_MethodNotFound | 520(0x00000208) |
-| Error_Redirect | 521(0x00000209) |
-| Error_BridgeNotBind | 522(0x0000020A) |
-| Error_BridgeNotOK | 523(0x0000020B) |
-| Error_NotSupport | 524(0x0000020C) |
-| Error_NotConfig | 525(0x0000020D) |
-| Error_InvalidState | 768(0x00000300) |
-| Error_NotInit | 769(0x00000301) |
-| Error_Paused | 770(0x00000302) |
-| Error_Stoped | 771(0x00000303) |
-| Error_Losted | 772(0x00000304) |
-| Error_Closed | 773(0x00000305) |
-| Error_Accept | 774(0x00000306) |
-| Error_Failed | 775(0x00000307) |
-| Error_Busy | 776(0x00000308) |
-| Error_TaskControl | 1024(0x00000400) |
-| Error_Pending | 1025(0x00000401) |
-| Error_Cancel | 1026(0x00000402) |
-| Error_Break | 1027(0x00000403) |
-| Error_NotMeetCondition | 1028(0x00000404) |
-| Error_NoPrivilege | 1029(0x00000405) |
-| Error_MethodSignatureFailed | 1030(0x00000406) |
-| Error_PeerAction | 1280(0x00000500) |
-| Error_PeerClose | 1281(0x00000501) |
-| Error_PeerIgnore | 1282(0x00000502) |
-| Error_PeerReject | 1283(0x00000503) |
-| Error_PeerDelay | 1284(0x00000504) |
-| Error_Process | 1536(0x00000600) |
-| Error_NetBroken | 1537(0x00000601) |
-| Error_UpdateFailed | 1538(0x00000602) |
-| Error_RegistryFailed | 1539(0x00000603) |
-| Error_IO | 1540(0x00000604) |
-| Error_Readonly | 1541(0x00000605) |
-| Error_TimeOut | 1792(0x00000700) |
-| Error_BlockTimeOut | 1793(0x00000701) |
-| Error_ThreadTimeOut | 1794(0x00000702) |
-| Error_QueueTimeOut | 1795(0x00000703) |
-| Error_ReplyTimeOut | 1796(0x00000704) |
-| Error_Hardware | 2048(0x00000800) |
-| Error_DevLoadFileFailed | 2049(0x00000801) |
-| Error_DevNotAvailable | 2050(0x00000802) |
-| Error_DevAlreadyConnected | 2051(0x00000803) |
-| Error_DevConnFailed | 2052(0x00000804) |
-| Error_DevCommFailed | 2053(0x00000805) |
-| Error_DevMedia | 2054(0x00000806) |
-| Error_EnvCamera | 2055(0x00000807) |
-| Error_OptCamera | 2056(0x00000808) |
-| Error_AllCamera | 2057(0x00000809) |
-| Error_AudioIN | 2059(0x0000080B) |
-| Error_AudioOut | 2060(0x0000080C) |
-| Error_DevFailAddUp | 2061(0x0000080D) |
-| Error_Interact | 2062(0x0000080E) |
-| Error_MaintainRequired | 2063(0x0000080F) |
-| Error_Socket | 2304(0x00000900) |
-| Error_ConnectFailed | 2305(0x00000901) |
-| Error_ServerNotAvailable | 2306(0x00000902) |
-| Error_Debug | 3840(0x00000F00) |
-| Error_Assert | 3841(0x00000F01) |
-| Error_Trace | 3842(0x00000F02) |
-| Error_Bug | 3843(0x00000F03) |
-| Error_Unrecover | 1879048192(0x70000000) |
-| Error_Resource | 1879048193(0x70000001) |
-| Error_NewProcess | 1879048194(0x70000002) |
-| Error_FailVerify | 1879048195(0x70000003) |
-| Error_Block | 1879048196(0x70000004) |
-| Error_Exception | 1879048197(0x70000005) |
-| Error_Unexpect | 2147483646(0x7FFFFFFE) |
-| Error_IgnoreAll | 2147483647(0x7FFFFFFF) |
-

BIN
Framework/spshell/Widgets/res/FavIcon.ico


BIN
Framework/spshell/Widgets/res/Logo.png


BIN
Framework/spshell/Widgets/res/bg.png


BIN
Framework/spshell/Widgets/res/bgactive.png


BIN
Framework/spshell/Widgets/res/fatcow/contrast_high.png


BIN
Framework/spshell/Widgets/res/fatcow/contrast_low.png


BIN
Framework/spshell/Widgets/res/fatcow/control_cursor.png


BIN
Framework/spshell/Widgets/res/fatcow/control_cursor_blue.png


BIN
Framework/spshell/Widgets/res/fatcow/control_eject.png


BIN
Framework/spshell/Widgets/res/fatcow/control_eject_blue.png


BIN
Framework/spshell/Widgets/res/fatcow/control_end.png


BIN
Framework/spshell/Widgets/res/fatcow/control_end_blue.png


BIN
Framework/spshell/Widgets/res/fatcow/control_fastforward.png


BIN
Framework/spshell/Widgets/res/fatcow/control_fastforward_blue.png


BIN
Framework/spshell/Widgets/res/fatcow/control_pause.png


BIN
Framework/spshell/Widgets/res/fatcow/control_pause_blue.png


BIN
Framework/spshell/Widgets/res/fatcow/control_play.png


BIN
Framework/spshell/Widgets/res/fatcow/control_play_blue.png


BIN
Framework/spshell/Widgets/res/fatcow/control_power.png


BIN
Framework/spshell/Widgets/res/fatcow/control_power_blue.png


BIN
Framework/spshell/Widgets/res/fatcow/control_repeat.png


BIN
Framework/spshell/Widgets/res/fatcow/control_repeat_blue.png


BIN
Framework/spshell/Widgets/res/fatcow/control_rewind.png


BIN
Framework/spshell/Widgets/res/fatcow/control_rewind_blue.png


BIN
Framework/spshell/Widgets/res/fatcow/control_start.png


BIN
Framework/spshell/Widgets/res/fatcow/control_start_blue.png


BIN
Framework/spshell/Widgets/res/fatcow/control_stop.png


BIN
Framework/spshell/Widgets/res/fatcow/control_stop_blue.png


BIN
Framework/spshell/Widgets/res/fatcow/cross.png


BIN
Framework/spshell/Widgets/res/fatcow/file_extension_log.png


BIN
Framework/spshell/Widgets/res/fatcow/format_painter.png


BIN
Framework/spshell/Widgets/res/fatcow/lcd_tv_test.png


BIN
Framework/spshell/Widgets/res/fatcow/page_delete.png


BIN
Framework/spshell/Widgets/res/fatcow/zoom_layer.png


+ 0 - 3
Framework/spshell/Widgets/res/forms/input.txt

@@ -1,3 +0,0 @@
-This user interface was loaded and processed at run-time.
-
-Applications that want to load .ui files at run-time must be configured to be link against the QtUiTools module. A form loader object, provided by the QUiLoader class, is used to construct the user interface. This user interface can be retrieved from any QIODevice; for example, a QFile object can be used to obtain a form stored in a project's resources. The QUiLoader::load() function takes the user interface description contained in the file and constructs the form widget.

+ 0 - 95
Framework/spshell/Widgets/res/forms/textfinder.ui

@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Form</class>
- <widget class="QWidget" name="Form">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>378</width>
-    <height>158</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Find Text</string>
-  </property>
-  <layout class="QVBoxLayout">
-   <property name="spacing">
-    <number>6</number>
-   </property>
-   <property name="leftMargin">
-    <number>9</number>
-   </property>
-   <property name="topMargin">
-    <number>9</number>
-   </property>
-   <property name="rightMargin">
-    <number>9</number>
-   </property>
-   <property name="bottomMargin">
-    <number>9</number>
-   </property>
-   <item>
-    <layout class="QGridLayout">
-     <property name="leftMargin">
-      <number>0</number>
-     </property>
-     <property name="topMargin">
-      <number>0</number>
-     </property>
-     <property name="rightMargin">
-      <number>0</number>
-     </property>
-     <property name="bottomMargin">
-      <number>0</number>
-     </property>
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <item row="0" column="1">
-      <widget class="QLineEdit" name="lineEdit"/>
-     </item>
-     <item row="0" column="0">
-      <widget class="QLabel" name="searchLabel">
-       <property name="text">
-        <string>关键词:</string>
-       </property>
-       <property name="buddy">
-        <cstring>lineEdit</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="2">
-      <widget class="QPushButton" name="findButton">
-       <property name="text">
-        <string>查找(&amp;F)</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QTextEdit" name="textEdit"/>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections>
-  <connection>
-   <sender>lineEdit</sender>
-   <signal>returnPressed()</signal>
-   <receiver>findButton</receiver>
-   <slot>animateClick()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>261</x>
-     <y>17</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>320</x>
-     <y>17</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>

+ 0 - 131
Framework/spshell/Widgets/res/set_nopass_priviledge.sh

@@ -1,131 +0,0 @@
-#!/bin/sh
-
-rvc_user=$1
-sudoers_file=/etc/sudoers
-lightdm_file=/etc/lightdm/lightdm.conf
-
-if [ $# -ne 1 ]; then
-    echo "[ERROR]: please only input the login user name with this file: $#"
-    exit 4
-fi
-
-echo "[INFO]: Going to add entry into /etc/sudoers file for user: $rvc_user"
-
-if [ ! -d '/etc/sudoers.d' ]; then
-    mkidr /etc/sudoers.d
-    chmod 750 /etc/sudoers.d
-fi
-
-curr_timestamp=`date "+%Y%m%d-%H%M%S.%3N"`
-
-setup_autologin()
-{
-    given_user=$1
-    given_sudoers_file=$2
-
-    if [ ! -f "$given_sudoers_file" ]; then
-        echo "[Seat:*]" > $given_sudoers_file
-        # echo "autologin-guest=false" >> $given_sudoers_file
-        echo "autologin-user=$given_user" >> $given_sudoers_file
-        echo "autologin-user-timeout=0" >> $given_sudoers_file
-    fi
-
-    if [ "$(grep -c "^\\s*autologin-user=${given_user}" $given_sudoers_file)" -gt 0 ]; then
-        echo "autologin-user is already setted in ^lightdm.conf^"
-    else
-        echo "setting autologin-user in ^$given_sudoers_file^"
-        #sed -i.bak -E "s|^#(autologin-user=).*|\\1$given_user|;s|^#(autologin-user-timeout=).*|\\0|" $given_sudoers_file
-        sed -i "s/^\s*#\s*autologin-user=/autologin-user=/g;s/autologin-user=.*$/autologin-user=$given_user/g" $given_sudoers_file
-        #sed -i "s/^#autologin-user=$/autologin-user=${given_user}/" $given_sudoers_file
-        #sed -i "s/^#autologin-user-timeout=$/autologin-user-timeout=0/" $given_sudoers_file
-        sed -i "s/^\s*#\s*autologin-user-timeout=/autologin-user-timeout=/g;s/autologin-user-timeout=.*$/autologin-user-timeout=0/g" $given_sudoers_file
-    fi
-
-    if [ -f "/home/$given_user/.local/share/keyrings/login.keyring" ]; then
-        rm /home/$given_user/.local/share/keyrings/login.keyring
-    fi
-}
-
-sudo_d_priviledge()
-{
-    given_user=$1
-    if [ ! -e '/etc/sudoers.d/set_rvc_terminal_sudo' ]; then
-        echo "# $(date)" >> /etc/sudoers.d/set_rvc_terminal_sudo
-        echo "${given_user}   ALL=(ALL)       ALL" >> /etc/sudoers.d/set_rvc_terminal_sudo
-        echo "${given_user}   ALL=(ALL) NOPASSWD: /opt/Run/version/*, NOPASSWD: /bin/sh, NOPASSWD: /bin/bash" >> /etc/sudoers.d/set_rvc_terminal_sudo
-        chmod 440 /etc/sudoers.d/set_rvc_terminal_sudo
-
-        if [ -z "$(grep /etc/sudoers.d /etc/sudoers)" ]; then
-            echo -e "\n#includedir /etc/sudoers.d" >> /etc/sudoers
-        fi
-
-        return 1
-    fi
-    return 0
-}
-
-sudo_priviledge() {
-
-    given_user=$1
-    given_sudoers_file=$2
-
-    if [ -e ${given_sudoers_file}.tmp -o "$(pidof visudo)" ]; then
-        echo "[ERROR]: ${given_sudoers_file} is working now,  wait a little and then try again later"
-        return 2
-    fi
-
-    ret=0
-	echo "[INFO]: to process editing sudoers file..."
-    
-    cp ${given_sudoers_file} ${given_sudoers_file}.tmp
-	
-    chmod 0640 ${given_sudoers_file}.tmp
-    cat ${given_sudoers_file}.tmp | grep  'includedir /etc/sudoers.d' > /dev/null
-    if [ $? = 0 ]; then
-        echo "[INFO]: '#includedir /etc/sudoers.d' already exists in /etc/sudoers file"
-    else
-        echo "#includedir /etc/sudoers.d"  >> ${given_sudoers_file}.tmp
-        ret=1
-    fi
-
-	if [  "`cat /etc/sudoers|grep ${given_user}|grep ALL=(ALL)`" != "" ]; then
-        echo "[WARN]: sudoers file has been loaded up all(all) config"
-    else
-        new_entry="${given_user} ALL=(ALL) ALL"
-        echo "${new_entry}" >> ${given_sudoers_file}.tmp
-        ret=1
-    fi
-
-    if [  "`cat /etc/sudoers|grep ${given_user}|grep Run`" != "" ]; then
-        echo "[WARN]: sudoers file has been loaded up rvc config"
-    else
-        new_entry="${given_user} ALL=(ALL) NOPASSWD: /opt/Run/version/*, NOPASSWD: /bin/sh, NOPASSWD: /bin/bash"
-        echo "${new_entry}" >> ${given_sudoers_file}.tmp
-        ret=1
-    fi
-
-    chmod 0440 ${given_sudoers_file}.tmp
-
-    if visudo -c -f ${given_sudoers_file}.tmp ; then
-        echo check syntax correct on ${given_sudoers_file}
-    else
-        echo "[ERROR]: syntax check failed on file ${given_sudoers_file}"
-        rm ${given_sudoers_file}.tmp
-        return 3
-    fi
-
-    if [ $ret -eq 1 ]; then
-        echo "[SUCCESS]: config file has been change !!"
-        cp ${given_sudoers_file} ${given_sudoers_file}.backup.${curr_timestamp}
-        mv ${given_sudoers_file}.tmp ${given_sudoers_file}
-    else
-        echo "[WARN]: config file not change"
-        rm ${given_sudoers_file}.tmp
-    fi
-
-    return $ret
-}
-
-sudo_priviledge ${rvc_user}   ${sudoers_file}
-setup_autologin  ${rvc_user}   ${lightdm_file}
-exit $?

+ 0 - 9
Framework/spshell/Widgets/res/spexplorerauto.desktop

@@ -1,9 +0,0 @@
-[Desktop Entry]
-Name=RVC Terminal
-Name[zh_CN]=招行可视柜台终端应用
-GenericName=RVC Terminal Application
-GenericName[zh_CN]=招行可视柜台终端应用程序
-Comment=RVC Terminal Application
-Comment[zh_CN]=招行可视柜台终端应用
-Exec=/opt/Run/version/spexplorer.sh
-Type=Application

BIN
Framework/spshell/Widgets/res/splash.png


Разница между файлами не показана из-за своего большого размера
+ 0 - 1176
Framework/spshell/Widgets/res/sys_errcode.html


+ 0 - 1193
Framework/spshell/Widgets/res/version_history.html

@@ -1,1193 +0,0 @@
-<!doctype html>
-<html style='font-size:14px !important'>
-<head>
-    <meta charset='UTF-8'>
-    <meta name='viewport' content='width=device-width initial-scale=1'>
-    <title>ChangeLog</title>
-    <link href='https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext' rel='stylesheet' type='text/css' />
-    <style type='text/css'>
-        html {
-            overflow-x: initial !important;
-        }
-
-        :root {
-            --bg-color: #ffffff;
-            --text-color: #333333;
-            --select-text-bg-color: #B5D6FC;
-            --select-text-font-color: auto;
-            --monospace: "Lucida Console",Consolas,"Courier",monospace;
-        }
-
-        html {
-            font-size: 14px;
-            background-color: var(--bg-color);
-            color: var(--text-color);
-            font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-            -webkit-font-smoothing: antialiased;
-        }
-
-        body {
-            margin: 0px;
-            padding: 0px;
-            height: auto;
-            bottom: 0px;
-            top: 0px;
-            left: 0px;
-            right: 0px;
-            font-size: 1rem;
-            line-height: 1.42857;
-            overflow-x: hidden;
-            background: inherit;
-            tab-size: 4;
-        }
-
-        iframe {
-            margin: auto;
-        }
-
-        a.url {
-            word-break: break-all;
-        }
-
-        a:active, a:hover {
-            outline: 0px;
-        }
-
-        .in-text-selection, ::selection {
-            text-shadow: none;
-            background: var(--select-text-bg-color);
-            color: var(--select-text-font-color);
-        }
-
-        #write {
-            margin: 0px auto;
-            height: auto;
-            width: inherit;
-            word-break: normal;
-            overflow-wrap: break-word;
-            position: relative;
-            white-space: normal;
-            overflow-x: visible;
-            padding-top: 40px;
-        }
-
-            #write.first-line-indent p {
-                text-indent: 2em;
-            }
-
-                #write.first-line-indent li p, #write.first-line-indent p * {
-                    text-indent: 0px;
-                }
-
-            #write.first-line-indent li {
-                margin-left: 2em;
-            }
-
-        .for-image #write {
-            padding-left: 8px;
-            padding-right: 8px;
-        }
-
-        body.typora-export {
-            padding-left: 30px;
-            padding-right: 30px;
-        }
-
-        .typora-export .footnote-line, .typora-export li, .typora-export p {
-            white-space: pre-wrap;
-        }
-
-        @media screen and (max-width: 500px) {
-            body.typora-export {
-                padding-left: 0px;
-                padding-right: 0px;
-            }
-
-            #write {
-                padding-left: 20px;
-                padding-right: 20px;
-            }
-
-            .CodeMirror-sizer {
-                margin-left: 0px !important;
-            }
-
-            .CodeMirror-gutters {
-                display: none !important;
-            }
-        }
-
-        #write li > figure:last-child {
-            margin-bottom: 0.5rem;
-        }
-
-        #write ol, #write ul {
-            position: relative;
-        }
-
-        img {
-            max-width: 100%;
-            vertical-align: middle;
-        }
-
-        button, input, select, textarea {
-            color: inherit;
-            font: inherit;
-        }
-
-            input[type="checkbox"], input[type="radio"] {
-                line-height: normal;
-                padding: 0px;
-            }
-
-        *, ::after, ::before {
-            box-sizing: border-box;
-        }
-
-        #write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre {
-            width: inherit;
-        }
-
-        #write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p {
-            position: relative;
-        }
-
-        p {
-            line-height: inherit;
-        }
-
-        h1, h2, h3, h4, h5, h6 {
-            break-after: avoid-page;
-            break-inside: avoid;
-            orphans: 2;
-        }
-
-        p {
-            orphans: 4;
-        }
-
-        h1 {
-            font-size: 2rem;
-        }
-
-        h2 {
-            font-size: 1.8rem;
-        }
-
-        h3 {
-            font-size: 1.6rem;
-        }
-
-        h4 {
-            font-size: 1.4rem;
-        }
-
-        h5 {
-            font-size: 1.2rem;
-        }
-
-        h6 {
-            font-size: 1rem;
-        }
-
-        .md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p {
-            margin-top: 1rem;
-            margin-bottom: 1rem;
-        }
-
-        .hidden {
-            display: none;
-        }
-
-        .md-blockmeta {
-            color: rgb(204, 204, 204);
-            font-weight: 700;
-            font-style: italic;
-        }
-
-        a {
-            cursor: pointer;
-        }
-
-        sup.md-footnote {
-            padding: 2px 4px;
-            background-color: rgba(238, 238, 238, 0.7);
-            color: rgb(85, 85, 85);
-            border-radius: 4px;
-            cursor: pointer;
-        }
-
-            sup.md-footnote a, sup.md-footnote a:hover {
-                color: inherit;
-                text-transform: inherit;
-                text-decoration: inherit;
-            }
-
-        #write input[type="checkbox"] {
-            cursor: pointer;
-            width: inherit;
-            height: inherit;
-        }
-
-        figure {
-            overflow-x: auto;
-            margin: 1.2em 0px;
-            max-width: calc(100% + 16px);
-            padding: 0px;
-        }
-
-            figure > table {
-                margin: 0px !important;
-            }
-
-        tr {
-            break-inside: avoid;
-            break-after: auto;
-        }
-
-        thead {
-            display: table-header-group;
-        }
-
-        table {
-            border-collapse: collapse;
-            border-spacing: 0px;
-            width: 100%;
-            overflow: auto;
-            break-inside: auto;
-            text-align: left;
-        }
-
-            table.md-table td {
-                min-width: 32px;
-            }
-
-        .CodeMirror-gutters {
-            border-right: 0px;
-            background-color: inherit;
-        }
-
-        .CodeMirror-linenumber {
-            user-select: none;
-        }
-
-        .CodeMirror {
-            text-align: left;
-        }
-
-        .CodeMirror-placeholder {
-            opacity: 0.3;
-        }
-
-        .CodeMirror pre {
-            padding: 0px 4px;
-        }
-
-        .CodeMirror-lines {
-            padding: 0px;
-        }
-
-        div.hr:focus {
-            cursor: none;
-        }
-
-        #write pre {
-            white-space: pre-wrap;
-        }
-
-        #write.fences-no-line-wrapping pre {
-            white-space: pre;
-        }
-
-        #write pre.ty-contain-cm {
-            white-space: normal;
-        }
-
-        .CodeMirror-gutters {
-            margin-right: 4px;
-        }
-
-        .md-fences {
-            font-size: 0.9rem;
-            display: block;
-            break-inside: avoid;
-            text-align: left;
-            overflow: visible;
-            white-space: pre;
-            background: inherit;
-            position: relative !important;
-        }
-
-        .md-diagram-panel {
-            width: 100%;
-            margin-top: 10px;
-            text-align: center;
-            padding-top: 0px;
-            padding-bottom: 8px;
-            overflow-x: auto;
-        }
-
-        #write .md-fences.mock-cm {
-            white-space: pre-wrap;
-        }
-
-        .md-fences.md-fences-with-lineno {
-            padding-left: 0px;
-        }
-
-        #write.fences-no-line-wrapping .md-fences.mock-cm {
-            white-space: pre;
-            overflow-x: auto;
-        }
-
-        .md-fences.mock-cm.md-fences-with-lineno {
-            padding-left: 8px;
-        }
-
-        .CodeMirror-line, twitterwidget {
-            break-inside: avoid;
-        }
-
-        .footnotes {
-            opacity: 0.8;
-            font-size: 0.9rem;
-            margin-top: 1em;
-            margin-bottom: 1em;
-        }
-
-            .footnotes + .footnotes {
-                margin-top: 0px;
-            }
-
-        .md-reset {
-            margin: 0px;
-            padding: 0px;
-            border: 0px;
-            outline: 0px;
-            vertical-align: top;
-            background: 0px 0px;
-            text-decoration: none;
-            text-shadow: none;
-            float: none;
-            position: static;
-            width: auto;
-            height: auto;
-            white-space: nowrap;
-            cursor: inherit;
-            -webkit-tap-highlight-color: transparent;
-            line-height: normal;
-            font-weight: 400;
-            text-align: left;
-            box-sizing: content-box;
-            direction: ltr;
-        }
-
-        li div {
-            padding-top: 0px;
-        }
-
-        blockquote {
-            margin: 1rem 0px;
-        }
-
-        li .mathjax-block, li p {
-            margin: 0.5rem 0px;
-        }
-
-        li {
-            margin: 0px;
-            position: relative;
-        }
-
-        blockquote > :last-child {
-            margin-bottom: 0px;
-        }
-
-        blockquote > :first-child, li > :first-child {
-            margin-top: 0px;
-        }
-
-        .footnotes-area {
-            color: rgb(136, 136, 136);
-            margin-top: 0.714rem;
-            padding-bottom: 0.143rem;
-            white-space: normal;
-        }
-
-        #write .footnote-line {
-            white-space: pre-wrap;
-        }
-
-        @media print {
-            body, html {
-                border: 1px solid transparent;
-                height: 99%;
-                break-after: avoid;
-                break-before: avoid;
-            }
-
-            #write {
-                margin-top: 0px;
-                padding-top: 0px;
-                border-color: transparent !important;
-            }
-
-            .typora-export * {
-                -webkit-print-color-adjust: exact;
-            }
-
-            html.blink-to-pdf {
-                font-size: 13px;
-            }
-
-            .typora-export #write {
-                padding-left: 32px;
-                padding-right: 32px;
-                padding-bottom: 0px;
-                break-after: avoid;
-            }
-
-                .typora-export #write::after {
-                    height: 0px;
-                }
-        }
-
-        .footnote-line {
-            margin-top: 0.714em;
-            font-size: 0.7em;
-        }
-
-        a img, img a {
-            cursor: pointer;
-        }
-
-        pre.md-meta-block {
-            font-size: 0.8rem;
-            min-height: 0.8rem;
-            white-space: pre-wrap;
-            background: rgb(204, 204, 204);
-            display: block;
-            overflow-x: hidden;
-        }
-
-        p > .md-image:only-child:not(.md-img-error) img, p > img:only-child {
-            display: block;
-            margin: auto;
-        }
-
-        p > .md-image:only-child {
-            display: inline-block;
-            width: 100%;
-        }
-
-        #write .MathJax_Display {
-            margin: 0.8em 0px 0px;
-        }
-
-        .md-math-block {
-            width: 100%;
-        }
-
-            .md-math-block:not(:empty)::after {
-                display: none;
-            }
-
-        [contenteditable="true"]:active, [contenteditable="true"]:focus {
-            outline: 0px;
-            box-shadow: none;
-        }
-
-        .md-task-list-item {
-            position: relative;
-            list-style-type: none;
-        }
-
-        .task-list-item.md-task-list-item {
-            padding-left: 0px;
-        }
-
-        .md-task-list-item > input {
-            position: absolute;
-            top: 0px;
-            left: 0px;
-            margin-left: -1.2em;
-            margin-top: calc(1em - 10px);
-            border: none;
-        }
-
-        .math {
-            font-size: 1rem;
-        }
-
-        .md-toc {
-            min-height: 3.58rem;
-            position: relative;
-            font-size: 0.9rem;
-            border-radius: 10px;
-        }
-
-        .md-toc-content {
-            position: relative;
-            margin-left: 0px;
-        }
-
-            .md-toc-content::after, .md-toc::after {
-                display: none;
-            }
-
-        .md-toc-item {
-            display: block;
-            color: rgb(65, 131, 196);
-        }
-
-            .md-toc-item a {
-                text-decoration: none;
-            }
-
-        .md-toc-inner:hover {
-            text-decoration: underline;
-        }
-
-        .md-toc-inner {
-            display: inline-block;
-            cursor: pointer;
-        }
-
-        .md-toc-h1 .md-toc-inner {
-            margin-left: 0px;
-            font-weight: 700;
-        }
-
-        .md-toc-h2 .md-toc-inner {
-            margin-left: 2em;
-        }
-
-        .md-toc-h3 .md-toc-inner {
-            margin-left: 4em;
-        }
-
-        .md-toc-h4 .md-toc-inner {
-            margin-left: 6em;
-        }
-
-        .md-toc-h5 .md-toc-inner {
-            margin-left: 8em;
-        }
-
-        .md-toc-h6 .md-toc-inner {
-            margin-left: 10em;
-        }
-
-        @media screen and (max-width: 48em) {
-            .md-toc-h3 .md-toc-inner {
-                margin-left: 3.5em;
-            }
-
-            .md-toc-h4 .md-toc-inner {
-                margin-left: 5em;
-            }
-
-            .md-toc-h5 .md-toc-inner {
-                margin-left: 6.5em;
-            }
-
-            .md-toc-h6 .md-toc-inner {
-                margin-left: 8em;
-            }
-        }
-
-        a.md-toc-inner {
-            font-size: inherit;
-            font-style: inherit;
-            font-weight: inherit;
-            line-height: inherit;
-        }
-
-        .footnote-line a:not(.reversefootnote) {
-            color: inherit;
-        }
-
-        .md-attr {
-            display: none;
-        }
-
-        .md-fn-count::after {
-            content: ".";
-        }
-
-        code, pre, samp, tt {
-            font-family: var(--monospace);
-        }
-
-        kbd {
-            margin: 0px 0.1em;
-            padding: 0.1em 0.6em;
-            font-size: 0.8em;
-            color: rgb(36, 39, 41);
-            background: rgb(255, 255, 255);
-            border: 1px solid rgb(173, 179, 185);
-            border-radius: 3px;
-            box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset;
-            white-space: nowrap;
-            vertical-align: middle;
-        }
-
-        .md-comment {
-            color: rgb(162, 127, 3);
-            opacity: 0.8;
-            font-family: var(--monospace);
-        }
-
-        code {
-            text-align: left;
-            vertical-align: initial;
-        }
-
-        a.md-print-anchor {
-            white-space: pre !important;
-            border-width: initial !important;
-            border-style: none !important;
-            border-color: initial !important;
-            display: inline-block !important;
-            position: absolute !important;
-            width: 1px !important;
-            right: 0px !important;
-            outline: 0px !important;
-            background: 0px 0px !important;
-            text-decoration: initial !important;
-            text-shadow: initial !important;
-        }
-
-        .md-inline-math .MathJax_SVG .noError {
-            display: none !important;
-        }
-
-        .html-for-mac .inline-math-svg .MathJax_SVG {
-            vertical-align: 0.2px;
-        }
-
-        .md-math-block .MathJax_SVG_Display {
-            text-align: center;
-            margin: 0px;
-            position: relative;
-            text-indent: 0px;
-            max-width: none;
-            max-height: none;
-            min-height: 0px;
-            min-width: 100%;
-            width: auto;
-            overflow-y: hidden;
-            display: block !important;
-        }
-
-        .MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display {
-            width: auto;
-            margin: inherit;
-            display: inline-block !important;
-        }
-
-        .MathJax_SVG .MJX-monospace {
-            font-family: var(--monospace);
-        }
-
-        .MathJax_SVG .MJX-sans-serif {
-            font-family: sans-serif;
-        }
-
-        .MathJax_SVG {
-            display: inline;
-            font-style: normal;
-            font-weight: 400;
-            line-height: normal;
-            zoom: 90%;
-            text-indent: 0px;
-            text-align: left;
-            text-transform: none;
-            letter-spacing: normal;
-            word-spacing: normal;
-            overflow-wrap: normal;
-            white-space: nowrap;
-            float: none;
-            direction: ltr;
-            max-width: none;
-            max-height: none;
-            min-width: 0px;
-            min-height: 0px;
-            border: 0px;
-            padding: 0px;
-            margin: 0px;
-        }
-
-            .MathJax_SVG * {
-                transition: none 0s ease 0s;
-            }
-
-        .MathJax_SVG_Display svg {
-            vertical-align: middle !important;
-            margin-bottom: 0px !important;
-            margin-top: 0px !important;
-        }
-
-        .os-windows.monocolor-emoji .md-emoji {
-            font-family: "Segoe UI Symbol", sans-serif;
-        }
-
-        .md-diagram-panel > svg {
-            max-width: 100%;
-        }
-
-        [lang="mermaid"] svg, [lang="flow"] svg {
-            max-width: 100%;
-            height: auto;
-        }
-
-        [lang="mermaid"] .node text {
-            font-size: 1rem;
-        }
-
-        table tr th {
-            border-bottom: 0px;
-        }
-
-        video {
-            max-width: 100%;
-            display: block;
-            margin: 0px auto;
-        }
-
-        iframe {
-            max-width: 100%;
-            width: 100%;
-            border: none;
-        }
-
-        .highlight td, .highlight tr {
-            border: 0px;
-        }
-
-        svg[id^="mermaidChart"] {
-            line-height: 1em;
-        }
-
-        mark {
-            background: rgb(255, 255, 0);
-            color: rgb(0, 0, 0);
-        }
-
-            .md-html-inline .md-plain, .md-html-inline strong, mark .md-inline-math, mark strong {
-                color: inherit;
-            }
-
-            mark .md-meta {
-                color: rgb(0, 0, 0);
-                opacity: 0.3 !important;
-            }
-
-
-        :root {
-            --side-bar-bg-color: #fafafa;
-            --control-text-color: #777;
-        }
-
-        @include-when-export url(https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext);
-
-        html {
-            font-size: 16px;
-        }
-
-        body {
-            font-family: "Open Sans","Clear Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
-            color: rgb(51, 51, 51);
-            line-height: 1.6;
-        }
-
-        #write {
-            max-width: 860px;
-            margin: 0 auto;
-            padding: 30px;
-            padding-bottom: 100px;
-        }
-
-            #write > ul:first-child,
-            #write > ol:first-child {
-                margin-top: 30px;
-            }
-
-        a {
-            color: #4183C4;
-        }
-
-        h1,
-        h2,
-        h3,
-        h4,
-        h5,
-        h6 {
-            position: relative;
-            margin-top: 1rem;
-            margin-bottom: 1rem;
-            font-weight: bold;
-            line-height: 1.4;
-            cursor: text;
-        }
-
-            h1:hover a.anchor,
-            h2:hover a.anchor,
-            h3:hover a.anchor,
-            h4:hover a.anchor,
-            h5:hover a.anchor,
-            h6:hover a.anchor {
-                text-decoration: none;
-            }
-
-            h1 tt,
-            h1 code {
-                font-size: inherit;
-            }
-
-            h2 tt,
-            h2 code {
-                font-size: inherit;
-            }
-
-            h3 tt,
-            h3 code {
-                font-size: inherit;
-            }
-
-            h4 tt,
-            h4 code {
-                font-size: inherit;
-            }
-
-            h5 tt,
-            h5 code {
-                font-size: inherit;
-            }
-
-            h6 tt,
-            h6 code {
-                font-size: inherit;
-            }
-
-        h1 {
-            padding-bottom: .3em;
-            font-size: 2.25em;
-            line-height: 1.2;
-            border-bottom: 1px solid #eee;
-        }
-
-        h2 {
-            padding-bottom: .3em;
-            font-size: 1.75em;
-            line-height: 1.225;
-            border-bottom: 1px solid #eee;
-        }
-
-        h3 {
-            font-size: 1.5em;
-            line-height: 1.43;
-        }
-
-        h4 {
-            font-size: 1.25em;
-        }
-
-        h5 {
-            font-size: 1em;
-        }
-
-        h6 {
-            font-size: 1em;
-            color: #777;
-        }
-
-        p,
-        blockquote,
-        ul,
-        ol,
-        dl,
-        table {
-            margin: 0.8em 0;
-        }
-
-        li > ol,
-        li > ul {
-            margin: 0 0;
-        }
-
-        hr {
-            height: 2px;
-            padding: 0;
-            margin: 16px 0;
-            background-color: #e7e7e7;
-            border: 0 none;
-            overflow: hidden;
-            box-sizing: content-box;
-        }
-
-        li p.first {
-            display: inline-block;
-        }
-
-        ul,
-        ol {
-            padding-left: 30px;
-        }
-
-            ul:first-child,
-            ol:first-child {
-                margin-top: 0;
-            }
-
-            ul:last-child,
-            ol:last-child {
-                margin-bottom: 0;
-            }
-
-        blockquote {
-            border-left: 4px solid #dfe2e5;
-            padding: 0 15px;
-            color: #777777;
-        }
-
-            blockquote blockquote {
-                padding-right: 0;
-            }
-
-        table {
-            padding: 0;
-            word-break: initial;
-        }
-
-            table tr {
-                border-top: 1px solid #dfe2e5;
-                margin: 0;
-                padding: 0;
-            }
-
-                table tr:nth-child(2n),
-                thead {
-                    background-color: #f8f8f8;
-                }
-
-                table tr th {
-                    font-weight: bold;
-                    border: 1px solid #dfe2e5;
-                    border-bottom: 0;
-                    margin: 0;
-                    padding: 6px 13px;
-                }
-
-                table tr td {
-                    border: 1px solid #dfe2e5;
-                    margin: 0;
-                    padding: 6px 13px;
-                }
-
-                    table tr th:first-child,
-                    table tr td:first-child {
-                        margin-top: 0;
-                    }
-
-                    table tr th:last-child,
-                    table tr td:last-child {
-                        margin-bottom: 0;
-                    }
-
-        .CodeMirror-lines {
-            padding-left: 4px;
-        }
-
-        .code-tooltip {
-            box-shadow: 0 1px 1px 0 rgba(0,28,36,.3);
-            border-top: 1px solid #eef2f2;
-        }
-
-        .md-fences,
-        code,
-        tt {
-            border: 1px solid #e7eaed;
-            background-color: #f8f8f8;
-            border-radius: 3px;
-            padding: 0;
-            padding: 2px 4px 0px 4px;
-            font-size: 0.9em;
-        }
-
-        code {
-            background-color: #f3f4f4;
-            padding: 0 2px 0 2px;
-        }
-
-        .md-fences {
-            margin-bottom: 15px;
-            margin-top: 15px;
-            padding-top: 8px;
-            padding-bottom: 6px;
-        }
-
-
-        .md-task-list-item > input {
-            margin-left: -1.3em;
-        }
-
-        @media print {
-            html {
-                font-size: 13px;
-            }
-
-            table,
-            pre {
-                page-break-inside: avoid;
-            }
-
-            pre {
-                word-wrap: break-word;
-            }
-        }
-
-        .md-fences {
-            background-color: #f8f8f8;
-        }
-
-        #write pre.md-meta-block {
-            padding: 1rem;
-            font-size: 85%;
-            line-height: 1.45;
-            background-color: #f7f7f7;
-            border: 0;
-            border-radius: 3px;
-            color: #777777;
-            margin-top: 0 !important;
-        }
-
-        .mathjax-block > .code-tooltip {
-            bottom: .375rem;
-        }
-
-        .md-mathjax-midline {
-            background: #fafafa;
-        }
-
-        #write > h3.md-focus:before {
-            left: -1.5625rem;
-            top: .375rem;
-        }
-
-        #write > h4.md-focus:before {
-            left: -1.5625rem;
-            top: .285714286rem;
-        }
-
-        #write > h5.md-focus:before {
-            left: -1.5625rem;
-            top: .285714286rem;
-        }
-
-        #write > h6.md-focus:before {
-            left: -1.5625rem;
-            top: .285714286rem;
-        }
-
-        .md-image > .md-meta {
-            /*border: 1px solid #ddd;*/
-            border-radius: 3px;
-            padding: 2px 0px 0px 4px;
-            font-size: 0.9em;
-            color: inherit;
-        }
-
-        .md-tag {
-            color: #a7a7a7;
-            opacity: 1;
-        }
-
-        .md-toc {
-            margin-top: 20px;
-            padding-bottom: 20px;
-        }
-
-        .sidebar-tabs {
-            border-bottom: none;
-        }
-
-        #typora-quick-open {
-            border: 1px solid #ddd;
-            background-color: #f8f8f8;
-        }
-
-        #typora-quick-open-item {
-            background-color: #FAFAFA;
-            border-color: #FEFEFE #e5e5e5 #e5e5e5 #eee;
-            border-style: solid;
-            border-width: 1px;
-        }
-
-        /** focus mode */
-        .on-focus-mode blockquote {
-            border-left-color: rgba(85, 85, 85, 0.12);
-        }
-
-        header, .context-menu, .megamenu-content, footer {
-            font-family: "Segoe UI", "Arial", sans-serif;
-        }
-
-        .file-node-content:hover .file-node-icon,
-        .file-node-content:hover .file-node-open-state {
-            visibility: visible;
-        }
-
-        .mac-seamless-mode #typora-sidebar {
-            background-color: #fafafa;
-            background-color: var(--side-bar-bg-color);
-        }
-
-        .md-lang {
-            color: #b4654d;
-        }
-
-        .html-for-mac .context-menu {
-            --item-hover-bg-color: #E6F0FE;
-        }
-
-        #md-notification .btn {
-            border: 0;
-        }
-
-        .dropdown-menu .divider {
-            border-color: #e5e5e5;
-        }
-
-        .ty-preferences .window-content {
-            background-color: #fafafa;
-        }
-
-        .ty-preferences .nav-group-item.active {
-            color: white;
-            background: #999;
-        }
-
-        .typora-export li, .typora-export p, .typora-export, .footnote-line {
-            white-space: normal;
-        }
-    </style>
-</head>
-<body class='typora-export os-windows'>
-    <div id='write' class='is-node'>
-        <h2><a class="md-header-anchor"></a><span>&nbsp;</span></h2>
-        <h2><a name="v107-dev4" class="md-header-anchor"></a><span>应用说明</span></h2>
-        <ul>
-            <li><span>可视柜台终端应用启动界面采用 QT 框架实现(通过动态链接Qt函数库的方式),引用 QT 版本 v5.11.3 </span></li>
-            <li><span>该界面应用引用 QT 模块包括:Qt Core、Qt GUI、Qt Widgets、Qt Charts,对应 LGPLv3、GPLv2、GPLv3 三款授权许可协议</span></li>
-            <li><span>关于QT的更多信息可访问:https://www.qt.io </span></li>
-        </ul>
-        <h2><a name="v107-dev4" class="md-header-anchor"></a><span>GPL, LGPL 许可协议说明</span></h2>
-        <ul>
-            <li><span>GPLv3: https://www.gnu.org/licenses/gpl-3.0.zh-cn.html</span></li>
-            <li><span>GPLv2:https://www.gnu.org/licenses/old-licenses/gpl-2.0.zh-cn.html</span></li>
-            <li><span>LGPLv3:https://www.gnu.org/licenses/lgpl-3.0.en.html</span></li>
-        </ul>
-    </div>
-</body>
-</html>

+ 0 - 173
Framework/spshell/Widgets/rootform.cpp

@@ -1,173 +0,0 @@
-#include "rootform.h"
-#include "ui_rootform.h"
-#include "treemodel/treemodel.h"
-#include <QFile>
-#include <QStyleFactory>
-
-RootForm::RootForm(const QString& iniFilePath, QWidget *parent) :
-    QWidget(parent),
-    ui(new Ui::RootForm)
-{
-    ui->setupUi(this);
-    ui->view->setStyleSheet("QTreeView::item:hover{background-color:rgb(0,0,255,50)}"
-                            "QTreeView::item:selected{background-color:rgb(0,0,255,100)}"
-                            "QTreeView::item{border-right: 1px solid black;border-bottom: 1px solid black;}"
-                );
-    TreeModel *model = new TreeModel(iniFilePath);
-    ui->view->setModel(model);
-    ui->view->setStyle(QStyleFactory::create("windows"));
-    for (int column = 0; column < model->columnCount(); ++column)
-        ui->view->resizeColumnToContents(column);
-
-    connect(ui->delSectionBtn, SIGNAL(clicked()), this, SLOT(removeRow()));
-    connect(ui->delKeyBtn, SIGNAL(clicked()), this, SLOT(removeRow()));
-    connect(ui->addSectionBtn, SIGNAL(clicked()), this, SLOT(insertRow()));
-    connect(ui->addKeyBtn, SIGNAL(clicked()), this, SLOT(insertChild()));
-
-    connect(ui->view->selectionModel(), &QItemSelectionModel::selectionChanged, this, &RootForm::updateActions);
-    updateActions();
-}
-
-RootForm::RootForm(QWidget *parent) :
-    QWidget(parent),
-    ui(new Ui::RootForm)
-{
-    ui->setupUi(this);
-
-    //const QStringList headers({tr("Name"), tr("Description")});
-    //QFile file(":/res/default.txt");
-    //file.open(QIODevice::ReadOnly);
-    //TreeModel *model = new TreeModel(headers, file.readAll());
-    //file.close();
-
-    ui->view->setStyleSheet("QTreeView::item:hover{background-color:rgb(0,0,255,50)}"
-                            "QTreeView::item:selected{background-color:rgb(0,0,255,100)}"
-                            "QTreeView::item{border-right: 1px solid black;border-bottom: 1px solid black;}"
-                );
-    TreeModel *model = new TreeModel("D:\\Run\\hardwarecfg\\root.ini");
-    ui->view->setModel(model);
-    ui->view->setStyle(QStyleFactory::create("windows"));
-    for (int column = 0; column < model->columnCount(); ++column)
-        ui->view->resizeColumnToContents(column);
-
-    connect(ui->delSectionBtn, SIGNAL(clicked()), this, SLOT(removeRow()));
-    connect(ui->delKeyBtn, SIGNAL(clicked()), this, SLOT(removeRow()));
-    connect(ui->addSectionBtn, SIGNAL(clicked()), this, SLOT(insertRow()));
-    connect(ui->addKeyBtn, SIGNAL(clicked()), this, SLOT(insertChild()));
-
-    connect(ui->view->selectionModel(), &QItemSelectionModel::selectionChanged, this, &RootForm::updateActions);
-    updateActions();
-}
-
-RootForm::~RootForm()
-{
-    delete ui;
-}
-
-void RootForm::insertChild()
-{
-    const QModelIndex index = ui->view->selectionModel()->currentIndex();
-    QAbstractItemModel *model = ui->view->model();
-    TreeModel* treeModel = dynamic_cast<TreeModel*>(model);
-    Q_ASSERT(treeModel != NULL);
-    const TreeItemType itemType = treeModel->getItemType(index.row(), index.parent());
-
-    if (model->columnCount(index) == 0) {
-        if (!model->insertColumn(0, index))
-            return;
-    }
-
-    if (!model->insertRow(0, index))
-        return;
-
-    for (int column = 0; column < model->columnCount(index); ++column) {
-        const QModelIndex child = model->index(0, column, index);
-        model->setData(child, QVariant(itemType == Section ? DEFAULT_KEY_VALUE : DEFAULT_UNKNOWN_VALUE), Qt::EditRole);
-        if (!model->headerData(column, Qt::Horizontal).isValid())
-            model->setHeaderData(column, Qt::Horizontal, QVariant(tr("[No header]")), Qt::EditRole);
-    }
-
-    ui->view->selectionModel()->setCurrentIndex(model->index(0, 0, index),
-                                            QItemSelectionModel::ClearAndSelect);
-    updateActions();
-}
-
-bool RootForm::insertColumn()
-{
-    QAbstractItemModel *model = ui->view->model();
-    int column = ui->view->selectionModel()->currentIndex().column();
-
-    // Insert a column in the parent item.
-    bool changed = model->insertColumn(column + 1);
-    if (changed)
-        model->setHeaderData(column + 1, Qt::Horizontal, QVariant("[No header]"), Qt::EditRole);
-
-    updateActions();
-
-    return changed;
-}
-
-void RootForm::insertRow()
-{
-    const QModelIndex index = ui->view->selectionModel()->currentIndex();
-    QAbstractItemModel *model = ui->view->model();
-    TreeModel* treeModel = dynamic_cast<TreeModel*>(model);
-    Q_ASSERT(treeModel != NULL);
-    const TreeItemType itemType = treeModel->getItemType(index.row(), index.parent());
-
-    if (!model->insertRow(index.row() + 1, index.parent()))
-        return;
-
-    updateActions();
-
-    for (int column = 0; column < model->columnCount(index.parent()); ++column) {
-        const QModelIndex child = model->index(index.row() + 1, column, index.parent());
-        QVariant value = (itemType == Key ? DEFAULT_KEY_VALUE : DEFAULT_SECTION_VALUE);
-        if(column == DEFAULT_VALUE_COLUMN && itemType == Section) value = "\t";
-        model->setData(child, value, Qt::EditRole);
-    }
-}
-
-bool RootForm::removeColumn()
-{
-    QAbstractItemModel *model = ui->view->model();
-    const int column = ui->view->selectionModel()->currentIndex().column();
-
-    // Insert columns in each child of the parent item.
-    const bool changed = model->removeColumn(column);
-    if (changed)
-        updateActions();
-
-    return changed;
-}
-
-void RootForm::removeRow()
-{
-    const QModelIndex index = ui->view->selectionModel()->currentIndex();
-    QAbstractItemModel *model = ui->view->model();
-    if (model->removeRow(index.row(), index.parent()))
-        updateActions();
-}
-
-void RootForm::updateActions()
-{
-
-    const QModelIndex index = ui->view->selectionModel()->currentIndex();
-    QAbstractItemModel *model = ui->view->model();
-    TreeModel* treeModel = dynamic_cast<TreeModel*>(model);
-    Q_ASSERT(treeModel != NULL);
-    const TreeItemType itemType = treeModel->getItemType(index.row(), index.parent());
-
-    const bool hasSelection = !ui->view->selectionModel()->selection().isEmpty();
-    ui->delKeyBtn->setEnabled(hasSelection && itemType == Key);
-    ui->delSectionBtn->setEnabled(hasSelection && itemType == Section);
-
-    const bool hasCurrent = ui->view->selectionModel()->currentIndex().isValid();
-    ui->addKeyBtn->setEnabled(hasCurrent && itemType == Section);
-    ui->addSectionBtn->setEnabled(hasCurrent && itemType == Section);
-
-    if (hasCurrent) {
-        ui->view->closePersistentEditor(ui->view->selectionModel()->currentIndex());
-    }
-}
-

+ 0 - 31
Framework/spshell/Widgets/rootform.h

@@ -1,31 +0,0 @@
-#ifndef ROOTFORM_H
-#define ROOTFORM_H
-
-#include <QWidget>
-
-namespace Ui {
-class RootForm;
-}
-
-class RootForm : public QWidget
-{
-    Q_OBJECT
-
-public:
-    explicit RootForm(QWidget *parent = nullptr);
-    explicit RootForm(const QString& iniFilePath, QWidget *parent = nullptr);
-    ~RootForm();
-public slots:
-    void updateActions();
-
-private slots:
-    void insertChild();
-    bool insertColumn();
-    void insertRow();
-    bool removeColumn();
-    void removeRow();
-private:
-    Ui::RootForm *ui;
-};
-
-#endif // ROOTFORM_H

+ 0 - 85
Framework/spshell/Widgets/rootform.ui

@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>RootForm</class>
- <widget class="QWidget" name="RootForm">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>747</width>
-    <height>440</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <property name="autoFillBackground">
-   <bool>true</bool>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0">
-    <widget class="QTreeView" name="view">
-     <property name="autoFillBackground">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="0">
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <item>
-      <spacer name="horizontalSpacer">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeType">
-        <enum>QSizePolicy::Expanding</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="addKeyBtn">
-       <property name="text">
-        <string>添加键</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="delKeyBtn">
-       <property name="text">
-        <string>删除键</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="addSectionBtn">
-       <property name="text">
-        <string>添加节点</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="delSectionBtn">
-       <property name="text">
-        <string>删除节点</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 0 - 129
Framework/spshell/Widgets/subnormalconfig.cpp

@@ -1,129 +0,0 @@
-#include "subnormalconfig.h"
-#include "ui_subnormalconfig.h"
-#include <QFile>
-#include <QFileInfo>
-#include <QDebug>
-#include <QTextStream>
-#include <QFileDevice>
-#include <QTextEdit>
-#include <QMessageBox>
-#include <QTemporaryDir>
-
-#include "BootGlobal.h"
-
-static const  QString LAUNCH_DESKTOP_CONFIG_FILENAME = "spexplorerauto.desktop";
-#ifdef WITH_QT
-static const  QString LAUNCH_DESKTOP_AUTOSTAT_DIR = "/etc/xdg/autostart/";
-#else
-static const  QString LAUNCH_DESKTOP_AUTOSTAT_DIR = "D:/";
-#endif
-
-SubNormalConfig::SubNormalConfig(QWidget *parent) :
-    QWidget(parent),
-    ui(new Ui::SubNormalConfig)
-{
-    ui->setupUi(this);
-    //connect(ui->autoLaunchAtBoot, SIGNAL(clicked()), this, SLOT(updateAutoState()));
-    ui->autoLaunchAtBoot->setChecked(checkAutoStartState());
-}
-
-SubNormalConfig::~SubNormalConfig()
-{
-    delete ui;
-}
-
-bool SubNormalConfig::setAutoStart(bool enable)
-{
-    bool result = true;
-    QString appName = LAUNCH_DESKTOP_CONFIG_FILENAME;
-    QString destAppFullPath = LAUNCH_DESKTOP_AUTOSTAT_DIR + appName;
-
-    if(enable && !autoRunFileExisted())
-    {
-        result = ExtractResFile(this, ":/res/spexplorerauto.desktop", destAppFullPath);
-        if (result) {
-            result = enableNopasswdAsSudo(true);
-            if (!result) {
-                QFile file(destAppFullPath);
-                file.remove();
-            }
-        }
-    }
-    else if(!enable && autoRunFileExisted())
-    {
-        QFile file(destAppFullPath);
-        result = file.remove();
-        if(!result) {
-            QString content = QString("删除文件 %1 失败: %2").arg(LAUNCH_DESKTOP_CONFIG_FILENAME).arg(file.errorString());
-            QMessageBox::critical(this, "错误", content, QMessageBox::Yes);
-            result = false;
-        }
-    }
-    return result;
-}
-
-bool SubNormalConfig::autoRunFileExisted() const
-{
-    QString appName = LAUNCH_DESKTOP_CONFIG_FILENAME;
-    QString destAppFullPath = LAUNCH_DESKTOP_AUTOSTAT_DIR + appName;
-    QFileInfo fileInfo(destAppFullPath);
-    if(fileInfo.exists() && fileInfo.isFile()) {
-        return true;
-    }
-    return false;
-}
-
-bool SubNormalConfig::enableNopasswdAsSudo(bool enable /*= true*/)
-{
-    bool result(true);
-
-    QString loginUser = getUserName();
-    if (loginUser.isEmpty()) {
-        QMessageBox::critical(this, "错误", "获取用户名失败!", QMessageBox::Yes);
-        return false;
-    }
-
-    QTemporaryDir dir;
-    if (!dir.isValid()) {
-        QMessageBox::critical(this, "错误", QString("创建临时文件夹失败: %1").arg(dir.errorString()), QMessageBox::Yes);
-        return false;
-    }
-
-    QString storeFilePath = dir.filePath("set_nopass_priviledge.sh");
-    result = ExtractResFile(this, ":/res/set_nopass_priviledge.sh", storeFilePath);
-    if (!result) {
-        return false;
-    }
-
-    QString programs = QString("%1 %2").arg(storeFilePath).arg(loginUser);
-    result = false;
-    auto resultStr = ExecuteShellScripts(this, programs);
-    if (resultStr.count() > 0) {
-        const int exitCode = resultStr[0].toInt();
-        if (exitCode == 1 || exitCode == 0) {
-            result = true;
-        }
-    }
-
-    return result;
-
-}
-
-bool SubNormalConfig::checkAutoStartState() const
-{
-    return autoRunFileExisted();
-}
-
-void SubNormalConfig::updateAutoState()
-{
-
-}
-
-void SubNormalConfig::on_autoLaunchAtBoot_clicked(bool checked)
-{
-    qDebug() << "Enter " << __FUNCTION__ << endl;
-    bool result = setAutoStart(checked);
-    if(!result) {
-        ui->autoLaunchAtBoot->setChecked(!checked);
-    }
-}

+ 0 - 32
Framework/spshell/Widgets/subnormalconfig.h

@@ -1,32 +0,0 @@
-#ifndef SUBNORMALCONFIG_H
-#define SUBNORMALCONFIG_H
-
-#include <QWidget>
-
-namespace Ui {
-class SubNormalConfig;
-}
-
-class SubNormalConfig : public QWidget
-{
-    Q_OBJECT
-
-public:
-    explicit SubNormalConfig(QWidget *parent = nullptr);
-    ~SubNormalConfig();
-public slots:
-    void updateAutoState();
-private slots:
-    void on_autoLaunchAtBoot_clicked(bool checked);
-
-private:
-    bool setAutoStart(bool enable = true);
-    bool checkAutoStartState() const;
-    bool autoRunFileExisted() const;
-
-    bool enableNopasswdAsSudo(bool enable = true);
-
-    Ui::SubNormalConfig *ui;
-};
-
-#endif // SUBNORMALCONFIG_H

+ 0 - 32
Framework/spshell/Widgets/subnormalconfig.ui

@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>SubNormalConfig</class>
- <widget class="QWidget" name="SubNormalConfig">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>563</width>
-    <height>444</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <widget class="QCheckBox" name="autoLaunchAtBoot">
-   <property name="geometry">
-    <rect>
-     <x>10</x>
-     <y>20</y>
-     <width>171</width>
-     <height>16</height>
-    </rect>
-   </property>
-   <property name="text">
-    <string>应用开机自启动</string>
-   </property>
-  </widget>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 0 - 30
Framework/spshell/Widgets/sysinfo.cpp

@@ -1,30 +0,0 @@
-#include "sysinfo.h"
-
-#include <QtGlobal>
-
-#ifdef Q_OS_WIN
-    #include "sysinfowindowsimpl.h"
-#elif defined(Q_OS_LINUX)
-    #include "sysinfolinuximpl.h"
-#endif
-
-SysInfo& SysInfo::instance()
-{
-    #ifdef Q_OS_WIN
-        static SysInfoWindowsImpl singleton;
-    #elif defined(Q_OS_MAC)
-        static SysInfoMacImpl singleton;
-    #elif defined(Q_OS_LINUX)
-        static SysInfoLinuxImpl singleton;
-    #endif
-
-    return singleton;
-}
-
-SysInfo::SysInfo()
-{
-}
-
-SysInfo::~SysInfo()
-{
-}

+ 0 - 23
Framework/spshell/Widgets/sysinfo.h

@@ -1,23 +0,0 @@
-#ifndef SYSINFO_H
-#define SYSINFO_H
-
-
-class SysInfo
-{
-public:
-    static SysInfo& instance();
-    virtual ~SysInfo();
-
-    virtual void init() = 0;
-    virtual double cpuLoadAverage() = 0;
-    virtual double memoryUsed() = 0;
-
-protected:
-    explicit SysInfo();
-
-private:
-    SysInfo(const SysInfo& rhs);
-    SysInfo& operator=(const SysInfo& rhs);
-};
-
-#endif // SYSINFO_H

+ 0 - 71
Framework/spshell/Widgets/sysinfolinuximpl.cpp

@@ -1,71 +0,0 @@
-#include "sysinfolinuximpl.h"
-
-#include <sys/types.h>
-#include <sys/sysinfo.h>
-
-#include <QFile>
-
-SysInfoLinuxImpl::SysInfoLinuxImpl() :
-    SysInfo(),
-    mCpuLoadLastValues()
-{
-
-}
-
-void SysInfoLinuxImpl::init()
-{
-    mCpuLoadLastValues = cpuRawData();
-}
-
-double SysInfoLinuxImpl::cpuLoadAverage()
-{
-    QVector<qulonglong> firstSample = mCpuLoadLastValues;
-    QVector<qulonglong> secondSample = cpuRawData();
-    mCpuLoadLastValues = secondSample;
-
-    double overall = (secondSample[0] - firstSample[0])
-        + (secondSample[1] - firstSample[1])
-        + (secondSample[2] - firstSample[2]);
-
-    double total = overall + (secondSample[3] - firstSample[3]);
-    double percent = (overall / total) * 100.0;
-    return qBound(0.0, percent, 100.0);
-}
-
-double SysInfoLinuxImpl::memoryUsed()
-{
-    struct sysinfo memInfo;
-    sysinfo(&memInfo);
-
-    qulonglong totalMemory = memInfo.totalram;
-    totalMemory += memInfo.totalswap;
-    totalMemory *= memInfo.mem_unit;
-
-    qulonglong totalMemoryUsed = memInfo.totalram - memInfo.freeram;
-    totalMemoryUsed += memInfo.totalswap - memInfo.freeswap;
-    totalMemoryUsed *= memInfo.mem_unit;
-
-    double percent = (double)totalMemoryUsed / (double)totalMemory * 100.0;
-    return qBound(0.0, percent, 100.0);
-}
-
-QVector<qulonglong> SysInfoLinuxImpl::cpuRawData()
-{
-    QFile file("/proc/stat");
-    file.open(QIODevice::ReadOnly);
-
-    QByteArray line = file.readLine();
-    file.close();
-    qulonglong totalUser = 0, totalUserNice = 0, totalSystem = 0, totalIdle = 0;
-    std::sscanf(line.data(), "cpu %llu %llu %llu %llu",
-                &totalUser, &totalUserNice, &totalSystem, &totalIdle);
-
-    QVector<qulonglong> rawData;
-    rawData.append(totalUser);
-    rawData.append(totalUserNice);
-    rawData.append(totalSystem);
-    rawData.append(totalIdle);
-
-    return rawData;
-}
-

+ 0 - 23
Framework/spshell/Widgets/sysinfolinuximpl.h

@@ -1,23 +0,0 @@
-#ifndef SYSINFOLINUXIMPL_H
-#define SYSINFOLINUXIMPL_H
-
-#include <QtGlobal>
-#include <QVector>
-
-#include "sysinfo.h"
-
-class SysInfoLinuxImpl : public SysInfo
-{
-public:
-    SysInfoLinuxImpl();
-
-    void init() override;
-    double cpuLoadAverage() override;
-    double memoryUsed() override;
-
-private:
-    QVector<qulonglong> cpuRawData();
-    QVector<qulonglong> mCpuLoadLastValues;
-};
-
-#endif // SYSINFOLINUXIMPL_H

Некоторые файлы не были показаны из-за большого количества измененных файлов