Skip to content
Permalink
Browse files

Merge pull request #6275 from 3nids/messagelevel

unite QgsMessageLog::Level and QgsMessageBar::MessageLevel in Qgis::MessageLevel
  • Loading branch information
3nids committed Feb 6, 2018
2 parents 8f2c857 + 3dc3d9d commit 3205c96af629194fa485e072050b677dacfc7f23
Showing with 610 additions and 603 deletions.
  1. +7 −0 doc/api_break.dox
  2. +6 −2 external/libdxfrw/CMakeLists.txt
  3. +2 −2 python/console/console_editor.py
  4. +2 −2 python/console/console_output.py
  5. +1 −1 python/core/__init__.py
  6. +9 −0 python/core/qgis.sip.in
  7. +3 −12 python/core/qgsmessagelog.sip.in
  8. +1 −1 python/gui/qgsmapcanvas.sip.in
  9. +1 −1 python/gui/qgsmaptool.sip.in
  10. +4 −11 python/gui/qgsmessagebar.sip.in
  11. +6 −6 python/gui/qgsmessagebaritem.sip.in
  12. +1 −1 python/gui/qgsmessagelogviewer.sip.in
  13. +1 −1 python/gui/qgspluginmanagerinterface.sip.in
  14. +5 −5 python/plugins/db_manager/db_manager.py
  15. +2 −2 python/plugins/db_manager/db_plugins/gpkg/plugin.py
  16. +9 −9 python/plugins/db_manager/db_plugins/plugin.py
  17. +3 −3 python/plugins/db_manager/db_plugins/postgis/plugin.py
  18. +4 −4 python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview/__init__.py
  19. +2 −2 python/plugins/db_manager/db_plugins/spatialite/plugin.py
  20. +2 −2 python/plugins/db_manager/db_tree.py
  21. +2 −2 python/plugins/db_manager/layer_preview.py
  22. +4 −3 python/plugins/processing/algs/gdal/GdalUtils.py
  23. +6 −5 python/plugins/processing/algs/grass7/Grass7Algorithm.py
  24. +4 −3 python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py
  25. +4 −3 python/plugins/processing/algs/grass7/Grass7Utils.py
  26. +4 −3 python/plugins/processing/algs/qgis/SymmetricalDifference.py
  27. +3 −2 python/plugins/processing/algs/qgis/ui/FieldsCalculatorDialog.py
  28. +3 −2 python/plugins/processing/algs/saga/SagaAlgorithm.py
  29. +6 −5 python/plugins/processing/algs/saga/SagaAlgorithmProvider.py
  30. +3 −2 python/plugins/processing/algs/saga/SagaUtils.py
  31. +3 −2 python/plugins/processing/gui/AlgorithmDialog.py
  32. +3 −2 python/plugins/processing/gui/AlgorithmExecutor.py
  33. +4 −3 python/plugins/processing/gui/BatchAlgorithmDialog.py
  34. +4 −3 python/plugins/processing/gui/BatchPanel.py
  35. +3 −2 python/plugins/processing/gui/HelpEditionDialog.py
  36. +3 −2 python/plugins/processing/gui/Postprocessing.py
  37. +4 −3 python/plugins/processing/modeler/ModelerAlgorithmProvider.py
  38. +9 −8 python/plugins/processing/modeler/ModelerDialog.py
  39. +4 −3 python/plugins/processing/modeler/ModelerParametersDialog.py
  40. +1 −1 python/plugins/processing/preconfigured/PreconfiguredAlgorithmDialog.py
  41. +2 −2 python/plugins/processing/script/AddScriptFromFileAction.py
  42. +3 −2 python/plugins/processing/script/ScriptUtils.py
  43. +8 −8 python/pyplugin_installer/installer.py
  44. +1 −1 python/pyplugin_installer/installer_data.py
  45. +1 −1 python/server/qgsserversettings.sip.in
  46. +2 −2 python/user.py
  47. +1 −1 python/utils.py
  48. +1 −1 src/analysis/processing/qgsalgorithmbuffer.cpp
  49. +3 −3 src/app/dwg/qgsdwgimportdialog.cpp
  50. +13 −13 src/app/layout/qgslayoutdesignerdialog.cpp
  51. +1 −1 src/app/pluginmanager/qgsapppluginmanagerinterface.cpp
  52. +1 −1 src/app/pluginmanager/qgsapppluginmanagerinterface.h
  53. +3 −3 src/app/pluginmanager/qgspluginmanager.cpp
  54. +1 −1 src/app/pluginmanager/qgspluginmanager.h
  55. +98 −98 src/app/qgisapp.cpp
  56. +2 −2 src/app/qgisapp.h
  57. +4 −4 src/app/qgsattributetabledialog.cpp
  58. +2 −2 src/app/qgsdiagramproperties.cpp
  59. +3 −3 src/app/qgsguivectorlayertools.cpp
  60. +1 −1 src/app/qgshandlebadlayers.cpp
  61. +3 −3 src/app/qgsloadstylefromdbdialog.cpp
  62. +4 −4 src/app/qgsmaptooladdpart.cpp
  63. +2 −2 src/app/qgsmaptooladdring.cpp
  64. +1 −1 src/app/qgsmaptoolcircle2tangentspoint.cpp
  65. +1 −1 src/app/qgsmaptoolcircle3tangents.cpp
  66. +7 −7 src/app/qgsmaptooldigitizefeature.cpp
  67. +2 −2 src/app/qgsmaptoolfeatureaction.cpp
  68. +3 −3 src/app/qgsmaptoolfillring.cpp
  69. +1 −1 src/app/qgsmaptoolmovefeature.cpp
  70. +1 −1 src/app/qgsmaptooloffsetcurve.cpp
  71. +1 −1 src/app/qgsmaptooloffsetpointsymbol.cpp
  72. +1 −1 src/app/qgsmaptoolpointsymbol.cpp
  73. +3 −3 src/app/qgsmaptoolreshape.cpp
  74. +1 −1 src/app/qgsmaptoolrotatepointsymbols.cpp
  75. +2 −2 src/app/qgsmaptoolselectutils.cpp
  76. +1 −1 src/app/qgsmaptoolshowhidelabels.cpp
  77. +5 −5 src/app/qgsmaptoolsplitfeatures.cpp
  78. +5 −5 src/app/qgsmaptoolsplitparts.cpp
  79. +2 −2 src/app/qgspluginregistry.cpp
  80. +3 −3 src/app/qgsselectbyformdialog.cpp
  81. +2 −2 src/app/qgsvectorlayerproperties.cpp
  82. +3 −3 src/core/processing/qgsprocessingalgorithm.cpp
  83. +1 −1 src/core/processing/qgsprocessingalgrunnertask.cpp
  84. +13 −0 src/core/qgis.h
  85. +1 −1 src/core/qgsapplication.cpp
  86. +1 −1 src/core/qgsfeature.cpp
  87. +3 −3 src/core/qgsgml.cpp
  88. +7 −7 src/core/qgsmessagelog.cpp
  89. +5 −14 src/core/qgsmessagelog.h
  90. +1 −1 src/core/qgsproject.cpp
  91. +2 −2 src/core/qgsvectorlayerfeatureiterator.cpp
  92. +7 −7 src/gui/auth/qgsauthauthoritieseditor.cpp
  93. +1 −1 src/gui/auth/qgsauthconfigeditor.cpp
  94. +1 −1 src/gui/auth/qgsautheditorwidgets.cpp
  95. +21 −21 src/gui/auth/qgsauthguiutils.cpp
  96. +4 −4 src/gui/auth/qgsauthidentitieseditor.cpp
  97. +6 −6 src/gui/auth/qgsauthserverseditor.cpp
  98. +1 −1 src/gui/auth/qgsauthtrustedcasdialog.cpp
  99. +1 −1 src/gui/editorwidgets/qgsdatetimeeditwrapper.cpp
  100. +5 −5 src/gui/qgsattributeform.cpp
  101. +1 −1 src/gui/qgsdatasourcemanagerdialog.cpp
  102. +2 −2 src/gui/qgsexpressionselectiondialog.cpp
  103. +4 −4 src/gui/qgsmapcanvas.cpp
  104. +1 −1 src/gui/qgsmapcanvas.h
  105. +1 −1 src/gui/qgsmapcanvastracer.cpp
  106. +1 −1 src/gui/qgsmaptool.h
  107. +2 −2 src/gui/qgsmaptoolcapture.cpp
  108. +10 −26 src/gui/qgsmessagebar.cpp
  109. +4 −11 src/gui/qgsmessagebar.h
  110. +13 −13 src/gui/qgsmessagebaritem.cpp
  111. +7 −7 src/gui/qgsmessagebaritem.h
  112. +10 −7 src/gui/qgsmessagelogviewer.cpp
  113. +1 −1 src/gui/qgsmessagelogviewer.h
  114. +1 −1 src/gui/qgspluginmanagerinterface.h
  115. +1 −1 src/gui/qgsprojectionselectiontreewidget.cpp
  116. +13 −13 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  117. +1 −1 src/plugins/grass/qgsgrassplugin.cpp
  118. +1 −1 src/plugins/topology/topolError.cpp
  119. +3 −3 src/providers/db2/qgsdb2newconnection.cpp
  120. +2 −2 src/providers/ogr/qgsogrprovider.cpp
  121. +2 −2 src/providers/oracle/qgsoraclenewconnection.cpp
  122. +2 −2 src/providers/postgres/qgspgnewconnection.cpp
  123. +2 −2 src/providers/wfs/qgswfsdataitems.cpp
  124. +1 −1 src/providers/wms/qgswmsprovider.cpp
  125. +1 −1 src/server/qgis_map_serv.cpp
  126. +5 −5 src/server/qgsaccesscontrolfilter.cpp
  127. +3 −3 src/server/qgsconfigcache.cpp
  128. +15 −15 src/server/qgsfcgiserverrequest.cpp
  129. +9 −9 src/server/qgsmslayercache.cpp
  130. +23 −23 src/server/qgsserver.cpp
  131. +1 −1 src/server/qgsserver.h
  132. +3 −3 src/server/qgsserverlogger.cpp
  133. +4 −4 src/server/qgsserverlogger.h
  134. +5 −5 src/server/qgsserverplugins.cpp
  135. +6 −6 src/server/qgsserversettings.cpp
  136. +1 −1 src/server/qgsserversettings.h
  137. +1 −1 src/server/services/wfs/qgswfsparameters.cpp
  138. +2 −2 src/server/services/wms/qgsmaprendererjobproxy.cpp
  139. +4 −4 src/server/services/wms/qgswmsgetschemaextension.cpp
  140. +1 −1 src/server/services/wms/qgswmsparameters.cpp
  141. +1 −1 src/server/services/wms/qgswmsrenderer.cpp
  142. +5 −5 tests/code_layout/acceptable_missing_doc.py
