Skip to content

Commit

Permalink
unite QgsMessageLog::Level and QgsMessageBar::MessageLevel in Qgis::M…
Browse files Browse the repository at this point in the history
…essageLevel

make enum items lower case
remove unused QgsMessageLog::None and All
  • Loading branch information
3nids committed Feb 6, 2018
1 parent 33ca8fc commit 3dc3d9d
Show file tree
Hide file tree
Showing 142 changed files with 610 additions and 603 deletions.
7 changes: 7 additions & 0 deletions doc/api_break.dox
Expand Up @@ -1605,9 +1605,16 @@ QgsMarkerSymbolLayer {#qgis_api_break_3_0_QgsMarkerSymbolLayer}
- bounds() is now pure virtual and must be implemented in all subclasses. - 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} 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. - 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} QgsMessageLogViewer {#qgis_api_break_3_0_QgsMessageLogViewer}
Expand Down
8 changes: 6 additions & 2 deletions external/libdxfrw/CMakeLists.txt
@@ -1,6 +1,10 @@
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core ${CMAKE_SOURCE_DIR}/src/core
${CMAKE_BINARY_DIR}/src/core ${CMAKE_SOURCE_DIR}/src/core/geometry

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

${Qt5Core_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS}
) )


Expand Down
4 changes: 2 additions & 2 deletions python/console/console_editor.py
Expand Up @@ -22,7 +22,7 @@
from qgis.PyQt.QtGui import QFont, QFontMetrics, QColor, QKeySequence, QCursor, QFontDatabase 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.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.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.gui import QgsMessageBar
from qgis.utils import OverrideCursor from qgis.utils import OverrideCursor
import sys import sys
Expand Down Expand Up @@ -1265,7 +1265,7 @@ def changeLastDirPath(self, tab):
self.settings.setValue("pythonConsole/lastDirPath", tabWidget.path) self.settings.setValue("pythonConsole/lastDirPath", tabWidget.path)


def widgetMessageBar(self, iface, text, level, timed=True): def widgetMessageBar(self, iface, text, level, timed=True):
messageLevel = [QgsMessageBar.INFO, QgsMessageBar.WARNING, QgsMessageBar.CRITICAL] messageLevel = [Qgis.Info, Qgis.Warning, Qgis.Critical]
if timed: if timed:
timeout = iface.messageTimeout() timeout = iface.messageTimeout()
else: else:
Expand Down
4 changes: 2 additions & 2 deletions python/console/console_output.py
Expand Up @@ -25,7 +25,7 @@
from qgis.PyQt.QtGui import QColor, QFont, QKeySequence, QFontDatabase from qgis.PyQt.QtGui import QColor, QFont, QKeySequence, QFontDatabase
from qgis.PyQt.QtWidgets import QGridLayout, QSpacerItem, QSizePolicy, QShortcut, QMenu, QApplication from qgis.PyQt.QtWidgets import QGridLayout, QSpacerItem, QSizePolicy, QShortcut, QMenu, QApplication
from qgis.PyQt.Qsci import QsciScintilla, QsciLexerPython 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 from qgis.gui import QgsMessageBar
import sys import sys


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


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


function.__name__ = name function.__name__ = name
Expand Down
9 changes: 9 additions & 0 deletions python/core/qgis.sip.in
Expand Up @@ -35,6 +35,15 @@ The Qgis class provides global constants for use throughout the application.
static const char *QGIS_DEV_VERSION; static const char *QGIS_DEV_VERSION;




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

