diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 93f24a01f..65149d05c 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -174,7 +174,7 @@ class MediaManagerItem(QtGui.QWidget): # Add a toolbar self.addToolbar() #Allow the plugin to define it's own header - self.addHeaderBar1() + self.addStartHeaderBar() # Create buttons for the toolbar ## File Button ## if self.hasFileIcon: @@ -217,7 +217,7 @@ class MediaManagerItem(QtGui.QWidget): translate(self.TranslationContext, u'Add the selected item(s) to the service'), u':/system/system_add.png', self.onAddClick, self.PluginTextShort+u'AddItem') #Allow the plugin to define it's own header - self.addHeaderBar2() + self.addEndHeaderBar() #Add the List widget self.ListView = self.ListViewWithDnD_class() self.ListView.uniformItemSizes = True @@ -260,15 +260,15 @@ class MediaManagerItem(QtGui.QWidget): """ pass - def addHeaderBar1(self): + def addStartHeaderBar(self): """ - Slot at start of toolbar for pluin to addwidgets + Slot at start of toolbar for plugin to addwidgets """ pass - def addHeaderBar2(self): + def addEndHeaderBar(self): """ - Slot at end of toolbar for pluin to add widgets + Slot at end of toolbar for plugin to add widgets """ pass diff --git a/openlp/core/lib/settingsmanager.py b/openlp/core/lib/settingsmanager.py index 26146d7fd..bebe6a322 100644 --- a/openlp/core/lib/settingsmanager.py +++ b/openlp/core/lib/settingsmanager.py @@ -34,13 +34,22 @@ class SettingsManager(object): self.width = self.screen[u'size'].width() self.height = self.screen[u'size'].height() self.mainwindow_height = self.height * 0.8 - self.mainwindow_docbars = self.width / 5 - if self.mainwindow_docbars > 300: - self.mainwindow_docbars > 300 - self.mainwindow_slidecontroller = self.width / 6 - self.slidecontroller = ((self.width - (self.mainwindow_docbars * 3 ) / 2 ) / 2 ) -100 + mainwindow_docbars = self.width / 5 + self.mainwindow_left = 0 + self.mainwindow_right = 0 + if mainwindow_docbars > 300: + self.mainwindow_left = 300 + self.mainwindow_right = 300 + + self.mainwindow_left = int( ConfigHelper.get_config( + u'user interface', u'mediamanager left', self.mainwindow_left)) + self.mainwindow_right = int( ConfigHelper.get_config( + u'user interface', u'mediamanager right', self.mainwindow_right)) + print self.mainwindow_left, self.mainwindow_right + + self.slidecontroller = (self.width - (self.mainwindow_left + self.mainwindow_right) - 100 ) / 2 self.slidecontroller_image = self.slidecontroller - 50 - print self.width, self.mainwindow_docbars, self.slidecontroller, self.slidecontroller_image + print self.width, mainwindow_docbars, self.slidecontroller, self.slidecontroller_image self.showMediaManager = str_to_bool( ConfigHelper.get_config( u'user interface', u'display mediamanager', True)) @@ -67,3 +76,6 @@ class SettingsManager(object): ConfigHelper.set_config(u'user interface', u'display previewpanel', isVisible) + def setDockbarLeft(self, value): + ConfigHelper.set_config(u'user interface', u'mediamanager left', value) + diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 6f3a3a384..9b890f3fd 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -31,6 +31,15 @@ from openlp.core.lib import translate, Plugin, MediaManagerItem, \ from openlp.core.utils import ConfigHelper +class mediaDock(QtGui.QDockWidget): + def __init__(self, parent=None, name=None): + QtGui.QDockWidget.__init__(self, parent) + self.parent = parent + + def resizeEvent(self, resizeEvent): + if resizeEvent.size().width() != resizeEvent.oldSize().width(): + self.parent.settingsmanager.setDockbarLeft(resizeEvent.size().width()) + class Ui_MainWindow(object): def setupUi(self, MainWindow): """ @@ -102,15 +111,20 @@ class Ui_MainWindow(object): self.DefaultThemeLabel.setObjectName(u'DefaultThemeLabel') self.StatusBar.addPermanentWidget(self.DefaultThemeLabel) # Create the MediaManager - self.MediaManagerDock = QtGui.QDockWidget(MainWindow) + self.MediaManagerDock = mediaDock(MainWindow) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(u':/system/system_mediamanager.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.MediaManagerDock.setWindowIcon(icon) self.MediaManagerDock.setFloating(False) self.MediaManagerDock.setObjectName(u'MediaManagerDock') - self.MediaManagerDock.setMinimumWidth( - self.settingsmanager.mainwindow_docbars) + self.MediaManagerDock.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Ignored, + QtGui.QSizePolicy.Maximum)) + geometry = self.MediaManagerDock.geometry() + geometry.setWidth(self.settingsmanager.mainwindow_left) + self.MediaManagerDock.setGeometry(geometry) + self.MediaManagerDock.setMinimumWidth(10) + self.MediaManagerContents = QtGui.QWidget() self.MediaManagerContents.setObjectName(u'MediaManagerContents') self.MediaManagerLayout = QtGui.QHBoxLayout(self.MediaManagerContents) @@ -134,7 +148,7 @@ class Ui_MainWindow(object): QtGui.QDockWidget.AllDockWidgetFeatures) self.ServiceManagerDock.setObjectName(u'ServiceManagerDock') self.ServiceManagerDock.setMinimumWidth( - self.settingsmanager.mainwindow_docbars) + self.settingsmanager.mainwindow_right) self.ServiceManagerContents = ServiceManager(self) self.ServiceManagerDock.setWidget(self.ServiceManagerContents) MainWindow.addDockWidget( diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index d94eb4465..a8119e3c6 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -374,6 +374,3 @@ class SlideController(QtGui.QWidget): def timerEvent(self, event): if event.timerId() == self.timer_id: self.onSlideSelectedNext() - - - diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 6124333eb..854e1ff7e 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -57,7 +57,8 @@ class ImpressController(object): when required. """ log.debug(u'start Openoffice') - cmd = u'openoffice.org -nologo -norestore -minimized -headless ' + u'"' + u'-accept=socket,host=localhost,port=2002;urp;'+ u'"' + # -headless + cmd = u'openoffice.org -nologo -norestore -minimized -invisible ' + u'"' + u'-accept=socket,host=localhost,port=2002;urp;'+ u'"' self.process = QtCore.QProcess() self.process.startDetached(cmd) self.process.waitForStarted() diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 35f37f704..956d8feb8 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -57,7 +57,7 @@ class PresentationMediaItem(MediaManagerItem): MediaManagerItem.__init__(self, parent, icon, title) self.message_listener = MessageListener(controllers) - def addHeaderBar2(self): + def addEndHeaderBar(self): self.PresentationWidget = QtGui.QWidget(self) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 154231be1..6d66cc003 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -104,5 +104,4 @@ class PresentationPlugin(Plugin): log.debug(u'Finalise') #Ask each controller to tidy up for controller in self.controllers: - print controller self.controllers[controller].kill()