From c0f4bb7bb218e4ec2d140874837bee89ab6ef591 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Sun, 25 Oct 2009 19:02:13 +0100 Subject: [PATCH] Display only the plugin file without plugin path in the options. Fixes issues with text wrapping when the path was too long. --- picard/plugin.py | 5 +++-- picard/ui/options/plugins.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/picard/plugin.py b/picard/plugin.py index f37681b14..843fb1410 100644 --- a/picard/plugin.py +++ b/picard/plugin.py @@ -53,8 +53,9 @@ class ExtensionPoint(QtCore.QObject): class PluginWrapper(object): - def __init__(self, module): + def __init__(self, module, plugindir): self.module = module + self.dir = plugindir def __get_name(self): try: @@ -133,7 +134,7 @@ class PluginManager(QtCore.QObject): info = imp.find_module(name, [plugindir]) try: plugin_module = imp.load_module('picard.plugins.' + name, *info) - plugin = PluginWrapper(plugin_module) + plugin = PluginWrapper(plugin_module, plugindir) for version in list(plugin.api_versions): found = False for api_version in picard.api_versions: diff --git a/picard/ui/options/plugins.py b/picard/ui/options/plugins.py index c7963f8a6..71512f397 100644 --- a/picard/ui/options/plugins.py +++ b/picard/ui/options/plugins.py @@ -96,7 +96,7 @@ class PluginsOptionsPage(OptionsPage): author = plugin.author if author: text.append("" + _("Author") + ": " + author) - text.append("" + _("File") + ": " + plugin.file) + text.append("" + _("File") + ": " + plugin.file[len(plugin.dir)+1:]) self.ui.details.setText("

%s

" % "
\n".join(text)) def open_plugin_dir(self):