OSDN Git Service

[Qt][GUI] Fix linkage error at libCSPgui.dll for Win32.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Mon, 26 Aug 2019 13:18:15 +0000 (22:18 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Mon, 26 Aug 2019 13:18:15 +0000 (22:18 +0900)
source/src/qt/gui/CMakeLists.txt
source/src/qt/gui/display_log.cpp
source/src/qt/gui/qt_debugger_tmpl.cpp
source/src/qt/gui/qt_debugger_tmpl.h

index 401d715..cbc92ec 100644 (file)
@@ -1,6 +1,6 @@
 message("* qt/gui")
 
-set(THIS_LIB_VERSION 2.19.6)
+set(THIS_LIB_VERSION 2.19.7)
 #include(cotire)
 #include(PrecompiledHeader)
 
index f2f90de..97fe358 100644 (file)
@@ -89,9 +89,10 @@ void Dlg_LogViewerBind::do_update(void)
 void Dlg_LogViewer::set_font(const QFont &font)
 {
        TextBox->setFont(font);
+       config_t *p_cfg = using_flags->get_config_ptr();
        if(!(font.toString().isEmpty())) {
-               memset(config.logwindow_font, 0x00, sizeof(config.logwindow_font));
-               snprintf(config.logwindow_font, sizeof(config.logwindow_font) - 1, "%s", font.toString().toLocal8Bit().constData());
+               memset(p_cfg->logwindow_font, 0x00, sizeof(p_cfg->logwindow_font));
+               snprintf(p_cfg->logwindow_font, sizeof(p_cfg->logwindow_font) - 1, "%s", font.toString().toLocal8Bit().constData());
        }
 }
 
@@ -109,8 +110,10 @@ void Dlg_LogViewer::resizeEvent(QResizeEvent *event)
        int height = s.height();
        if(width < 320) width = 320;
        if(height < 200) height = 200;
-       config.logwindow_height = height;
-       config.logwindow_width = width;
+       config_t *p_cfg = using_flags->get_config_ptr();
+       
+       p_cfg->logwindow_height = height;
+       p_cfg->logwindow_width = width;
 }
 
 
@@ -162,9 +165,12 @@ Dlg_LogViewer::Dlg_LogViewer(USING_FLAGS *p, CSP_Logger *logger, QWidget *parent
        connect(this, SIGNAL(sig_text_append(QString)), TextBox, SLOT(append(QString)));
        MasterLayout = new QGridLayout;
        FontDlgButton = new QPushButton(QApplication::translate("LogWindow", "Set Font", 0),this);
-       if(strlen(config.logwindow_font) > 0) {
+
+       config_t *p_cfg = using_flags->get_config_ptr();
+
+       if(strlen(p_cfg->logwindow_font) > 0) {
                QFont font;
-               font.fromString(QString::fromLocal8Bit(config.logwindow_font));
+               font.fromString(QString::fromLocal8Bit(p_cfg->logwindow_font));
                TextBox->setFont(font);
        }
        connect(FontDlgButton, SIGNAL(pressed()), this, SLOT(rise_font_dialog()));
@@ -178,8 +184,8 @@ Dlg_LogViewer::Dlg_LogViewer(USING_FLAGS *p, CSP_Logger *logger, QWidget *parent
        UpdateTimer->start();
        this->setLayout(MasterLayout);
 
-       int w = config.logwindow_width;
-       int h = config.logwindow_height;
+       int w = p_cfg->logwindow_width;
+       int h = p_cfg->logwindow_height;
        if(w < 320) w = 320;
        if(h < 200) h = 200;
        this->resize(w, h);
index 63c35bf..7ba52c7 100644 (file)
@@ -27,7 +27,6 @@
 #include "qt_debugger_tmpl.h"
 #include "qt_lineeditplus.h"
 #include "osd_base.h"
-#include "../../config.h"
 
 void CSP_Debugger_Tmpl::set_string_attr(QString color, bool is_strong)
 {
@@ -129,8 +128,8 @@ void CSP_Debugger_Tmpl::set_font(const QFont &font)
        text_command->setFont(font);
        text->setFont(font);
        if(!(font.toString().isEmpty())) {
-               memset(config.debugwindow_font, 0x00, sizeof(config.debugwindow_font));
-               snprintf(config.debugwindow_font, sizeof(config.debugwindow_font) - 1, "%s", font.toString().toLocal8Bit().constData());
+               memset(p_cfg->debugwindow_font, 0x00, sizeof(p_cfg->debugwindow_font));
+               snprintf(p_cfg->debugwindow_font, sizeof(p_cfg->debugwindow_font) - 1, "%s", font.toString().toLocal8Bit().constData());
        }
 }
 
@@ -149,14 +148,14 @@ void CSP_Debugger_Tmpl::resizeEvent(QResizeEvent *event)
        int height = s.height();
        if(width < 320) width = 320;
        if(height < 200) height = 200;
-       config.debugwindow_height = height;
-       config.debugwindow_width = width;
+       p_cfg->debugwindow_height = height;
+       p_cfg->debugwindow_width = width;
 }
 
 CSP_Debugger_Tmpl::CSP_Debugger_Tmpl(OSD_BASE* p_osd, QWidget *parent) : QWidget(parent, Qt::Window)
 {
        widget = this;
-       
+       p_cfg = p_osd->get_config_flags()->get_config_ptr();
        parent_object = parent;
        text = new QTextEdit(this);
        text->setReadOnly(true);
@@ -170,9 +169,11 @@ CSP_Debugger_Tmpl::CSP_Debugger_Tmpl(OSD_BASE* p_osd, QWidget *parent) : QWidget
        text_command->setEnabled(true);
        text_command->clear();
        call_font_dialog = new QPushButton(QApplication::translate("Debugger", "Set Font", 0),this);
-       if(strlen(config.debugwindow_font) > 0) {
+
+       
+       if(strlen(p_cfg->debugwindow_font) > 0) {
                QFont font;
-               font.fromString(QString::fromLocal8Bit(config.debugwindow_font));
+               font.fromString(QString::fromLocal8Bit(p_cfg->debugwindow_font));
                text->setFont(font);
                text_command->setFont(font);
        }
@@ -194,8 +195,8 @@ CSP_Debugger_Tmpl::CSP_Debugger_Tmpl(OSD_BASE* p_osd, QWidget *parent) : QWidget
        VBoxWindow->addWidget(text);
        VBoxWindow->addWidget(text_command);
        
-       int w = config.debugwindow_width;
-       int h = config.debugwindow_height;
+       int w = p_cfg->debugwindow_width;
+       int h = p_cfg->debugwindow_height;
        if(w < 320) w = 320;
        if(h < 200) h = 200;
        
index 3fd6e0a..7c1e317 100644 (file)
@@ -24,6 +24,7 @@
 #include <string>
 
 #include "../../fileio.h"
+#include "../../config.h"
 
 QT_BEGIN_NAMESPACE     
 
@@ -41,6 +42,7 @@ class DLL_PREFIX CSP_Debugger_Tmpl : public QWidget
 {
        Q_OBJECT
  protected:
+       config_t *p_cfg;
        QObject *parent_object;
        QWidget *widget;
        QTextEdit *text;
@@ -53,7 +55,8 @@ class DLL_PREFIX CSP_Debugger_Tmpl : public QWidget
        bool string_is_strong;
        QString text_color;
        QStringList complete_list;
- public:
+
+public:
        CSP_Debugger_Tmpl(OSD_BASE* p_osd, QWidget *parent);
        ~CSP_Debugger_Tmpl();
        //virtual void closeEvent(QCloseEvent *event);