From f693679a25a7009a21ec16cee50de6dec4e3b3e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20Ara=C3=BAjo=20e=20Silva?= Date: Wed, 22 Nov 2023 11:04:22 -0300 Subject: [PATCH] Partially fixes the build of the gqb plugin on pgModeler 1.1.x. (#27) --- .../graphicalquerybuilder.pro | 8 ++-- .../src/graphicalquerybuilder.cpp | 40 +++++++++++-------- .../src/graphicalquerybuilder.h | 24 ++++++----- .../src/graphicalquerybuildersqlwidget.h | 1 + plugins.pro | 8 +++- 5 files changed, 49 insertions(+), 32 deletions(-) diff --git a/graphicalquerybuilder/graphicalquerybuilder.pro b/graphicalquerybuilder/graphicalquerybuilder.pro index 3fc1ea9..66f2507 100644 --- a/graphicalquerybuilder/graphicalquerybuilder.pro +++ b/graphicalquerybuilder/graphicalquerybuilder.pro @@ -134,10 +134,10 @@ equals(GQB_JOIN_SOLVER, "y"){ DEFINES += "GRAPHICAL_QUERY_BUILDER_JOIN_SOLVER" HEADERS += src/graphicalquerybuilderjoinsolver.h SOURCES += src/graphicalquerybuilderjoinsolver.cpp - INCLUDEPATH += $$PWD/paal/include - $$PWD/paal/boost - DEPENDPATH += $$PWD/paal/include - $$PWD/paal/boost + INCLUDEPATH += $$absolute_path($$PWD/paal/include) \ + $$absolute_path($$PWD/paal/boost) + DEPENDPATH += $$absolute_path($$PWD/paal/include) \ + $$absolute_path($$PWD/paal/boost) } #------------------------------------------------------------------------------------------------ diff --git a/graphicalquerybuilder/src/graphicalquerybuilder.cpp b/graphicalquerybuilder/src/graphicalquerybuilder.cpp index dfa3da7..88b1ad5 100644 --- a/graphicalquerybuilder/src/graphicalquerybuilder.cpp +++ b/graphicalquerybuilder/src/graphicalquerybuilder.cpp @@ -20,46 +20,52 @@ #include "exception.h" #include "messagebox.h" #include "mainwindow.h" +#include "guiutilsns.h" -GraphicalQueryBuilder::GraphicalQueryBuilder(void) +GraphicalQueryBuilder::GraphicalQueryBuilder() { configurePluginInfo(getPluginTitle(), - getPluginVersion(), - getPluginAuthor(), - getPluginDescription(), - - GlobalAttributes::getPluginsDir() + - GlobalAttributes::DirSeparator + - QString("graphicalquerybuilder") + - GlobalAttributes::DirSeparator + QString("graphicalquerybuilder.png")); + getPluginVersion(), + getPluginAuthor(), + getPluginDescription()); is_plugin_active=false; } -QString GraphicalQueryBuilder::getPluginTitle(void) +QString GraphicalQueryBuilder::getPluginTitle() const { return(tr("Graphical query builder")); } -QString GraphicalQueryBuilder::getPluginVersion(void) +QString GraphicalQueryBuilder::getPluginVersion() const { - return(QString("0.9.2")); + return(QString("0.1.0")); } -QString GraphicalQueryBuilder::getPluginAuthor(void) +QString GraphicalQueryBuilder::getPluginAuthor() const { return(QString("Maxime Chambonnet maxzor@maxzor.eu")); } -QString GraphicalQueryBuilder::getPluginDescription(void) +QString GraphicalQueryBuilder::getPluginDescription() const { return(tr("Check documentation, source code and report bugs at : \ \n https://www.github.com/pgmodeler/plugins/graphicalquerybuilder \ \n https://www.gitlab.com/maxzor/pgmodeler_gqb")); } -void GraphicalQueryBuilder::showPluginInfo(void) +QAction *GraphicalQueryBuilder::getAction(ActionId act_id) const +{ + return nullptr; +} + +QToolButton *GraphicalQueryBuilder::getToolButton() const +{ + return nullptr; +} + +void GraphicalQueryBuilder::showPluginInfo() { plugin_info_frm->show(); } @@ -246,12 +252,12 @@ void GraphicalQueryBuilder::adjustViewportToItems(QList items) } -QKeySequence GraphicalQueryBuilder::getPluginShortcut(void) +QKeySequence GraphicalQueryBuilder::getPluginShortcut() { return(QKeySequence(QString("Ctrl+J"))); } -bool GraphicalQueryBuilder::hasMenuAction(void) +bool GraphicalQueryBuilder::hasMenuAction() { return(false); } diff --git a/graphicalquerybuilder/src/graphicalquerybuilder.h b/graphicalquerybuilder/src/graphicalquerybuilder.h index 928561c..415b4fc 100644 --- a/graphicalquerybuilder/src/graphicalquerybuilder.h +++ b/graphicalquerybuilder/src/graphicalquerybuilder.h @@ -52,16 +52,20 @@ class GraphicalQueryBuilder: public QObject, public PgModelerPlugin { GraphicalQueryBuilderPathWidget *gqb_path_wgt; public: - GraphicalQueryBuilder(void); - - QString getPluginTitle(void); - QString getPluginVersion(void); - QString getPluginAuthor(void); - QString getPluginDescription(void); - QKeySequence getPluginShortcut(void); - bool hasMenuAction(void); - void executePlugin(ModelWidget *model_wgt); - void initPlugin(MainWindow *main_window); + GraphicalQueryBuilder(); + + QString getPluginTitle() const override; + QString getPluginVersion() const override; + QString getPluginAuthor() const override; + QString getPluginDescription() const override; + + QAction *getAction(ActionId act_id) const override; + QToolButton *getToolButton() const override; + + QKeySequence getPluginShortcut(); + bool hasMenuAction(); + void executePlugin(ModelWidget *model_wgt); + void initPlugin(MainWindow *main_window) override; private slots: void handleModelChange(ModelWidget *new_model); diff --git a/graphicalquerybuilder/src/graphicalquerybuildersqlwidget.h b/graphicalquerybuilder/src/graphicalquerybuildersqlwidget.h index 7ca6a7b..c9f81c1 100644 --- a/graphicalquerybuilder/src/graphicalquerybuildersqlwidget.h +++ b/graphicalquerybuilder/src/graphicalquerybuildersqlwidget.h @@ -28,6 +28,7 @@ #include "ui_graphicalquerybuildersqlwidget.h" #include "dbobjects/baseobjectwidget.h" #include "widgets/numberedtexteditor.h" +#include "utils/syntaxhighlighter.h" class GraphicalQueryBuilderSQLWidget: public BaseObjectWidget, public Ui::GraphicalQueryBuilderSqlWidget { private: diff --git a/plugins.pro b/plugins.pro index 59e83d0..cd46f3f 100644 --- a/plugins.pro +++ b/plugins.pro @@ -3,5 +3,11 @@ include(plugins.pri) TEMPLATE = subdirs SUBDIRS += sampleplugin -# GQB plugin temporarily disabled due to problems in compilation process +# Graphical Query Builder plugin is temporarily disabled due to problems in compilation process. +# Currently only the graphical query builder portion can be compiled. The path solver code is failing to build. +# Uncomment the line "SUBDIRS+=..." below if you want to try to build and eventually fix the build process. +# +# Building instructions here: +# >> https://github.com/pgmodeler/plugins/blob/develop/graphicalquerybuilder/README.md + # SUBDIRS += graphicalquerybuilder