Skip to content

Commit

Permalink
dbmanager: display info about missing modules on the info panel inste…
Browse files Browse the repository at this point in the history
…ad of on the status bar
  • Loading branch information
brushtyler committed Nov 29, 2012
1 parent 08e844f commit 563cce9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
16 changes: 0 additions & 16 deletions python/plugins/db_manager/db_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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()
Expand Down
12 changes: 11 additions & 1 deletion python/plugins/db_manager/info_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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;">'
Expand Down Expand Up @@ -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; ' )
Expand Down

0 comments on commit 563cce9

Please sign in to comment.