http://git.freesmartphone.org/?p=specs.git;a=blob_plain;f=html/index.html;hb=HEAD
* Features to add:
- - calendar: show preview of next 30 days
- (not among the notes: it replaces the calendar view; unless we skip the empty dates, which is a good idea)
- next30: when clicking on an item, show that day and switch to day notes (conflates next30 and day notes)
- tab becomes day / month / all
- next30: don't update if not shown currently on the notebook
- gtk_calendar_set_detail_func
+ - alerts with at
+ - work without ogpsd
+ - use the gpsd dbus protocol
+ - power on/off the gps and start/stop gpsd
+ - set to keep the GPS on during suspend
+ - suspend/resume hooks to put the GPS into low power mode
+ - next30: don't update if not shown currently on the notebook
+ - gtk_calendar_set_detail_func
- contacts: show as a fancy focus+context list (see prefuse)
- GSM power and network
- link to open SHR-dialer
{
public UselessService()
{
- name = "app.debug.useless_service";
+ Object(name: "app.debug.useless_service");
}
}
public Keyboard()
{
- name = "keyboard";
+ Object(name: "keyboard");
}
private void on_child_quit(Pid pid, int status)
public PolygenPage(string name)
{
- this.name = name;
+ Object(name: name);
model = new Gtk.ListStore(3, typeof(string), typeof(string), typeof(string));
list = new Gtk.TreeView.with_model(model);
list.insert_column_with_attributes (-1, "Name", new Gtk.CellRendererText(), "text", 0);
public string grm_name { get; set; }
public string grm_type { get; set; }
- public PolygenRun()
+ public PolygenRun() throws RegexError
{
grm_name = "";
grm_type = "";
notebook.set_current_page(notebook.get_n_pages()-1);
}
- public Polygen(string label, IOChannel data)
+ public Polygen(string label, IOChannel data) throws ConvertError, IOChannelError, RegexError
{
_label = label;
pages = new Gee.ArrayList<PolygenPage>();
while (true)
{
- string line;
- var res = data.read_line(out line, null, null);
- if (res != IOStatus.NORMAL) break;
- string[] vals = line.split(" ", 3);
- if (vals == null) break;
- string[] np = vals[0].split("/", 2);
- if (np == null) break;
- add_grammar(np[0], np[1], vals[1], vals[2].strip());
+ string line;
+ var res = data.read_line(out line, null, null);
+ if (res != IOStatus.NORMAL) break;
+ string[] vals = line.split(" ", 3);
+ if (vals == null) break;
+ string[] np = vals[0].split("/", 2);
+ if (np == null) break;
+ add_grammar(np[0], np[1], vals[1], vals[2].strip());
}
notebook = new Gtk.Notebook();
{
public Backlight()
{
- name = "backlight";
+ Object(name: "backlight");
}
// Turn the backlight on and then let it fade off
public PowerMenu()
{
- type = Gtk.WindowType.TOPLEVEL;
- title = "Power Menu";
+ Object(
+ type: Gtk.WindowType.TOPLEVEL,
+ title: "Power Menu"
+ );
shown = false;
destroy_with_parent = true;
set_transient_for(zavai.app);
backlight = new Backlight();
zavai.registry.register_service(backlight);
- battery_icons = new Gee.ArrayList<BatteryIcon>();
- // Enumerate batteries
- var c = new Dkp.Client();
- unowned GLib.PtrArray devs = c.enumerate_devices();
- for (int i = 0; i < devs.len; ++i)
- {
- Dkp.Device dev = (Dkp.Device)devs.pdata[i];
- stderr.printf("Found new device %s\n", dev.native_path);
- dev.print();
- stderr.printf("Rechargeable: %s\n", dev.is_rechargeable ? "yes" : "no");
- if (!dev.is_rechargeable) continue;
- var bi = new BatteryIcon(dev);
- bi.set_visible(true);
- battery_icons.add(bi);
- }
-
- power_menu = new PowerMenu();
- zavai.registry.register_resource("powermenu", power_menu);
+ try {
+ battery_icons = new Gee.ArrayList<BatteryIcon>();
+ // Enumerate batteries
+ var c = new Dkp.Client();
+ unowned GLib.PtrArray devs = c.enumerate_devices();
+ for (int i = 0; i < devs.len; ++i)
+ {
+ Dkp.Device dev = (Dkp.Device)devs.pdata[i];
+ stderr.printf("Found new device %s\n", dev.native_path);
+ dev.print();
+ stderr.printf("Rechargeable: %s\n", dev.is_rechargeable ? "yes" : "no");
+ if (!dev.is_rechargeable) continue;
+ var bi = new BatteryIcon(dev);
+ bi.set_visible(true);
+ battery_icons.add(bi);
+ }
+
+ power_menu = new PowerMenu();
+ zavai.registry.register_resource("powermenu", power_menu);
+ } catch (Error e) {
+ stderr.printf("Creating power menu: %s\n", e.message);
+ power_menu = null;
+ }
//zavai.registry.getmenu("menu.main").add_applet("menu.power");
//tpm = new TogglePowerMenu();
{
static const string DENTRY_GROUP = "Desktop Entry";
- public Launcher(string label)
+ public Launcher(string label) throws Error
{
_label = label;
app_shortcut = new AppShortcut();
- launcher = new Launcher("Run program");
- zavai.registry.register_applet("wm.launcher", launcher);
+ try {
+ launcher = new Launcher("Run program");
+ zavai.registry.register_applet("wm.launcher", launcher);
+ } catch (Error e) {
+ stderr.printf("Error creating app launcher: %s\n", e.message);
+ launcher = null;
+ }
window_list = new WindowList("Apps");
zavai.registry.register_applet("wm.list", window_list);
Pid pid;
int stdout;
- if (!Process.spawn_async_with_pipes("/", argv, null, SpawnFlags.STDERR_TO_DEV_NULL, null, out pid, null, out stdout, null))
+ try
+ {
+ if (!Process.spawn_async_with_pipes("/", argv, null, SpawnFlags.STDERR_TO_DEV_NULL, null, out pid, null, out stdout, null))
+ return -1;
+ } catch (SpawnError e) {
+ stderr.printf("Cannot run 'at -q': %s\n", e.message);
return -1;
+ }
FileStream fs = FileStream.fdopen(stdout, "r");
if (fs == null)
if (!line[0].isdigit()) continue;
weak string rest;
ulong id = line.to_ulong(out rest, 10);
- Time t = new Time();
+ Time t = Time();
rest = t.strptime(rest.offset(1), "%a %b %d %H:%M:%S %Y");
if (rest == null) continue;
time_t tt = t.mktime();
Pid pid;
int stdoutfd;
- if (!Process.spawn_async_with_pipes("/", argv, null, SpawnFlags.STDERR_TO_DEV_NULL, null, out pid, null, out stdoutfd, null))
+ try
+ {
+ if (!Process.spawn_async_with_pipes("/", argv, null, SpawnFlags.STDERR_TO_DEV_NULL, null, out pid, null, out stdoutfd, null))
+ return false;
+ } catch (SpawnError e) {
+ stderr.printf("Cannot run 'at -c': %s\n", e.message);
return false;
+ }
bool res = parser(stdoutfd);
public Audio()
{
- name = "audio";
+ Object(name: "audio");
audiodev = zavai.registry.sbus.get_object(
"org.freesmartphone.odeviced",
"/org/freesmartphone/Device/Audio",
public Clock()
{
- name = "clock";
+ Object(name: "clock");
alarms = null;
listener = new AlarmNotification();
last_minute = 0;
public GPS()
{
- name = "gps";
+ Object(name: "gps");
// see mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage
usage = zavai.registry.sbus.get_object(
public Position()
{
- name = "gps.position";
+ Object(name: "gps.position");
position = zavai.registry.sbus.get_object(
"org.freesmartphone.ogpsd",
"/org/freedesktop/Gypsy",
public GPX()
{
- name = "gps.gpx";
+ Object(name: "gps.gpx");
}
public override void start()
public GSM()
{
- name = "gsm.gsm";
+ Object(name: "gsm.gsm");
device = zavai.registry.sbus.get_object(
"org.freesmartphone.ogpsd",
public GPRS()
{
- name = "gsm.gprs";
+ Object(name: "gsm.gprs");
device = zavai.registry.sbus.get_object(
"org.freesmartphone.ogsmd",
public PowerButton()
{
- name = "input.power_button";
// FIXME: change to event0 for the power button
// FIXME: change to event4 for the aux button and headset button
//device = "/dev/input/event1";
- device = "/dev/input/event0";
+ Object(
+ name: "input.power_button",
+ device: "/dev/input/event0"
+ );
event += on_event;
}
memb_applets = new HashMap<string, Applet>(str_hash, str_equal);
memb_menus = new HashMap<string, Menu>(str_hash, str_equal);
registration_order = new ArrayList<Resource>();
- sbus = DBus.Bus.get(DBus.BusType.SYSTEM);
+ try {
+ sbus = DBus.Bus.get(DBus.BusType.SYSTEM);
+ } catch (DBus.Error e) {
+ stderr.printf("Cannot access system DBus bus: %s\n", e.message);
+ sbus = null;
+ }
bus_name = DBus.bus_get_unique_name(sbus.get_connection());
zavai.log.info("My bus name: " + bus_name);
protected int cur_year;
protected int cur_month;
protected int cur_day;
- protected Regex re_dayfile;
public Calendar()
{
pack_start(notebook, true, true, 0);
- re_dayfile = new Regex("[0-9][0-9]\\.txt");
-
on_month_changed();
on_day_selected();
}
{
var d = dir.read_name();
if (d == null) break;
- if (re_dayfile.match(d))
+ if (d[0].isdigit() && d.has_suffix(".txt") && d.size() == 6)
{
calendar.mark_day((int)d.to_ulong(null, 10));
}