From 12b6618a2b968cadf21efc003871a4b8658f4178 Mon Sep 17 00:00:00 2001 From: Enrico Zini Date: Sun, 13 Dec 2009 00:28:15 +0000 Subject: [PATCH] Started to extract polygen out as a separate applet --- CMakeLists.txt | 1 + README | 15 ++++++---- src/Makefile.am | 3 +- .../zapolygen-update-info | 0 .../zapolygen.vala | 29 +++++++++++-------- 5 files changed, 28 insertions(+), 20 deletions(-) rename src/update-polygen-info => zapolygen/zapolygen-update-info (100%) rename src/app_polygen.vala => zapolygen/zapolygen.vala (89%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04bae58..befae8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,5 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(zavai) set(zavai_version "0.1") add_subdirectory(gtkfisheyelist) +add_subdirectory(zapolygen) #add_subdirectory(src) #add_subdirectory(hooks) diff --git a/README b/README index 32388df..2cfdda6 100644 --- a/README +++ b/README @@ -155,18 +155,21 @@ TODO list / wish list http://git.freesmartphone.org/?p=specs.git;a=blob_plain;f=html/index.html;hb=HEAD * Features to add: - - fisheye listview + + fisheye listview + use a TreeStore as a backend (precaching the elements in an array) + draw something outside of focus area + ensure that the first and last items are selectable - - rename in FisheyeListView - - contacts: show as a fancy focus+context list (see prefuse) - - profile - - polygen can use the same list - - s/autotools/cmake + + rename in FisheyeListView - Split polygen applet in a separate app, ran via a .desktop file (faster zavai startup time, can then integrate a browser in the polygen applet, makes more sense altogether) + - polygen applet with FisheyeListView + - lua config + - contacts: show as a fancy focus+context list (see prefuse) + - vcard on e-vcard.{h,c} + - ical on libical-dev + - vcard+index file + - s/autotools/cmake - alarm - vibrate at alarm trigger - play sound at alarm trigger diff --git a/src/Makefile.am b/src/Makefile.am index 268e104..d6fc178 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -53,7 +53,6 @@ zavai_VALASOURCES = \ app_gps.vala \ app_gsm.vala \ app_calendar.vala \ - app_polygen.vala \ app_main.vala \ app_debug.vala \ zavai.vala @@ -103,5 +102,5 @@ zavai_calendar_LDADD = \ # gee-1.0.vapi \ # $(NULL) -EXTRA_DIST = $(zavai_VAPIS) sat-monitor update-polygen-info +EXTRA_DIST = $(zavai_VAPIS) sat-monitor #$(libgee_la_VALASOURCES) gee-1.0.vapi gee.vala.stamp diff --git a/src/update-polygen-info b/zapolygen/zapolygen-update-info similarity index 100% rename from src/update-polygen-info rename to zapolygen/zapolygen-update-info diff --git a/src/app_polygen.vala b/zapolygen/zapolygen.vala similarity index 89% rename from src/app_polygen.vala rename to zapolygen/zapolygen.vala index 17e26e7..cda2768 100644 --- a/src/app_polygen.vala +++ b/zapolygen/zapolygen.vala @@ -1,5 +1,5 @@ /* - * app_polygen - zavai polygen applet + * zapolygen - zavai polygen applet * * Copyright (C) 2009 Enrico Zini * @@ -121,7 +121,7 @@ protected class PolygenRun : Gtk.VBox int pipe_out; string result; try { - Process.spawn_async_with_pipes(config.homedir, args, null, 0, null, null, null, out pipe_out, null); + Process.spawn_async_with_pipes(homedir, args, null, 0, null, null, null, out pipe_out, null); IOChannel ch = new IOChannel.unix_new(pipe_out); size_t res_len; ch.read_to_end(out result, out res_len); @@ -146,7 +146,7 @@ protected class PolygenRun : Gtk.VBox } } -public class Polygen : Applet +public class Polygen : Gtk.Window { protected Gee.ArrayList pages; protected Gtk.Notebook notebook; @@ -187,7 +187,10 @@ public class Polygen : Applet public Polygen(string label, IOChannel data) throws ConvertError, IOChannelError, RegexError { - _label = label; + title = label; + var vbox = new Gtk.VBox(false, 0); + add(vbox); + pages = new Gee.ArrayList(); while (true) @@ -210,11 +213,11 @@ public class Polygen : Applet result = new PolygenRun(); notebook.append_page(result, new Gtk.Label("Result")); - pack_start(notebook, true, true, 0); + vbox.pack_start(notebook, true, true, 0); - Gtk.Button select = new Gtk.Button.with_label("Select"); - button_box.pack_start(select, true, true, 0); - select.clicked += on_click; + //Gtk.Button select = new Gtk.Button.with_label("Select"); + //button_box.pack_start(select, true, true, 0); + //select.clicked += on_click; } private void on_click(Gtk.Button b) @@ -231,19 +234,21 @@ public class Polygen : Applet } Polygen polygen; +string homedir; public void init() { + homedir = GLib.Environment.get_home_dir() + "/.zavai"; try { - var data = new IOChannel.file(zavai.config.homedir + "/polygen-info", "r"); + var data = new IOChannel.file(homedir + "/polygen-info", "r"); polygen = new Polygen("Polygen", data); data.shutdown(false); - zavai.registry.register_applet("ui.polygen", polygen); - zavai.registry.getmenu("menu.misc").add_applet("ui.polygen"); + //zavai.registry.register_applet("ui.polygen", polygen); + //zavai.registry.getmenu("menu.misc").add_applet("ui.polygen"); } catch (Error e) { polygen = null; - zavai.log.error("Skipping polygen plugin: " + e.message); + //zavai.log.error("Skipping polygen plugin: " + e.message); } } -- 2.39.5