Active Topics

 



Notices


Reply
Thread Tools
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#181
Originally Posted by BrentDC View Post
Code:
def shorten_text(self, variable_holding_text):
    if len(variable_holding_text) > 15:
        new_variable = variable_holding_text[0:15] + " ..."
    return new_variable
Extremely easy!
Or:
Code:
def shorten_text(self, variable_holding_text):
    if len(variable_holding_text) > 18:
        new_variable = variable_holding_text[0:15] + " ..."
    return new_variable
After all, if you can hold 15 chars with " ..." you can hold at least 17, and usually 18, chars without.
 
bongo's Avatar
Posts: 291 | Thanked: 124 times | Joined on Feb 2006 @ Trier, Germany
#182
Originally Posted by Bundyo View Post
Yes, xbel support is planned.
That's good news.

Could you please implement a temporary solution to delete/edit bookmarks?
__________________
ongo bongo!
 
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#183
I've already did add removing bookmarks using the star when there is bookmark already. I have some things yet to do before the next release though.
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#184
Originally Posted by Benson View Post
Or:
Code:
def shorten_text(self, variable_holding_text):
    if len(variable_holding_text) > 18:
        new_variable = variable_holding_text[0:15] + " ..."
    return new_variable
After all, if you can hold 15 chars with " ..." you can hold at least 17, and usually 18, chars without.
True, True. This is really something that should be changeable in the settings (which should be a Control Panel applet. K, TrueJournals? ).

I have a programming rule: if I find myself putting an arbitrary hard-coded value into my program, chances are it should be user-configurable.

So, shorten_text version 2:

Code:
def shorten_text(self, variable_holding_text):
    settings = self.get_settings() # a function to get all user settings. This should be a list.
    if len(variable_holding_text) > settings['title_length']:
        end_length = settings['title_length'] - 3
        new_variable = variable_holding_text[0:end_length] + " ..."
    return new_variable

I think that'll work. Never tested using a variable as a slice index, though... (translated, it'll cause you plugin to silently fail like all problems with Python hildon-desktop plugins do).
__________________
-Brent

Author of TouchSearch -- web searching software for Maemo 5.

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900
 
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#185
Btw, these changes to the Tear bookmarks remove the need for VBox and look good on the dark Echo background (also add left alignment):

Code:
       for row in self.c:
             menuitem = gtk.ImageMenuItem()
             label = gtk.Label("")
             label.set_markup("<span color='#7090BA'><b>"+self.html_escape(str(row[1]))+"</b></span>\n<span foreground='#FFF'>%s</span>" % row[2])
             label.set_alignment(0, 0)
             menuitem.add(label)
             self.menu.append(menuitem)
             menuitem.connect('activate',self.open_url,row[2])

       #menu_item = gtk.SeparatorMenuItem()
       #self.menu.append(menu_item)
Right now i'm directly using white for the bookmark url, but if we can get the theme fg color will be best. I tried with

Code:
fgcolor = menu_item.get_child().get_style().text[0]
and with
Code:
scheme = gtk.Object(gtk.Settings().get_default()).get("gtk-color-scheme")
But I'm not very good with Python and even less with Hildon Desktop and wasn't able to see the error messages which I was getting to check what I'm receiving. Maybe someone else can take it from here?
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 
bongo's Avatar
Posts: 291 | Thanked: 124 times | Joined on Feb 2006 @ Trier, Germany
#186
Originally Posted by Bundyo View Post
I've already did add removing bookmarks using the star when there is bookmark already. I have some things yet to do before the next release though.
Doesn't work for me. I use 0.3pre4 ...
__________________
ongo bongo!
 
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#187
Its not released
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#188
Originally Posted by Bundyo View Post
Btw, these changes to the Tear bookmarks remove the need for VBox and look good on the dark Echo background (also add left alignment):

Code:
       for row in self.c:
             menuitem = gtk.ImageMenuItem()
             label = gtk.Label("")
             label.set_markup("<span color='#7090BA'><b>"+self.html_escape(str(row[1]))+"</b></span>\n<span foreground='#FFF'>%s</span>" % row[2])
             label.set_alignment(0, 0)
             menuitem.add(label)
             self.menu.append(menuitem)
             menuitem.connect('activate',self.open_url,row[2])

       #menu_item = gtk.SeparatorMenuItem()
       #self.menu.append(menu_item)
Right now i'm directly using white for the bookmark url, but if we can get the theme fg color will be best. I tried with

Code:
fgcolor = menu_item.get_child().get_style().text[0]
and with
Code:
scheme = gtk.Object(gtk.Settings().get_default()).get("gtk-color-scheme")
But I'm not very good with Python and even less with Hildon Desktop and wasn't able to see the error messages which I was getting to check what I'm receiving. Maybe someone else can take it from here?
Python hildon-desktop applets/plugins always silently fail. At least on the device (I hear you can get the debug text on scratchbox...if I can ever get it installed).

I'll take a look at it later and see if I can figure out how to do it.
__________________
-Brent

Author of TouchSearch -- web searching software for Maemo 5.

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900
 
bongo's Avatar
Posts: 291 | Thanked: 124 times | Joined on Feb 2006 @ Trier, Germany
#189
Originally Posted by Bundyo View Post
Its not released
Might be the reason ...

I had an other thought about the bookmark manager: what about mer? The microb manager won't be there so maybe we need a new one.
__________________
ongo bongo!
 

The Following User Says Thank You to bongo For This Useful Post:
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#190
Yeah, you're right, ask me for a project join if you have an urge to do it
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 
Reply

Tags
brower, browser, browserd fix, khtml, microb alternative, microb killer, tear, webkit, www


 
Forum Jump


All times are GMT. The time now is 04:59.