Fix the places module!

Removed all that crappy hal/udisk #ifdefs
I don't want to maintain 2 different backend, so I removed all the HAL code

Now to run the module you must have the udisks stuff and e_dbus compiled
with ukit support, you will also need a super-updated e_dbus version.

The module need some testing now, give it a try ;)

SVN revision: 67283
This commit is contained in:
Davide Andreoli 2012-01-17 21:46:33 +00:00
parent cc5a14ff87
commit 5196f555ee
6 changed files with 324 additions and 545 deletions

View File

@ -58,54 +58,11 @@ AC_SUBST(EDJE_CC)
AC_MSG_CHECKING([Which edje_cc to use])
AC_MSG_RESULT(${EDJE_CC})
dbus_mount="dbus-1, edbus >= 1.0.999"
hal_mount="ehal >= 1.0.999"
udisks_mount="eukit >= 1.0.999"
AC_ARG_ENABLE([mount-hal],
AS_HELP_STRING([--enable-mount-hal],[enable hal mounting support @<:@default=enabled@:>@]),
[e_cv_want_mount_hal=$enableval],
AC_CACHE_VAL([e_cv_want_mount_hal], [e_cv_want_mount_hal=yes]))
if test "x$e_cv_want_mount_hal" != "xno";then
PKG_CHECK_EXISTS([ehal >= 1.0.999],
[],[
hal_mount=
AC_MSG_NOTICE([HAL mounting disabled])
])
else
hal_mount=
AC_MSG_NOTICE([HAL mounting disabled])
fi
AC_ARG_ENABLE([mount-udisks],
AS_HELP_STRING([--enable-mount-udisks],[enable udisks mounting support @<:@default=enabled@:>@]),
[e_cv_want_mount_udisks=$enableval],
AC_CACHE_VAL([e_cv_want_mount_udisks], [e_cv_want_mount_udisks=yes]))
if test "x$e_cv_want_mount_udisks" != "xno";then
PKG_CHECK_EXISTS([eukit >= 1.0.999],
[],[
udisks_mount=
AC_MSG_NOTICE([udisks mounting disabled])
])
else
udisks_mount=
AC_MSG_NOTICE([udisks mounting disabled])
fi
PKG_CHECK_MODULES(E_DBUS, edbus)
PKG_CHECK_MODULES(E_UKIT, eukit)
if test "x${e_cv_want_mount_udisks}" = "xno" && test "x${e_cv_want_mount_hal}" = "xno" ; then
DBUS_MOUNT_CONFIG=0
dbus_mount=
test "x${e_cv_want_mount_udisks}" = "xno" && udisks_mount=
test "x${e_cv_want_mount_hal}" = "xno" && hal_mount=
fi
AM_CONDITIONAL([HAVE_HAL_MOUNT], [test -n "$hal_mount"])
AM_CONDITIONAL([HAVE_UDISKS_MOUNT], [test -n "$udisks_mount"])
test -n "$hal_mount" && AC_DEFINE_UNQUOTED([HAVE_HAL_MOUNT], [1], [enable HAL mounting])
test -n "$udisks_mount" && AC_DEFINE_UNQUOTED([HAVE_UDISKS_MOUNT], [1], [enable Udisks mounting])
PKG_CHECK_MODULES(E_DBUS, [$dbus_mount $hal_mount $udisks_mount])
datadir=$(pkg-config --variable=modules enlightenment)/${PACKAGE}
AC_ARG_ENABLE(homedir-install,
AS_HELP_STRING([--enable-homedir-install], [Install module in homedir]),

View File

@ -45,6 +45,81 @@ collections
}
}
/****************************************************/
/** GADGET HEADER *********************************/
/****************************************************/
group {
name: "modules/places/header";
min: 90 35;
max: 384 60;
parts {
part { name: "bg";
mouse_events: 1;
type: RECT;
description { state: "default" 0.0;
color: 50 100 50 255;
// color: 50 0 50 200;
}
}
part { name: "label";
mouse_events: 0;
type: TEXT;
effect: SOFT_SHADOW;
description { state: "default" 0.0;
color: 255 255 255 255;
color3: 0 0 0 60;
text {
font: "Sans:style=Bold";
size: 14;
text: "Places";
align: 0.5 0.5;
text_class: "module_large";
}
}
}
part { name: "separator";
mouse_events: 0;
type: RECT;
description { state: "default" 0.0;
rel1.relative: 0.0 0.0;
rel2.relative: 0.0 0.0;
color: 0 0 0 0;
}
description { state: "horiz" 0.0;
rel1.relative: 0.0 1.0;
rel2.relative: 1.0 1.0;
rel1.offset: 0 -1;
color: 0 0 0 255;
}
description { state: "vert" 0.0;
rel1.relative: 1.0 0.0;
rel2.relative: 1.0 1.0;
rel1.offset: -1 0;
color: 0 0 0 255;
}
}
}
programs {
program { name: "set_separator_horiz";
signal: "separator,set,horiz";
source: "places";
action: STATE_SET "horiz" 0.0;
target: "separator";
}
program { name: "set_separator_vert";
signal: "separator,set,vert";
source: "places";
action: STATE_SET "vert" 0.0;
target: "separator";
}
program { name: "set_separator_hidden";
signal: "separator,set,hidden";
source: "places";
action: STATE_SET "default" 0.0;
target: "separator";
}
}
}
/****************************************************/
/** GADGET VOLUME *********************************/
/****************************************************/
group { name: "modules/places/main";
@ -140,7 +215,6 @@ collections
mouse_events: 0;
clip_to: "icon_clip";
description { state: "default" 0.0;
image.normal: "tag_ext3.png";
rel1.to: "icon";
rel2.relative: 0.5 0.5;
rel2.to: "icon";
@ -250,7 +324,8 @@ collections
type: TEXT;
effect: SOFT_SHADOW;
description { state: "default" 0.0;
rel1.relative: 0.25 0.1;
rel1.relative: 0.0 0.1;
rel1.offset: 52 0;
rel2.relative: 0.98 0.40;
rel2.to: "bg";
color: 255 255 255 255;
@ -346,14 +421,15 @@ collections
mouse_events: 1;
type: IMAGE;
description { state: "default" 0.0;
rel1.relative: 1.0 0.0;
rel1.offset: -30 10;
rel2.offset: 0 -10;
image {normal: "eject.png";}
rel1.relative: 1.0 0.0;
rel1.offset: -2 10;
rel2.offset: 0 -10;
visible: 0;
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
rel1.offset: -30 10;
visible: 1;
}
}

View File

@ -3,7 +3,7 @@ MAINTAINERCLEANFILES = Makefile.in
INCLUDES = -I. \
-I$(top_srcdir) \
-I$(includedir) \
@E_CFLAGS@ @E_DBUS_CFLAGS@
@E_CFLAGS@ @E_DBUS_CFLAGS@ -Wall
pkgdir = $(datadir)/$(MODULE_ARCH)
pkg_LTLIBRARIES = module.la

View File

@ -35,7 +35,7 @@ static const E_Gadcon_Client_Class _gc_class =
GADCON_CLIENT_CLASS_VERSION, "Places",
{_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon,
_gc_id_new, _gc_id_del, e_gadcon_site_is_not_toolbar},
E_GADCON_CLIENT_STYLE_PLAIN
E_GADCON_CLIENT_STYLE_INSET
};
EAPI E_Module_Api e_modapi = {E_MODULE_API_VERSION, "Places"};
@ -234,6 +234,12 @@ static void
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
{
Instance *inst;
Volume *v;
Eina_List *l;
int count = 1;
EINA_LIST_FOREACH(volumes, l, v)
if (v->valid) count++;
inst = gcc->data;
switch (orient)
@ -245,8 +251,8 @@ _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
case E_GADCON_ORIENT_CORNER_TR:
case E_GADCON_ORIENT_CORNER_BL:
case E_GADCON_ORIENT_CORNER_BR:
e_gadcon_client_aspect_set(gcc, 100 * eina_list_count(volumes), 50);
e_gadcon_client_min_size_set(gcc, 100 * eina_list_count(volumes), 50);
e_gadcon_client_aspect_set(gcc, 100 * count, 60);
e_gadcon_client_min_size_set(gcc, 100 * count, 60);
e_box_orientation_set(inst->o_box, 1);
break;
case E_GADCON_ORIENT_FLOAT:
@ -257,8 +263,8 @@ _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
case E_GADCON_ORIENT_CORNER_RT:
case E_GADCON_ORIENT_CORNER_LB:
case E_GADCON_ORIENT_CORNER_RB:
e_gadcon_client_aspect_set(gcc, 200, 50 * eina_list_count(volumes) + 30);
e_gadcon_client_min_size_set(gcc, 200, 50 * eina_list_count(volumes) + 30);
e_gadcon_client_aspect_set(gcc, 200, 50 * count);
e_gadcon_client_min_size_set(gcc, 200, 50 * count);
e_box_orientation_set(inst->o_box, 0);
break;
default:
@ -406,7 +412,7 @@ _places_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event)
zone = e_util_zone_current_get(e_manager_current_get());
/* create popup menu */
m = e_menu_new();
m = e_menu_new();
mi = e_menu_item_new(m);
e_menu_item_label_set(mi, D_("Settings"));

File diff suppressed because it is too large Load Diff

View File

@ -14,6 +14,7 @@ typedef struct _Volume
const char *udi;
const char *label;
const char *uuid;
const char *device;
unsigned char mounted;
const char *mount_point;
const char *fstype;