econnman got icons (ugly, but less than the text versions I had before)
SVN revision: 73440
32
Makefile.am
|
@ -1,3 +1,5 @@
|
|||
ACLOCAL_AMFLAGS = -I m4
|
||||
AM_MAKEFLAGS = --no-print-directory
|
||||
EXTRA_DIST = \
|
||||
AUTHORS \
|
||||
COPYING \
|
||||
|
@ -11,6 +13,35 @@ desktop_DATA = data/desktop/econnman.desktop
|
|||
|
||||
EXTRA_DIST += $(desktop_DATA)
|
||||
|
||||
EDJE_CC = @edje_cc@
|
||||
EDJE_FLAGS_VERBOSE_ =
|
||||
EDJE_FLAGS_VERBOSE_0 =
|
||||
EDJE_FLAGS_VERBOSE_1 = -v
|
||||
EDJE_FLAGS = $(EDJE_FLAGS_VERBOSE_$(V)) -id $(top_srcdir)/data/theme -fd $(top_srcdir)/data/theme
|
||||
AM_V_EDJ = $(am__v_EDJ_$(V))
|
||||
am__v_EDJ_ = $(am__v_EDJ_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_EDJ_0 = @echo " EDJ " $@;
|
||||
|
||||
THEME_IMAGES = \
|
||||
data/theme/connman-ethernet.png \
|
||||
data/theme/connman-wifi-bad.png \
|
||||
data/theme/connman-wifi-good.png \
|
||||
data/theme/connman-wifi-medium.png
|
||||
|
||||
themedir = $(pkgdatadir)/theme
|
||||
theme_DATA = data/theme/default.edj
|
||||
|
||||
EXTRA_DIST += data/theme/default.edc $(THEME_IMAGES)
|
||||
|
||||
data/theme/default.edj: $(top_builddir)/Makefile $(top_srcdir)/data/theme/default.edc $(THEME_IMAGES)
|
||||
$(MKDIR_P) $(top_builddir)/data/theme
|
||||
$(AM_V_EDJ)$(EDJE_CC) $(EDJE_FLAGS) \
|
||||
$(top_srcdir)/data/theme/default.edc \
|
||||
$(top_builddir)/data/theme/default.edj
|
||||
|
||||
clean-local:
|
||||
rm -f $(top_builddir)/data/theme/default.edj
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
aclocal.m4 \
|
||||
configure \
|
||||
|
@ -19,3 +50,4 @@ MAINTAINERCLEANFILES = \
|
|||
install-sh \
|
||||
Makefile.in \
|
||||
missing
|
||||
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
AC_INIT([econnman], [1], [enlightenment-devel@lists.sourceforge.net])
|
||||
AC_PREREQ([2.65])
|
||||
AC_CONFIG_SRCDIR([configure.ac])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_INIT_AUTOMAKE([])
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
AM_PATH_PYTHON([2.7])
|
||||
EFL_WITH_BIN([edje], [edje-cc], [edje_cc])
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
|
@ -22,6 +25,7 @@ echo
|
|||
echo "Configuration Options Summary:"
|
||||
echo
|
||||
echo " Python...............: $PYTHON ($PYTHON_VERSION)"
|
||||
echo " edje_cc..............: $edje_cc"
|
||||
echo
|
||||
echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
|
||||
echo " prefix...............: $prefix"
|
||||
|
|
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 930 B |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 5.4 KiB |
|
@ -0,0 +1,220 @@
|
|||
collections {
|
||||
|
||||
group {
|
||||
name: "elm/icon/connman-tech-connected/default";
|
||||
max: 128 128;
|
||||
min: 16 16;
|
||||
parts {
|
||||
part {
|
||||
name: "icon";
|
||||
type: IMAGE;
|
||||
mouse_events: 0;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image.image: "connman-tech-connected.png" COMP;
|
||||
image.normal: "connman-tech-connected.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group {
|
||||
name: "elm/icon/connman-tech-powered/default";
|
||||
max: 128 128;
|
||||
min: 16 16;
|
||||
parts {
|
||||
part {
|
||||
name: "icon";
|
||||
type: IMAGE;
|
||||
mouse_events: 0;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image.image: "connman-tech-powered.png" COMP;
|
||||
image.normal: "connman-tech-powered.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group {
|
||||
name: "elm/icon/connman-tech-offline/default";
|
||||
max: 128 128;
|
||||
min: 16 16;
|
||||
parts {
|
||||
part {
|
||||
name: "icon";
|
||||
type: IMAGE;
|
||||
mouse_events: 0;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image.image: "connman-tech-offline.png" COMP;
|
||||
image.normal: "connman-tech-offline.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// quite close to e17 icon
|
||||
|
||||
// ICONS: receive the following signals, all with source being "elm"
|
||||
// elm,favorite,{yes,no}
|
||||
// elm,auto_connect,{yes,no}
|
||||
// elm,state,{idle,association,configuration,ready,disconnect,failure}
|
||||
// elm,security,{none,yes,wep,psk,ieee8021x,wpa,rsn} (yes = catch all)
|
||||
// and also the following message:
|
||||
// id=1, type=MSG_INT, description=strength (0-100)
|
||||
|
||||
group {
|
||||
name: "elm/icon/ethernet/default";
|
||||
max: 128 128;
|
||||
min: 16 16;
|
||||
parts {
|
||||
part {
|
||||
name: "icon";
|
||||
type: IMAGE;
|
||||
mouse_events: 0;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image.image: "connman-ethernet.png" COMP;
|
||||
image.normal: "connman-ethernet.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group {
|
||||
name: "elm/icon/wifi/default";
|
||||
max: 128 128;
|
||||
min: 16 16;
|
||||
images {
|
||||
image: "connman-wifi-good.png" COMP;
|
||||
image: "connman-wifi-medium.png" COMP;
|
||||
image: "connman-wifi-bad.png" COMP;
|
||||
image: "connman-lock.png" COMP;
|
||||
image: "connman-favorite.png" COMP;
|
||||
}
|
||||
script {
|
||||
public message(Msg_Type:type, id, ...) {
|
||||
if ((type == MSG_INT) && (id == 1)) {
|
||||
new strength;
|
||||
strength = getarg(2);
|
||||
if (strength >= 65)
|
||||
run_program(PROGRAM:"strength,good");
|
||||
else if (strength >= 35)
|
||||
run_program(PROGRAM:"strength,medium");
|
||||
else
|
||||
run_program(PROGRAM:"strength,bad");
|
||||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part {
|
||||
name: "icon";
|
||||
type: IMAGE;
|
||||
mouse_events: 0;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image.normal: "connman-wifi-good.png";
|
||||
}
|
||||
description {
|
||||
state: "medium" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "connman-wifi-medium.png";
|
||||
}
|
||||
description {
|
||||
state: "bad" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
image.normal: "connman-wifi-bad.png";
|
||||
}
|
||||
}
|
||||
|
||||
part {
|
||||
name: "security";
|
||||
type: IMAGE;
|
||||
mouse_events: 0;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image.normal: "connman-lock.png";
|
||||
visible: 0;
|
||||
}
|
||||
description {
|
||||
state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
|
||||
part {
|
||||
name: "favorite";
|
||||
type: IMAGE;
|
||||
mouse_events: 0;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
aspect: 1.0 1.0;
|
||||
aspect_preference: BOTH;
|
||||
image.normal: "connman-favorite.png";
|
||||
visible: 0;
|
||||
}
|
||||
description {
|
||||
state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
|
||||
programs {
|
||||
program {
|
||||
signal: "elm,security,yes";
|
||||
source: "elm";
|
||||
action: STATE_SET "visible" 0.0;
|
||||
target: "security";
|
||||
}
|
||||
program {
|
||||
signal: "elm,security,none";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "security";
|
||||
}
|
||||
|
||||
program {
|
||||
signal: "elm,favorite,yes";
|
||||
source: "elm";
|
||||
action: STATE_SET "visible" 0.0;
|
||||
target: "favorite";
|
||||
}
|
||||
program {
|
||||
signal: "elm,favorite,none";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "favorite";
|
||||
}
|
||||
|
||||
program {
|
||||
name: "strength,good";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "icon";
|
||||
}
|
||||
program {
|
||||
name: "strength,medium";
|
||||
action: STATE_SET "medium" 0.0;
|
||||
target: "icon";
|
||||
}
|
||||
program {
|
||||
name: "strength,bad";
|
||||
action: STATE_SET "bad" 0.0;
|
||||
target: "icon";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
50
econnman-bin
|
@ -15,6 +15,7 @@ import elementary as elm
|
|||
import evas
|
||||
import e_dbus
|
||||
import ecore
|
||||
import edje
|
||||
import dbus
|
||||
import dbus.service
|
||||
import logging
|
||||
|
@ -378,16 +379,15 @@ class TechList(object):
|
|||
t = self.techs.get(item_data)
|
||||
if not t:
|
||||
return None
|
||||
connected = t.get("Connected", False)
|
||||
powered = t.get("Powered", False)
|
||||
lb = elm.Label(obj)
|
||||
if connected:
|
||||
lb.text = "[connected]"
|
||||
elif powered:
|
||||
lb.text = "[powered]"
|
||||
|
||||
ic = elm.Icon(obj)
|
||||
if t.get("Connected", False):
|
||||
ic.standard = "connman-tech-connected"
|
||||
elif t.get("Powered", False):
|
||||
ic.standard = "connman-tech-powered"
|
||||
else:
|
||||
lb.text = "[offline]"
|
||||
return lb
|
||||
ic.standard = "connman-tech-offline"
|
||||
return ic
|
||||
|
||||
|
||||
class TechView(ObjectView):
|
||||
|
@ -647,10 +647,34 @@ class ServicesList(object):
|
|||
strength = s.get("Strength")
|
||||
favorite = s.get("Favorite")
|
||||
roaming = s.get("Roaming")
|
||||
auto_connect = s.get("AutoConnect")
|
||||
|
||||
lb = elm.Label(obj)
|
||||
lb.text = "%s: %s" % (type, state)
|
||||
return lb
|
||||
ly = elm.Layout(obj)
|
||||
ly.theme_set("icon", type, "default")
|
||||
ly.size_hint_min_set(48, 48)
|
||||
|
||||
def yesno(val):
|
||||
return ("no", "yes")[bool(val)]
|
||||
|
||||
def ornone(val):
|
||||
return val or "none"
|
||||
|
||||
ly.signal_emit("elm,state," + state, "elm")
|
||||
ly.signal_emit("elm,error," + ornone(error), "elm")
|
||||
ly.signal_emit("elm,favorite," + yesno(favorite), "elm")
|
||||
ly.signal_emit("elm,roaming," + yesno(roaming), "elm")
|
||||
ly.signal_emit("elm,auto_connect," + yesno(auto_connect), "elm")
|
||||
|
||||
for s in security:
|
||||
ly.signal_emit("elm,security," + s, "elm")
|
||||
if security:
|
||||
ly.signal_emit("elm,security,yes", "elm")
|
||||
else:
|
||||
ly.signal_emit("elm,security,none", "elm")
|
||||
|
||||
if strength:
|
||||
ly.edje.message_send(1, strength)
|
||||
return ly
|
||||
|
||||
def service_name_get(self, path):
|
||||
s = self.services.get(path)
|
||||
|
@ -1329,6 +1353,8 @@ if __name__ == "__main__":
|
|||
elm.init()
|
||||
elm.policy_set(elm.ELM_POLICY_QUIT, elm.ELM_POLICY_QUIT_LAST_WINDOW_CLOSED)
|
||||
|
||||
elm.theme_extension_add("./data/theme/default.edj")
|
||||
|
||||
win = elm.Window("econnman", elm.ELM_WIN_BASIC)
|
||||
win.title = "EConnMan"
|
||||
win.icon_name = "econnman"
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
|
||||
dnl That code is public domain and can be freely used or copied.
|
||||
|
||||
dnl Macro that check if a binary is built or not
|
||||
|
||||
dnl Usage: EFL_ENABLE_BIN(binary)
|
||||
dnl Call AC_SUBST(BINARY_PRG) (BINARY is the uppercase of binary, - being transformed into _)
|
||||
dnl Define have_binary (- is transformed into _)
|
||||
dnl Define conditional BUILD_BINARY (BINARY is the uppercase of binary, - being transformed into _)
|
||||
|
||||
AC_DEFUN([EFL_ENABLE_BIN],
|
||||
[
|
||||
|
||||
m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
|
||||
m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
|
||||
|
||||
have_[]m4_defn([DOWN])="yes"
|
||||
|
||||
dnl configure option
|
||||
|
||||
AC_ARG_ENABLE([$1],
|
||||
[AC_HELP_STRING([--disable-$1], [disable building of ]DOWN)],
|
||||
[
|
||||
if test "x${enableval}" = "xyes" ; then
|
||||
have_[]m4_defn([DOWN])="yes"
|
||||
else
|
||||
have_[]m4_defn([DOWN])="no"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether to build ]DOWN[ binary])
|
||||
AC_MSG_RESULT([$have_[]m4_defn([DOWN])])
|
||||
|
||||
if test "x$have_[]m4_defn([DOWN])" = "xyes"; then
|
||||
UP[]_PRG=DOWN[${EXEEXT}]
|
||||
fi
|
||||
|
||||
AC_SUBST(UP[]_PRG)
|
||||
|
||||
AM_CONDITIONAL(BUILD_[]UP, test "x$have_[]m4_defn([DOWN])" = "xyes")
|
||||
|
||||
AS_IF([test "x$have_[]m4_defn([DOWN])" = "xyes"], [$2], [$3])
|
||||
|
||||
])
|
||||
|
||||
|
||||
dnl Macro that check if a binary is built or not
|
||||
|
||||
dnl Usage: EFL_WITH_BIN(package, binary, default_value)
|
||||
dnl Call AC_SUBST(_binary) (_binary is the lowercase of binary, - being transformed into _ by default, or the value set by the user)
|
||||
|
||||
AC_DEFUN([EFL_WITH_BIN],
|
||||
[
|
||||
|
||||
m4_pushdef([DOWN], m4_translit([[$2]], [-A-Z], [_a-z]))dnl
|
||||
|
||||
dnl configure option
|
||||
|
||||
AC_ARG_WITH([$2],
|
||||
[AC_HELP_STRING([--with-$2=PATH], [specify a specific path to ]DOWN[ @<:@default=$3@:>@])],
|
||||
[_efl_with_binary=${withval}],
|
||||
[_efl_with_binary=$(pkg-config --variable=prefix $1)/bin/$3])
|
||||
|
||||
DOWN=${_efl_with_binary}
|
||||
AC_MSG_NOTICE(DOWN[ set to ${_efl_with_binary}])
|
||||
|
||||
with_binary_[]m4_defn([DOWN])=${_efl_with_binary}
|
||||
|
||||
AC_SUBST(DOWN)
|
||||
|
||||
])
|