forked from openlp/openlp
Fix for the File Menu
This commit is contained in:
parent
787e26dcbf
commit
e5d97d17d9
@ -519,6 +519,14 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
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
|
||||
|
@ -361,21 +361,28 @@ class ServiceManager(QtGui.QWidget):
|
||||
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 @@ class ServiceManager(QtGui.QWidget):
|
||||
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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user