Skip to content
Permalink
Browse files

[dbmanager] again replacement box->bar stuff....hopefully the last :-)

  • Loading branch information
slarosa authored and nyalldawson committed Sep 25, 2014
1 parent a778e26 commit cb414f5d2cdbec71d37bd782a649850890a7ae7b
Showing with 6 additions and 3 deletions.
  1. +1 −1 python/plugins/db_manager/db_model.py
  2. +5 −2 python/plugins/db_manager/layer_preview.py
@@ -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()
@@ -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
@@ -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()

0 comments on commit cb414f5

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