deskbar-applet r2160 - in trunk: . deskbar/handlers deskbar/handlers/actions
- From: sebp svn gnome org
- To: svn-commits-list gnome org
- Subject: deskbar-applet r2160 - in trunk: . deskbar/handlers deskbar/handlers/actions
- Date: Sun, 11 May 2008 11:04:48 +0100 (BST)
Author: sebp
Date: Sun May 11 10:04:48 2008
New Revision: 2160
URL: http://svn.gnome.org/viewvc/deskbar-applet?rev=2160&view=rev
Log:
Implement Action's get_tooltip method
Modified:
trunk/ChangeLog
trunk/deskbar/handlers/actions/OpenFileAction.py
trunk/deskbar/handlers/actions/OpenWithNautilusAction.py
trunk/deskbar/handlers/actions/ShowUrlAction.py
trunk/deskbar/handlers/beagle-live.py
Modified: trunk/deskbar/handlers/actions/OpenFileAction.py
==============================================================================
--- trunk/deskbar/handlers/actions/OpenFileAction.py (original)
+++ trunk/deskbar/handlers/actions/OpenFileAction.py Sun May 11 10:04:48 2008
@@ -25,10 +25,14 @@
def get_icon(self):
return "gtk-open"
- def is_valid(self):
+ def _get_unesacped_url_without_protocol(self):
url = self._url[7:]
if not self._escape:
url = gnomevfs.unescape_string_for_display(url)
+ return url
+
+ def is_valid(self):
+ url = self._get_unesacped_url_without_protocol()
if not exists(url):
LOGGER.debug("File %s does not exist", url)
@@ -52,3 +56,6 @@
def activate(self, text=None):
url_show_file(self._url, escape=self._escape)
+
+ def get_tooltip(self, text=None):
+ return self._get_unesacped_url_without_protocol()
Modified: trunk/deskbar/handlers/actions/OpenWithNautilusAction.py
==============================================================================
--- trunk/deskbar/handlers/actions/OpenWithNautilusAction.py (original)
+++ trunk/deskbar/handlers/actions/OpenWithNautilusAction.py Sun May 11 10:04:48 2008
@@ -29,4 +29,7 @@
elif uri_scheme in self.AUDIO_URIS:
return _("Open audio disc %s") % "<b>%(name)s</b>"
else:
- return _("Open location %s") % "<b>%(name)s</b>"
\ No newline at end of file
+ return _("Open location %s") % "<b>%(name)s</b>"
+
+ def get_tooltip(self, text=None):
+ return self._url
\ No newline at end of file
Modified: trunk/deskbar/handlers/actions/ShowUrlAction.py
==============================================================================
--- trunk/deskbar/handlers/actions/ShowUrlAction.py (original)
+++ trunk/deskbar/handlers/actions/ShowUrlAction.py Sun May 11 10:04:48 2008
@@ -24,4 +24,7 @@
return _("Open %s") % "<b>%(name)s</b>"
def activate(self, text=None):
- url_show(self._url)
\ No newline at end of file
+ url_show(self._url)
+
+ def get_tooltip(self, text=None):
+ return self._url
\ No newline at end of file
Modified: trunk/deskbar/handlers/beagle-live.py
==============================================================================
--- trunk/deskbar/handlers/beagle-live.py (original)
+++ trunk/deskbar/handlers/beagle-live.py Sun May 11 10:04:48 2008
@@ -8,7 +8,8 @@
from gettext import gettext as _
from os.path import basename
from gobject import GError
-import cgi, re
+import cgi
+import re
import deskbar, deskbar.interfaces.Module
import deskbar.interfaces.Match
import gnomevfs
@@ -308,18 +309,13 @@
return "system-search"
def get_verb(self):
- # stay backward compatible
- if hasattr(self, "_display_uri"):
- return _("Open History Item %s (%s)") % ("<b>%(name)s</b>", "<i>%(uri)s</i>")
- else:
- return _("Open History Item %s") % "<b>%(name)s</b>"
+ return _("Open History Item %s") % "<b>%(name)s</b>"
def get_name(self, text=None):
- # stay backward compatible
- if hasattr(self, "_display_uri"):
- return {'name': self._name, 'uri': self._display_uri}
- else:
- return ShowUrlAction.get_name(self, text=None)
+ return ShowUrlAction.get_name(self, text=None)
+
+ def get_tooltip(self, text=None):
+ return self._display_uri
class OpenBeagleFileAction(OpenFileAction):
def __init__(self, name, uri, inside_archive, parent_file):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]