Skip to content
Permalink
Browse files
dbmanager: display info about missing modules on the info panel inste…
…ad of on the status bar
  • Loading branch information
brushtyler committed Nov 29, 2012
1 parent 08e844f commit 563cce9111bea8a64cafea05cf8a1460b649f2a1
Showing with 11 additions and 17 deletions.
  1. +0 −16 python/plugins/db_manager/db_manager.py
  2. +11 −1 python/plugins/db_manager/info_viewer.py
@@ -31,7 +31,6 @@

from .db_tree import DBTree

from .db_plugins import getDbPluginErrors
from .db_plugins.plugin import BaseError
from .dlg_db_error import DlgDbError

@@ -53,21 +52,6 @@ def __init__(self, iface, parent=None):
self.connect(self.tree, SIGNAL("selectedItemChanged"), self.itemChanged)
self.itemChanged(None)

self.displayDbPluginErrors()

def displayDbPluginErrors(self):
if len(getDbPluginErrors()) <= 0:
return

if not hasattr(self, '_dbPluginErrorIndex') or self._dbPluginErrorIndex >= len(getDbPluginErrors()):
self._dbPluginErrorIndex = 0

msg = getDbPluginErrors()[self._dbPluginErrorIndex]
self._dbPluginErrorIndex += 1

self.statusBar.showMessage( msg, 5000 )
QTimer.singleShot( 6000, self.displayDbPluginErrors)


def closeEvent(self, e):
self.unregisterAllActions()
@@ -36,6 +36,8 @@ def __init__(self, parent=None):
self.dirty = False

self._clear()
self._showPluginInfo()

self.connect(self, SIGNAL("anchorClicked(const QUrl&)"), self._linkClicked)

def _linkClicked(self, url):
@@ -89,6 +91,15 @@ def _clear(self):
self.item = None
self.setHtml("")


def _showPluginInfo(self):
from .db_plugins import getDbPluginErrors
html = u'<div style="background-color:#ffffcc;"><h1>&nbsp;DB Manager</h1></div>'
html += '<div style="margin-left:8px;">'
for msg in getDbPluginErrors():
html += u"<p>%s" % msg
self.setHtml(html)

def _showDatabaseInfo(self, connection):
html = u'<div style="background-color:#ccffcc;"><h1>&nbsp;%s</h1></div>' % connection.connectionName()
html += '<div style="margin-left:8px;">'
@@ -126,7 +137,6 @@ def _showTableInfo(self, table):
return True



def setHtml(self, html):
# convert special tags :)
html = unicode(html).replace( '<warning>', '<img src=":/db_manager/warning">&nbsp;&nbsp; ' )

0 comments on commit 563cce9

Please sign in to comment.