Skip to content

Commit

Permalink
I fixed issue #38: remove the crappy URI text ellipsization that I di…
Browse files Browse the repository at this point in the history
…d in Specto a while ago. The

reason? Because pango does that automagically! Please backport this fix to your branches if needed.

I also added launch.sh to circumvent the stupidness of GNOME's launchers.
  • Loading branch information
nekohayo committed Jan 21, 2007
1 parent e7abdc7 commit 11ea804
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
8 changes: 8 additions & 0 deletions data/doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2007-01-20 Jean-Francois Fortin
* use pango to ellipsize (truncate) the webpage URIs shown in the notifier window. Better results and less hacks.

2007-01-05 Jean-Francois Fortin
* late happy new year, folks :)
* added back the launch.sh script. This is used only for those who do not want to install Specto and who face gnome's stupid launchers. Starting
"specto" directly still works though.

2006-12-26 Wout Clymans
* Export watches implemented

Expand Down
3 changes: 3 additions & 0 deletions launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
cd `dirname $0`
PYTHONPATH=$PYTHONPATH:src ./specto $@
19 changes: 4 additions & 15 deletions spectlib/notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import gtk
import gtk.glade
import gobject
import pango
except:
pass

Expand Down Expand Up @@ -307,21 +308,9 @@ def show_watch_info(self, *args):
if selected.type == 0:
#get the info
self.lblNameText.set_label(selected.name)

#Strip down the URI lenght to prevent messing up the user interface width
if len(selected.url_) >=45:
if "https://" in selected.url_:
strippedurl = selected.url_[8:]
elif "http://" in selected.url_:
strippedurl = selected.url_[7:]
elif "ftp://" in selected.url_:
strippedurl = selected.url_[6:]

#We want maximum 45 characters, so let's just keep 20 from the start and end.
strippedurl = ( strippedurl[:15] + " ... " + strippedurl[-15:] )
self.lblLocationText.set_label(strippedurl)
else:#The URL is short enough, we keep it as is.
self.lblLocationText.set_label(selected.url_)

self.lblLocationText.set_label(selected.url_)
self.lblLocationText.set_ellipsize(pango.ELLIPSIZE_MIDDLE)#shorten the string in the middle if the URI is too long

margin = float(selected.error_margin) * 100
self.lblErrorMarginText.set_label(str(margin) + " %")
Expand Down

0 comments on commit 11ea804

Please sign in to comment.