Skip to content

Commit

Permalink
DBManager: remove label from separators (fix #5393)
Browse files Browse the repository at this point in the history
  • Loading branch information
brushtyler authored and jef-n committed May 21, 2012
1 parent 86243eb commit 8cb380a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/plugins/db_manager/db_manager.py
Expand Up @@ -223,7 +223,7 @@ def registerAction(self, action, menuName, callback=None):
# get the placeholder's position to insert before it
pos = 0
for pos in range(len(menuActions)):
if menuActions[pos].isSeparator() and menuActions[pos].text() == "placeholder":
if menuActions[pos].isSeparator() and menuActions[pos].objectName().endsWith("_placeholder"):
menuActions[pos].setVisible(True)
break

Expand Down Expand Up @@ -301,7 +301,7 @@ def unregisterAction(self, action, menuName):
# hide the placeholder if there're no other registered actions
if len(self._registeredDbActions[menuName]) <= 0:
for i in range(len(menuActions)):
if menuActions[i].isSeparator() and menuActions[i].text() == "placeholder":
if menuActions[i].isSeparator() and menuActions[i].objectName().endsWith("_placeholder"):
menuActions[i].setVisible(False)
break

Expand Down Expand Up @@ -369,18 +369,18 @@ def setupUi(self):
# create menus' actions

# menu DATABASE
sep = self.menuDb.addAction("placeholder"); sep.setSeparator(True); sep.setVisible(False)
sep = self.menuDb.addSeparator(); sep.setObjectName("DB_Manager_DbMenu_placeholder"); sep.setVisible(False)
self.actionRefresh = self.menuDb.addAction( QIcon(":/db_manager/actions/refresh"), "&Refresh", self.refreshActionSlot, QKeySequence("F5") )
self.actionSqlWindow = self.menuDb.addAction( QIcon(":/db_manager/actions/sql_window"), "&SQL window", self.runSqlWindow, QKeySequence("F2") )
self.menuDb.addSeparator()
self.actionClose = self.menuDb.addAction( QIcon(), "&Exit", self.close, QKeySequence("CTRL+Q") )

# menu SCHEMA
sep = self.menuSchema.addAction("placeholder"); sep.setSeparator(True); sep.setVisible(False)
sep = self.menuSchema.addSeparator(); sep.setObjectName("DB_Manager_SchemaMenu_placeholder"); sep.setVisible(False)
actionMenuSchema.setVisible(False)

# menu TABLE
sep = self.menuTable.addAction("placeholder"); sep.setSeparator(True); sep.setVisible(False)
sep = self.menuTable.addSeparator(); sep.setObjectName("DB_Manager_TableMenu_placeholder"); sep.setVisible(False)
actionMenuTable.setVisible(False)
self.actionShowSystemTables = self.menuTable.addAction("Show system tables/views", self.showSystemTables)
self.actionShowSystemTables.setCheckable(True)
Expand Down

0 comments on commit 8cb380a

Please sign in to comment.