#include <ui-gadget.h>
+#include <vconf.h>
#include "_util_log.h"
#include "volume.h"
#include "_sound.h"
#include "_logic.h"
+enum {
+ IDLELOCK_OFF = 0x0,
+ IDLELOCK_ON,
+ IDLELOCK_MAX,
+};
+
static void button_ug_layout_cb(ui_gadget_h ug,
enum ug_mode mode, void *priv)
{
elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_HIDE);
_close_volume(ad);
- elm_exit();
}
ui_gadget_h create_button_ug(void *data)
ui_gadget_h ug = NULL;
struct ug_cbs cbs = {0};
struct appdata *ad = (struct appdata *)data;
+ int vconf_status = -1;
+ int lock = -1, type = -1;
retvm_if(ad == NULL, 0, "Invalid argument:appdata is NULL\n");
cbs.layout_cb = button_ug_layout_cb;
cbs.destroy_cb = button_ug_destroy_cb;
cbs.priv = (void *)data;
- ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NORMAL);
+ vconf_get_int(VCONFKEY_PWLOCK_STATE, &vconf_status);
+
+ lock = _get_vconf_idlelock();
+ type = _get_volume_type();
+
+ if(vconf_status == VCONFKEY_PWLOCK_BOOTING_LOCK || (lock == IDLELOCK_ON && type == VOLUME_TYPE_MEDIA)){
+ ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NOTIFICATION);
+ }
+ else{
+ ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NORMAL);
+ }
utilx_set_window_opaque_state(ecore_x_display_get(), elm_win_xwindow_get(ad->win), UTILX_OPAQUE_STATE_ON);
ug = ug_create(NULL, "setting-profile-efl", UG_MODE_FULLVIEW, NULL, &cbs);
#include <ui-gadget.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
+#include <system_info.h>
#include"_logic.h"
#include "volume.h"
else
rotation = angle;
- ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+ system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_WIDTH, &w);
+ system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_HEIGHT, &h);
switch(rotation){
case 90 :
int ret = -1, status = -1, val = 0;
int type = MM_ERROR_SOUND_VOLUME_CAPTURE_ONLY;
int lock = IDLELOCK_ON;
- int w, h;
Evas_Object *win, *sl, *ic, *ic_settings;
/* volume-app layout */
Elm_Theme *th;
retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
ad->flag_touching = EINA_FALSE;
+ ad->noti_seen = EINA_FALSE;
_init_mm_sound(ad);
status = _check_status(&lock, &type);
elm_theme_extension_add(th, EDJ_APP);
block = _add_layout(win, EDJ_APP, GRP_VOLUME_BLOCKEVENTS);
- ecore_x_window_size_get(
- ecore_x_window_root_first_get(),
- &w, &h);
- evas_object_resize(block, w, h);
- evas_object_show(block);
edje_object_signal_callback_add(elm_layout_edje_get(block), "clicked", "*", _block_clicked_cb, ad);
outer = _add_layout(win, EDJ_APP, GRP_VOLUME_LAYOUT);
inner = _add_layout(win, EDJ_APP, GRP_VOLUME_CONTENT);
struct appdata *ad = (struct appdata *)data;
retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
- if(ad->noti){
- noti_err = notification_delete(ad->noti);
+ if(ad->noti_id != 0)
+ {
+ noti_err = notification_delete_by_priv_id(PKGNAME, NOTIFICATION_TYPE_NOTI, ad->noti_id);
retvm_if(noti_err != NOTIFICATION_ERROR_NONE, ECORE_CALLBACK_RENEW, "Fail to notification_delete : %d\n", noti_err);
}
- ad->noti = NULL;
+ ad->noti_id = 0;
return ECORE_CALLBACK_CANCEL;
}
-notification_h _insert_message_ticker_notification(const char* pTickerMsg, const char* pLocaleTickerMsg)
+int _insert_message_ticker_notification(void)
{
notification_h noti = NULL;
notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
+ int priv_id = 0;
noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
- retvm_if(noti == NULL, NULL, "notification_new is failed\n");
+ retvm_if(noti == NULL, 0, "notification_new is failed\n");
noti_err = notification_set_application(noti, PKGNAME);
- retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_application : %d\n", noti_err);
+ retvm_if(noti_err != NOTIFICATION_ERROR_NONE, 0, "Fail to notification_set_application : %d\n", noti_err);
noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, IMG_VOLUME_PACKAGE_ICON);
- retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_image : %d\n", noti_err);
+ retvm_if(noti_err != NOTIFICATION_ERROR_NONE, 0, "Fail to notification_set_image : %d\n", noti_err);
- noti_err = notification_set_text_domain(noti, "volume-app", LOCALEDIR);
- retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_text_domain : %d\n", noti_err);
+ noti_err = notification_set_text_domain(noti, PACKAGE, LOCALEDIR);
+ retvm_if(noti_err != NOTIFICATION_ERROR_NONE, 0, "Fail to notification_set_text_domain : %d\n", noti_err);
- noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, pTickerMsg, T_(pLocaleTickerMsg), NOTIFICATION_VARIABLE_TYPE_NONE);
- retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_text : %d\n", noti_err);
+ noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, STR_MEDIA_MSG, IDS_MEDIA_MSG, NOTIFICATION_VARIABLE_TYPE_NONE);
+ retvm_if(noti_err != NOTIFICATION_ERROR_NONE, 0, "Fail to notification_set_text : %d\n", noti_err);
- noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT_FOR_DISPLAY_OPTION_IS_OFF, pTickerMsg, T_(pLocaleTickerMsg), NOTIFICATION_VARIABLE_TYPE_NONE);
- retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_text : %d\n", noti_err);
+ noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, STR_WARNING_MSG, IDS_WARNING_MSG, NOTIFICATION_VARIABLE_TYPE_NONE);
+ retvm_if(noti_err != NOTIFICATION_ERROR_NONE, 0, "Fail to notification_set_text : %d\n", noti_err);
- noti_err = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_TICKER);
- retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_display_applist : %d\n", noti_err);
+ noti_err = notification_insert(noti, &priv_id);
+ retvm_if(noti_err != NOTIFICATION_ERROR_NONE, 0, "Fail to notification_set_text_domain : %d\n", noti_err);
- noti_err = notification_insert(noti, NULL);
- retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_text_domain : %d\n", noti_err);
-
- return noti;
+ return priv_id;
}
void _set_device_warning(void *data, int val, int device)
switch (device) {
case SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_EARPHONE:
- if (val >= 10) {
- if(ad->noti == NULL){
- ad->noti = _insert_message_ticker_notification(IDS_WARNING_MSG, STR_WARNING_MSG);
+ if (val >= 10 && ad->type == VOLUME_TYPE_MEDIA) {
+ if(ad->noti_id == 0 && ad->noti_seen == EINA_FALSE){
+ ad->noti_id = _insert_message_ticker_notification();
+ DEL_TIMER(ad->warntimer);
+ ADD_TIMER(ad->warntimer, 2.0, _delete_message_ticker_notification, data);
+ ad->noti_seen = EINA_TRUE;
}
- DEL_TIMER(ad->warntimer);
- ADD_TIMER(ad->warntimer, 2.0, _delete_message_ticker_notification, data);
}
else {
_delete_message_ticker_notification(data);
+ ad->noti_seen = EINA_FALSE;
}
break;
default:
_delete_message_ticker_notification(data);
+ ad->noti_seen = EINA_FALSE;
break;
}
}
retm_if(ad->win == NULL, "Failed to get window\n");
/* function could be activated when window exists */
+ ad->type = _get_volume_type();
ad->step = _get_step(ad->type);
mm_sound_route_get_playing_device(&device);
mm_sound_volume_get_value(ad->type, (unsigned int*)(&val));