parent
625d598e98
commit
2a4c6774a6
|
@ -36,7 +36,9 @@ _config_mpdule_module (Config_Item * ci)
|
||||||
snprintf (buf, sizeof (buf), "%s/e-module-mpdule.edj",
|
snprintf (buf, sizeof (buf), "%s/e-module-mpdule.edj",
|
||||||
e_module_dir_get (mpdule_config->module));
|
e_module_dir_get (mpdule_config->module));
|
||||||
con = e_container_current_get (e_manager_current_get ());
|
con = e_container_current_get (e_manager_current_get ());
|
||||||
cfd = e_config_dialog_new (con, D_ ("MPDule Configuration"), "MPDule", "_e_modules_mpdule_config_dialog", buf, 0, v, ci);
|
cfd =
|
||||||
|
e_config_dialog_new (con, D_ ("MPDule Configuration"), "MPDule",
|
||||||
|
"_e_modules_mpdule_config_dialog", buf, 0, v, ci);
|
||||||
mpdule_config->config_dialog = cfd;
|
mpdule_config->config_dialog = cfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +80,8 @@ static Evas_Object *
|
||||||
_basic_create_widgets (E_Config_Dialog * cfd, Evas * evas,
|
_basic_create_widgets (E_Config_Dialog * cfd, Evas * evas,
|
||||||
E_Config_Dialog_Data * cfdata)
|
E_Config_Dialog_Data * cfdata)
|
||||||
{
|
{
|
||||||
Evas_Object *o, *of, *ob, *time_entry, *time_check, *hostname_entry, *port_entry;
|
Evas_Object *o, *of, *ob, *time_entry, *time_check, *hostname_entry,
|
||||||
|
*port_entry;
|
||||||
E_Radio_Group *rg;
|
E_Radio_Group *rg;
|
||||||
|
|
||||||
o = e_widget_list_add (evas, 0, 0);
|
o = e_widget_list_add (evas, 0, 0);
|
||||||
|
@ -86,13 +89,17 @@ _basic_create_widgets (E_Config_Dialog * cfd, Evas * evas,
|
||||||
of = e_widget_frametable_add (evas, D_ ("Configuration"), 1);
|
of = e_widget_frametable_add (evas, D_ ("Configuration"), 1);
|
||||||
ob = e_widget_label_add (evas, D_ ("Poll Time:"));
|
ob = e_widget_label_add (evas, D_ ("Poll Time:"));
|
||||||
e_widget_frametable_object_append (of, ob, 0, 0, 1, 1, 1, 0, 1, 0);
|
e_widget_frametable_object_append (of, ob, 0, 0, 1, 1, 1, 0, 1, 0);
|
||||||
ob = e_widget_slider_add (evas, 1, 0, D_ ("%1.0f seconds"), 1, 60, 1, 0, NULL, &(cfdata->poll_time), 100);
|
ob =
|
||||||
|
e_widget_slider_add (evas, 1, 0, D_ ("%1.0f seconds"), 1, 60, 1, 0, NULL,
|
||||||
|
&(cfdata->poll_time), 100);
|
||||||
e_widget_frametable_object_append (of, ob, 0, 1, 1, 1, 1, 0, 1, 0);
|
e_widget_frametable_object_append (of, ob, 0, 1, 1, 1, 1, 0, 1, 0);
|
||||||
ob = e_widget_label_add (evas, D_ ("Hostname:"));
|
ob = e_widget_label_add (evas, D_ ("Hostname:"));
|
||||||
e_widget_frametable_object_append (of, ob, 0, 2, 1, 1, 1, 0, 1, 0);
|
e_widget_frametable_object_append (of, ob, 0, 2, 1, 1, 1, 0, 1, 0);
|
||||||
hostname_entry = e_widget_entry_add (evas, &cfdata->hostname, NULL, NULL, NULL);
|
hostname_entry =
|
||||||
|
e_widget_entry_add (evas, &cfdata->hostname, NULL, NULL, NULL);
|
||||||
e_widget_min_size_set (hostname_entry, 150, 1);
|
e_widget_min_size_set (hostname_entry, 150, 1);
|
||||||
e_widget_frametable_object_append (of, hostname_entry, 0, 3, 1, 1, 1, 0, 1, 0);
|
e_widget_frametable_object_append (of, hostname_entry, 0, 3, 1, 1, 1, 0, 1,
|
||||||
|
0);
|
||||||
ob = e_widget_label_add (evas, D_ ("Port:"));
|
ob = e_widget_label_add (evas, D_ ("Port:"));
|
||||||
e_widget_frametable_object_append (of, ob, 0, 4, 1, 1, 1, 0, 1, 0);
|
e_widget_frametable_object_append (of, ob, 0, 4, 1, 1, 1, 0, 1, 0);
|
||||||
port_entry = e_widget_entry_add (evas, &cfdata->port, NULL, NULL, NULL);
|
port_entry = e_widget_entry_add (evas, &cfdata->port, NULL, NULL, NULL);
|
||||||
|
|
231
e_mod_main.c
231
e_mod_main.c
|
@ -26,17 +26,24 @@ static const char *_gc_id_new(void);
|
||||||
/* Module Protos */
|
/* Module Protos */
|
||||||
static void _mpdule_cb_mouse_down (void *data, Evas * e, Evas_Object * obj,
|
static void _mpdule_cb_mouse_down (void *data, Evas * e, Evas_Object * obj,
|
||||||
void *event_info);
|
void *event_info);
|
||||||
static void _mpdule_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
static void _mpdule_cb_mouse_in (void *data, Evas * e, Evas_Object * obj,
|
||||||
static void _mpdule_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
void *event_info);
|
||||||
|
static void _mpdule_cb_mouse_out (void *data, Evas * e, Evas_Object * obj,
|
||||||
|
void *event_info);
|
||||||
static void _mpdule_menu_cb_configure (void *data, E_Menu * m,
|
static void _mpdule_menu_cb_configure (void *data, E_Menu * m,
|
||||||
E_Menu_Item * mi);
|
E_Menu_Item * mi);
|
||||||
static void _mpdule_menu_cb_post (void *data, E_Menu * m);
|
static void _mpdule_menu_cb_post (void *data, E_Menu * m);
|
||||||
static int _mpdule_cb_check (void *data);
|
static int _mpdule_cb_check (void *data);
|
||||||
static void _mpdule_cb_play(void *data, Evas_Object *obj, const char *emission, const char *source);
|
static void _mpdule_cb_play (void *data, Evas_Object * obj,
|
||||||
static void _mpdule_cb_stop(void *data, Evas_Object *obj, const char *emission, const char *source);
|
const char *emission, const char *source);
|
||||||
static void _mpdule_cb_pause(void *data, Evas_Object *obj, const char *emission, const char *source);
|
static void _mpdule_cb_stop (void *data, Evas_Object * obj,
|
||||||
static void _mpdule_cb_next(void *data, Evas_Object *obj, const char *emission, const char *source);
|
const char *emission, const char *source);
|
||||||
static void _mpdule_cb_previous(void *data, Evas_Object *obj, const char *emission, const char *source);
|
static void _mpdule_cb_pause (void *data, Evas_Object * obj,
|
||||||
|
const char *emission, const char *source);
|
||||||
|
static void _mpdule_cb_next (void *data, Evas_Object * obj,
|
||||||
|
const char *emission, const char *source);
|
||||||
|
static void _mpdule_cb_previous (void *data, Evas_Object * obj,
|
||||||
|
const char *emission, const char *source);
|
||||||
static Config_Item *_mpdule_config_item_get (const char *id);
|
static Config_Item *_mpdule_config_item_get (const char *id);
|
||||||
|
|
||||||
static E_Config_DD *conf_edd = NULL;
|
static E_Config_DD *conf_edd = NULL;
|
||||||
|
@ -47,7 +54,8 @@ Config *mpdule_config = NULL;
|
||||||
/* Define the class and gadcon functions this module provides */
|
/* Define the class and gadcon functions this module provides */
|
||||||
static const E_Gadcon_Client_Class _gc_class = {
|
static const E_Gadcon_Client_Class _gc_class = {
|
||||||
GADCON_CLIENT_CLASS_VERSION,
|
GADCON_CLIENT_CLASS_VERSION,
|
||||||
"mpdule", {_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL},
|
"mpdule", {_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon,
|
||||||
|
_gc_id_new, NULL},
|
||||||
E_GADCON_CLIENT_STYLE_PLAIN
|
E_GADCON_CLIENT_STYLE_PLAIN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -118,16 +126,26 @@ _gc_init (E_Gadcon * gc, const char *name, const char *id, const char *style)
|
||||||
_mpdule_cb_mouse_in, inst);
|
_mpdule_cb_mouse_in, inst);
|
||||||
evas_object_event_callback_add (inst->mpdule, EVAS_CALLBACK_MOUSE_OUT,
|
evas_object_event_callback_add (inst->mpdule, EVAS_CALLBACK_MOUSE_OUT,
|
||||||
_mpdule_cb_mouse_out, inst);
|
_mpdule_cb_mouse_out, inst);
|
||||||
edje_object_signal_callback_add(o, "mpdule,play", "", _mpdule_cb_play, inst);
|
edje_object_signal_callback_add (o, "mpdule,play", "", _mpdule_cb_play,
|
||||||
edje_object_signal_callback_add(o, "mpdule,stop", "", _mpdule_cb_stop, inst);
|
inst);
|
||||||
edje_object_signal_callback_add(o, "mpdule,pause", "", _mpdule_cb_pause, inst);
|
edje_object_signal_callback_add (o, "mpdule,stop", "", _mpdule_cb_stop,
|
||||||
edje_object_signal_callback_add(o, "mpdule,next", "", _mpdule_cb_next, inst);
|
inst);
|
||||||
edje_object_signal_callback_add(o, "mpdule,previous", "", _mpdule_cb_previous, inst);
|
edje_object_signal_callback_add (o, "mpdule,pause", "", _mpdule_cb_pause,
|
||||||
edje_object_signal_callback_add(o_popup, "mpdule,play", "", _mpdule_cb_play, inst);
|
inst);
|
||||||
edje_object_signal_callback_add(o_popup, "mpdule,stop", "", _mpdule_cb_stop, inst);
|
edje_object_signal_callback_add (o, "mpdule,next", "", _mpdule_cb_next,
|
||||||
edje_object_signal_callback_add(o_popup, "mpdule,pause", "", _mpdule_cb_pause, inst);
|
inst);
|
||||||
edje_object_signal_callback_add(o_popup, "mpdule,next", "", _mpdule_cb_next, inst);
|
edje_object_signal_callback_add (o, "mpdule,previous", "",
|
||||||
edje_object_signal_callback_add(o_popup, "mpdule,previous", "", _mpdule_cb_previous, inst);
|
_mpdule_cb_previous, inst);
|
||||||
|
edje_object_signal_callback_add (o_popup, "mpdule,play", "",
|
||||||
|
_mpdule_cb_play, inst);
|
||||||
|
edje_object_signal_callback_add (o_popup, "mpdule,stop", "",
|
||||||
|
_mpdule_cb_stop, inst);
|
||||||
|
edje_object_signal_callback_add (o_popup, "mpdule,pause", "",
|
||||||
|
_mpdule_cb_pause, inst);
|
||||||
|
edje_object_signal_callback_add (o_popup, "mpdule,next", "",
|
||||||
|
_mpdule_cb_next, inst);
|
||||||
|
edje_object_signal_callback_add (o_popup, "mpdule,previous", "",
|
||||||
|
_mpdule_cb_previous, inst);
|
||||||
_mpdule_connect (inst);
|
_mpdule_connect (inst);
|
||||||
_mpdule_update_song (inst);
|
_mpdule_update_song (inst);
|
||||||
inst->update_timer = ecore_timer_add ((double) inst->ci->poll_time,
|
inst->update_timer = ecore_timer_add ((double) inst->ci->poll_time,
|
||||||
|
@ -237,30 +255,36 @@ _mpdule_cb_mouse_down (void *data, Evas * e, Evas_Object * obj,
|
||||||
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
||||||
evas_event_feed_mouse_up (inst->gcc->gadcon->evas, ev->button,
|
evas_event_feed_mouse_up (inst->gcc->gadcon->evas, ev->button,
|
||||||
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
||||||
} else if (ev->button == 1) {
|
}
|
||||||
|
else if (ev->button == 1)
|
||||||
|
{
|
||||||
//e_gadcon_popup_toggle_pinned(inst->popup);
|
//e_gadcon_popup_toggle_pinned(inst->popup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mpdule_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
_mpdule_cb_mouse_in (void *data, Evas * e, Evas_Object * obj,
|
||||||
|
void *event_info)
|
||||||
{
|
{
|
||||||
Instance *inst;
|
Instance *inst;
|
||||||
E_Gadcon_Popup *popup;
|
E_Gadcon_Popup *popup;
|
||||||
|
|
||||||
if (!(inst = data)) return;
|
if (!(inst = data))
|
||||||
|
return;
|
||||||
popup = inst->popup;
|
popup = inst->popup;
|
||||||
e_gadcon_popup_show (inst->popup);
|
e_gadcon_popup_show (inst->popup);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mpdule_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
_mpdule_cb_mouse_out (void *data, Evas * e, Evas_Object * obj,
|
||||||
|
void *event_info)
|
||||||
{
|
{
|
||||||
Instance *inst;
|
Instance *inst;
|
||||||
E_Gadcon_Popup *popup;
|
E_Gadcon_Popup *popup;
|
||||||
|
|
||||||
if (!(inst = data)) return;
|
if (!(inst = data))
|
||||||
|
return;
|
||||||
popup = inst->popup;
|
popup = inst->popup;
|
||||||
e_gadcon_popup_hide (inst->popup);
|
e_gadcon_popup_hide (inst->popup);
|
||||||
}
|
}
|
||||||
|
@ -301,8 +325,7 @@ _mpdule_config_updated (Config_Item *ci)
|
||||||
_mpdule_connect (inst);
|
_mpdule_connect (inst);
|
||||||
_mpdule_update_song (inst);
|
_mpdule_update_song (inst);
|
||||||
if (inst->update_timer)
|
if (inst->update_timer)
|
||||||
ecore_timer_interval_set (inst->update_timer,
|
ecore_timer_interval_set (inst->update_timer, (double) ci->poll_time);
|
||||||
(double) ci->poll_time);
|
|
||||||
else
|
else
|
||||||
inst->update_timer =
|
inst->update_timer =
|
||||||
ecore_timer_add ((double) ci->poll_time, _mpdule_update_song_cb,
|
ecore_timer_add ((double) ci->poll_time, _mpdule_update_song_cb,
|
||||||
|
@ -312,7 +335,8 @@ _mpdule_config_updated (Config_Item *ci)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mpdule_cb_play(void *data, Evas_Object *obj, const char *emission, const char *source)
|
_mpdule_cb_play (void *data, Evas_Object * obj, const char *emission,
|
||||||
|
const char *source)
|
||||||
{
|
{
|
||||||
Instance *inst;
|
Instance *inst;
|
||||||
mpd_Connection *mpd;
|
mpd_Connection *mpd;
|
||||||
|
@ -323,7 +347,8 @@ _mpdule_cb_play(void *data, Evas_Object *obj, const char *emission, const char *
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mpdule_cb_previous(void *data, Evas_Object *obj, const char *emission, const char *source)
|
_mpdule_cb_previous (void *data, Evas_Object * obj, const char *emission,
|
||||||
|
const char *source)
|
||||||
{
|
{
|
||||||
Instance *inst;
|
Instance *inst;
|
||||||
mpd_Connection *mpd;
|
mpd_Connection *mpd;
|
||||||
|
@ -334,7 +359,8 @@ _mpdule_cb_previous(void *data, Evas_Object *obj, const char *emission, const ch
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mpdule_cb_next(void *data, Evas_Object *obj, const char *emission, const char *source)
|
_mpdule_cb_next (void *data, Evas_Object * obj, const char *emission,
|
||||||
|
const char *source)
|
||||||
{
|
{
|
||||||
Instance *inst;
|
Instance *inst;
|
||||||
mpd_Connection *mpd;
|
mpd_Connection *mpd;
|
||||||
|
@ -345,7 +371,8 @@ _mpdule_cb_next(void *data, Evas_Object *obj, const char *emission, const char *
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mpdule_cb_stop(void *data, Evas_Object *obj, const char *emission, const char *source)
|
_mpdule_cb_stop (void *data, Evas_Object * obj, const char *emission,
|
||||||
|
const char *source)
|
||||||
{
|
{
|
||||||
Instance *inst;
|
Instance *inst;
|
||||||
mpd_Connection *mpd;
|
mpd_Connection *mpd;
|
||||||
|
@ -356,7 +383,8 @@ _mpdule_cb_stop(void *data, Evas_Object *obj, const char *emission, const char *
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_mpdule_cb_pause(void *data, Evas_Object *obj, const char *emission, const char *source)
|
_mpdule_cb_pause (void *data, Evas_Object * obj, const char *emission,
|
||||||
|
const char *source)
|
||||||
{
|
{
|
||||||
Instance *inst;
|
Instance *inst;
|
||||||
mpd_Connection *mpd;
|
mpd_Connection *mpd;
|
||||||
|
@ -384,7 +412,8 @@ _mpdule_config_item_get (const char *id)
|
||||||
const char *p;
|
const char *p;
|
||||||
ci = evas_list_last (mpdule_config->items)->data;
|
ci = evas_list_last (mpdule_config->items)->data;
|
||||||
p = strrchr (ci->id, '.');
|
p = strrchr (ci->id, '.');
|
||||||
if (p) num = atoi(p + 1) + 1;
|
if (p)
|
||||||
|
num = atoi (p + 1) + 1;
|
||||||
}
|
}
|
||||||
snprintf (buf, sizeof (buf), "%s.%d", _gc_class.name, num);
|
snprintf (buf, sizeof (buf), "%s.%d", _gc_class.name, num);
|
||||||
id = buf;
|
id = buf;
|
||||||
|
@ -432,7 +461,8 @@ _mpdule_disconnect(Instance *inst)
|
||||||
{
|
{
|
||||||
mpd_Connection *mpd;
|
mpd_Connection *mpd;
|
||||||
|
|
||||||
if (inst->mpd) {
|
if (inst->mpd)
|
||||||
|
{
|
||||||
mpd = inst->mpd;
|
mpd = inst->mpd;
|
||||||
mpd_closeConnection (mpd);
|
mpd_closeConnection (mpd);
|
||||||
inst->mpd = NULL;
|
inst->mpd = NULL;
|
||||||
|
@ -470,23 +500,31 @@ _mpdule_update_song(Instance *inst)
|
||||||
{
|
{
|
||||||
if (status->state == MPD_STATUS_STATE_UNKNOWN)
|
if (status->state == MPD_STATUS_STATE_UNKNOWN)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.status", D_ ("Unknown"));
|
edje_object_part_text_set (mpdule, "mpdule.status",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.status", D_ ("Unknown"));
|
D_ ("Unknown"));
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.status",
|
||||||
|
D_ ("Unknown"));
|
||||||
}
|
}
|
||||||
else if (status->state == MPD_STATUS_STATE_STOP)
|
else if (status->state == MPD_STATUS_STATE_STOP)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.status", D_ ("Stopped"));
|
edje_object_part_text_set (mpdule, "mpdule.status",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.status", D_ ("Stopped"));
|
D_ ("Stopped"));
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.status",
|
||||||
|
D_ ("Stopped"));
|
||||||
}
|
}
|
||||||
else if (status->state == MPD_STATUS_STATE_PLAY)
|
else if (status->state == MPD_STATUS_STATE_PLAY)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.status", D_ ("Playing"));
|
edje_object_part_text_set (mpdule, "mpdule.status",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.status", D_ ("Playing"));
|
D_ ("Playing"));
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.status",
|
||||||
|
D_ ("Playing"));
|
||||||
}
|
}
|
||||||
else if (status->state == MPD_STATUS_STATE_PAUSE)
|
else if (status->state == MPD_STATUS_STATE_PAUSE)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.status", D_ ("Paused"));
|
edje_object_part_text_set (mpdule, "mpdule.status",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.status", D_ ("Paused"));
|
D_ ("Paused"));
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.status",
|
||||||
|
D_ ("Paused"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status->state > MPD_STATUS_STATE_STOP)
|
if (status->state > MPD_STATUS_STATE_STOP)
|
||||||
|
@ -503,73 +541,103 @@ _mpdule_update_song(Instance *inst)
|
||||||
|
|
||||||
if (song->artist)
|
if (song->artist)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.artist", song->artist);
|
edje_object_part_text_set (mpdule, "mpdule.artist",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.artist", song->artist);
|
song->artist);
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.artist",
|
||||||
|
song->artist);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.artist", "");
|
edje_object_part_text_set (mpdule, "mpdule.artist",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.artist", "");
|
"");
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.artist",
|
||||||
|
"");
|
||||||
}
|
}
|
||||||
if (song->title)
|
if (song->title)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.title", song->title);
|
edje_object_part_text_set (mpdule, "mpdule.title",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.title", song->title);
|
song->title);
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.title",
|
||||||
|
song->title);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.title", "");
|
edje_object_part_text_set (mpdule, "mpdule.title",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.title", "");
|
"");
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.title",
|
||||||
|
"");
|
||||||
}
|
}
|
||||||
if (song->album)
|
if (song->album)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.album", song->album);
|
edje_object_part_text_set (mpdule, "mpdule.album",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.album", song->album);
|
song->album);
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.album",
|
||||||
|
song->album);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.album", "");
|
edje_object_part_text_set (mpdule, "mpdule.album",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.album", "");
|
"");
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.album",
|
||||||
|
"");
|
||||||
}
|
}
|
||||||
if (song->track)
|
if (song->track)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.track", song->track);
|
edje_object_part_text_set (mpdule, "mpdule.track",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.track", song->track);
|
song->track);
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.track",
|
||||||
|
song->track);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.track", "");
|
edje_object_part_text_set (mpdule, "mpdule.track",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.track", "");
|
"");
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.track",
|
||||||
|
"");
|
||||||
}
|
}
|
||||||
if (song->date)
|
if (song->date)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.date", song->date);
|
edje_object_part_text_set (mpdule, "mpdule.date",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.date", song->date);
|
song->date);
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.date",
|
||||||
|
song->date);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.date", "");
|
edje_object_part_text_set (mpdule, "mpdule.date",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.date", "");
|
"");
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.date",
|
||||||
|
"");
|
||||||
}
|
}
|
||||||
if (song->genre)
|
if (song->genre)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.genre", song->genre);
|
edje_object_part_text_set (mpdule, "mpdule.genre",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.genre", song->genre);
|
song->genre);
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.genre",
|
||||||
|
song->genre);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.genre", "");
|
edje_object_part_text_set (mpdule, "mpdule.genre",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.genre", "");
|
"");
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.genre",
|
||||||
|
"");
|
||||||
}
|
}
|
||||||
if (song->composer)
|
if (song->composer)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.composer", song->composer);
|
edje_object_part_text_set (mpdule,
|
||||||
edje_object_part_text_set (o_popup, "mpdule.composer", song->composer);
|
"mpdule.composer",
|
||||||
|
song->composer);
|
||||||
|
edje_object_part_text_set (o_popup,
|
||||||
|
"mpdule.composer",
|
||||||
|
song->composer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.composer", "");
|
edje_object_part_text_set (mpdule,
|
||||||
edje_object_part_text_set (o_popup, "mpdule.composer", "");
|
"mpdule.composer", "");
|
||||||
|
edje_object_part_text_set (o_popup,
|
||||||
|
"mpdule.composer", "");
|
||||||
}
|
}
|
||||||
if (song->time)
|
if (song->time)
|
||||||
{
|
{
|
||||||
|
@ -580,18 +648,24 @@ _mpdule_update_song(Instance *inst)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.time", "");
|
edje_object_part_text_set (mpdule, "mpdule.time",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.time", "");
|
"");
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.time",
|
||||||
|
"");
|
||||||
}
|
}
|
||||||
if (song->file)
|
if (song->file)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.file", song->file);
|
edje_object_part_text_set (mpdule, "mpdule.file",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.file", song->file);
|
song->file);
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.file",
|
||||||
|
song->file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_part_text_set (mpdule, "mpdule.file", "");
|
edje_object_part_text_set (mpdule, "mpdule.file",
|
||||||
edje_object_part_text_set (o_popup, "mpdule.file", "");
|
"");
|
||||||
|
edje_object_part_text_set (o_popup, "mpdule.file",
|
||||||
|
"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -701,7 +775,8 @@ e_modapi_save (E_Module * m)
|
||||||
static void
|
static void
|
||||||
_mpdule_popup_destroy (Instance * inst)
|
_mpdule_popup_destroy (Instance * inst)
|
||||||
{
|
{
|
||||||
if (!inst->popup) return;
|
if (!inst->popup)
|
||||||
|
return;
|
||||||
e_object_del (E_OBJECT (inst->popup));
|
e_object_del (E_OBJECT (inst->popup));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -709,8 +784,10 @@ static void
|
||||||
_mpdule_popup_resize (Evas_Object * obj, int *w, int *h)
|
_mpdule_popup_resize (Evas_Object * obj, int *w, int *h)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
if (!(*w)) *w = 0;
|
if (!(*w))
|
||||||
if (!(*h)) *h = 0;
|
*w = 0;
|
||||||
|
if (!(*h))
|
||||||
|
*h = 0;
|
||||||
edje_object_size_min_calc (obj, &x, &y);
|
edje_object_size_min_calc (obj, &x, &y);
|
||||||
*w = x;
|
*w = x;
|
||||||
*h = y;
|
*h = y;
|
||||||
|
|
450
mpdule.edc
450
mpdule.edc
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue