forked from openlp/openlp
Fix duplicate file save bug
Fix Dnd bug bzr-revno: 1074 Fixes: https://launchpad.net/bugs/656177
This commit is contained in:
commit
e37682cb03
@ -96,7 +96,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
#TODO: plugin should not be the parent in future
|
#TODO: plugin should not be the parent in future
|
||||||
self.plugin = parent # plugin
|
self.plugin = parent # plugin
|
||||||
visible_title = self.plugin.getString(StringContent.VisibleName)
|
visible_title = self.plugin.getString(StringContent.VisibleName)
|
||||||
self.title = visible_title[u'title']
|
self.title = unicode(visible_title[u'title'])
|
||||||
self.settingsSection = self.plugin.name.lower()
|
self.settingsSection = self.plugin.name.lower()
|
||||||
if isinstance(icon, QtGui.QIcon):
|
if isinstance(icon, QtGui.QIcon):
|
||||||
self.icon = icon
|
self.icon = icon
|
||||||
|
@ -303,7 +303,7 @@ class Plugin(QtCore.QObject):
|
|||||||
The new name the plugin should now use.
|
The new name the plugin should now use.
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def getString(self, name):
|
def getString(self, name):
|
||||||
"""
|
"""
|
||||||
encapsulate access of plugins translated text strings
|
encapsulate access of plugins translated text strings
|
||||||
@ -314,4 +314,4 @@ class Plugin(QtCore.QObject):
|
|||||||
"""
|
"""
|
||||||
Called to define all translatable texts of the plugin
|
Called to define all translatable texts of the plugin
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
@ -101,9 +101,9 @@ class ServiceItem(object):
|
|||||||
self.main = None
|
self.main = None
|
||||||
self.footer = None
|
self.footer = None
|
||||||
self.bg_image_bytes = None
|
self.bg_image_bytes = None
|
||||||
self._new_item()
|
|
||||||
self.search_string = u''
|
self.search_string = u''
|
||||||
self.data_string = u''
|
self.data_string = u''
|
||||||
|
self._new_item()
|
||||||
|
|
||||||
def _new_item(self):
|
def _new_item(self):
|
||||||
"""
|
"""
|
||||||
|
@ -602,6 +602,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
zip = None
|
zip = None
|
||||||
file = None
|
file = None
|
||||||
try:
|
try:
|
||||||
|
write_list = []
|
||||||
zip = zipfile.ZipFile(unicode(filename), 'w')
|
zip = zipfile.ZipFile(unicode(filename), 'w')
|
||||||
for item in self.serviceItems:
|
for item in self.serviceItems:
|
||||||
service.append({u'serviceitem':item[u'service_item']
|
service.append({u'serviceitem':item[u'service_item']
|
||||||
@ -611,7 +612,10 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
path_from = unicode(os.path.join(
|
path_from = unicode(os.path.join(
|
||||||
frame[u'path'],
|
frame[u'path'],
|
||||||
frame[u'title']))
|
frame[u'title']))
|
||||||
zip.write(path_from.encode(u'utf-8'))
|
# On write a file once
|
||||||
|
if not path_from in write_list:
|
||||||
|
write_list.append(path_from)
|
||||||
|
zip.write(path_from.encode(u'utf-8'))
|
||||||
file = open(servicefile, u'wb')
|
file = open(servicefile, u'wb')
|
||||||
cPickle.dump(service, file)
|
cPickle.dump(service, file)
|
||||||
file.close()
|
file.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user