summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Back <fredericback@gmail.com>2006-09-29 08:06:14 +0000
committerFrederic Back <fredericback@gmail.com>2006-09-29 08:06:14 +0000
commit9f61b0f1bc9393b6d8b92f62f4b82fb91a5b314b (patch)
treeefdc2134fe3f58a99257522dfda37a04d03d63b6
parent0e94ac3838dffe81e82a2b01e3f94314d0ea67fa (diff)
* 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
-rw-r--r--AUTHORS2
-rw-r--r--README0
-rw-r--r--TODO15
-rw-r--r--setup.py14
-rw-r--r--src/fring.desktop12
-rw-r--r--src/fring.svg63
-rw-r--r--src/fringlib/fringrenderer.py23
7 files changed, 109 insertions, 20 deletions
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
--- /dev/null
+++ b/README
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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="25.6pt"
+ height="25.6pt"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.43"
+ version="1.0"
+ sodipodi:docbase="/home/fbk/dev/fring/trunk/src"
+ sodipodi:docname="fring.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="12.210826"
+ inkscape:cx="16.933578"
+ inkscape:cy="13.675269"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:window-width="1014"
+ inkscape:window-height="689"
+ inkscape:window-x="0"
+ inkscape:window-y="27" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path1336"
+ sodipodi:cx="16.256067"
+ sodipodi:cy="15.170671"
+ sodipodi:rx="11.506183"
+ sodipodi:ry="11.506183"
+ d="M 27.76225 15.170671 A 11.506183 11.506183 0 1 1 4.7498846,15.170671 A 11.506183 11.506183 0 1 1 27.76225 15.170671 z"
+ transform="translate(0.327578,8.189454e-2)" />
+ </g>
+</svg>
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)