Skip to content

Commit

Permalink
Merge branch 'pgmodeler:develop' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
koosty authored Mar 24, 2023
2 parents 631681a + 5a906d4 commit 6e78b12
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 26 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
Changelog
---------

v1.0.2
------
<em>Release date: March 14, 2023</em><br/>

* [Fix] Fixed a bug related to importing referenced tables of FKs in partial import mode.
* [Fix] Fixed the attributes toggler item border style in partition tables.
* [Fix] Fixed a regression that was preventing the canvas color to be changed.
* [Fix] Fixed a bug in BaseObjectWidget::finishConfiguration that was preventing the creation of a role and a table with the same names.
* [Fix] Fixed the generation of DROP command for policy, trigger, and rule.
* [Fix] Fixed a bug that was causing objects to be selected in the sample model at appearance settings.
* [Fix] Forcing the usage of Qt 6.x due to problems on Windows when compiling with Qt 5.
* [Fix] Minor adjustment in CodeCompletionWidget stylesheet.
* [Fix] Saving/restoring the painter settings after drawing the background in ObjectsScene.
* [Fix] Fixed a malformed diff code for policies.

v1.0.1
------
<em>Release date: February 17, 2023</em><br/>
Expand Down
24 changes: 13 additions & 11 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
v1.0.1
v1.0.2
------
<em>Release date: February 17, 2023</em><br/>
<em>Changes since: <strong>v1.0.0</strong></em><br/>
<em>Release date: March 14, 2023</em><br/>
<em>Changes since: <strong>v1.0.1</strong></em><br/>

This patch release for pgModeler 1.0.x brings the following changes and fixes:

* The appearance config now correctly adjusts the drop shadows on tool buttons improving the color contrast according to the current theme.
* When removing a primary key of a table in the editing dialog, pgModeler will now ask the user to uncheck all columns marked as PK in the Columns tab.
* The catalog query for transform objects was disabled for PostgreSQL 9.x to allow compatibility mode to work without errors when browsing databases on that version.
* Improving the visibility of some elements in the main menu bar and in the about widget.
* Fixed the assignment of layer colors when loading model created in older pgModeler versions using compatibility mode.
* When activating the action "Schemas rectangles > Hide" in the canvas area the child tables are properly updated in such a way to show the schema name in their title bars.
* Fixed the disable state change for delimiter scale lock action when changing the current main window view.
* Fixed the action "Open in file manager" in the file selector widget.
* Fixed a bug related to importing referenced tables of FKs in partial import mode.
* Fixed the attributes toggler item border style in partition tables.
* Fixed a regression that was preventing the canvas color to be changed.
* Fixed a bug in BaseObjectWidget::finishConfiguration that was preventing the creation of a role and a table with the same names.
* Fixed the generation of DROP command for policy, trigger, and rule.
* Fixed a bug that was causing objects to be selected in the sample model at appearance settings.
* Forcing the usage of Qt 6.x due to problems on Windows when compiling with Qt 5.
* Minor adjustment in CodeCompletionWidget stylesheet.
* Saving/restoring the painter settings after drawing the background in ObjectsScene.
* Fixed a malformed diff code for policies.
6 changes: 2 additions & 4 deletions assets/conf/ui-style.conf
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,8 @@ QTabWidget#databases_tbw > QTabBar::close-button:pressed {
*/
CodeCompletionWidget > QWidget {
background-color: palette(button);
border: 1px solid palette(base);
border-radius: 2px;
border: 1px solid palette(mid);
}

/*
* NewObjectOverlayWidget
*/
Expand All @@ -233,7 +231,7 @@ NewObjectOverlayWidget > QFrame,
TaskProgressWidget > QFrame,
ObjectRenameWidget > QFrame {
background-color: palette(button);
border: 1px solid palette(base);
border: 1px solid palette(mid);
border-radius: 6px
}

Expand Down
2 changes: 1 addition & 1 deletion assets/schemas/alter/policy.sch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{alter-cmds}

%if {has-changes} %then
[ALTER ] {sql-object} $sp {signature}
[ALTER POLICY ] {name} [ ON ] {table}

%if {roles} %then
$br $tb [TO ]
Expand Down
6 changes: 5 additions & 1 deletion assets/schemas/sql/drop.sch
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
[DROP ] {sql-object} [ IF EXISTS ]
%end

%if {column} %or {constraint} %and %not {decl-in-table} %or {extension} %then
%if {column} %or {constraint} %and %not {decl-in-table} %or {extension} %or {rule} %or {trigger} %or {policy} %then
{name}
%else
{signature}
%end

%if {trigger} %or {rule} %or {policy} %then
[ ON ] {table}
%end

%if {cascade} %and %not {database} %and %not {tablespace} %and %not {role} %and %not {usermapping} %then
[ CASCADE]
%end
Expand Down
4 changes: 4 additions & 0 deletions libs/libcanvas/src/objectsscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,12 @@ void ObjectsScene::drawBackground(QPainter *painter, const QRectF &rect)
page_w = aux_size.width() / static_cast<double>(grid_size) * grid_size;
page_h = aux_size.height() / static_cast<double>(grid_size) * grid_size;

