openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00347
[Merge] lp:~maikels/openlp/menufix into lp:openlp
Maikel Stuivenberg has proposed merging lp:~maikels/openlp/menufix into lp:openlp.
Requested reviews:
openlp.org Core (openlp-core)
--
https://code.launchpad.net/~maikels/openlp/menufix/+merge/12039
Your team openlp.org Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2009-09-12 18:27:17 +0000
+++ openlp/core/ui/mainwindow.py 2009-09-18 09:03:04 +0000
@@ -519,6 +519,14 @@
QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_global_theme'), self.defaultThemeChanged)
+ QtCore.QObject.connect(self.FileNewItem,
+ QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onNewService)
+ QtCore.QObject.connect(self.FileOpenItem,
+ QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onLoadService)
+ QtCore.QObject.connect(self.FileSaveItem,
+ QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onQuickSaveService)
+ QtCore.QObject.connect(self.FileSaveAsItem,
+ QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onSaveService)
#warning cyclic dependency
#RenderManager needs to call ThemeManager and
#ThemeManager needs to call RenderManager
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2009-09-12 17:24:16 +0000
+++ openlp/core/ui/servicemanager.py 2009-09-18 09:03:04 +0000
@@ -361,21 +361,28 @@
if serviceItem == itemcount and serviceItemCount == count:
self.ServiceManagerList.setCurrentItem(treewidgetitem1)
- def onSaveService(self):
+ def onSaveService(self, quick=False):
"""
Save the current service in a zip file
This file contains
* An ood which is a pickle of the service items
* All image, presentation and video files needed to run the service.
"""
- filename = QtGui.QFileDialog.getSaveFileName(self,
+
+ if not quick:
+ filename = QtGui.QFileDialog.getSaveFileName(self,
u'Save Order of Service',self.config.get_last_dir() )
+ else:
+ filename = self.config.get_last_dir()
+ splittedFile = filename.split(u'.')
+ if splittedFile[-1] != u'oos':
+ filename = filename + u'.oos'
filename = unicode(filename)
if filename != u'':
self.config.set_last_dir(filename)
service = []
servicefile= filename + u'.ood'
- zip = zipfile.ZipFile(unicode(filename) + u'.oos', 'w')
+ zip = zipfile.ZipFile(unicode(filename), 'w')
for item in self.serviceItems:
service.append({u'serviceitem':item[u'data'].get_oos_repr()})
if item[u'data'].service_item_type == ServiceType.Image or \
@@ -393,7 +400,12 @@
os.remove(servicefile)
except:
pass #if not present do not worry
- self.parent.OosChanged(True, filename + u'.oos')
+ name = filename.split(os.path.sep)
+ self.serviceName = name[-1]
+ self.parent.OosChanged(True, self.serviceName)
+
+ def onQuickSaveService(self):
+ self.onSaveService(True)
def onLoadService(self):
"""
Follow ups