Fix name standards

This commit is contained in:
Tim Bentley 2009-10-17 20:13:11 +01:00
parent d5b5549ca0
commit 3c9ffae002
4 changed files with 20 additions and 20 deletions

View File

@ -250,7 +250,7 @@ class Plugin(object):
"""
Called by the plugin to remove toolbar
"""
self.mediadock.removeDock(self.name)
self.mediadock.remove_dock(self.name)
self.settings.removeTab(self.name)
def insert_toolbox_item(self):
@ -258,6 +258,6 @@ class Plugin(object):
Called by plugin to replace toolbar
"""
if self.media_item is not None:
self.mediadock.insertDock(self.media_item, self.icon, self.weight)
self.mediadock.insert_dock(self.media_item, self.icon, self.weight)
if self.settings_tab is not None:
self.settings.insertTab(self.settings_tab, self.weight)

View File

@ -140,7 +140,7 @@ class PluginManager(object):
if plugin.media_item is not None:
log.debug(u'Inserting media manager item from %s' % \
plugin.name)
mediadock.addDock(plugin.media_item, plugin.icon, plugin.weight)
mediadock.add_dock(plugin.media_item, plugin.icon, plugin.weight)
def hook_settings_tabs(self, settingsform=None):
"""

View File

@ -24,19 +24,19 @@
import logging
log = logging.getLogger(u'MediaDockManager')
log = logging.getLogger(u'media_dockManager')
class MediaDockManager(object):
def __init__(self, mediaDock):
self.mediaDock = mediaDock
def __init__(self, media_dock):
self.media_dock = media_dock
def addDock(self, media_item, icon, weight):
def add_dock(self, media_item, icon, weight):
log.info(u'Adding %s dock' % media_item.title)
id = self.mediaDock.addItem(
id = self.media_dock.addItem(
media_item, icon, media_item.title)
def insertDock(self, media_item, icon, weight):
def insert_dock(self, media_item, icon, weight):
"""
This should insert a dock item at a given location
This does not work as it gives a Segmentation error.
@ -44,18 +44,18 @@ class MediaDockManager(object):
"""
log.debug(u'Inserting %s dock' % media_item.title)
match = False
for dock_index in range(0, self.mediaDock.count()):
if self.mediaDock.widget(dock_index).ConfigSection == media_item.title.lower():
for dock_index in range(0, self.media_dock.count()):
if self.media_dock.widget(dock_index).ConfigSection == media_item.title.lower():
match = True
break
if not match:
self.mediaDock.addItem(media_item, icon, media_item.title)
self.media_dock.addItem(media_item, icon, media_item.title)
def removeDock(self, name):
def remove_dock(self, name):
log.debug(u'remove %s dock' % name)
for dock_index in range(0, self.mediaDock.count()):
if self.mediaDock.widget(dock_index) is not None:
if self.mediaDock.widget(dock_index).ConfigSection == name.lower():
self.mediaDock.widget(dock_index).hide()
self.mediaDock.removeItem(dock_index)
for dock_index in range(0, self.media_dock.count()):
if self.media_dock.widget(dock_index) is not None:
if self.media_dock.widget(dock_index).ConfigSection == name.lower():
self.media_dock.widget(dock_index).hide()
self.media_dock.removeItem(dock_index)

View File

@ -415,7 +415,6 @@ class ThemeManager(QtGui.QWidget):
theme_file = os.path.join(theme_dir, name + u'.xml')
log.debug(theme_file)
result = QtGui.QMessageBox.Yes
print self.saveThemeName , name
if self.saveThemeName != name:
if os.path.exists(theme_file):
result = QtGui.QMessageBox.question(
@ -432,8 +431,9 @@ class ThemeManager(QtGui.QWidget):
outfile.write(theme_pretty_xml)
outfile.close()
if image_from is not None and image_from != image_to:
print "if", image_from
print "it", image_to
shutil.copyfile(image_from, image_to)
self.generateAndSaveImage(self.path, name, theme_xml)
self.loadThemes()
else: