Skip to content

Commit

Permalink
[dbmanager] again replacement box->bar stuff....hopefully the last :-)
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa authored and nyalldawson committed Sep 25, 2014
1 parent a778e26 commit cb414f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_model.py
Expand Up @@ -152,7 +152,7 @@ def populate(self):
return False

except BaseError, e:
QMessageBox.warning( None, self.tr("Unable to connect"), unicode(e) )
DlgDbError.showError(unicode(e), None)
return False

database = connection.database()
Expand Down
7 changes: 5 additions & 2 deletions python/plugins/db_manager/layer_preview.py
Expand Up @@ -23,14 +23,15 @@
from PyQt4.QtCore import *
from PyQt4.QtGui import *

from qgis.gui import QgsMapCanvas, QgsMapCanvasLayer
from qgis.gui import QgsMapCanvas, QgsMapCanvasLayer, QgsMessageBar
from qgis.core import QgsVectorLayer, QgsMapLayerRegistry

from .db_plugins.plugin import DbError, Table

class LayerPreview(QgsMapCanvas):
def __init__(self, parent=None):
QgsMapCanvas.__init__(self, parent)
self.parent = parent
self.setCanvasColor(QColor(255,255,255))

self.item = None
Expand Down Expand Up @@ -95,7 +96,9 @@ def _loadTablePreview(self, table, limit=False):
if limit and table.rowCount > 1000:
uniqueField = table.getValidQGisUniqueFields(True)
if uniqueField == None:
QMessageBox.warning(self, QApplication.translate("DBManagerPlugin", "Sorry"), QApplication.translate("DBManagerPlugin", "Unable to find a valid unique field"))
self.parent.tabs.setCurrentWidget(self.parent.info)
self.parent.infoBar.pushMessage(QApplication.translate("DBManagerPlugin", "Unable to find a valid unique field"),
QgsMessageBar.WARNING, self.parent.iface.messageTimeout())
return

uri = table.database().uri()
Expand Down

0 comments on commit cb414f5

Please sign in to comment.