@@ -1605,9 +1605,16 @@ QgsMarkerSymbolLayer {#qgis_api_break_3_0_QgsMarkerSymbolLayer}
- bounds() is now pure virtual and must be implemented in all subclasses.


QgsMessageBar {#qgis_api_break_3_0_QgsMessageBar}
---------------------------

- MessageLevel has been removed. Use Qgis::MessageLevel instead


QgsMessageLog {#qgis_api_break_3_0_QgsMessageLog}
---------------------------

- MessageLevel has been removed. Use Qgis::MessageLevel instead
- This class is no longer a singleton and instance() has been removed. Instead use QgsApplication::messageLog() to access an application-wide log.

QgsMessageLogViewer {#qgis_api_break_3_0_QgsMessageLogViewer}
@@ -1,6 +1,10 @@
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_BINARY_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/geometry

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/core/geometry

${Qt5Core_INCLUDE_DIRS}
)

@@ -22,7 +22,7 @@
from qgis.PyQt.QtGui import QFont, QFontMetrics, QColor, QKeySequence, QCursor, QFontDatabase
from qgis.PyQt.QtWidgets import QShortcut, QMenu, QApplication, QWidget, QGridLayout, QSpacerItem, QSizePolicy, QFileDialog, QTabWidget, QTreeWidgetItem, QFrame, QLabel, QToolButton, QMessageBox
from qgis.PyQt.Qsci import QsciScintilla, QsciLexerPython, QsciAPIs, QsciStyle
from qgis.core import QgsApplication, QgsSettings
from qgis.core import Qgis, QgsApplication, QgsSettings
from qgis.gui import QgsMessageBar
from qgis.utils import OverrideCursor
import sys
@@ -1265,7 +1265,7 @@ def changeLastDirPath(self, tab):
self.settings.setValue("pythonConsole/lastDirPath", tabWidget.path)

def widgetMessageBar(self, iface, text, level, timed=True):
messageLevel = [QgsMessageBar.INFO, QgsMessageBar.WARNING, QgsMessageBar.CRITICAL]
messageLevel = [Qgis.Info, Qgis.Warning, Qgis.Critical]
if timed:
timeout = iface.messageTimeout()
else:
@@ -25,7 +25,7 @@
from qgis.PyQt.QtGui import QColor, QFont, QKeySequence, QFontDatabase
from qgis.PyQt.QtWidgets import QGridLayout, QSpacerItem, QSizePolicy, QShortcut, QMenu, QApplication
from qgis.PyQt.Qsci import QsciScintilla, QsciLexerPython
from qgis.core import QgsApplication, QgsSettings
from qgis.core import Qgis, QgsApplication, QgsSettings
from qgis.gui import QgsMessageBar
import sys

@@ -293,4 +293,4 @@ def keyPressEvent(self, e):

def widgetMessageBar(self, iface, text):
timeout = iface.messageTimeout()
self.infoBar.pushMessage(text, QgsMessageBar.INFO, timeout)
self.infoBar.pushMessage(text, Qgis.Info, timeout)
@@ -139,7 +139,7 @@ def referencedColumns(self, node):
msg = QCoreApplication.translate("UserExpressions",
"The user expression {0} already exists and could not be unregistered.").format(
name)
QgsMessageLog.logMessage(msg + "\n", msgtitle, QgsMessageLog.WARNING)
QgsMessageLog.logMessage(msg + "\n", msgtitle, Qgis.Warning)
return None

function.__name__ = name
@@ -35,6 +35,15 @@ The Qgis class provides global constants for use throughout the application.
static const char *QGIS_DEV_VERSION;


enum MessageLevel
{
Info,
Warning,
Critical,
Success,
None
};

enum DataType
{
UnknownDataType,
@@ -29,27 +29,18 @@ QgsMessageLog is not usually directly created, but rather accessed through
%End
public:

enum MessageLevel
{
ALL,
INFO,
WARNING,
CRITICAL,
NONE
};

QgsMessageLog();
%Docstring
Constructor for QgsMessageLog.
%End

static void logMessage( const QString &message, const QString &tag = QString(), MessageLevel level = QgsMessageLog::WARNING );
static void logMessage( const QString &message, const QString &tag = QString(), Qgis::MessageLevel level = Qgis::Warning );
%Docstring
add a message to the instance (and create it if necessary)
%End

signals:
void messageReceived( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level );
void messageReceived( const QString &message, const QString &tag, Qgis::MessageLevel level );

void messageReceived( bool received );

@@ -71,7 +62,7 @@ be the right choice for apps without GUI.
QgsMessageLogConsole();

public slots:
void logMessage( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level );
void logMessage( const QString &message, const QString &tag, Qgis::MessageLevel level );
};

/************************************************************************
@@ -930,7 +930,7 @@ Emitted when the canvas has been assigned a different map theme.
.. versionadded:: 3.0
%End

void messageEmitted( const QString &title, const QString &message, QgsMessageBar::MessageLevel = QgsMessageBar::INFO );
void messageEmitted( const QString &title, const QString &message, Qgis::MessageLevel = Qgis::Info );
%Docstring
emit a message (usually to be displayed in a message bar)
%End
@@ -187,7 +187,7 @@ The values is calculated from searchRadiusMM().
%End

signals:
void messageEmitted( const QString &message, QgsMessageBar::MessageLevel = QgsMessageBar::INFO );
void messageEmitted( const QString &message, Qgis::MessageLevel = Qgis::Info );
%Docstring
emit a message
%End
@@ -21,13 +21,6 @@ A bar for displaying non-blocking messages to the user.
#include "qgsmessagebar.h"
%End
public:
enum MessageLevel
{
INFO,
WARNING,
CRITICAL,
SUCCESS
};

QgsMessageBar( QWidget *parent /TransferThis/ = 0 );
%Docstring
@@ -43,13 +36,13 @@ The message bar will take ownership of the item.
:param item: Item to display
%End

QgsMessageBarItem *pushWidget( QWidget *widget /Transfer/, MessageLevel level = INFO, int duration = 0 );
QgsMessageBarItem *pushWidget( QWidget *widget /Transfer/, Qgis::MessageLevel level = Qgis::Info, int duration = 0 );
%Docstring
Display a widget as a message on the bar after hiding the currently visible one
and putting it in a stack.

:param widget: message widget to display
:param level: is QgsMessageBar.INFO, WARNING, CRITICAL or SUCCESS
:param level: is Qgis.Info, Warning, Critical or Success
:param duration: timeout duration of message in seconds, 0 value indicates no timeout
%End

@@ -76,11 +69,11 @@ make out a widget containing title and message to be displayed on the bar
make out a widget containing title and message to be displayed on the bar
%End

void pushMessage( const QString &text, MessageLevel level = INFO, int duration = 5 );
void pushMessage( const QString &text, Qgis::MessageLevel level = Qgis::Info, int duration = 5 );
%Docstring
convenience method for pushing a message to the bar
%End
void pushMessage( const QString &title, const QString &text, MessageLevel level = INFO, int duration = 5 );
void pushMessage( const QString &title, const QString &text, Qgis::MessageLevel level = Qgis::Info, int duration = 5 );
%Docstring
convenience method for pushing a message with title to the bar
%End
@@ -17,22 +17,22 @@ class QgsMessageBarItem : QWidget
#include "qgsmessagebaritem.h"
%End
public:
QgsMessageBarItem( const QString &text, QgsMessageBar::MessageLevel level = QgsMessageBar::INFO, int duration = 0, QWidget *parent /TransferThis/ = 0 );
QgsMessageBarItem( const QString &text, Qgis::MessageLevel level = Qgis::Info, int duration = 0, QWidget *parent /TransferThis/ = 0 );
%Docstring
make out a widget containing a message to be displayed on the bar
%End

QgsMessageBarItem( const QString &title, const QString &text, QgsMessageBar::MessageLevel level = QgsMessageBar::INFO, int duration = 0, QWidget *parent /TransferThis/ = 0 );
QgsMessageBarItem( const QString &title, const QString &text, Qgis::MessageLevel level = Qgis::Info, int duration = 0, QWidget *parent /TransferThis/ = 0 );
%Docstring
make out a widget containing title and message to be displayed on the bar
%End

QgsMessageBarItem( const QString &title, const QString &text, QWidget *widget, QgsMessageBar::MessageLevel level = QgsMessageBar::INFO, int duration = 0, QWidget *parent /TransferThis/ = 0 );
QgsMessageBarItem( const QString &title, const QString &text, QWidget *widget, Qgis::MessageLevel level = Qgis::Info, int duration = 0, QWidget *parent /TransferThis/ = 0 );
%Docstring
make out a widget containing title, message and widget to be displayed on the bar
%End

QgsMessageBarItem( QWidget *widget, QgsMessageBar::MessageLevel level = QgsMessageBar::INFO, int duration = 0, QWidget *parent /TransferThis/ = 0 );
QgsMessageBarItem( QWidget *widget, Qgis::MessageLevel level = Qgis::Info, int duration = 0, QWidget *parent /TransferThis/ = 0 );
%Docstring
make out a widget containing a widget to be displayed on the bar
%End
@@ -51,9 +51,9 @@ Returns the text for the message.
Returns the title for the message.
%End

QgsMessageBarItem *setLevel( QgsMessageBar::MessageLevel level );
QgsMessageBarItem *setLevel( Qgis::MessageLevel level );

QgsMessageBar::MessageLevel level() const;
Qgis::MessageLevel level() const;
%Docstring
Returns the message level for the message.
%End
@@ -29,7 +29,7 @@ QgsApplication.messageLog() instance.

public slots:

void logMessage( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level );
void logMessage( const QString &message, const QString &tag, Qgis::MessageLevel level );
%Docstring
Logs a ``message`` to the viewer.
%End
@@ -56,7 +56,7 @@ add repository to the repository listWidget
show the Plugin Manager window and optionally open tab tabIndex
%End

virtual void pushMessage( const QString &text, QgsMessageBar::MessageLevel level = QgsMessageBar::INFO, int duration = -1 ) = 0;
virtual void pushMessage( const QString &text, Qgis::MessageLevel level = Qgis::Info, int duration = -1 ) = 0;
%Docstring
show the given message in the Plugin Manager internal message bar
%End
@@ -29,7 +29,7 @@
from qgis.PyQt.QtGui import QIcon, QKeySequence

from qgis.gui import QgsMessageBar
from qgis.core import QgsSettings, QgsMapLayer
from qgis.core import Qgis, QgsSettings, QgsMapLayer
from qgis.utils import OverrideCursor

from .info_viewer import InfoViewer
@@ -146,7 +146,7 @@ def importActionSlot(self):
db = self.tree.currentDatabase()
if db is None:
self.infoBar.pushMessage(self.tr("No database selected or you are not connected to it."),
QgsMessageBar.INFO, self.iface.messageTimeout())
Qgis.Info, self.iface.messageTimeout())
return

outUri = db.uri()
@@ -162,15 +162,15 @@ def importActionSlot(self):
def exportActionSlot(self):
table = self.tree.currentTable()
if table is None:
self.infoBar.pushMessage(self.tr("Select the table you want export to file."), QgsMessageBar.INFO,
self.infoBar.pushMessage(self.tr("Select the table you want export to file."), Qgis.Info,
self.iface.messageTimeout())
return

inLayer = table.toMapLayer()
if inLayer.type() != QgsMapLayer.VectorLayer:
self.infoBar.pushMessage(
self.tr("Select a vector or a tabular layer you want export."),
QgsMessageBar.WARNING, self.iface.messageTimeout())
Qgis.Warning, self.iface.messageTimeout())
return

from .dlg_export_vector import DlgExportVector
@@ -184,7 +184,7 @@ def runSqlWindow(self):
db = self.tree.currentDatabase()
if db is None:
self.infoBar.pushMessage(self.tr("No database selected or you are not connected to it."),
QgsMessageBar.INFO, self.iface.messageTimeout())
Qgis.Info, self.iface.messageTimeout())
# force displaying of the message, it appears on the first tab (i.e. Info)
self.tabs.setCurrentIndex(0)
return
@@ -27,7 +27,7 @@
from qgis.PyQt.QtCore import Qt, QFileInfo
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QApplication, QAction, QFileDialog
from qgis.core import QgsDataSourceUri, QgsSettings
from qgis.core import Qgis, QgsDataSourceUri, QgsSettings
from qgis.gui import QgsMessageBar

from ..plugin import DBPlugin, Database, Table, VectorTable, RasterTable, TableField, TableIndex, TableTrigger, \
@@ -143,7 +143,7 @@ def runVacuumActionSlot(self, item, action, parent):
try:
if not isinstance(item, (DBPlugin, Table)) or item.database() is None:
parent.infoBar.pushMessage(self.tr("No database selected or you are not connected to it."),
QgsMessageBar.INFO, parent.iface.messageTimeout())
Qgis.Info, parent.iface.messageTimeout())
return
finally:
QApplication.setOverrideCursor(Qt.WaitCursor)
@@ -27,7 +27,7 @@
from qgis.PyQt.QtGui import QKeySequence, QIcon

from qgis.gui import QgsMessageBar
from qgis.core import QgsSettings
from qgis.core import Qgis, QgsSettings
from ..db_plugins import createDbPlugin


@@ -357,7 +357,7 @@ def deleteActionSlot(self, item, action, parent):
else:
QApplication.restoreOverrideCursor()
parent.infoBar.pushMessage(QApplication.translate("DBManagerPlugin", "Cannot delete the selected item."),
QgsMessageBar.INFO, parent.iface.messageTimeout())
Qgis.Info, parent.iface.messageTimeout())
QApplication.setOverrideCursor(Qt.WaitCursor)

def createSchemaActionSlot(self, item, action, parent):
@@ -366,7 +366,7 @@ def createSchemaActionSlot(self, item, action, parent):
if not isinstance(item, (DBPlugin, Schema, Table)) or item.database() is None:
parent.infoBar.pushMessage(
QApplication.translate("DBManagerPlugin", "No database selected or you are not connected to it."),
QgsMessageBar.INFO, parent.iface.messageTimeout())
Qgis.Info, parent.iface.messageTimeout())
return
(schema, ok) = QInputDialog.getText(parent, QApplication.translate("DBManagerPlugin", "New schema"),
QApplication.translate("DBManagerPlugin", "Enter new schema name"))
@@ -383,7 +383,7 @@ def deleteSchemaActionSlot(self, item, action, parent):
if not isinstance(item, Schema):
parent.infoBar.pushMessage(
QApplication.translate("DBManagerPlugin", "Select an empty schema for deletion."),
QgsMessageBar.INFO, parent.iface.messageTimeout())
Qgis.Info, parent.iface.messageTimeout())
return
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "hey!"),
QApplication.translate("DBManagerPlugin",
@@ -414,7 +414,7 @@ def createTableActionSlot(self, item, action, parent):
if not hasattr(item, 'database') or item.database() is None:
parent.infoBar.pushMessage(
QApplication.translate("DBManagerPlugin", "No database selected or you are not connected to it."),
QgsMessageBar.INFO, parent.iface.messageTimeout())
Qgis.Info, parent.iface.messageTimeout())
return
from ..dlg_create_table import DlgCreateTable

@@ -426,7 +426,7 @@ def editTableActionSlot(self, item, action, parent):
try:
if not isinstance(item, Table) or item.isView:
parent.infoBar.pushMessage(QApplication.translate("DBManagerPlugin", "Select a table to edit."),
QgsMessageBar.INFO, parent.iface.messageTimeout())
Qgis.Info, parent.iface.messageTimeout())
return
from ..dlg_table_properties import DlgTableProperties

@@ -440,7 +440,7 @@ def deleteTableActionSlot(self, item, action, parent):
if not isinstance(item, Table):
parent.infoBar.pushMessage(
QApplication.translate("DBManagerPlugin", "Select a table/view for deletion."),
QgsMessageBar.INFO, parent.iface.messageTimeout())
Qgis.Info, parent.iface.messageTimeout())
return
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "hey!"),
QApplication.translate("DBManagerPlugin",
@@ -458,7 +458,7 @@ def emptyTableActionSlot(self, item, action, parent):
try:
if not isinstance(item, Table) or item.isView:
parent.infoBar.pushMessage(QApplication.translate("DBManagerPlugin", "Select a table to empty it."),
QgsMessageBar.INFO, parent.iface.messageTimeout())
Qgis.Info, parent.iface.messageTimeout())
return
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "hey!"),
QApplication.translate("DBManagerPlugin",
@@ -485,7 +485,7 @@ def moveTableToSchemaActionSlot(self, item, action, parent, new_schema):
try:
if not isinstance(item, Table):
parent.infoBar.pushMessage(QApplication.translate("DBManagerPlugin", "Select a table/view."),
QgsMessageBar.INFO, parent.iface.messageTimeout())
Qgis.Info, parent.iface.messageTimeout())
return
finally:
QApplication.setOverrideCursor(Qt.WaitCursor)

0 comments on commit 3205c96

Please sign in to comment.
You can’t perform that action at this time.