Skip to content

Commit 563cce9

Browse files
committed
dbmanager: display info about missing modules on the info panel instead of on the status bar
1 parent 08e844f commit 563cce9

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

python/plugins/db_manager/db_manager.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
from .db_tree import DBTree
3333

34-
from .db_plugins import getDbPluginErrors
3534
from .db_plugins.plugin import BaseError
3635
from .dlg_db_error import DlgDbError
3736

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

56-
self.displayDbPluginErrors()
57-
58-
def displayDbPluginErrors(self):
59-
if len(getDbPluginErrors()) <= 0:
60-
return
61-
62-
if not hasattr(self, '_dbPluginErrorIndex') or self._dbPluginErrorIndex >= len(getDbPluginErrors()):
63-
self._dbPluginErrorIndex = 0
64-
65-
msg = getDbPluginErrors()[self._dbPluginErrorIndex]
66-
self._dbPluginErrorIndex += 1
67-
68-
self.statusBar.showMessage( msg, 5000 )
69-
QTimer.singleShot( 6000, self.displayDbPluginErrors)
70-
7155

7256
def closeEvent(self, e):
7357
self.unregisterAllActions()

python/plugins/db_manager/info_viewer.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def __init__(self, parent=None):
3636
self.dirty = False
3737

3838
self._clear()
39+
self._showPluginInfo()
40+
3941
self.connect(self, SIGNAL("anchorClicked(const QUrl&)"), self._linkClicked)
4042

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

94+
95+
def _showPluginInfo(self):
96+
from .db_plugins import getDbPluginErrors
97+
html = u'<div style="background-color:#ffffcc;"><h1>&nbsp;DB Manager</h1></div>'
98+
html += '<div style="margin-left:8px;">'
99+
for msg in getDbPluginErrors():
100+
html += u"<p>%s" % msg
101+
self.setHtml(html)
102+
92103
def _showDatabaseInfo(self, connection):
93104
html = u'<div style="background-color:#ccffcc;"><h1>&nbsp;%s</h1></div>' % connection.connectionName()
94105
html += '<div style="margin-left:8px;">'
@@ -126,7 +137,6 @@ def _showTableInfo(self, table):
126137
return True
127138

128139

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

0 commit comments

Comments
 (0)