dockwidget tweak

This commit is contained in:
Andreas Preikschat 2010-12-28 11:35:59 +01:00
parent 2354ae6530
commit 3a3aee9c4a
2 changed files with 11 additions and 12 deletions

View File

@ -37,13 +37,15 @@ class OpenLPDockWidget(QtGui.QDockWidget):
"""
Custom DockWidget class to handle events
"""
def __init__(self, parent=None, name=None):
def __init__(self, parent=None, name=None, icon=None):
"""
Initialise the DockWidget
"""
log.debug(u'Initialise the DockWidget %s' % name)
log.debug(u'Initialise the %s widget' % name)
QtGui.QDockWidget.__init__(self, parent)
self.parent = parent
if name:
self.setObjectName(name)
if icon:
self.setWindowIcon(icon)
self.setFloating(False)

View File

@ -141,13 +141,12 @@ class Ui_MainWindow(object):
self.DefaultThemeLabel.setObjectName(u'DefaultThemeLabel')
self.StatusBar.addPermanentWidget(self.DefaultThemeLabel)
# Create the MediaManager
self.MediaManagerDock = OpenLPDockWidget(MainWindow)
self.MediaManagerDock.setWindowIcon(
self.MediaManagerDock = OpenLPDockWidget(
MainWindow, u'MediaManagerDock',
build_icon(u':/system/system_mediamanager.png'))
self.MediaManagerDock.setStyleSheet(MEDIA_MANAGER_STYLE)
self.MediaManagerDock.setMinimumWidth(
self.settingsmanager.mainwindow_left)
self.MediaManagerDock.setObjectName(u'MediaManagerDock')
self.MediaManagerContents = QtGui.QWidget(MainWindow)
self.MediaManagerContents.setObjectName(u'MediaManagerContents')
self.MediaManagerLayout = QtGui.QHBoxLayout(self.MediaManagerContents)
@ -161,10 +160,9 @@ class Ui_MainWindow(object):
MainWindow.addDockWidget(
QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock)
# Create the service manager
self.ServiceManagerDock = OpenLPDockWidget(MainWindow)
self.ServiceManagerDock.setWindowIcon(
self.ServiceManagerDock = OpenLPDockWidget(
MainWindow, u'ServiceManagerDock',
build_icon(u':/system/system_servicemanager.png'))
self.ServiceManagerDock.setObjectName(u'ServiceManagerDock')
self.ServiceManagerDock.setMinimumWidth(
self.settingsmanager.mainwindow_right)
self.ServiceManagerContents = ServiceManager(self)
@ -172,10 +170,9 @@ class Ui_MainWindow(object):
MainWindow.addDockWidget(
QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock)
# Create the theme manager
self.ThemeManagerDock = OpenLPDockWidget(MainWindow)
self.ThemeManagerDock.setWindowIcon(
self.ThemeManagerDock = OpenLPDockWidget(
MainWindow, u'ThemeManagerDock',
build_icon(u':/system/system_thememanager.png'))
self.ThemeManagerDock.setObjectName(u'ThemeManagerDock')
self.ThemeManagerDock.setMinimumWidth(
self.settingsmanager.mainwindow_right)
self.ThemeManagerContents = ThemeManager(self)
@ -1000,4 +997,4 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.recentFiles.insert(0, QtCore.QString(filename))
while self.recentFiles.count() > maxRecentFiles:
# Don't care what API says takeLast works, removeLast doesn't!
self.recentFiles.takeLast()
self.recentFiles.takeLast()