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

Proposed by Maikel Stuivenberg
Status: Merged
Merged at revision: not available
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
Tim Bentley Approve
Jon Tibble (community) Approve
Review via email: mp+12055@code.launchpad.net

This proposal supersedes a proposal from 2009-09-18.

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

Looks good to me

review: Approve
Revision history for this message
Jon Tibble (meths) wrote : Posted in a previous version of this proposal

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

review: Approve
Revision history for this message
Jon Tibble (meths) :
review: Approve
Revision history for this message
Tim Bentley (trb143) wrote :

Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
519 QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked)519 QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked)
520 QtCore.QObject.connect(Receiver.get_receiver(),520 QtCore.QObject.connect(Receiver.get_receiver(),
521 QtCore.SIGNAL(u'update_global_theme'), self.defaultThemeChanged)521 QtCore.SIGNAL(u'update_global_theme'), self.defaultThemeChanged)
522 QtCore.QObject.connect(self.FileNewItem,
523 QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onNewService)
524 QtCore.QObject.connect(self.FileOpenItem,
525 QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onLoadService)
526 QtCore.QObject.connect(self.FileSaveItem,
527 QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onQuickSaveService)
528 QtCore.QObject.connect(self.FileSaveAsItem,
529 QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onSaveService)
522 #warning cyclic dependency530 #warning cyclic dependency
523 #RenderManager needs to call ThemeManager and531 #RenderManager needs to call ThemeManager and
524 #ThemeManager needs to call RenderManager532 #ThemeManager needs to call RenderManager
525533
=== 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 13:45:07 +0000
@@ -100,6 +100,7 @@
100 self.parent = parent100 self.parent = parent
101 self.serviceItems = []101 self.serviceItems = []
102 self.serviceName = u''102 self.serviceName = u''
103 self.isNew = True
103 self.Layout = QtGui.QVBoxLayout(self)104 self.Layout = QtGui.QVBoxLayout(self)
104 self.Layout.setSpacing(0)105 self.Layout.setSpacing(0)
105 self.Layout.setMargin(0)106 self.Layout.setMargin(0)
@@ -319,6 +320,7 @@
319 self.ServiceManagerList.clear()320 self.ServiceManagerList.clear()
320 self.serviceItems = []321 self.serviceItems = []
321 self.serviceName = u''322 self.serviceName = u''
323 self.isNew = True
322 self.parent.OosChanged(True, self.serviceName)324 self.parent.OosChanged(True, self.serviceName)
323325
324 def onDeleteFromService(self):326 def onDeleteFromService(self):
@@ -361,21 +363,28 @@
361 if serviceItem == itemcount and serviceItemCount == count:363 if serviceItem == itemcount and serviceItemCount == count:
362 self.ServiceManagerList.setCurrentItem(treewidgetitem1)364 self.ServiceManagerList.setCurrentItem(treewidgetitem1)
363365
364 def onSaveService(self):366 def onSaveService(self, quick=False):
365 """367 """
366 Save the current service in a zip file368 Save the current service in a zip file
367 This file contains369 This file contains
368 * An ood which is a pickle of the service items370 * An ood which is a pickle of the service items
369 * All image, presentation and video files needed to run the service.371 * All image, presentation and video files needed to run the service.
370 """372 """
371 filename = QtGui.QFileDialog.getSaveFileName(self,373 if not quick or self.isNew:
374 filename = QtGui.QFileDialog.getSaveFileName(self,
372 u'Save Order of Service',self.config.get_last_dir() )375 u'Save Order of Service',self.config.get_last_dir() )
373 filename = unicode(filename)376 else:
377 filename = self.config.get_last_dir()
374 if filename != u'':378 if filename != u'':
379 splittedFile = filename.split(u'.')
380 if splittedFile[-1] != u'oos':
381 filename = filename + u'.oos'
382 filename = unicode(filename)
383 self.isNew = False
375 self.config.set_last_dir(filename)384 self.config.set_last_dir(filename)
376 service = []385 service = []
377 servicefile= filename + u'.ood'386 servicefile= filename + u'.ood'
378 zip = zipfile.ZipFile(unicode(filename) + u'.oos', 'w')387 zip = zipfile.ZipFile(unicode(filename), 'w')
379 for item in self.serviceItems:388 for item in self.serviceItems:
380 service.append({u'serviceitem':item[u'data'].get_oos_repr()})389 service.append({u'serviceitem':item[u'data'].get_oos_repr()})
381 if item[u'data'].service_item_type == ServiceType.Image or \390 if item[u'data'].service_item_type == ServiceType.Image or \
@@ -393,7 +402,12 @@
393 os.remove(servicefile)402 os.remove(servicefile)
394 except:403 except:
395 pass #if not present do not worry404 pass #if not present do not worry
396 self.parent.OosChanged(True, filename + u'.oos')405 name = filename.split(os.path.sep)
406 self.serviceName = name[-1]
407 self.parent.OosChanged(True, self.serviceName)
408
409 def onQuickSaveService(self):
410 self.onSaveService(True)
397411
398 def onLoadService(self):412 def onLoadService(self):
399 """413 """
@@ -412,6 +426,7 @@
412 zip = zipfile.ZipFile(unicode(filename))426 zip = zipfile.ZipFile(unicode(filename))
413 filexml = None427 filexml = None
414 themename = None428 themename = None
429
415 for file in zip.namelist():430 for file in zip.namelist():
416 names = file.split(os.path.sep)431 names = file.split(os.path.sep)
417 file_to = os.path.join(self.servicePath,432 file_to = os.path.join(self.servicePath,
@@ -439,6 +454,7 @@
439 except:454 except:
440 log.error(u'Problem processing oos load %s', sys.exc_info()[0])455 log.error(u'Problem processing oos load %s', sys.exc_info()[0])
441 pass456 pass
457 self.isNew = False
442 self.serviceName = name[len(name) - 1]458 self.serviceName = name[len(name) - 1]
443 self.parent.OosChanged(True, self.serviceName)459 self.parent.OosChanged(True, self.serviceName)
444460