10-30-2009, 04:39 PM | #1 |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
Iliad Toolbox: some tools for your device
EDIT: new version 1.2
Main new features: - new file browser - system operations: reboot and power-off - readme Screenshots have been updated as well. Please, read the documentation, as some features have changed a bit. Look at the readme file. Hello, I'm pleased to announce the first public version of Iliad Toolbox, v1.1. Iliad Toolbox is a set of some useful small applications for your Iliad. Tools: - File Browser. (not implemented yet). - System Information. Shows information about: cpu, memory, battery, uptime, load, disks, processes - Recent Files. It lets you to delete some old entries in Recent Files that may pollute the list. - Power-off. I need it because the switch-off handle of my old Iliad doesn't work well. Better take a look at the screenshots to get an idea. Code: Iliad Toolbox has been written in Lua language and uses lgob (gtk+ bindings for lua), both compiled and packaged for Iliad by Great Hansel. Display refresh is handled by Hansel's xx, a small program based on Antartica's xepdmgr. You don't need to install them separately because they are included with the package (and in fact that's the reason it's so big). Installation: To install, uncompress, copy on your Iliad and run the installer from the ContentLister. To upgrade, delete the old version and proceed to install again. Btw, the install method has been created by Hansel as well. Using Iliad Toolbox: You need to use the stylus to click. The X on top-left is to close each window. Of course, all feedback, ideas and suggestions are welcome. Iņigo Last edited by Iņigo; 11-22-2009 at 05:05 PM. |
10-31-2009, 03:13 AM | #2 |
JSR FFD2
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
|
looks professional! And beautiful icons! Will you add a network page?
You may want to grab xx from the latest MiniPad. (Some) earlier versions had a problem when the xserver was not tcp enabled. A Lua tip: when you need multi-line strings, you can just say Code:
text = [[ line 1 line 2 line 2]] Last edited by hansel; 10-31-2009 at 03:35 AM. |
Advert | |
|
10-31-2009, 04:10 AM | #3 |
Guru
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
|
Iņigo,
since you have a shutdown function, why not add a reboot function? |
10-31-2009, 04:36 AM | #4 | |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
Quote:
My idea is to have only common utilities here; for instance, after thinking about it I've dicarded some posible features like registry explorer or network activation cause they are not generally useful. Anyway, please provide ideas. Iņigo |
|
10-31-2009, 04:46 AM | #5 | |||
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
Icons are from BlackSecret: http://gnome-look.org/content/show.p...content=112261
Quote:
Quote:
Quote:
some buttons to start / stop networking? Thanks a lot for the feedback, Iņigo |
|||
Advert | |
|
10-31-2009, 05:22 AM | #6 |
Guru
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
|
I don't know if people really need the function. For me, I created several shell scripts, such as reboot, shutdown, enable netword, disable network, and I put them in "Main Memory" so that I can access them easily in Contentlister. I did a lot of experiements on iLiad, and when something went wrong, rebooting without using the power-off button is really convenient for me. But for most people, they don't need reboot as often as I do.
Last edited by ericshliao; 10-31-2009 at 05:41 AM. |
10-31-2009, 12:12 PM | #7 | |
JSR FFD2
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
|
Quote:
Another tool could be an graphical interface to ipkg, to instal and upgrade Lua and Lgob Last edited by hansel; 10-31-2009 at 12:27 PM. |
|
11-01-2009, 02:00 AM | #8 |
Guru
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
|
Iņigo,
I see that there is a line in your code: evbox:modify_bg(gtk.STATE_NORMAL, gdk.color_parse("black")) Are you sure "gdk.color_parse("black")" correct? By the ref (http://library.gnome.org/devel/gdk/2...nd-Colors.html), gdk_color_parse() does not return a GdkColor variable. Gdk and Pango have some structs without a function to create it. For example, GdkColor, PangoMatrix. I can create these structs in C code without a creating-function, but I don't know how to create them in Lua. It is really frustrating. Last edited by ericshliao; 11-01-2009 at 02:05 AM. |
11-01-2009, 08:43 AM | #9 | |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
Quote:
Code:
[inigo@inigo ~]$ lua Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > require("lgob.gdk") > =gdk.color_parse("black") Boxed(GdkColor): 0x23ddbb0 I think is this second case in gdk.color_parse(), the color is returned: Code:
Lua: color = gdk.color_parse("black") C: GdkColor *col = gdk_colormap_alloc_color(); gdk_color_parse("black", col); [I needed the iter for a row in a treeview when I click on it] Code:
local res, iterpath = view:get_path_at_pos(x, y) local iter = gtk.TreeIter.new() model:get_iter_from_string(iter, iterpath) But note that in previous "view:get_path_at_pos()" call the path I want is returned as the second value, first one being a true/false boolean saying if method was ok. Completely different from C API. Coming from pygtk I find Lua API quite confusing, sometimes it's like C API but other times is like Python API. It's not predictive or at least I can't fully understand the logic behind it. As there is no lgob documentation I often spend hours and hours trying to get the proper API for some functions and methods... read C and python API, look for some examples in google, check different approaches and use prints to check the results... Anyway, coding in lua/lgob is funny, not so funny as in pygtk but much better than in C Iņigo |
|
11-01-2009, 11:22 AM | #10 |
Guru
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
|
|
11-01-2009, 12:09 PM | #11 | |
JSR FFD2
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
|
Quote:
Code:
--[[ Handles the conversions between C and Lua function calls. --]] For example to delete the selected text in a text buffer you have to do: Code:
local b,e = gtk.TextIter:new(), gtk.TextIter:new() local sel = buffer:get_selection_bounds(b,e) if sel then buf:delete(b,e) end Code:
function gtk.TextBuffer:get_sel_bounds() local b,e = gtk.TextIter:new(), gtk.TextIter:new() local sel = self:get_selection_bounds(b,e) return sel, b, e end Code:
local sel, b, e = buf:get_sel_bounds() if sel then buf:delete(b,e) end Last edited by hansel; 11-01-2009 at 12:29 PM. |
|
11-01-2009, 12:20 PM | #12 |
JSR FFD2
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
|
For inspiration look in lgob-9.09/gdk/src/gdk.def:
Code:
defFunction('gdk_color_parse', { since = '0.1', args = {'char* none', 'struct* full'}, ret = 'boolean none' } ) Code:
static int _wrap_gdk_color_parse(lua_State* L) { GdkColor color; gdk_color_parse(lua_tostring(L, 1), &color); boxed_new(L, GDK_TYPE_COLOR, &color); return 1; } PS: shall we start a new thread for lgob discussions to avoid 'polluting' the software release threads? |
11-01-2009, 01:42 PM | #13 | |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
Quote:
Anyway, you're right, we should move to other thread. Btw, what do you think about creating a lua+lgob+xx installer to not include inside each new program? Iņigo |
|
11-11-2009, 10:00 AM | #14 |
Junior Member
Posts: 4
Karma: 10
Join Date: Nov 2009
Device: Irex Iliad
|
I downloaded Software tools, unzipped and copied to CF card. I went to device manager then to CF card. There I could "Iliad Toolbox: Install it on your Iliad". When I click on it, the screen flashes once and then green LED blinks for a couple of seconds and then nothing happens.
Is the toolbox installed ? If yes then how do I run it ? I Just received my Iliad. I have downloaded the developers package as explained here (https://www.mobileread.com/forums/showthread.php?t=17342) and also checked mrxvt runs fine. Is there anything I am doing wrong ? |
11-12-2009, 10:00 AM | #15 |
Junior Member
Posts: 4
Karma: 10
Join Date: Nov 2009
Device: Irex Iliad
|
Got it working. I unzipped the tar.gz using winzip. That caused some LF/CR changes. I unzipped with WinRar and then transferred to SD card. Now the installation went through fine.
Great tool. Thanks |
Tags |
lua, toolbox, tools |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Free Book (Kindle) - The Conflict Resolution Toolbox (UK only) | koland | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 08-14-2010 09:58 AM |
iLiad Device Support | DesiLinguist | Calibre | 11 | 08-06-2009 01:58 AM |
PDF Toolbox on Mashable.com | sic | News | 0 | 07-25-2007 12:29 PM |
Photo of smashed iLiad device | TadW | iRex | 13 | 01-24-2007 05:26 PM |
Useful tools for the iLiad | LittleTalker | iRex | 24 | 05-15-2006 08:28 AM |