From 9f61b0f1bc9393b6d8b92f62f4b82fb91a5b314b Mon Sep 17 00:00:00 2001 From: Frederic Back Date: Fri, 29 Sep 2006 08:06:14 +0000 Subject: * Install a desktop entry and an icon * Minor cleanup in the renderer git-svn-id: file:///home/lennart/svn/public/fring/trunk@50 d0d2c35f-0a1e-0410-abeb-dabff30a67ee --- AUTHORS | 2 ++ README | 0 TODO | 15 +++++++---- setup.py | 14 +++++++--- src/fring.desktop | 12 +++++++++ src/fring.svg | 63 +++++++++++++++++++++++++++++++++++++++++++ src/fringlib/fringrenderer.py | 23 ++++++++-------- 7 files changed, 109 insertions(+), 20 deletions(-) create mode 100644 AUTHORS create mode 100644 README create mode 100644 src/fring.desktop create mode 100644 src/fring.svg diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..68d5581 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Lennart Poettering lennart@poettering.net +Frederic Back fredericback@gmail.com diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/TODO b/TODO index 0c7a1f5..f5e3361 100644 --- a/TODO +++ b/TODO @@ -16,12 +16,17 @@ TODO ========================= DISPLAY [x] display total in ring center -[ ] always render text on top -[ ] make sure that filenames are always visible -[ ] do more magic adjustments -[ ] clean gui -> renderer interface +[x] restore the rainbow +[D] always render text on top +[-] make sure that filenames are always visible +[ ] cut down loooong directory names in link labels ========================= FOLDER READING -[ ] merge back c_walker +[x] merge back c_walker +[x] sort subdirectories +[ ] don't re-walk the tree when opening a subdirectory [ ] don't use size, use blocks of 512k instead (this will solve a couple of long/int bugs) + +========================= DOCUMENTATION +[ ] write README diff --git a/setup.py b/setup.py index dfdd680..43b606b 100644 --- a/setup.py +++ b/setup.py @@ -4,18 +4,24 @@ from os import sep from distutils.core import setup, Extension if __name__ == '__main__' : - - module = Extension('fringtools',sources = ['src'+sep+'extension'+sep+'fringtools.cpp']) setup(\ name = "fring", version = "0.0.1", license = "GPL", - description = "Display Disk Usage Visually", + description = "Display disk usage visually", packages = ['fringlib'], package_dir = {'fringlib': 'src'+sep+'fringlib'}, scripts = ['src'+sep+'fring'], - ext_modules = [ module ] + data_files = [ + ("share"+sep+"fring", ['AUTHORS','COPYING','TODO','README']), + ("share"+sep+"pixmaps", ["src"+sep+"fring.svg"]), + ("share"+sep+"applications",['src'+sep+'fring.desktop']), + ], + + ext_modules = [ + Extension('fringtools',sources = ['src'+sep+'extension'+sep+'fringtools.cpp']) + ], ) diff --git a/src/fring.desktop b/src/fring.desktop new file mode 100644 index 0000000..3f3d7a2 --- /dev/null +++ b/src/fring.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=0.1 +Type=Application +Encoding=UTF-8 +Name=fring +GenericName=fring +Comment=Display disk usage visually +Icon=fring.svg +Exec=fring +Terminal=false +Categories=GNOME;GTK;Application;System + diff --git a/src/fring.svg b/src/fring.svg new file mode 100644 index 0000000..3d7be83 --- /dev/null +++ b/src/fring.svg @@ -0,0 +1,63 @@ + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/src/fringlib/fringrenderer.py b/src/fringlib/fringrenderer.py index 9b92418..c5fd5ee 100644 --- a/src/fringlib/fringrenderer.py +++ b/src/fringlib/fringrenderer.py @@ -46,9 +46,13 @@ class FringRenderer: self.LINE_WIDTH = .5 self.LABEL_UNTIL_RING = 0 self.RING_OUTLINE_COLOR = (.2,.2,.2) + self.LEG_LINE_WIDTH = 1 self.LEG_LINE_COLOR = (.1,.1,.1) + self.LINK_LABEL_COLOR = (0,0,1) + self.FILE_LABEL_COLOR = (.5,.5,.5) + def prepare_layouts(self,ctx): self.linklayout = ctx.create_layout() @@ -125,7 +129,6 @@ class FringRenderer: leg_radius = self.INNER_RADIUS + (self.RINGS_MAX+1) * (self.RING_RADIUS + self.RING_SPACE) leg_radius -= (self.RING_RADIUS + self.RING_SPACE) / 2 - if cos((start+end)*pi) >= 0: x = self.WIDTH align_x = 0 @@ -135,7 +138,6 @@ class FringRenderer: y = CENTERY+leg_radius*sin((start+end)*pi) xmod = 2*(align_x*2-1) - #xmod = 0 point_a = CENTERX+e*cos((start+end)*pi), CENTERY+e*sin((start+end)*pi) point_b = CENTERX+leg_radius*cos((start+end)*pi), CENTERY+leg_radius*sin((start+end)*pi) @@ -143,23 +145,22 @@ class FringRenderer: # draw the side link label ctx.move_to(x+xmod,y) - if hasContents: - ctx.set_source_rgb(0,0,1) - width,height = self._draw_centered_text(ctx, fn + "/", align_x) - else: - ctx.set_source_rgb(0.5,0.5,0.5) - width,height = self._draw_centered_text(ctx, fn, align_x) + if hasContents: ctx.set_source_rgb(*self.LINK_LABEL_COLOR) + else: ctx.set_source_rgb(*self.FILE_LABEL_COLOR) + + # todo: cut down label size if longer than WIDTH/2 - ring*ringradius - innerradius + label = fn - if align_x == 0: - width *= -1 + width,height = self._draw_centered_text(ctx, label, align_x) + if align_x == 0: width *= -1 #TODO change this... self.__register_side_link(hasContents,p,value,end-start,x,y+(height/2),x+(width),y-(height/2)) # draw line ctx.move_to(*point_a) ctx.line_to(*point_b) offset = 5 - if align_x: ctx.line_to(point_c[0]+width+offset,point_c[1]) + if align_x: ctx.line_to(point_c[0]+width+offset,point_c[1]) #TODO ...and this! else: ctx.line_to(point_c[0]+xmod+width-offset,point_c[1]) ctx.set_source_rgb(*self.LEG_LINE_COLOR) ctx.set_line_width(self.LEG_LINE_WIDTH) -- cgit