enum DataType enum DataType
{ {
UnknownDataType, UnknownDataType,
Expand Down
15 changes: 3 additions & 12 deletions python/core/qgsmessagelog.sip.in
Expand Up @@ -29,27 +29,18 @@ QgsMessageLog is not usually directly created, but rather accessed through
%End %End
public: public:


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

QgsMessageLog(); QgsMessageLog();
%Docstring %Docstring
Constructor for QgsMessageLog. Constructor for QgsMessageLog.
%End %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 %Docstring
add a message to the instance (and create it if necessary) add a message to the instance (and create it if necessary)
%End %End


signals: 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 ); void messageReceived( bool received );


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


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


/************************************************************************ /************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmapcanvas.sip.in
Expand Up @@ -930,7 +930,7 @@ Emitted when the canvas has been assigned a different map theme.
.. versionadded:: 3.0 .. versionadded:: 3.0
%End %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 %Docstring
emit a message (usually to be displayed in a message bar) emit a message (usually to be displayed in a message bar)
%End %End
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmaptool.sip.in
Expand Up @@ -187,7 +187,7 @@ The values is calculated from searchRadiusMM().
%End %End


signals: signals:
void messageEmitted( const QString &message, QgsMessageBar::MessageLevel = QgsMessageBar::INFO ); void messageEmitted( const QString &message, Qgis::MessageLevel = Qgis::Info );
%Docstring %Docstring
emit a message emit a message
%End %End
Expand Down
15 changes: 4 additions & 11 deletions python/gui/qgsmessagebar.sip.in
Expand Up @@ -21,13 +21,6 @@ A bar for displaying non-blocking messages to the user.
#include "qgsmessagebar.h" #include "qgsmessagebar.h"
%End %End
public: public:
enum MessageLevel
{
INFO,
WARNING,
CRITICAL,
SUCCESS
};


QgsMessageBar( QWidget *parent /TransferThis/ = 0 ); QgsMessageBar( QWidget *parent /TransferThis/ = 0 );
%Docstring %Docstring
Expand All @@ -43,13 +36,13 @@ The message bar will take ownership of the item.
:param item: Item to display :param item: Item to display
%End %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 %Docstring
Display a widget as a message on the bar after hiding the currently visible one Display a widget as a message on the bar after hiding the currently visible one
and putting it in a stack. and putting it in a stack.


:param widget: message widget to display :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 :param duration: timeout duration of message in seconds, 0 value indicates no timeout
%End %End


Expand All @@ -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 make out a widget containing title and message to be displayed on the bar
%End %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 %Docstring
convenience method for pushing a message to the bar convenience method for pushing a message to the bar
%End %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 %Docstring
convenience method for pushing a message with title to the bar convenience method for pushing a message with title to the bar
%End %End
Expand Down
12 changes: 6 additions & 6 deletions python/gui/qgsmessagebaritem.sip.in
Expand Up @@ -17,22 +17,22 @@ class QgsMessageBarItem : QWidget
#include "qgsmessagebaritem.h" #include "qgsmessagebaritem.h"
%End %End
public: 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 %Docstring
make out a widget containing a message to be displayed on the bar make out a widget containing a message to be displayed on the bar
%End %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 %Docstring
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 %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 %Docstring
make out a widget containing title, message and widget to be displayed on the bar make out a widget containing title, message and widget to be displayed on the bar
%End %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 %Docstring
make out a widget containing a widget to be displayed on the bar make out a widget containing a widget to be displayed on the bar
%End %End
Expand All @@ -51,9 +51,9 @@ Returns the text for the message.
Returns the title for the message. Returns the title for the message.
%End %End


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


QgsMessageBar::MessageLevel level() const; Qgis::MessageLevel level() const;
%Docstring %Docstring
Returns the message level for the message. Returns the message level for the message.
%End %End
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmessagelogviewer.sip.in
Expand Up @@ -29,7 +29,7 @@ QgsApplication.messageLog() instance.


public slots: 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 %Docstring
Logs a ``message`` to the viewer. Logs a ``message`` to the viewer.
%End %End
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgspluginmanagerinterface.sip.in
Expand Up @@ -56,7 +56,7 @@ add repository to the repository listWidget
show the Plugin Manager window and optionally open tab tabIndex show the Plugin Manager window and optionally open tab tabIndex
%End %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 %Docstring
show the given message in the Plugin Manager internal message bar show the given message in the Plugin Manager internal message bar
%End %End
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/db_manager/db_manager.py
Expand Up @@ -29,7 +29,7 @@
from qgis.PyQt.QtGui import QIcon, QKeySequence from qgis.PyQt.QtGui import QIcon, QKeySequence


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


from .info_viewer import InfoViewer from .info_viewer import InfoViewer
Expand Down Expand Up @@ -146,7 +146,7 @@ def importActionSlot(self):
db = self.tree.currentDatabase() db = self.tree.currentDatabase()
if db is None: if db is None:
self.infoBar.pushMessage(self.tr("No database selected or you are not connected to it."), 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 return


outUri = db.uri() outUri = db.uri()
Expand All @@ -162,15 +162,15 @@ def importActionSlot(self):
def exportActionSlot(self): def exportActionSlot(self):
table = self.tree.currentTable() table = self.tree.currentTable()
if table is None: 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()) self.iface.messageTimeout())
return return


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


from .dlg_export_vector import DlgExportVector from .dlg_export_vector import DlgExportVector
Expand All @@ -184,7 +184,7 @@ def runSqlWindow(self):
db = self.tree.currentDatabase() db = self.tree.currentDatabase()
if db is None: if db is None:
self.infoBar.pushMessage(self.tr("No database selected or you are not connected to it."), 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) # force displaying of the message, it appears on the first tab (i.e. Info)
self.tabs.setCurrentIndex(0) self.tabs.setCurrentIndex(0)
return return
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/gpkg/plugin.py
Expand Up @@ -27,7 +27,7 @@
from qgis.PyQt.QtCore import Qt, QFileInfo from qgis.PyQt.QtCore import Qt, QFileInfo
from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QApplication, QAction, QFileDialog 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 qgis.gui import QgsMessageBar


from ..plugin import DBPlugin, Database, Table, VectorTable, RasterTable, TableField, TableIndex, TableTrigger, \ from ..plugin import DBPlugin, Database, Table, VectorTable, RasterTable, TableField, TableIndex, TableTrigger, \
Expand Down Expand Up @@ -143,7 +143,7 @@ def runVacuumActionSlot(self, item, action, parent):
try: try:
if not isinstance(item, (DBPlugin, Table)) or item.database() is None: 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."), 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 return
finally: finally:
QApplication.setOverrideCursor(Qt.WaitCursor) QApplication.setOverrideCursor(Qt.WaitCursor)
Expand Down
18 changes: 9 additions & 9 deletions python/plugins/db_manager/db_plugins/plugin.py
Expand Up @@ -27,7 +27,7 @@
from qgis.PyQt.QtGui import QKeySequence, QIcon from qgis.PyQt.QtGui import QKeySequence, QIcon


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




Expand Down Expand Up @@ -357,7 +357,7 @@ def deleteActionSlot(self, item, action, parent):
else: else:
QApplication.restoreOverrideCursor() QApplication.restoreOverrideCursor()
parent.infoBar.pushMessage(QApplication.translate("DBManagerPlugin", "Cannot delete the selected item."), 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) QApplication.setOverrideCursor(Qt.WaitCursor)


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


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


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

0 comments on commit 3dc3d9d

Please sign in to comment.