diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6ac057b6c7..005b7d7ba2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,55 @@
Change Log
---------
+v0.9.1
+------
+Release date: May 14, 2018
+
+* [New] Added support to line selection by clicking and moving the mouse over the line numbers widget in any source code field.
+* [New] The validator now checks if the model has columns referencing spatial data types and creates the postgis extension automatically when fixing the model.
+* [New] Added support to RESTART IDENTITY on truncate tables in DatabaseExplorerWidget.
+* [New] Added an custom option checkbox in Messagebox for general purpose usage.
+* [New] Added support to diff operation in CLI.
+* [New] Added support to import database from CLI.
+* [New] Adding missing types regrole and regnamespace.
+* [Change] Improved the copy/duplicate operation in order to copy rules, index, trigger and policies together to their parents.
+* [Change] Added column names to the code completion widget used in the filter widget at DataManipulationForm.
+* [Change] Improved the SQLExecutionWidget in such way that it'll display large amount of data more quickly and consuming less memory.
+* [Change] Minor improvement in SQLExecutionWidget to show the amount of time took to run a query.
+* [Change] Minor improvement in the text find widgets in SQL tool in order to make them closable via dedicated button.
+* [Change] Improved the set tag operation in ModelWidget in order to cleanup the assigned tags to a set of objects.
+* [Change] Minor improvement on DatabaseExplorerWidget to show the rls attributes labels correctly in the attributes grid.
+* [Change] Refactored all the CLI options.
+* [Change] Minor change in Connection::generateConnectionString in order to put the dbname param in the start of the string.
+* [Change] Improved the performance of the row duplication action in DataManipulationForm.
+* [Change] Minor improvement in order to update the schemas boxes when the tables have their extended attributes box toggled.
+* [Change] Improved the performance of "Move to schema" operation.
+* [Change] Added an busy cursor while closing a model.
+* [Change] Improved the object selection in object finder.
+* [Change] Changed the behaviour of select and fade buttons in ObjectFinderWidget in such way to enable the user to select/fade the objects in the listing (or not included in the results).
+* [Fix] Fixed a bug when import identity columns in certain cases when the identity column was followed by another column which data type was not accepted for identity, e.g, text after smallint.
+* [Fix] Fixed the check boxes disabling when dealing with identifier relationships.
+* [Fix] Disabled the drag & drop for items in the side listing at ConfigurationForm.
+* [Fix] Fixed the tab behavior on comment box in all editing forms of database objects.
+* [Fix] Fixed the catalog query for user defined types.
+* [Fix] Fixed the import of user defined types which names contains uppercase characters.
+* [Fix] Minor typo fixes in CLI.
+* [Fix] Fix window scaling on HiDPI/Retina screens.
+* [Fix] Minor fix in Connection::getConnectionId in order to omit port when that parameter is not configured in the connection.
+* [Fix] Fixed a bug in ModelExportHelper that was failing to remane the database when the command appeared.
+* [Fix] Fixed a bug in CollationWidget that was referencing the collation attributes LC_??? using the wrong constant.
+* [Fix] Fixed the behaviour of the message box that warns about the need of validate the model prior to export, save or diff. Now rejecting the dialog (i.e. closing it) will be considered that the user wants to proceed with the pending operation even with an invalid model.
+* [Fix] Fixed the import of comments for constraints,triggers, index and rules.
+* [Fix] The value input in BulkDataEditWidget will be focused as soon as the widget appears.
+* [Fix] Fixed a bug in the aggregate import process.
+* [Fix] Minor fix in DataManipulationForm to avoid the generation of a where clause when the filter is filled only with spaces.
+* [Fix] Minor fix in the magnfier tool to use the same render hints as the canvas viewport.
+* [Fix] Fixed a bug in the diff process that was trying to recreate the whole database when the "Force recreation" option was set.
+* [Fix] Fixed a bug when showing the source of tables in DatabaseExplorerWidget when these objects have permissions assigned.
+* [Fix] Adjusting tables position when the parent schema is moved and the alignment to grid is enabled.
+* [Fix] Minor fix in the CLI menu.
+* [Fix] Fixed the saving process for large models by stopping the threads related to temp models saving while the model file is being written.
+
v0.9.1-beta1
------
Release date: April 6, 2018
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 3840d69f48..f77074d8b2 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -1,50 +1,49 @@
-v0.9.1-beta1
+v0.9.1
------
-Release date: April 6, 2018
-Changes since: v0.9.1-beta
-
-Summary: finally we've reached the last beta release of the 0.9.1! This time pgModeler brings important fixes and new features requested long ago which are finally implemented in experimental stage.
-
-The first new feature we have in this release is the support to multiples relationships for the same pair of tables. In previous versions, pgModeler would refuse to create a second relationship between the tables A and B. From now on, pgModeler will accept the creation of one-to-many and many-to-many relationships linking A and B more then once. For the other kinds of relationships (generalization, copy, one-to-one) the old rule is still valid: only one relationship per table pair is accepted.
-
-Some missing features of PostgreSQL are present in this version too being them: row level security (RLS) and identity columns. For RLS, introduced in PostgreSQL 9.5, we have added the related options to toggle it in tables (ENABLE|FORCE RLS) as well the support to policy objects which are the main part of this new security modality. The identity columns, introduced in PostgreSQL 10, are now fully supported by pgModeler and you can make use of them from the column editing form.
-
-Other new feature is the support to multiple check constraints by domains. Actually, this is more a patch than a new feature because pgModeler was unaware that domains could support more than one check constraint, so we have fixed that now.
-
-Now, talking about changes, we fixed an old missinterpretation of the PostgreSQL's documentations by changing the way extensions are stored in the database model. Previously, this kind of objects were stored at schemas level but the right way to store them is at database level. So now instead of seeing extensions in the schema's subtree you'll see them in the database subtree. All validation rules, export, import and diff processes were fixed in such way to reflect the right way to treat these objects.
-
-Another important change, and that one is related to an annoying behaviour of the tool, is that pgModeler will silently ignore the absence of the plugins folder and proceed with the normal startup avoiding the display of a message box regarding the missing folder and automatically disabling the plugins search mechanism.
-
-In the fixes section, we've included a patch for a bug that was causing recurrent crashes on macOS when the user tried to load a second model file making almost impossible the working on two or more database models at once. Also, we've patched the reverse engineering in such way to avoid the duplication of data types related to tables, sequences and views which was causing problems in the validation process. Another fix was done in the diff process that was generating a malformed DROP command for extensions.
-
-The set of changes of this release has 47 entries between new features, changes, improvements and bug fixes. Below we highlight some of them, for the complete list, please, consider reading the CHANGELOG.md.
-
-* [New] Added the ability to create multiples one-to-many and many-to-many relatationships between the same pair of tables.
-* [New] Added the ability to use more special ascii chars in the middle of object names.
-* [New] Added support to multi line comments in UI.
-* [New] Added full support to row level security (RLS), including export, import and diff of this kind of object.
-* [New] Added support to bulk data editing in DataManipulationForm.
-* [New] Added an option to diff process to force the generation of DROP commands for columns and constraints even if the missing objects need to be preserved. This is useful to work with partial models and the user need to remove columns/constraints and preserve the rest of objects.
-* [New] Added support to identity columns (PostgreSQL 10).
-* [New] Added the support to BYPASSRLS option on roles.
-* [New] Added support to IS_TEMPLATE and ALLOW_CONNECTIONS options in database object.
-* [New] Added the procedures to fix old style domains in CLI.
-* [New] Added support to multiple check constraint in domains.
-* [New] Added support to sort items alphabetically (ascending) or by oid in DatabaseExplorerWidget.
-* [Change] Changed the input mode of the password field in ConnectionsConfigWidget in order to hide the passwords in the form. NOTE: the passwords are still in plain text in the config file.
-* [Change] Moved extensions from schema level to database level in order to reproduce better the PostgreSQL's behavior.
-* [Change] In GeneralConfigWidget when restoring default settings the default settings for syntax highlight are restored as well.
-* [Change] pgModeler will not try to create the plugins path anymore. This will avoid constant error messages during startup. Now, it'll silently ignore the absence of that folder and skip the plugin loading.
-* [Change] Improved the source editing in external application. The use is informed about the app running state and the contents for the source editor field are locked until the user closes the external app.
-* [Fix] Fixed the query catalog for built-in types to include the types related to domains.
-* [Fix] Fixed the extension creation, allowing only one instance of the named extension per database no matter the schema used to allocate its children objects.
-* [Fix] Fixed a bug when dropping Functions in DatabaseExplorerWidget.
-* [Fix] Fixed a bug that was causing the disabling of connections for database models created prior to 0.9.1-beta1.
-* [Fix] Fixed a bug on import process that was wrongly creating types derivated from tables/sequence/views causing duplication problems during validation.
-* [Fix] Fixed a crash on macOs when opening a second model.
-* [Fix] Fixed an issue in diff process that was generating a malformed DROP command for extensions.
-* [Fix] Fixed the diff for domains which contain multiple check constraints.
-* [Fix] Fixed a bug that was not selecting the correct spatial type in the widget.
-* [Fix] Fixed a conflict of shortcuts in DatabaseExplorerWidget. Now F5 updates a leaf/subtree and Alt+F5 performs quick refresh of the tree.
-* [Fix] Fixed a problem with sqlexecutionwidget.ui that is not building properly in Qt 5.10.
+Release date: May 14, 2018
+Changes since: v0.9.1-beta1
+
+Summary: after eight months of hard work we finally have the stable release 0.9.1. This version is a mark in the pgModeler's development and so important as the release 0.8.2 in terms of improvements because it brought features requested long ago and that will make pgModeler even better to work with, being some of them: crow's foot notation support, multiple relationships for the same table pair, support to row level security, identity columns and much more.
+
+For this release specifically (considering only the work after 0.9.1-beta1), the golden rule was to fix bugs, adjust the current features and introduce few new things and thus was done: 21 bug fixes, 14 changes/improvements and 7 new features.
+
+The majority of new features are related to the CLI which received the ability to import and diff databases which can make it even better to integrate to automtated deployment processess or run quick tasks over models or databases without the need to open pgModeler's GUI.
+
+Some important improvements were done in the overall performance of the SQL tool. The query execution and results display are a lot better now being quicker and less eager in terms of memory consumption avoiding crashes when querying large tables. The data manipulation also received a patch that makes the row duplication more efficient.
+
+Now, for the fixes, another patch was introduced in order to resize correctly dialogs in HiDPI/Retina displays. Several reverse engineering bugs were fixes and now databases are imported more precisely compared to previous releases. Lastly, a bug that seems to happen only on macOS while dealing with large models is finally fixed and was related to some running threads messing around with the main process avoiding it to correctly save the model and causing hang ups sometimes.
+
+The whole set of changes of this release (considering the alpha and beta stages) has 152 entries being 43 new features, 47 changes/improvements and 62 bug fixes. Below we highlight some of news for the work since 0.9.1-beta1, for the complete list of changes, please, take a look into the CHANGELOG.md.
+
+* [New] Added support to line selection by clicking and moving the mouse over the line numbers widget in any source code field.
+* [New] The validator now checks if the model has columns referencing spatial data types and creates the postgis extension automatically when fixing the model.
+* [New] Added support to RESTART IDENTITY on truncate tables in DatabaseExplorerWidget.
+* [New] Added support to diff operation in CLI.
+* [New] Added support to import database from CLI.
+* [New] Adding missing types regrole and regnamespace.
+* [Change] Improved the copy/duplicate operation in order to copy rules, index, trigger and policies together to their parents.
+* [Change] Added column names to the code completion widget used in the filter widget at DataManipulationForm.
+* [Change] Improved the SQLExecutionWidget in such way that it'll display large amount of data more quickly and consuming less memory.
+* [Change] Minor improvement in SQLExecutionWidget to show the amount of time took to run a query.
+* [Change] Minor improvement in the text find widgets in SQL tool in order to make them closable via dedicated button.
+* [Change] Improved the set tag operation in ModelWidget in order to cleanup the assigned tags to a set of objects.
+* [Change] Refactored all the CLI options.
+* [Change] Improved the performance of the row duplication action in DataManipulationForm.
+* [Change] Improved the performance of "Move to schema" operation.
+* [Change] Changed the behaviour of select and fade buttons in ObjectFinderWidget in such way to enable the user to select/fade the objects in the listing (or not included in the results).
+* [Fix] Fixed a bug when import identity columns in certain cases when the identity column was followed by another column which data type was not accepted for identity, e.g, text after smallint.
+* [Fix] Fixed the tab behavior on comment box in all editing forms of database objects.
+* [Fix] Fixed the catalog query for user defined types.
+* [Fix] Fixed the import of user defined types which names contains uppercase characters.
+* [Fix] Fix window scaling on HiDPI/Retina screens.
+* [Fix] Fixed a bug in ModelExportHelper that was failing to remane the database when the command appeared.
+* [Fix] Fixed a bug in CollationWidget that was referencing the collation attributes LC_??? using the wrong constant.
+* [Fix] Fixed the behaviour of the message box that warns about the need of validate the model prior to export, save or diff. Now rejecting the dialog (i.e. closing it) will be considered that the user wants to proceed with the pending operation even with an invalid model.
+* [Fix] Fixed the import of comments for constraints,triggers, index and rules.
+* [Fix] Fixed a bug in the aggregate import process.
+* [Fix] Minor fix in DataManipulationForm to avoid the generation of a where clause when the filter is filled only with spaces.
+* [Fix] Minor fix in the magnfier tool to use the same render hints as the canvas viewport.
+* [Fix] Fixed a bug in the diff process that was trying to recreate the whole database when the "Force recreation" option was set.
+* [Fix] Fixed a bug when showing the source of tables in DatabaseExplorerWidget when these objects have permissions assigned.
+* [Fix] Fixed the saving process for large models by stopping the threads related to temp models saving while the model file is being written.
diff --git a/conf/defaults/pgmodeler.conf b/conf/defaults/pgmodeler.conf
index 0d280ddfa2..38405c783c 100644
--- a/conf/defaults/pgmodeler.conf
+++ b/conf/defaults/pgmodeler.conf
@@ -37,8 +37,7 @@
align-objs-to-grid="true"
min-object-opacity="10"
history-max-length="1000"
- use-curved-lines="true"
- max-result-rows="20000"/>
+ use-curved-lines="true"/>
diff --git a/conf/dtd/pgmodeler.dtd b/conf/dtd/pgmodeler.dtd
index cdea216667..51768e16d0 100644
--- a/conf/dtd/pgmodeler.dtd
+++ b/conf/dtd/pgmodeler.dtd
@@ -44,7 +44,6 @@
-
diff --git a/conf/pgmodeler.conf b/conf/pgmodeler.conf
index 0d280ddfa2..38405c783c 100644
--- a/conf/pgmodeler.conf
+++ b/conf/pgmodeler.conf
@@ -37,8 +37,7 @@
align-objs-to-grid="true"
min-object-opacity="10"
history-max-length="1000"
- use-curved-lines="true"
- max-result-rows="20000"/>
+ use-curved-lines="true"/>
diff --git a/conf/schemas/pgmodeler.sch b/conf/schemas/pgmodeler.sch
index d68dd6ad17..74715d9844 100644
--- a/conf/schemas/pgmodeler.sch
+++ b/conf/schemas/pgmodeler.sch
@@ -48,10 +48,6 @@ $sp [ QFrame
}
AboutWidget > QFrame > QLabel#title_lbl,
-AboutWidget > QFrame > QLabel#slogan_lbl,
AboutWidget > QFrame > QLabel#about_lbl,
-AboutWidget > QFrame > QLabel#pgmodeler_ver_lbl,
AboutWidget > QFrame > QLabel#build_lbl,
AboutWidget > QFrame > QLabel#copyright_lbl {
- color: #000;
+ color: #000;
+}
+
+AboutWidget > QFrame > QLabel#pgmodeler_ver_lbl {
+ color: #4C7DD0;
}
DonateWidget > QFrame > QLabel#title_lbl,
@@ -436,23 +438,8 @@ QTabWidget#models_tbw > QTabBar::tab:selected {
margin-top: 0px;
}
-/*QSplitter#h_splitter::handle {
- background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFAFA , stop: 1 #E0E0E0);
-} */
-
-/*QSplitter#h_splitter_opr_objs::handle {
- background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFAFA , stop: 1 #E0E0E0);
- border-left: 1px solid #404040;
-}*/
-
-/*QSplitter#v_splitter::handle, QSplitter#v_splitter1::handle,QSplitter#v_splitter2::handle {
- background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFAFA , stop: 1 #E0E0E0);
-} */
-
SQLToolWidget > QWidget#bg_frame {
- /*background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFAFA , stop: 1 #E0E0E0);*/
- /*border-bottom: 1px solid #d0d0d0;
- border-top: transparent;*/
+
}
/* Floating hint widget member of HintTextWidget */
@@ -471,7 +458,6 @@ HintTextWidget > QWidget
HintTextWidget > QWidget > QLabel
{
color: #0000c0;
- /*font-size: 8pt;*/
}
QTabWidget#databases_tbw > QTabBar::close-button {
diff --git a/lang/es_ES.qm b/lang/es_ES.qm
index 15fab2a28b..1ba8d10728 100644
Binary files a/lang/es_ES.qm and b/lang/es_ES.qm differ
diff --git a/lang/es_ES.ts b/lang/es_ES.ts
index 2ea09f6e30..f453b0c496 100644
--- a/lang/es_ES.ts
+++ b/lang/es_ES.ts
@@ -282,7 +282,7 @@ Danúbio Viana Nogueira
- Funtion Inputs
+ Function InputsEntradas de Funciones
@@ -2301,7 +2301,7 @@ Desmarcando esto hará que el SQL que se adjunta al final del mandato CREATE DAT
- <strong>WARNING:</strong> Once commited its not possible to undo the changes! Proceed with saving?
+ <strong>WARNING:</strong> Once committed its not possible to undo the changes! Proceed with saving?<strong>WARNING:</strong> Una vez que su cometido no es posible deshacer los cambios! Procedo con salvar?
@@ -3678,7 +3678,7 @@ Ref. column(s): %2
- Importing process sucessfuly ended!
+ Importing process successfully ended!Proceso de Importación terminado satisfactoriamente!
@@ -5208,7 +5208,7 @@ Mensage retornada por el SGBD: `%1'
- Assignement of an invalid object name pattern to the relationship `%1'!
+ Assignment of an invalid object name pattern to the relationship `%1'!Asignacion de un patrón de nombre de objeto no válido a la relación `%1'!
@@ -5766,7 +5766,7 @@ Mensage retornada por el SGBD: `%1'
- Souce code editor:
+ Source code editor:
@@ -5776,7 +5776,7 @@ Mensage retornada por el SGBD: `%1'
- Clear the entire SQL comand history.
+ Clear the entire SQL command history.
@@ -5806,7 +5806,7 @@ Mensage retornada por el SGBD: `%1'
- Souce code editor args:
+ Source code editor args:
@@ -6271,7 +6271,7 @@ Mensage retornada por el SGBD: `%1'
- Toogle the model validation widgets
+ Toggle the model validation widgetsCambiar el modelo de validación del widgets
@@ -7586,7 +7586,7 @@ Mensage retornada por el SGBD: `%1'
- This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separeted by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result.
+ This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separated by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result.
@@ -7822,7 +7822,7 @@ Mensage retornada por el SGBD: `%1'
- This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separeted by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result.
+ This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separated by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result.
@@ -8001,7 +8001,7 @@ Mensage retornada por el SGBD: `%1'
- Exporting process sucessfuly ended!
+ Exporting process successfully ended!Proceso de exportación terminó satisfactoriamente!
@@ -12451,7 +12451,7 @@ modos se describen a continuación.
-- NOTE: the code below contains the SQL for the selected object
-- as well for its dependencies and children (if applicable).
--
--- This feature is only a convinience in order to permit you to test
+-- This feature is only a convenience in order to permit you to test
-- the whole object's SQL definition at once.
--
-- When exporting or generating the SQL for the whole database model
@@ -12610,7 +12610,7 @@ modos se describen a continuación.
- Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands.
+ Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely ignored when generating the <strong>INSERT</strong> commands.
diff --git a/lang/fr_FR.qm b/lang/fr_FR.qm
index 7b1f0ecfd4..eb60e10b67 100644
Binary files a/lang/fr_FR.qm and b/lang/fr_FR.qm differ
diff --git a/lang/fr_FR.ts b/lang/fr_FR.ts
index c10f2c124d..5ec9da9fb8 100644
--- a/lang/fr_FR.ts
+++ b/lang/fr_FR.ts
@@ -227,7 +227,7 @@
Condition initiale:
- Funtion Inputs
+ Function InputsEntrées de la fonction
@@ -1834,7 +1834,7 @@ Sinon (décoché) pgModeler ajoutera ce code après la commande SQL CREATE DATAB
[données binaires]
- <strong>WARNING:</strong> Once commited its not possible to undo the changes! Proceed with saving?
+ <strong>WARNING:</strong> Once committed its not possible to undo the changes! Proceed with saving?<strong>ATTENTION:</strong> Une fois validés (Commit), il ne sera plus possible d'annuler les changements ! Sauvegarder les changements ?
@@ -2896,7 +2896,7 @@ Ref. column(s): %2Processus d'importation interrompu par l'utilisateur !
- Importing process sucessfuly ended!
+ Importing process successfully ended!Processus d'importation terminé avec succès !
@@ -4106,7 +4106,7 @@ Message returned by the DBMS: `%1'
- Assignement of an invalid object name pattern to the relationship `%1'!
+ Assignment of an invalid object name pattern to the relationship `%1'!
@@ -5450,7 +5450,7 @@ Voulez-vous vraiment le FERMER SANS le SAUVEGARDER?
- Toogle the model validation widgets
+ Toggle the model validation widgets
@@ -6425,7 +6425,7 @@ Voulez-vous vraiment le FERMER SANS le SAUVEGARDER?
Processus d'exportation annulé par l'utilisateur!
- Exporting process sucessfuly ended!
+ Exporting process successfully ended!Processus d'exportation terminé avec succès!
@@ -9986,7 +9986,7 @@ accepted structure. All available options are described below.
-- NOTE: the code below contains the SQL for the selected object
-- as well for its dependencies and children (if applicable).
--
--- This feature is only a convinience in order to permit you to test
+-- This feature is only a convenience in order to permit you to test
-- the whole object's SQL definition at once.
--
-- When exporting or generating the SQL for the whole database model
@@ -10076,7 +10076,7 @@ accepted structure. All available options are described below.Ins
- Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands.
+ Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely ignored when generating the <strong>INSERT</strong> commands.
diff --git a/lang/nl_NL.qm b/lang/nl_NL.qm
index 5a3df20d0b..eedb44c49b 100644
Binary files a/lang/nl_NL.qm and b/lang/nl_NL.qm differ
diff --git a/lang/nl_NL.ts b/lang/nl_NL.ts
index 83dfa028b2..46aeedffd7 100644
--- a/lang/nl_NL.ts
+++ b/lang/nl_NL.ts
@@ -270,7 +270,7 @@
- Funtion Inputs
+ Function InputsFunctie Invoer
@@ -2262,7 +2262,7 @@ Deze optie afvinken zorgt ervoor dat de SQL wordt ingevoegd na het CREATE DATABA
- <strong>WARNING:</strong> Once commited its not possible to undo the changes! Proceed with saving?
+ <strong>WARNING:</strong> Once committed its not possible to undo the changes! Proceed with saving?<strong>OPGEPAST: </strong> Eens toegepast is het niet langer mogelijk om aanpassingen ongedaan te maken! Bent u zeker dat u wilt opslaan?
@@ -3532,7 +3532,7 @@ Ref. column(s): %2
- Importing process sucessfuly ended!
+ Importing process successfully ended!Het import proces werd succesvol beëindigt!
@@ -5024,7 +5024,7 @@ Het bericht dat terugkwam van de DBMS is: `%1'
- Assignement of an invalid object name pattern to the relationship `%1'!
+ Assignment of an invalid object name pattern to the relationship `%1'!Toewijzijng van een ongeldig objectnaamspatroon aan de relatie `%1'!
@@ -6092,7 +6092,7 @@ Het bericht dat terugkwam van de DBMS is: `%1'
- Toogle the model validation widgets
+ Toggle the model validation widgetsToon of verberg het modelvalidatie-widget
@@ -7925,7 +7925,7 @@ Het bericht dat terugkwam van de DBMS is: `%1'
- Exporting process sucessfuly ended!
+ Exporting process successfully ended!Het export proces werd succesvol beëindigt!
@@ -12347,7 +12347,7 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr
-- NOTE: the code below contains the SQL for the selected object
-- as well for its dependencies and children (if applicable).
--
--- This feature is only a convinience in order to permit you to test
+-- This feature is only a convenience in order to permit you to test
-- the whole object's SQL definition at once.
--
-- When exporting or generating the SQL for the whole database model
@@ -12472,7 +12472,7 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr
- Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands.
+ Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely ignored when generating the <strong>INSERT</strong> commands.
diff --git a/lang/pt_BR.qm b/lang/pt_BR.qm
index 9060df3e01..23863665a5 100644
Binary files a/lang/pt_BR.qm and b/lang/pt_BR.qm differ
diff --git a/lang/pt_BR.ts b/lang/pt_BR.ts
index caf91dac77..8ed286f7a6 100644
--- a/lang/pt_BR.ts
+++ b/lang/pt_BR.ts
@@ -275,7 +275,7 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de
Condição Inicial:
- Funtion Inputs
+ Function InputsEntradas da Função
@@ -2640,7 +2640,7 @@ Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE
- <strong>WARNING:</strong> Once commited its not possible to undo the changes! Proceed with saving?
+ <strong>WARNING:</strong> Once committed its not possible to undo the changes! Proceed with saving?
@@ -3628,7 +3628,7 @@ Ref. column(s): %2
- Importing process sucessfuly ended!
+ Importing process successfully ended!
@@ -5853,7 +5853,7 @@ Message returned by the DBMS: `%1'
- Assignement of an invalid object name pattern to the relationship `%1'!
+ Assignment of an invalid object name pattern to the relationship `%1'!
@@ -6238,7 +6238,7 @@ Message returned by the DBMS: `%1'
Criando objetos No banco de dados '%1'...
- Exporting process sucessfuly ended!
+ Exporting process successfully ended!Exportação finalizada com sucesso!
@@ -6553,7 +6553,7 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da
Condição Inicial:
- Funtion Inputs
+ Function InputsEntradas da Função
@@ -7971,7 +7971,7 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da
- Toogle the model validation widgets
+ Toggle the model validation widgets
@@ -9124,7 +9124,7 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da
Criando objetos No banco de dados '%1'...
- Exporting process sucessfuly ended!
+ Exporting process successfully ended!Processo de exportação finalizado com sucesso!
@@ -13704,7 +13704,7 @@ disponíveis estão descritos abaixo.
-- NOTE: the code below contains the SQL for the selected object
-- as well for its dependencies and children (if applicable).
--
--- This feature is only a convinience in order to permit you to test
+-- This feature is only a convenience in order to permit you to test
-- the whole object's SQL definition at once.
--
-- When exporting or generating the SQL for the whole database model
@@ -13916,7 +13916,7 @@ disponíveis estão descritos abaixo.
- Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands.
+ Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely ignored when generating the <strong>INSERT</strong> commands.
diff --git a/lang/zh_CN.qm b/lang/zh_CN.qm
index 45596b5ae3..a665ef83cd 100644
Binary files a/lang/zh_CN.qm and b/lang/zh_CN.qm differ
diff --git a/lang/zh_CN.ts b/lang/zh_CN.ts
index deba0c9869..0925a59292 100644
--- a/lang/zh_CN.ts
+++ b/lang/zh_CN.ts
@@ -270,7 +270,7 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G
最终条件:
- Funtion Inputs
+ Function Inputs函数输入
@@ -1953,7 +1953,7 @@ Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE
- <strong>WARNING:</strong> Once commited its not possible to undo the changes! Proceed with saving?
+ <strong>WARNING:</strong> Once committed its not possible to undo the changes! Proceed with saving?
@@ -2941,7 +2941,7 @@ Ref. column(s): %2
- Importing process sucessfuly ended!
+ Importing process successfully ended!
@@ -4543,7 +4543,7 @@ Message returned by the DBMS: `%1'
- Assignement of an invalid object name pattern to the relationship `%1'!
+ Assignment of an invalid object name pattern to the relationship `%1'!
@@ -5817,7 +5817,7 @@ Message returned by the DBMS: `%1'
- Toogle the model validation widgets
+ Toggle the model validation widgets
@@ -6950,7 +6950,7 @@ Message returned by the DBMS: `%1'
正在对数据库 '%1' 创建对象...
- Exporting process sucessfuly ended!
+ Exporting process successfully ended!成功导出!
@@ -10764,7 +10764,7 @@ p, li { white-space: pre-wrap; }
-- NOTE: the code below contains the SQL for the selected object
-- as well for its dependencies and children (if applicable).
--
--- This feature is only a convinience in order to permit you to test
+-- This feature is only a convenience in order to permit you to test
-- the whole object's SQL definition at once.
--
-- When exporting or generating the SQL for the whole database model
@@ -10846,7 +10846,7 @@ p, li { white-space: pre-wrap; }
Ins
- Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands.
+ Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely ignored when generating the <strong>INSERT</strong> commands.
diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp
index 396741816e..1a21cd06a7 100644
--- a/libobjrenderer/src/baseobjectview.cpp
+++ b/libobjrenderer/src/baseobjectview.cpp
@@ -638,10 +638,12 @@ double BaseObjectView::getFontFactor(void)
double BaseObjectView::getScreenDpiFactor(void)
{
- double factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f;
+ QScreen *screen = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()));
+ double factor = screen->logicalDotsPerInch() / 96.0f;
+ double pixel_ratio = screen->devicePixelRatio();
if(factor < 1)
return (1);
- return(factor);
+ return(factor * pixel_ratio);
}
diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp
index 1e50e9beda..362d3f76f2 100644
--- a/libobjrenderer/src/basetableview.cpp
+++ b/libobjrenderer/src/basetableview.cpp
@@ -356,13 +356,14 @@ void BaseTableView::__configureObject(float width)
QPen pen = ext_attribs_body->pen();
float py = 0;
float factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f;
+ float pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio();
ext_attribs_toggler->setVisible(true);
ext_attribs_tog_arrow->setVisible(true);
ext_attribs_toggler->setPen(pen);
ext_attribs_toggler->setBrush(ext_attribs_body->brush());
- ext_attribs_toggler->setRect(QRectF(0, 0, width, 12 * factor));
+ ext_attribs_toggler->setRect(QRectF(0, 0, width, 12 * factor * pixel_ratio));
if(!tab->isExtAttribsHidden())
{
@@ -383,14 +384,14 @@ void BaseTableView::__configureObject(float width)
if(!tab->isExtAttribsHidden())
{
pol.append(QPointF(0,0));
- pol.append(QPointF(-5 * factor, 6 * factor));
- pol.append(QPointF(5 * factor, 6 * factor));
+ pol.append(QPointF(-5 * factor * pixel_ratio, 6 * factor * pixel_ratio));
+ pol.append(QPointF(5 * factor * pixel_ratio, 6 * factor * pixel_ratio));
}
else
{
- pol.append(QPointF(0,6 * factor));
- pol.append(QPointF(-5 * factor, 0));
- pol.append(QPointF(5 * factor, 0));
+ pol.append(QPointF(0,6 * factor * pixel_ratio));
+ pol.append(QPointF(-5 * factor * pixel_ratio, 0));
+ pol.append(QPointF(5 * factor * pixel_ratio, 0));
}
QLinearGradient grad(QPointF(0,0),QPointF(0,1));
diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp
index dd0f7709ba..3a3068e96d 100644
--- a/libparsers/src/parsersattributes.cpp
+++ b/libparsers/src/parsersattributes.cpp
@@ -291,7 +291,6 @@ namespace ParsersAttributes {
MATERIALIZED=QString("materialized"),
MAX_CONNECTIONS=QString("max-connections"),
MAX_VALUE=QString("max-value"),
- MAX_RESULT_ROWS=QString("max-result-rows"),
MEMBER_ROLES=QString("member-roles"),
MEMBER=QString("member"),
MERGES=QString("merges"),
@@ -410,6 +409,7 @@ namespace ParsersAttributes {
RENAME=QString("rename"),
REPLICATION=QString("replication"),
RESTRICTION_FUNC=QString("restriction"),
+ RESTART_SEQ=QString("restart-seq"),
RETURN_TABLE=QString("return-table"),
RETURN_TYPE=QString("return-type"),
RETURNS_SETOF=QString("returns-setof"),
diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h
index d06ce98284..c58b148a6f 100644
--- a/libparsers/src/parsersattributes.h
+++ b/libparsers/src/parsersattributes.h
@@ -306,7 +306,6 @@ namespace ParsersAttributes {
MATERIALIZED,
MAX_CONNECTIONS,
MAX_VALUE,
- MAX_RESULT_ROWS,
MEMBER_ROLES,
MEMBER,
MERGES,
@@ -424,6 +423,7 @@ namespace ParsersAttributes {
RELATIONSHIP,
RENAME,
REPLICATION,
+ RESTART_SEQ,
RESTRICTION_FUNC,
RETURN_TABLE,
RETURN_TYPE,
diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp
index 201a197e27..1e9b59e006 100644
--- a/libpgmodeler/src/databasemodel.cpp
+++ b/libpgmodeler/src/databasemodel.cpp
@@ -6802,7 +6802,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b
{
for(auto &object : (*obj_list))
{
- /* If the object is a FK relationship it's stored in a separeted list in order to have the
+ /* If the object is a FK relationship it's stored in a separated list in order to have the
code generated at end of whole definition (after foreign keys definition) */
if(object->getObjectType()==BASE_RELATIONSHIP &&
dynamic_cast(object)->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK)
@@ -8101,7 +8101,10 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector
{
col=tab->getColumn(i1);
- if(!col->isAddedByRelationship() && col->getType()==ptr_pgsqltype)
+ if(!col->isAddedByRelationship() &&
+ (col->getType()==ptr_pgsqltype ||
+ //Special case for postgis extension
+ (obj_type == OBJ_EXTENSION && object->getName() == QString("postgis") && col->getType().isGiSType())))
{
refer=true;
refs.push_back(col);
@@ -8808,6 +8811,15 @@ void DatabaseModel::__getObjectReferences(BaseObject *object, vector &objects)
+{
+ for(auto &obj : objects)
+ {
+ if(BaseGraphicObject::isGraphicObject(obj->getObjectType()))
+ dynamic_cast(obj)->setModified(true);
+ }
+}
+
void DatabaseModel::setObjectsModified(vector types)
{
ObjectType obj_types[]={OBJ_TABLE, OBJ_VIEW,
diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h
index 11406b0ad2..f0cde903cb 100644
--- a/libpgmodeler/src/databasemodel.h
+++ b/libpgmodeler/src/databasemodel.h
@@ -561,10 +561,13 @@ class DatabaseModel: public QObject, public BaseObject {
meaning that ALL objects directly or inderectly linked to the 'object' are retrieved. */
void __getObjectReferences(BaseObject *object, vector &refs, bool exclude_perms=false);
- /*! \brief Marks the graphical objects as modified forcing their redraw. User can specify only a set of
+ /*! \brief Marks the graphical objects of the provided types as modified forcing their redraw. User can specify only a set of
graphical objects to be marked */
void setObjectsModified(vector types={});
+ //! \brief Marks the graphical objects in the list as modified forcing their redraw.
+ void setObjectsModified(vector &objects);
+
/*! \brief Marks the objects with code invalidated forcing their code regeneration. User can specify only a set of
graphical objects to be marked */
void setCodesInvalidated(vector types={});
diff --git a/libpgmodeler_ui/libpgmodeler_ui.pro b/libpgmodeler_ui/libpgmodeler_ui.pro
index e0eacb7103..48455934a5 100644
--- a/libpgmodeler_ui/libpgmodeler_ui.pro
+++ b/libpgmodeler_ui/libpgmodeler_ui.pro
@@ -112,7 +112,8 @@ SOURCES += src/mainwindow.cpp \
src/sceneinfowidget.cpp \
src/bulkdataeditwidget.cpp \
src/policywidget.cpp \
- src/objectstablewidget.cpp
+ src/objectstablewidget.cpp \
+ src/resultsetmodel.cpp
HEADERS += src/mainwindow.h \
@@ -212,7 +213,8 @@ HEADERS += src/mainwindow.h \
src/sceneinfowidget.h \
src/bulkdataeditwidget.h \
src/policywidget.h \
- src/objectstablewidget.h
+ src/objectstablewidget.h \
+ src/resultsetmodel.h
FORMS += ui/mainwindow.ui \
ui/textboxwidget.ui \
diff --git a/libpgmodeler_ui/src/aboutwidget.cpp b/libpgmodeler_ui/src/aboutwidget.cpp
index 5c36d6391d..7e01b667c3 100644
--- a/libpgmodeler_ui/src/aboutwidget.cpp
+++ b/libpgmodeler_ui/src/aboutwidget.cpp
@@ -31,14 +31,13 @@ AboutWidget::AboutWidget(QWidget *parent) : QWidget(parent)
drop_shadow->setBlurRadius(30);
this->setGraphicsEffect(drop_shadow);
- pgmodeler_ver_lbl->setText(QString("v%1").arg(GlobalAttributes::PGMODELER_VERSION));
- build_num_lbl->setText(GlobalAttributes::PGMODELER_BUILD_NUMBER);
-
- for(int row=0; row < contributors_tab->rowCount(); row++)
- contributors_tab->item(row, 2)->setToolTip(contributors_tab->item(row, 2)->text().replace(QString("; "), QString(";\n")));
+ PgModelerUiNS::configureWidgetFont(title_lbl, PgModelerUiNS::HUGE_FONT_FACTOR);
+ PgModelerUiNS::configureWidgetFont(pgmodeler_ver_lbl, PgModelerUiNS::HUGE_FONT_FACTOR);
+ PgModelerUiNS::configureWidgetFont(build_lbl, PgModelerUiNS::BIG_FONT_FACTOR);
+ PgModelerUiNS::configureWidgetFont(build_num_lbl, PgModelerUiNS::BIG_FONT_FACTOR);
- contributors_tab->sortByColumn(0, Qt::AscendingOrder);
- contributors_tab->resizeColumnsToContents();
+ pgmodeler_ver_lbl->setText(QString("v%1 ").arg(GlobalAttributes::PGMODELER_VERSION));
+ build_num_lbl->setText(QString("%1 Qt %2").arg(GlobalAttributes::PGMODELER_BUILD_NUMBER).arg(QT_VERSION_STR));
connect(hide_tb, &QToolButton::clicked, this,
[&](){
@@ -46,12 +45,6 @@ AboutWidget::AboutWidget(QWidget *parent) : QWidget(parent)
emit s_visibilityChanged(false);
});
- PgModelerUiNS::configureWidgetFont(title_lbl, PgModelerUiNS::HUGE_FONT_FACTOR);
- PgModelerUiNS::configureWidgetFont(slogan_lbl, PgModelerUiNS::BIG_FONT_FACTOR);
- PgModelerUiNS::configureWidgetFont(pgmodeler_ver_lbl, PgModelerUiNS::HUGE_FONT_FACTOR);
- PgModelerUiNS::configureWidgetFont(build_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR);
- PgModelerUiNS::configureWidgetFont(build_num_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR);
-
float factor = BaseObjectView::getScreenDpiFactor();
this->adjustSize();
this->resize(this->minimumWidth() * factor, this->minimumHeight() * factor);
diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp
index 15104d7136..6bfb5c8178 100644
--- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp
+++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp
@@ -384,7 +384,7 @@ void AppearanceConfigWidget::restoreDefaults(void)
{
try
{
- BaseConfigWidget::restoreDefaults(GlobalAttributes::OBJECTS_STYLE_CONF);
+ BaseConfigWidget::restoreDefaults(GlobalAttributes::OBJECTS_STYLE_CONF, false);
this->loadConfiguration();
setConfigurationChanged(true);
}
diff --git a/libpgmodeler_ui/src/baseconfigwidget.cpp b/libpgmodeler_ui/src/baseconfigwidget.cpp
index 8a94221c0b..e211d74e14 100644
--- a/libpgmodeler_ui/src/baseconfigwidget.cpp
+++ b/libpgmodeler_ui/src/baseconfigwidget.cpp
@@ -99,7 +99,7 @@ void BaseConfigWidget::saveConfiguration(const QString &conf_id, map%1!").arg(bkp_filename), Messagebox::INFO_ICON);
diff --git a/libpgmodeler_ui/src/baseconfigwidget.h b/libpgmodeler_ui/src/baseconfigwidget.h
index 572f584f5f..9225a529ba 100644
--- a/libpgmodeler_ui/src/baseconfigwidget.h
+++ b/libpgmodeler_ui/src/baseconfigwidget.h
@@ -55,8 +55,9 @@ class BaseConfigWidget: public QWidget {
//! \brief Get a configuratoin key from the xml parser
void getConfigurationParams(map &config_params, const vector &key_attribs);
- //! \brief Restore the configuration specified by conf_in loading them from the original file (conf/defaults)
- void restoreDefaults(const QString &conf_id);
+ /*! \brief Restore the configuration specified by conf_in loading them from the original file (conf/defaults)
+ * The silent parameter indicates that the restoration should not emit a message box informing the restoration sucess */
+ void restoreDefaults(const QString &conf_id, bool silent);
//! \brief Adds a parameter to the specified configuration parameters set
static void addConfigurationParam(map &config_params, const QString ¶m, const attribs_map &attribs);
diff --git a/libpgmodeler_ui/src/baseform.cpp b/libpgmodeler_ui/src/baseform.cpp
index 309c2b35b7..6899100882 100644
--- a/libpgmodeler_ui/src/baseform.cpp
+++ b/libpgmodeler_ui/src/baseform.cpp
@@ -46,10 +46,12 @@ void BaseForm::resizeForm(QWidget *widget)
screen_id = qApp->desktop()->screenNumber(qApp->activeWindow());
QScreen *screen=qApp->screens().at(screen_id);
float dpi_factor = 0;
+ float pixel_ratio = 0;
max_w = screen->size().width() * 0.70;
max_h = screen->size().height() * 0.70;
dpi_factor = screen->logicalDotsPerInch() / 96.0f;
+ pixel_ratio = screen->devicePixelRatio();
if(dpi_factor <= 1.01f)
dpi_factor = 1.0f;
@@ -102,8 +104,8 @@ void BaseForm::resizeForm(QWidget *widget)
((buttons_lt->contentsMargins().top() +
buttons_lt->contentsMargins().bottom()) * 6);
- curr_w *= dpi_factor;
- curr_h *= dpi_factor;
+ curr_w *= dpi_factor * pixel_ratio;
+ curr_h *= dpi_factor * pixel_ratio;
if(curr_w > screen->size().width())
curr_w = screen->size().width() * 0.80;
diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp
index 5324a4f59e..737dd633a0 100644
--- a/libpgmodeler_ui/src/codecompletionwidget.cpp
+++ b/libpgmodeler_ui/src/codecompletionwidget.cpp
@@ -35,7 +35,7 @@ CodeCompletionWidget::CodeCompletionWidget(QPlainTextEdit *code_field_txt, bool
name_list=new QListWidget(completion_wgt);
name_list->setSpacing(2);
name_list->setIconSize(QSize(16,16));
- name_list->setSortingEnabled(true);
+ name_list->setSortingEnabled(false);
persistent_chk=new QCheckBox(completion_wgt);
persistent_chk->setText(trUtf8("Make &persistent"));
@@ -258,6 +258,12 @@ void CodeCompletionWidget::insertCustomItems(const QStringList &names, const QSt
}
}
+void CodeCompletionWidget::insertCustomItems(const QStringList &names, const QString &tooltip, ObjectType obj_type)
+{
+ for(auto &name : names)
+ insertCustomItem(name, tooltip, QPixmap(PgModelerUiNS::getIconPath(obj_type)));
+}
+
void CodeCompletionWidget::clearCustomItems(void)
{
custom_items.clear();
diff --git a/libpgmodeler_ui/src/codecompletionwidget.h b/libpgmodeler_ui/src/codecompletionwidget.h
index 347104e912..d8faf7a3d5 100644
--- a/libpgmodeler_ui/src/codecompletionwidget.h
+++ b/libpgmodeler_ui/src/codecompletionwidget.h
@@ -112,11 +112,14 @@ class CodeCompletionWidget: public QWidget
highlighter uses an different configuration */
void configureCompletion(DatabaseModel *db_model, SyntaxHighlighter *syntax_hl=nullptr, const QString &keywords_grp=QString("keywords"));
- //! \brief Inserts a custom named item on the list with a custom icon. Custom item will be always appear at the beggining of the list
+ //! \brief Inserts a custom named item on the list with a custom icon. Custom item will always appear at the beggining of the list
void insertCustomItem(const QString &name, const QString &tooltip, const QPixmap &icon);
- //! \brief Inserts several custom named item on the list with a custom icon. Custom item will be always appear at the beggining of the list
+ //! \brief Inserts several custom named item on the list with a custom icon. Custom item will always appear at the beggining of the list
void insertCustomItems(const QStringList &names, const QStringList &tooltips, const QPixmap &icon);
+
+//! \brief Inserts several custom named items on the list with an icon related to the obj_type. Custom item will always appear at the beggining of the list
+ void insertCustomItems(const QStringList &names, const QString &tooltip, ObjectType obj_type);
//! \brief Clear the custom added items
void clearCustomItems(void);
diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp
index 6af970c210..6a764e5dda 100644
--- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp
+++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp
@@ -451,7 +451,7 @@ void ConnectionsConfigWidget::restoreDefaults(void)
try
{
//Restore the default connection config file
- BaseConfigWidget::restoreDefaults(GlobalAttributes::CONNECTIONS_CONF);
+ BaseConfigWidget::restoreDefaults(GlobalAttributes::CONNECTIONS_CONF, false);
//Remove all connections
while(connections_cmb->count() > 0)
diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp
index 1f47174fe2..d93cc10784 100644
--- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp
+++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp
@@ -93,7 +93,8 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n {
{SERVER_VERSION, QT_TR_NOOP("Server version")}, {IDENT_FILE, QT_TR_NOOP("Ident file")}, {PASSWORD_ENCRYPTION, QT_TR_NOOP("Password encryption")},
{CONNECTION, QT_TR_NOOP("Connection ID")}, {SERVER_PID, QT_TR_NOOP("Server PID")}, {SERVER_PROTOCOL, QT_TR_NOOP("Server protocol")},
{REFERRERS, QT_TR_NOOP("Referrers")}, {IDENTITY_TYPE, QT_TR_NOOP("Identity")}, {COMMAND, QT_TR_NOOP("Command")},
- {USING_EXP, QT_TR_NOOP("USING expr.")}, {CHECK_EXP, QT_TR_NOOP("CHECK expr.")}, {ROLES, QT_TR_NOOP("Roles")}
+ {USING_EXP, QT_TR_NOOP("USING expr.")}, {CHECK_EXP, QT_TR_NOOP("CHECK expr.")}, {ROLES, QT_TR_NOOP("Roles")},
+ {RLS_ENABLED, QT_TR_NOOP("RLS enabled")}, {RLS_FORCED, QT_TR_NOOP("RLS forced")}
};
DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent)
@@ -509,7 +510,9 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs)
void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs)
{
formatBooleanAttribs(attribs, { ParsersAttributes::OIDS,
- ParsersAttributes::UNLOGGED });
+ ParsersAttributes::UNLOGGED,
+ ParsersAttributes::RLS_ENABLED,
+ ParsersAttributes::RLS_FORCED});
formatOidAttribs(attribs, { ParsersAttributes::PARENTS }, OBJ_TABLE, true);
}
@@ -1265,6 +1268,7 @@ void DatabaseExplorerWidget::truncateTable(QTreeWidgetItem *item, bool cascade)
else
msg=trUtf8("Do you really want to cascade truncate the table %1? This action will truncate all the tables that depends on it?").arg(obj_name);
+ msg_box.setCustomOptionText(trUtf8("Also restart sequences"));
msg_box.show(msg, Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS);
if(msg_box.result()==QDialog::Accepted)
@@ -1276,7 +1280,7 @@ void DatabaseExplorerWidget::truncateTable(QTreeWidgetItem *item, bool cascade)
attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(OBJ_TABLE);
attribs[ParsersAttributes::SIGNATURE]=sch_name + QString(".\"%1\"").arg(obj_name);
attribs[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : "");
-
+ attribs[ParsersAttributes::RESTART_SEQ]=(msg_box.isCustomOptionChecked() ? ParsersAttributes::_TRUE_ : "");
//Generate the truncate command
schparser.ignoreEmptyAttributes(true);
diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp
index a52611c7b0..aa30540b1b 100644
--- a/libpgmodeler_ui/src/databaseimportform.cpp
+++ b/libpgmodeler_ui/src/databaseimportform.cpp
@@ -529,7 +529,7 @@ void DatabaseImportForm::handleImportFinished(Exception e)
model_wgt->getDatabaseModel()->setInvalidated(false);
- finishImport(trUtf8("Importing process sucessfuly ended!"));
+ finishImport(trUtf8("Importing process successfully ended!"));
ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_info")));
import_helper->closeConnection();
diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp
index 8743cae066..3030f94852 100644
--- a/libpgmodeler_ui/src/databaseimporthelper.cpp
+++ b/libpgmodeler_ui/src/databaseimporthelper.cpp
@@ -1670,8 +1670,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs)
{
/* Building the type name prepending the schema name in order to search it on
the user defined types list at PgSQLType class */
- type_name=getObjectName(types[type_oid][ParsersAttributes::SCHEMA], true);
- type_name+=QString(".") + types[type_oid][ParsersAttributes::NAME];
+ type_name=BaseObject::formatName(getObjectName(types[type_oid][ParsersAttributes::SCHEMA], true), false);
+ type_name+=QString(".") + BaseObject::formatName(types[type_oid][ParsersAttributes::NAME], false);
is_type_registered=PgSQLType::isRegistered(type_name, dbmodel);
}
else
@@ -1695,6 +1695,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs)
type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], OBJ_DOMAIN);
}
+ col.setIdentityType(BaseType::null);
col.setType(PgSQLType::parseString(type_name));
col.setNotNull(!itr->second[ParsersAttributes::NOT_NULL].isEmpty());
col.setComment(itr->second[ParsersAttributes::COMMENT]);
diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp
index 64ab8b381e..eee33987ce 100644
--- a/libpgmodeler_ui/src/datamanipulationform.cpp
+++ b/libpgmodeler_ui/src/datamanipulationform.cpp
@@ -374,6 +374,9 @@ void DataManipulationForm::retrieveData(void)
paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() &&
table_cmb->currentData().toUInt() == OBJ_TABLE &&
!col_names.isEmpty());
+
+ code_compl_wgt->clearCustomItems();
+ code_compl_wgt->insertCustomItems(col_names, trUtf8("Column"), OBJ_COLUMN);
}
catch(Exception &e)
{
@@ -1227,7 +1230,7 @@ void DataManipulationForm::saveChanges(void)
QString cmd;
Messagebox msg_box;
- msg_box.show(trUtf8("WARNING: Once commited its not possible to undo the changes! Proceed with saving?"),
+ msg_box.show(trUtf8("WARNING: Once committed its not possible to undo the changes! Proceed with saving?"),
Messagebox::ALERT_ICON,
Messagebox::YES_NO_BUTTONS);
diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp
index 80bd4c378a..b9dada0f9d 100644
--- a/libpgmodeler_ui/src/generalconfigwidget.cpp
+++ b/libpgmodeler_ui/src/generalconfigwidget.cpp
@@ -86,8 +86,6 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa
connect(tab_width_chk, SIGNAL(toggled(bool)), tab_width_spb, SLOT(setEnabled(bool)));
connect(tab_width_chk, SIGNAL(toggled(bool)), this, SLOT(updateFontPreview()));
- connect(max_result_rows_chk, SIGNAL(toggled(bool)), max_result_rows_spb, SLOT(setEnabled(bool)));
-
connect(font_preview_txt, SIGNAL(cursorPositionChanged()), this, SLOT(updateFontPreview()));
connect(select_editor_btn, SIGNAL(clicked(bool)), this, SLOT(selectSourceEditor()));
@@ -129,7 +127,6 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa
config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_APP]=QString();
config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::UI_LANGUAGE]=QString();
config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_CURVED_LINES]=QString();
- config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MAX_RESULT_ROWS]=QString();
simp_obj_creation_ht=new HintTextWidget(simp_obj_creation_hint, this);
simp_obj_creation_ht->setText(simple_obj_creation_chk->statusTip());
@@ -182,9 +179,6 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa
use_curved_lines_ht=new HintTextWidget(use_curved_lines_hint, this);
use_curved_lines_ht->setText(use_curved_lines_chk->statusTip());
- max_result_rows_ht=new HintTextWidget(max_result_rows_hint, this);
- max_result_rows_ht->setText(max_result_rows_spb->statusTip());
-
selectPaperSize();
QList chk_boxes=this->findChildren();
@@ -308,11 +302,6 @@ void GeneralConfigWidget::loadConfiguration(void)
min_obj_opacity_spb->setValue(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MIN_OBJECT_OPACITY].toUInt());
- int value = config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MAX_RESULT_ROWS].toInt();
- max_result_rows_chk->setChecked(value > 0);
- max_result_rows_spb->setEnabled(value > 0);
- max_result_rows_spb->setValue(value);
-
margin=config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_MARGIN].split(',');
custom_size=config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_CUSTOM_SIZE].split(',');
@@ -433,7 +422,6 @@ void GeneralConfigWidget::saveConfiguration(void)
config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MIN_OBJECT_OPACITY]=QString::number(min_obj_opacity_spb->value());
config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_PLACEHOLDERS]=(use_placeholders_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString());
config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HISTORY_MAX_LENGTH]=QString::number(history_max_length_spb->value());
- config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MAX_RESULT_ROWS]=QString::number(max_result_rows_chk->isChecked() ? max_result_rows_spb->value() : 0);
config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_CURVED_LINES]=(use_curved_lines_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString());
ObjectsScene::getGridOptions(show_grid, align_grid, show_delim);
@@ -552,7 +540,6 @@ void GeneralConfigWidget::applyConfiguration(void)
MainWindow::setConfirmValidation(confirm_validation_chk->isChecked());
BaseObjectView::setPlaceholderEnabled(use_placeholders_chk->isChecked());
SQLExecutionWidget::setSQLHistoryMaxLength(history_max_length_spb->value());
- SQLExecutionWidget::setMaxResultRows(max_result_rows_chk->isChecked()? max_result_rows_spb->value() : 0);
fnt.setFamily(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT]);
fnt.setPointSize(fnt_size);
@@ -570,9 +557,10 @@ void GeneralConfigWidget::restoreDefaults(void)
{
try
{
- BaseConfigWidget::restoreDefaults(GlobalAttributes::GENERAL_CONF);
- BaseConfigWidget::restoreDefaults(GlobalAttributes::XML_HIGHLIGHT_CONF);
- BaseConfigWidget::restoreDefaults(GlobalAttributes::SQL_HIGHLIGHT_CONF);
+ BaseConfigWidget::restoreDefaults(GlobalAttributes::GENERAL_CONF, false);
+ BaseConfigWidget::restoreDefaults(GlobalAttributes::XML_HIGHLIGHT_CONF, true);
+ BaseConfigWidget::restoreDefaults(GlobalAttributes::SQL_HIGHLIGHT_CONF, true);
+ BaseConfigWidget::restoreDefaults(GlobalAttributes::UI_STYLE_CONF, true);
this->loadConfiguration();
this->applyConfiguration();
setConfigurationChanged(true);
diff --git a/libpgmodeler_ui/src/linenumberswidget.cpp b/libpgmodeler_ui/src/linenumberswidget.cpp
index 11db826fd8..eb8ffb76b6 100644
--- a/libpgmodeler_ui/src/linenumberswidget.cpp
+++ b/libpgmodeler_ui/src/linenumberswidget.cpp
@@ -19,14 +19,23 @@
#include "linenumberswidget.h"
#include
#include
+#include "exception.h"
QColor LineNumbersWidget::font_color=Qt::lightGray;
QColor LineNumbersWidget::bg_color=Qt::black;
LineNumbersWidget::LineNumbersWidget(QPlainTextEdit * parent) : QWidget(parent)
{
- first_line=line_count=0;
+ if(!parent)
+ throw Exception(ERR_ASG_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__);
+
+ parent_edt = qobject_cast(parent);
+ first_line=line_count=start_sel_pos=0;
dy=0;
+ has_selection = false;
+ start_sel_line = -1;
+
+ connect(parent_edt, SIGNAL(selectionChanged()), this, SLOT(update()));
}
void LineNumbersWidget::drawLineNumbers(unsigned first_line, unsigned line_count, int dy)
@@ -51,8 +60,20 @@ void LineNumbersWidget::setColors(const QColor &font_color, const QColor &bg_col
void LineNumbersWidget::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
- int y=dy, height=fontMetrics().height();
+ int y = dy, height = 0;
unsigned last_line=first_line + line_count;
+ QFont font = painter.font();
+ unsigned fs_line = 0, ls_line = 0;
+ QTextCursor cursor = parent_edt->textCursor();
+
+ if(cursor.hasSelection())
+ {
+ QTextCursor start = cursor, end = cursor;
+ start.setPosition(cursor.selectionStart(), QTextCursor::MoveAnchor);
+ fs_line = start.blockNumber();
+ end.setPosition(cursor.selectionEnd(), QTextCursor::KeepAnchor);
+ ls_line = end.blockNumber();
+ }
//Repaint the widget to clear previous drawn numbers
painter.fillRect(event->rect(), bg_color);
@@ -61,15 +82,77 @@ void LineNumbersWidget::paintEvent(QPaintEvent *event)
//Draw line numbers
for(unsigned lin=first_line; lin < last_line; lin++)
{
- painter.drawText(0, y, this->width(), fontMetrics().height(),
- Qt::AlignHCenter, QString::number(lin));
+ font.setBold(cursor.hasSelection() && lin-1 >= fs_line && lin-1 <= ls_line);
+ height = QFontMetrics(font).height();
+ painter.setFont(font);
+
+ if(font.bold())
+ {
+ painter.setBrush(bg_color.dark(150));
+ painter.setPen(Qt::transparent);
+ painter.drawRect(QRect(-1, y, this->width() + 1, height));
+ painter.setPen(font_color.light(180));
+ }
+ else
+ painter.setPen(font_color);
+
+ painter.drawText(0, y, this->width(), height, Qt::AlignHCenter, QString::number(lin));
y+=height;
}
}
-QColor LineNumbersWidget::getBackgroundColor(void)
+void LineNumbersWidget::mousePressEvent(QMouseEvent *event)
{
- return(LineNumbersWidget::bg_color);
+ if(event->buttons() == Qt::LeftButton && !has_selection)
+ {
+ QTextCursor cursor = parent_edt->cursorForPosition(QPoint(0, event->pos().y()));
+
+ has_selection = true;
+ cursor.select(QTextCursor::LineUnderCursor);
+ parent_edt->setTextCursor(cursor);
+ start_sel_line = cursor.blockNumber();
+ start_sel_pos = cursor.position();
+ }
+}
+
+void LineNumbersWidget::mouseMoveEvent(QMouseEvent *event)
+{
+ if(event->buttons() == Qt::LeftButton && has_selection)
+ {
+ QTextCursor cursor = parent_edt->cursorForPosition(QPoint(0, event->pos().y())),
+ curr_cursor = parent_edt->textCursor();
+
+ //If the user wants selects lines below the first
+ if(start_sel_line < cursor.blockNumber())
+ {
+ cursor.movePosition(QTextCursor::EndOfLine);
+ curr_cursor.setPosition(cursor.position(), QTextCursor::KeepAnchor);
+ parent_edt->setTextCursor(curr_cursor);
+ }
+ //If the user wants selects lines above the first
+ else if(start_sel_line > cursor.blockNumber())
+ {
+ curr_cursor.setPosition(start_sel_pos);
+ curr_cursor.movePosition(QTextCursor::EndOfLine);
+ curr_cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, curr_cursor.position() - cursor.position());
+ parent_edt->setTextCursor(curr_cursor);
+ }
+ else
+ {
+ cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);
+ parent_edt->setTextCursor(cursor);
+ }
+
+ this->update();
+ }
}
+void LineNumbersWidget::mouseReleaseEvent(QMouseEvent *)
+{
+ has_selection = false;
+}
+QColor LineNumbersWidget::getBackgroundColor(void)
+{
+ return(LineNumbersWidget::bg_color);
+}
diff --git a/libpgmodeler_ui/src/linenumberswidget.h b/libpgmodeler_ui/src/linenumberswidget.h
index ac83e76c25..420f63b2c6 100644
--- a/libpgmodeler_ui/src/linenumberswidget.h
+++ b/libpgmodeler_ui/src/linenumberswidget.h
@@ -32,6 +32,10 @@ class LineNumbersWidget : public QWidget {
private:
Q_OBJECT
+ QPlainTextEdit *parent_edt;
+
+ bool has_selection;
+
//! \brief The first line number that must be drawn
unsigned first_line,
@@ -41,6 +45,8 @@ class LineNumbersWidget : public QWidget {
//! \brief The y axis increment to start drawn the line number
int dy;
+ int start_sel_line, start_sel_pos;
+
//! \brief Font color for drawn line numbers
static QColor font_color,
@@ -49,9 +55,12 @@ class LineNumbersWidget : public QWidget {
protected:
void paintEvent(QPaintEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *);
public:
- explicit LineNumbersWidget(QPlainTextEdit *parent = 0);
+ explicit LineNumbersWidget(QPlainTextEdit *parent);
/*! \brief Draw the lines starting from 'first_line' and stoping at fisrt_line + line_count -1.
The dy param. defines an initial Y translation before drawn lines */
diff --git a/libpgmodeler_ui/src/messagebox.cpp b/libpgmodeler_ui/src/messagebox.cpp
index efa66df897..4120492e6a 100644
--- a/libpgmodeler_ui/src/messagebox.cpp
+++ b/libpgmodeler_ui/src/messagebox.cpp
@@ -31,8 +31,10 @@ Messagebox::Messagebox(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
connect(show_errors_tb,SIGNAL(clicked()),this,SLOT(showExceptionList()));
connect(show_errors_tb,SIGNAL(toggled(bool)),show_raw_info_tb,SLOT(setVisible(bool)));
connect(show_raw_info_tb,SIGNAL(toggled(bool)),this,SLOT(showExceptionList(void)));
- show_errors_tb->setVisible(false);
+
show_raw_info_tb->setVisible(false);
+ error_show_btns_wgt->setVisible(false);
+ custom_option_chk->setVisible(false);
}
void Messagebox::handleYesOkClick(void)
@@ -62,6 +64,17 @@ bool Messagebox::isCancelled(void)
return(cancelled);
}
+void Messagebox::setCustomOptionText(const QString &text)
+{
+ custom_option_chk->setVisible(!text.isEmpty());
+ custom_option_chk->setText(text);
+}
+
+bool Messagebox::isCustomOptionChecked(void)
+{
+ return(custom_option_chk->isChecked());
+}
+
void Messagebox::showExceptionList(void)
{
if(show_errors_tb->isChecked())
@@ -188,7 +201,7 @@ void Messagebox::show(const QString &title, const QString &msg, unsigned icon_ty
this->setWindowTitle(aux_title);
this->objs_group_wgt->setCurrentIndex(0);
this->show_errors_tb->setChecked(false);
- this->show_errors_tb->setVisible((exceptions_trw->topLevelItemCount() > 0));
+ error_show_btns_wgt->setVisible((exceptions_trw->topLevelItemCount() > 0));
showExceptionList();
this->resize(this->minimumWidth(), this->minimumHeight());
diff --git a/libpgmodeler_ui/src/messagebox.h b/libpgmodeler_ui/src/messagebox.h
index d549e1fb15..69228e1c36 100644
--- a/libpgmodeler_ui/src/messagebox.h
+++ b/libpgmodeler_ui/src/messagebox.h
@@ -67,6 +67,9 @@ class Messagebox: public QDialog, public Ui::Messagebox {
bool isCancelled(void);
+ void setCustomOptionText(const QString &text);
+ bool isCustomOptionChecked(void);
+
private slots:
void handleYesOkClick(void);
void handleNoCancelClick(void);
diff --git a/libpgmodeler_ui/src/modelexportform.cpp b/libpgmodeler_ui/src/modelexportform.cpp
index 1442cc6b0f..d0cd81941b 100644
--- a/libpgmodeler_ui/src/modelexportform.cpp
+++ b/libpgmodeler_ui/src/modelexportform.cpp
@@ -324,7 +324,7 @@ void ModelExportForm::handleExportCanceled(void)
void ModelExportForm::handleExportFinished(void)
{
QPixmap ico=QPixmap(PgModelerUiNS::getIconPath("msgbox_info"));
- QString msg=trUtf8("Exporting process sucessfuly ended!");
+ QString msg=trUtf8("Exporting process successfully ended!");
finishExport(msg);
ico_lbl->setPixmap(ico);
diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp
index b7aa3839f4..92cd2473d9 100644
--- a/libpgmodeler_ui/src/modelobjectswidget.cpp
+++ b/libpgmodeler_ui/src/modelobjectswidget.cpp
@@ -469,7 +469,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root)
int count, count2, i;
QPixmap group_icon=QPixmap(PgModelerUiNS::getIconPath(QString(BaseObject::getSchemaName(OBJ_SCHEMA)) + QString("_grp")));
- //Removing the OBJ_TABLE and OBJ_VIEW types since they are handled separetedly
+ //Removing the OBJ_TABLE and OBJ_VIEW types since they are handled separatedly
types.erase(std::find(types.begin(), types.end(), OBJ_TABLE));
types.erase(std::find(types.begin(), types.end(), OBJ_VIEW));
diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp
index f53c0ff65a..cd0d404ee9 100644
--- a/libpgmodeler_ui/src/modelvalidationhelper.cpp
+++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp
@@ -46,7 +46,8 @@ ModelValidationHelper::~ModelValidationHelper(void)
void ModelValidationHelper::generateValidationInfo(unsigned val_type, BaseObject *object, vector refs)
{
if(!refs.empty() ||
- (val_type==ValidationInfo::BROKEN_REL_CONFIG &&
+ val_type==ValidationInfo::MISSING_EXTENSION ||
+ (val_type==ValidationInfo::BROKEN_REL_CONFIG &&
std::find(inv_rels.begin(), inv_rels.end(), object)==inv_rels.end()))
{
//Configures a validation info
@@ -71,7 +72,7 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info)
//Resolving broken references by swaping the object ids
if(info.getValidationType()==ValidationInfo::BROKEN_REFERENCE ||
- info.getValidationType()==ValidationInfo::SP_OBJ_BROKEN_REFERENCE)
+ info.getValidationType()==ValidationInfo::SP_OBJ_BROKEN_REFERENCE)
{
BaseObject *info_obj=info.getObject(), *aux_obj=nullptr;
unsigned obj_id=info_obj->getObjectId();
@@ -190,6 +191,13 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info)
refs.pop_back();
}
}
+ //Resolving the absence of postgis extension
+ else if(info.getValidationType()==ValidationInfo::MISSING_EXTENSION && !db_model->getExtension(QString("postgis")))
+ {
+ Extension *extension = new Extension();
+ extension->setName(QString("postgis"));
+ db_model->addExtension(extension);
+ }
}
catch(Exception &e)
{
@@ -274,13 +282,14 @@ void ModelValidationHelper::validateModel(void)
map > dup_objects;
map >::iterator mitr;
QString name, signal_msg=QString("`%1' (%2)");
+ bool postgis_exists = db_model->getObjectIndex(QString("postgis"), OBJ_EXTENSION) >= 0;
warn_count=error_count=progress=0;
val_infos.clear();
valid_canceled=false;
/* Step 1: Validating broken references. This situation happens when a object references another
- whose id is smaller than the id of the first one. */
+ which id is smaller than the id of the first one. */
for(i=0; i < count && !valid_canceled; i++)
{
obj_list=db_model->getObjectList(types[i]);
@@ -508,8 +517,31 @@ void ModelValidationHelper::validateModel(void)
i++; mitr++;
}
+ // Step 3: Checking if columns of any table is using GiS data types and the postgis extension is not created.
+ if(!postgis_exists)
+ {
+ obj_list=db_model->getObjectList(OBJ_TABLE);
+ itr=obj_list->begin();
+ i=0;
+
+ while(itr!=obj_list->end() && !valid_canceled)
+ {
+ table = dynamic_cast
(*itr);
+ itr++;
+
+ for(auto &obj : *table->getObjectList(OBJ_COLUMN))
+ {
+ col = dynamic_cast(obj);
+
+ if(col->getType().isGiSType())
+ generateValidationInfo(ValidationInfo::MISSING_EXTENSION, col, {});
+ }
- /* Step 3: Checking if there are some invalidated relationship. In some cases, specially with identifier and generalization relationships,
+ progress=30 + ((i/static_cast(obj_list->size()))*20);
+ }
+ }
+
+ /* Step 4: Checking if there are some invalidated relationship. In some cases, specially with identifier and generalization relationships,
the columns aren't correctly propagated due to creation order and special behavior of those objects. Thus, in order to
keep all columns synchonized it is need to make this step and change the relationship creation order if needed. This step is executed
only when there is no validation infos generated because for each broken relationship there is the need to do a revalidation of all relationships */
@@ -520,7 +552,7 @@ void ModelValidationHelper::validateModel(void)
while(itr!=obj_list->end() && !valid_canceled)
{
- progress=30 + ((i/static_cast(obj_list->size()))*20);
+ progress=40 + ((i/static_cast(obj_list->size()))*20);
if(dynamic_cast(*itr)->isInvalidated())
generateValidationInfo(ValidationInfo::BROKEN_REL_CONFIG, *itr, {});
@@ -529,7 +561,6 @@ void ModelValidationHelper::validateModel(void)
}
}
-
if(!valid_canceled && !fix_mode)
{
//Step 3 (optional): Validating the SQL code onto a local DBMS.
@@ -575,8 +606,9 @@ void ModelValidationHelper::applyFixes(void)
{
if(!validate_rels)
validate_rels=(val_infos[i].getValidationType()==ValidationInfo::BROKEN_REFERENCE ||
- val_infos[i].getValidationType()==ValidationInfo::SP_OBJ_BROKEN_REFERENCE ||
- val_infos[i].getValidationType()==ValidationInfo::NO_UNIQUE_NAME);
+ val_infos[i].getValidationType()==ValidationInfo::SP_OBJ_BROKEN_REFERENCE ||
+ val_infos[i].getValidationType()==ValidationInfo::NO_UNIQUE_NAME ||
+ val_infos[i].getValidationType()==ValidationInfo::MISSING_EXTENSION);
/* Checking if a broken relatinship is found, when this is the case all the pending validation info
will not be analyzed until no broken relationship is found */
diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp
index 9319a73cff..9017267c01 100644
--- a/libpgmodeler_ui/src/modelvalidationwidget.cpp
+++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp
@@ -266,6 +266,16 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info)
.arg(val_info.getObject()->getObjectId()));
else if(val_info.getValidationType()==ValidationInfo::SQL_VALIDATION_ERR)
label->setText(trUtf8("SQL validation failed due to error(s) below. NOTE: These errors does not invalidates the model but may affect operations like export and diff."));
+ else if(val_info.getValidationType() == ValidationInfo::MISSING_EXTENSION)
+ {
+ Column *col = dynamic_cast(val_info.getObject());
+
+ label->setText(trUtf8("The column %1 on %2(%3) is referencing the geospatial data type %4 but the postgis extension is not present in the model!")
+ .arg(col->getName())
+ .arg(col->getParentTable()->getSignature(true))
+ .arg(BaseObject::getTypeName(OBJ_TABLE))
+ .arg(~col->getType()));
+ }
else
label->setText(val_info.getErrors().at(0));
@@ -306,6 +316,11 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info)
PgModelerUiNS::createOutputTreeItem(output_trw, trUtf8("HINT: try to swap the relationship by another ones that somehow are linked to it through generated columns or constraints to solve this issue. Note that other objects may be lost in the swap process."),
QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), item);
}
+ else if(val_info.getValidationType()==ValidationInfo::MISSING_EXTENSION)
+ {
+ PgModelerUiNS::createOutputTreeItem(output_trw, trUtf8("HINT: Create the extension in the model or let it be created by applying the needed fixes."),
+ QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), item);
+ }
else
{
//Listing the referrer object on output pane
diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp
index 000c455c1d..3fb4f64bd0 100644
--- a/libpgmodeler_ui/src/modelwidget.cpp
+++ b/libpgmodeler_ui/src/modelwidget.cpp
@@ -2006,11 +2006,13 @@ void ModelWidget::setTag(void)
{
op_id=op_list->registerObject(obj, Operation::OBJECT_MODIFIED, -1);
tab->setTag(dynamic_cast(tag));
- tab->setModified(true);
}
}
op_list->finishOperationChain();
+ db_model->setObjectsModified(selected_objects);
+ scene->clearSelection();
+
emit s_objectModified();
}
catch(Exception &e)
@@ -2210,9 +2212,9 @@ void ModelWidget::copyObjects(bool duplicate_mode)
vector deps;
BaseObject *object=nullptr;
TableObject *tab_obj=nullptr;
- Table *table=nullptr;
+ BaseTable *table=nullptr;
Constraint *constr=nullptr;
- ObjectType types[]={ OBJ_TRIGGER, OBJ_INDEX, OBJ_CONSTRAINT };
+ ObjectType types[]={ OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX, OBJ_CONSTRAINT, OBJ_POLICY };
unsigned i, type_id, count;
Messagebox msg_box;
@@ -2232,7 +2234,7 @@ void ModelWidget::copyObjects(bool duplicate_mode)
Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS);
}
- /* When in cut operation is necessary to store the selected objects in a separeted list
+ /* When in cut operation is necessary to store the selected objects in a separated list
in order to correclty cut (remove) the object on the source model */
if(ModelWidget::cut_operation)
cutted_objects=selected_objects;
@@ -2254,11 +2256,11 @@ void ModelWidget::copyObjects(bool duplicate_mode)
/* Copying the special objects (which references columns added by relationship) in order
to be correclty created when pasted */
- if(object->getObjectType()==OBJ_TABLE)
+ if(object->getObjectType()==OBJ_TABLE || object->getObjectType() == OBJ_VIEW)
{
- table=dynamic_cast
(object);
+ table=dynamic_cast(object);
- for(type_id=0; type_id < 3; type_id++)
+ for(type_id=0; type_id < 4; type_id++)
{
count=table->getObjectCount(types[type_id]);
@@ -2271,14 +2273,16 @@ void ModelWidget::copyObjects(bool duplicate_mode)
columns added by relationship. Case the object is a constraint, it cannot be a primary key because
this type of constraint is treated separetely by relationships */
if(!tab_obj->isAddedByRelationship() &&
- ((constr &&
+ (!constr ||
+ (((constr &&
(constr->getConstraintType()==ConstraintType::foreign_key ||
(constr->getConstraintType()==ConstraintType::unique &&
- constr->isReferRelationshipAddedColumn()))) ||
- (types[type_id]==OBJ_TRIGGER && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) ||
- (types[type_id]==OBJ_INDEX && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn())))
+ constr->isReferRelationshipAddedColumn())))))))
deps.push_back(tab_obj);
}
+
+ if(object->getObjectType() == OBJ_VIEW && type_id >= 2)
+ break;
}
}
}
@@ -2374,7 +2378,7 @@ void ModelWidget::pasteObjects(void)
aux_object=db_model->getObject(aux_name, obj_type);
else
{
- if(sel_view && (obj_type==OBJ_TRIGGER || obj_type==OBJ_RULE))
+ if(sel_view && (obj_type==OBJ_TRIGGER || obj_type==OBJ_RULE || obj_type==OBJ_INDEX))
aux_object=sel_view->getObject(aux_name, obj_type);
else if(sel_table)
aux_object=sel_table->getObject(aux_name, obj_type);
@@ -2420,7 +2424,12 @@ void ModelWidget::pasteObjects(void)
else
{
if(tab_obj)
- tab_obj->setName(PgModelerNS::generateUniqueName(tab_obj, (*sel_table->getObjectList(tab_obj->getObjectType())), false, QString("_cp"), true));
+ {
+ if(sel_table)
+ tab_obj->setName(PgModelerNS::generateUniqueName(tab_obj, (*sel_table->getObjectList(tab_obj->getObjectType())), false, QString("_cp"), true));
+ else
+ tab_obj->setName(PgModelerNS::generateUniqueName(tab_obj, (*sel_view->getObjectList(tab_obj->getObjectType())), false, QString("_cp"), true));
+ }
else
object->setName(PgModelerNS::generateUniqueName(object, (*db_model->getObjectList(object->getObjectType())), false, QString("_cp"), true));
@@ -2467,11 +2476,12 @@ void ModelWidget::pasteObjects(void)
parent=sel_view;
/* Only generates the XML for a table object when the selected receiver object
- is a table or is a view and the current object is a trigger or rule (because
+ is a table or is a view and the current object is a trigger, index, or rule (because
view's only accepts this two types) */
if(sel_table ||
(sel_view && (tab_obj->getObjectType()==OBJ_TRIGGER ||
- tab_obj->getObjectType()==OBJ_RULE)))
+ tab_obj->getObjectType()==OBJ_RULE ||
+ tab_obj->getObjectType()==OBJ_INDEX)))
{
//Backups the original parent table
orig_parent_tab=tab_obj->getParentTable();
@@ -2549,17 +2559,11 @@ void ModelWidget::pasteObjects(void)
//Special case for table objects
if(tab_obj)
{
- if(sel_table &&
- (tab_obj->getObjectType()==OBJ_COLUMN || tab_obj->getObjectType()==OBJ_RULE))
+ if(sel_table && tab_obj->getObjectType()==OBJ_COLUMN)
{
sel_table->addObject(tab_obj);
sel_table->setModified(true);
}
- else if(sel_view && tab_obj->getObjectType()==OBJ_RULE)
- {
- sel_view->addObject(tab_obj);
- sel_view->setModified(true);
- }
//Updates the fk relationships if the constraint is a foreign-key
if(constr && constr->getConstraintType()==ConstraintType::foreign_key)
@@ -2639,7 +2643,11 @@ void ModelWidget::duplicateObject(void)
table = dynamic_cast(object)->getParentTable();
PgModelerNS::copyObject(&dup_object, object, obj_type);
- dup_object->setName(PgModelerNS::generateUniqueName(dup_object, *dynamic_cast