painter->save();
painter->setClipping(true);
painter->setClipRect(rect);
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setRenderHint(QPainter::TextAntialiasing, false);
painter->fillRect(rect, canvas_color);

if(show_grid)
{
Expand Down Expand Up @@ -827,6 +829,8 @@ void ObjectsScene::drawBackground(QPainter *painter, const QRectF &rect)
painter->drawLine(0, scene_lim_y, scene_lim_x, scene_lim_y);
painter->drawLine(scene_lim_x, 0, scene_lim_x, scene_lim_y);
}

painter->restore();
}

void ObjectsScene::setGridSize(unsigned size)
Expand Down
5 changes: 5 additions & 0 deletions libs/libcanvas/src/tableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,12 @@ void TableView::configureObject()
table_tooltip += QString("\n%1 (%2)").arg(tr("Partitioned")).arg(~table->getPartitioningType());

if(table->isPartition())
{
table_tooltip += QString("\n%1 of %2").arg(tr("Partition")).arg(table->getPartitionedTable()->getSignature(true));
pen = attribs_toggler->pen();
pen.setStyle(Qt::DashLine);
attribs_toggler->setPen(pen);
}

if(!table->getAlias().isEmpty())
table_tooltip += QString("\nAlias: %1").arg(table->getAlias());
Expand Down
1 change: 1 addition & 0 deletions libs/libcore/src/policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ QString Policy::getAlterCode(BaseObject *object)
attribs_map attribs;

attributes[Attributes::AlterCmds]=BaseObject::getAlterCode(object);
attribs[Attributes::Table] = getParentTable()->getSignature(true);

if(this->using_expr.simplified() != policy->using_expr.simplified())
attribs[Attributes::UsingExp] = policy->using_expr;
Expand Down
4 changes: 3 additions & 1 deletion libs/libgui/src/dbobjects/baseobjectwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,9 @@ void BaseObjectWidget::applyConfiguration()
checking on table list when the configured object is a view or a checking
on view list when the configured object is a table, this because PostgreSQL
does not accepts tables and views have the same name on the same schema */
aux_obj = model->getObject(obj_name, { ObjectType::Table, ObjectType::ForeignTable, ObjectType::View });
if(BaseTable::isBaseTable(obj_type))
aux_obj = model->getObject(obj_name, { ObjectType::Table, ObjectType::ForeignTable, ObjectType::View });

new_obj = (aux_obj == nullptr);
}

Expand Down
5 changes: 1 addition & 4 deletions libs/libgui/src/settings/appearanceconfigwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,7 @@ void AppearanceConfigWidget::loadExampleModel()
}

for(auto &obj : graph_objs)
{
obj->setFlag(QGraphicsItem::ItemIsSelectable, false);
obj->setFlag(QGraphicsItem::ItemIsMovable, false);
}
obj->setEnabled(false);

placeholder->setRect(QRectF(400, 280, 200, 150));
updatePlaceholderItem();
Expand Down
6 changes: 3 additions & 3 deletions libs/libgui/src/tools/databaseimporthelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,8 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType
if(use_signature)
obj_name = obj_attr[Attributes::Signature] = getObjectName(oid, true);
else
obj_name = obj_attr[Attributes::Name] = getObjectName(oid);
//obj_name = obj_attr[Attributes::Name] = getObjectName(oid);
obj_name = getObjectName(oid);

/* If the attributes of the dependency exists but it was not created on the model yet,
pgModeler will create it and it's dependencies recursively */
Expand Down Expand Up @@ -2673,8 +2674,7 @@ void DatabaseImportHelper::createColumns(attribs_map &attribs, std::vector<unsig
//Retrieving columns if they were not retrieved yet
if(columns[attribs[Attributes::Oid].toUInt()].empty() && auto_resolve_deps)
{
QString sch_name;
sch_name = getDependencyObject(attribs[Attributes::SchemaOid], ObjectType::Schema, true, auto_resolve_deps, false);
QString sch_name = getDependencyObject(attribs[Attributes::SchemaOid], ObjectType::Schema, true, auto_resolve_deps, false);
retrieveTableColumns(sch_name, attribs[Attributes::Name]);
}

Expand Down
2 changes: 1 addition & 1 deletion libs/libutils/src/globalattributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <QRegularExpression>

/** Base version number **/
const QString GlobalAttributes::PgModelerVersion = QString("1.0.1")
const QString GlobalAttributes::PgModelerVersion = QString("1.0.2")

/* Appending the snapshot build number to the version number
* when the external variable SNAPSHOT_BUILD is defined */
Expand Down
5 changes: 5 additions & 0 deletions pgmodeler.pri
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ UI_DIR = src
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000
!defined(NO_CHECK_CURR_VER, var):DEFINES+=CHECK_CURR_VER

# Forcing the compilation using Qt 6.x
!versionAtLeast(QT_VERSION, "6.0.0") {
error("Unsupported Qt version detected: $${QT_VERSION}! pgModeler must be compiled with at least Qt 6.0.0.")
}

# Store the absolute paths to library subprojects to be referenced in other .pro files
# *_ROOT -> the path to the root folder of the subproject
# *_LIB -> the libary flags (-L -l) (LIBS on qmake) passed to the compiler that points to the library generated from a subproject
Expand Down

0 comments on commit 6e78b12

Please sign in to comment.