Merge lp:~maikels/openlp/menufix into lp:openlp

Proposed by Maikel Stuivenberg
Status: Superseded
Proposed branch: lp:~maikels/openlp/menufix
Merge into: lp:openlp
Diff against target: None lines
To merge this branch: bzr merge lp:~maikels/openlp/menufix
Reviewer Review Type Date Requested Status
Jon Tibble (community) Approve
Tim Bentley Approve
Review via email: mp+12039@code.launchpad.net

This proposal has been superseded by a proposal from 2009-09-18.

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote :

Looks good to me

review: Approve
lp:~maikels/openlp/menufix updated
549. By Maikel Stuivenberg

small fix for quick save

Revision history for this message
Jon Tibble (meths) wrote :

Looks fine here. Uncovered other issues in testing none the fault of this patch.

review: Approve
lp:~maikels/openlp/menufix updated
550. By Maikel Stuivenberg

Another save fix..

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/ui/mainwindow.py'
2--- openlp/core/ui/mainwindow.py 2009-09-12 18:27:17 +0000
3+++ openlp/core/ui/mainwindow.py 2009-09-18 09:03:04 +0000
4@@ -519,6 +519,14 @@
5 QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked)
6 QtCore.QObject.connect(Receiver.get_receiver(),
7 QtCore.SIGNAL(u'update_global_theme'), self.defaultThemeChanged)
8+ QtCore.QObject.connect(self.FileNewItem,
9+ QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onNewService)
10+ QtCore.QObject.connect(self.FileOpenItem,
11+ QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onLoadService)
12+ QtCore.QObject.connect(self.FileSaveItem,
13+ QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onQuickSaveService)
14+ QtCore.QObject.connect(self.FileSaveAsItem,
15+ QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onSaveService)
16 #warning cyclic dependency
17 #RenderManager needs to call ThemeManager and
18 #ThemeManager needs to call RenderManager
19
20=== modified file 'openlp/core/ui/servicemanager.py'
21--- openlp/core/ui/servicemanager.py 2009-09-12 17:24:16 +0000
22+++ openlp/core/ui/servicemanager.py 2009-09-18 09:03:04 +0000
23@@ -361,21 +361,28 @@
24 if serviceItem == itemcount and serviceItemCount == count:
25 self.ServiceManagerList.setCurrentItem(treewidgetitem1)
26
27- def onSaveService(self):
28+ def onSaveService(self, quick=False):
29 """
30 Save the current service in a zip file
31 This file contains
32 * An ood which is a pickle of the service items
33 * All image, presentation and video files needed to run the service.
34 """
35- filename = QtGui.QFileDialog.getSaveFileName(self,
36+
37+ if not quick:
38+ filename = QtGui.QFileDialog.getSaveFileName(self,
39 u'Save Order of Service',self.config.get_last_dir() )
40+ else:
41+ filename = self.config.get_last_dir()
42+ splittedFile = filename.split(u'.')
43+ if splittedFile[-1] != u'oos':
44+ filename = filename + u'.oos'
45 filename = unicode(filename)
46 if filename != u'':
47 self.config.set_last_dir(filename)
48 service = []
49 servicefile= filename + u'.ood'
50- zip = zipfile.ZipFile(unicode(filename) + u'.oos', 'w')
51+ zip = zipfile.ZipFile(unicode(filename), 'w')
52 for item in self.serviceItems:
53 service.append({u'serviceitem':item[u'data'].get_oos_repr()})
54 if item[u'data'].service_item_type == ServiceType.Image or \
55@@ -393,7 +400,12 @@
56 os.remove(servicefile)
57 except:
58 pass #if not present do not worry
59- self.parent.OosChanged(True, filename + u'.oos')
60+ name = filename.split(os.path.sep)
61+ self.serviceName = name[-1]
62+ self.parent.OosChanged(True, self.serviceName)
63+
64+ def onQuickSaveService(self):
65+ self.onSaveService(True)
66
67 def onLoadService(self):
68 """