2005-12-16 12:57:24 -08:00
|
|
|
#include "e.h"
|
|
|
|
#include "e_mod_main.h"
|
|
|
|
|
2012-06-25 03:48:42 -07:00
|
|
|
#define BUTTON_DRAG 0
|
2007-12-17 16:46:46 -08:00
|
|
|
#define BUTTON_NOPLACE 1
|
2012-06-25 03:48:42 -07:00
|
|
|
#define BUTTON_DESK 2
|
2006-11-19 00:58:05 -08:00
|
|
|
|
2010-11-11 09:58:23 -08:00
|
|
|
struct _E_Config_Dialog_Data
|
2005-12-16 12:57:24 -08:00
|
|
|
{
|
2010-11-11 09:58:23 -08:00
|
|
|
struct
|
2012-06-25 03:48:42 -07:00
|
|
|
{
|
|
|
|
int show, urgent_show, urgent_stick, urgent_focus;
|
|
|
|
double speed, urgent_speed;
|
|
|
|
int height, act_height;
|
|
|
|
} popup;
|
2010-11-11 09:58:23 -08:00
|
|
|
struct
|
2012-06-25 03:48:42 -07:00
|
|
|
{
|
|
|
|
unsigned int drag, noplace, desk;
|
|
|
|
} btn;
|
2010-11-11 09:58:23 -08:00
|
|
|
struct
|
2012-06-25 03:48:42 -07:00
|
|
|
{
|
|
|
|
Ecore_X_Window bind_win;
|
2012-08-24 06:55:26 -07:00
|
|
|
E_Grab_Dialog *dia;
|
2012-06-25 03:48:42 -07:00
|
|
|
Eina_List *hdls;
|
|
|
|
int btn;
|
|
|
|
} grab;
|
2010-11-11 09:58:23 -08:00
|
|
|
struct
|
2012-06-25 03:48:42 -07:00
|
|
|
{
|
|
|
|
Evas_Object *ob1, *ob2, *ob3;
|
|
|
|
Eina_List *popup_list, *urgent_list;
|
|
|
|
} gui;
|
2012-08-10 21:40:30 -07:00
|
|
|
int drag_resist, flip_desk, show_desk_names, live_preview;
|
2012-08-24 06:55:26 -07:00
|
|
|
E_Config_Dialog *cfd;
|
2005-12-16 12:57:24 -08:00
|
|
|
};
|
|
|
|
|
2010-03-15 13:38:49 -07:00
|
|
|
/* local function prototypes */
|
2012-06-25 03:48:42 -07:00
|
|
|
static void *_create_data(E_Config_Dialog *cfd);
|
|
|
|
static void _fill_data(E_Config_Dialog_Data *cfdata);
|
|
|
|
static void _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
|
2010-03-15 13:38:49 -07:00
|
|
|
static Evas_Object *_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata);
|
2012-06-25 03:48:42 -07:00
|
|
|
static int _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
|
|
|
|
static int _basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
|
2010-03-15 13:38:49 -07:00
|
|
|
static Evas_Object *_adv_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata);
|
2012-06-25 03:48:42 -07:00
|
|
|
static int _adv_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
|
|
|
|
static int _adv_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
|
|
|
|
static void _update_btn_lbl(E_Config_Dialog_Data *cfdata);
|
|
|
|
static void _grab_window_show(void *data1, void *data2);
|
|
|
|
static Eina_Bool _grab_cb_mouse_down(void *data, int type, void *event);
|
|
|
|
static Eina_Bool _grab_cb_key_down(void *data, int type, void *event);
|
|
|
|
static void _cb_disable_check_list(void *data, Evas_Object *obj);
|
|
|
|
|
|
|
|
void
|
|
|
|
_config_pager_module(Config_Item *ci)
|
2005-12-16 12:57:24 -08:00
|
|
|
{
|
|
|
|
E_Config_Dialog *cfd;
|
2006-01-22 06:17:43 -08:00
|
|
|
E_Config_Dialog_View *v;
|
2007-12-17 16:46:46 -08:00
|
|
|
E_Container *con;
|
2010-03-15 13:38:49 -07:00
|
|
|
char buff[PATH_MAX];
|
2007-12-17 16:46:46 -08:00
|
|
|
|
2006-01-22 06:17:43 -08:00
|
|
|
v = E_NEW(E_Config_Dialog_View, 1);
|
2007-12-17 16:46:46 -08:00
|
|
|
if (!v) return;
|
|
|
|
|
2006-01-22 06:17:43 -08:00
|
|
|
v->create_cfdata = _create_data;
|
|
|
|
v->free_cfdata = _free_data;
|
2007-12-17 16:46:46 -08:00
|
|
|
v->basic.create_widgets = _basic_create;
|
|
|
|
v->basic.apply_cfdata = _basic_apply;
|
2010-03-15 14:27:26 -07:00
|
|
|
v->basic.check_changed = _basic_check_changed;
|
2007-12-17 16:46:46 -08:00
|
|
|
v->advanced.create_widgets = _adv_create;
|
|
|
|
v->advanced.apply_cfdata = _adv_apply;
|
2010-03-15 14:27:26 -07:00
|
|
|
v->advanced.check_changed = _adv_check_changed;
|
2007-12-17 16:46:46 -08:00
|
|
|
|
2012-06-25 03:48:42 -07:00
|
|
|
snprintf(buff, sizeof(buff), "%s/e-module-pager.edj",
|
2010-03-15 13:38:49 -07:00
|
|
|
pager_config->module->dir);
|
2007-12-17 16:46:46 -08:00
|
|
|
con = e_container_current_get(e_manager_current_get());
|
2012-06-25 03:48:42 -07:00
|
|
|
cfd = e_config_dialog_new(con, _("Pager Settings"), "E",
|
2010-03-15 13:38:49 -07:00
|
|
|
"_e_mod_pager_config_dialog", buff, 0, v, ci);
|
2006-04-20 04:30:25 -07:00
|
|
|
pager_config->config_dialog = cfd;
|
2005-12-16 12:57:24 -08:00
|
|
|
}
|
|
|
|
|
2010-03-15 13:38:49 -07:00
|
|
|
/* local function prototypes */
|
2006-01-08 01:29:42 -08:00
|
|
|
static void *
|
2012-06-25 03:48:42 -07:00
|
|
|
_create_data(E_Config_Dialog *cfd __UNUSED__)
|
2005-12-16 12:57:24 -08:00
|
|
|
{
|
2006-01-14 08:10:57 -08:00
|
|
|
E_Config_Dialog_Data *cfdata;
|
2007-12-17 16:46:46 -08:00
|
|
|
|
2006-01-14 08:10:57 -08:00
|
|
|
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
2010-03-15 13:38:49 -07:00
|
|
|
_fill_data(cfdata);
|
2005-12-16 12:57:24 -08:00
|
|
|
return cfdata;
|
|
|
|
}
|
|
|
|
|
2010-11-11 09:58:23 -08:00
|
|
|
static void
|
|
|
|
_fill_data(E_Config_Dialog_Data *cfdata)
|
2007-12-17 16:46:46 -08:00
|
|
|
{
|
|
|
|
cfdata->popup.show = pager_config->popup;
|
|
|
|
cfdata->popup.speed = pager_config->popup_speed;
|
|
|
|
cfdata->popup.urgent_show = pager_config->popup_urgent;
|
|
|
|
cfdata->popup.urgent_stick = pager_config->popup_urgent_stick;
|
2010-11-11 09:58:23 -08:00
|
|
|
cfdata->popup.urgent_focus = pager_config->popup_urgent_focus;
|
2007-12-17 16:46:46 -08:00
|
|
|
cfdata->popup.urgent_speed = pager_config->popup_urgent_speed;
|
2008-01-06 17:30:02 -08:00
|
|
|
cfdata->popup.height = pager_config->popup_height;
|
|
|
|
cfdata->popup.act_height = pager_config->popup_act_height;
|
2007-12-17 16:46:46 -08:00
|
|
|
cfdata->drag_resist = pager_config->drag_resist;
|
|
|
|
cfdata->btn.drag = pager_config->btn_drag;
|
|
|
|
cfdata->btn.noplace = pager_config->btn_noplace;
|
|
|
|
cfdata->btn.desk = pager_config->btn_desk;
|
|
|
|
cfdata->flip_desk = pager_config->flip_desk;
|
2012-08-10 21:40:30 -07:00
|
|
|
cfdata->live_preview = !pager_config->disable_live_preview;
|
2010-03-15 13:38:49 -07:00
|
|
|
cfdata->show_desk_names = pager_config->show_desk_names;
|
2007-12-17 16:46:46 -08:00
|
|
|
}
|
|
|
|
|
2012-06-25 03:48:42 -07:00
|
|
|
static void
|
|
|
|
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
2005-12-16 12:57:24 -08:00
|
|
|
{
|
2010-03-15 13:38:49 -07:00
|
|
|
cfdata->gui.popup_list = eina_list_free(cfdata->gui.popup_list);
|
|
|
|
cfdata->gui.urgent_list = eina_list_free(cfdata->gui.urgent_list);
|
2006-04-20 04:30:25 -07:00
|
|
|
pager_config->config_dialog = NULL;
|
2007-02-02 18:02:49 -08:00
|
|
|
E_FREE(cfdata);
|
2005-12-16 12:57:24 -08:00
|
|
|
}
|
|
|
|
|
2006-01-08 01:29:42 -08:00
|
|
|
static Evas_Object *
|
2012-08-24 06:55:26 -07:00
|
|
|
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
2005-12-16 12:57:24 -08:00
|
|
|
{
|
2010-03-15 13:38:49 -07:00
|
|
|
Evas_Object *ol, *of, *ow;
|
|
|
|
|
2012-08-24 06:55:26 -07:00
|
|
|
cfdata->cfd = cfd;
|
2010-03-15 13:38:49 -07:00
|
|
|
ol = e_widget_list_add(evas, 0, 0);
|
2006-08-05 19:21:07 -07:00
|
|
|
|
2010-03-15 13:38:49 -07:00
|
|
|
of = e_widget_framelist_add(evas, _("General"), 0);
|
2012-06-25 03:48:42 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Flip desktop on mouse wheel"),
|
2009-04-17 13:35:04 -07:00
|
|
|
&(cfdata->flip_desk));
|
2007-12-17 16:46:46 -08:00
|
|
|
e_widget_framelist_object_append(of, ow);
|
2012-07-12 23:34:38 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Always show desktop names"),
|
2009-04-17 13:35:04 -07:00
|
|
|
&(cfdata->show_desk_names));
|
2008-01-10 23:33:57 -08:00
|
|
|
e_widget_framelist_object_append(of, ow);
|
2012-08-10 21:40:30 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Live preview"),
|
|
|
|
&(cfdata->live_preview));
|
2012-08-10 06:29:35 -07:00
|
|
|
e_widget_framelist_object_append(of, ow);
|
2010-03-15 13:38:49 -07:00
|
|
|
e_widget_list_object_append(ol, of, 1, 0, 0.5);
|
2007-12-17 16:46:46 -08:00
|
|
|
|
2010-03-15 13:38:49 -07:00
|
|
|
of = e_widget_framelist_add(evas, _("Popup"), 0);
|
2012-06-25 03:48:42 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Show popup on desktop change"),
|
2009-04-17 13:35:04 -07:00
|
|
|
&(cfdata->popup.show));
|
2007-12-17 16:46:46 -08:00
|
|
|
e_widget_framelist_object_append(of, ow);
|
2012-06-25 03:48:42 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Show popup for urgent windows"),
|
2009-04-17 13:35:04 -07:00
|
|
|
&(cfdata->popup.urgent_show));
|
2007-12-17 16:46:46 -08:00
|
|
|
e_widget_framelist_object_append(of, ow);
|
2010-03-15 13:38:49 -07:00
|
|
|
e_widget_list_object_append(ol, of, 1, 0, 0.5);
|
2005-12-16 12:57:24 -08:00
|
|
|
|
2010-03-15 13:38:49 -07:00
|
|
|
return ol;
|
2005-12-16 12:57:24 -08:00
|
|
|
}
|
|
|
|
|
2012-06-25 03:48:42 -07:00
|
|
|
static int
|
|
|
|
_basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
2005-12-16 12:57:24 -08:00
|
|
|
{
|
2007-12-17 16:46:46 -08:00
|
|
|
pager_config->popup = cfdata->popup.show;
|
|
|
|
pager_config->flip_desk = cfdata->flip_desk;
|
2012-08-10 21:40:30 -07:00
|
|
|
pager_config->disable_live_preview = !cfdata->live_preview;
|
2008-01-10 23:33:57 -08:00
|
|
|
pager_config->show_desk_names = cfdata->show_desk_names;
|
2007-12-17 16:46:46 -08:00
|
|
|
pager_config->popup_urgent = cfdata->popup.urgent_show;
|
2012-07-11 01:50:52 -07:00
|
|
|
_pager_cb_config_updated();
|
2005-12-16 12:57:24 -08:00
|
|
|
e_config_save_queue();
|
2005-12-24 12:01:03 -08:00
|
|
|
return 1;
|
2005-12-16 12:57:24 -08:00
|
|
|
}
|
|
|
|
|
2012-06-25 03:48:42 -07:00
|
|
|
static int
|
|
|
|
_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
2010-03-15 14:27:26 -07:00
|
|
|
{
|
2011-05-22 10:13:26 -07:00
|
|
|
if ((int)pager_config->popup != cfdata->popup.show) return 1;
|
|
|
|
if ((int)pager_config->flip_desk != cfdata->flip_desk) return 1;
|
2012-08-10 21:40:30 -07:00
|
|
|
if ((int)pager_config->disable_live_preview != !cfdata->live_preview) return 1;
|
2011-05-22 10:13:26 -07:00
|
|
|
if ((int)pager_config->show_desk_names != cfdata->show_desk_names) return 1;
|
|
|
|
if ((int)pager_config->popup_urgent != cfdata->popup.urgent_show) return 1;
|
2010-03-15 14:27:26 -07:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-01-08 01:29:42 -08:00
|
|
|
static Evas_Object *
|
2012-08-24 06:55:26 -07:00
|
|
|
_adv_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
2005-12-16 12:57:24 -08:00
|
|
|
{
|
2010-03-15 13:38:49 -07:00
|
|
|
Evas_Object *otb, *ol, *ow;
|
|
|
|
Evas_Object *pc, *uc;
|
|
|
|
|
2012-08-24 06:55:26 -07:00
|
|
|
cfdata->cfd = cfd;
|
2010-03-15 13:38:49 -07:00
|
|
|
otb = e_widget_toolbook_add(evas, (48 * e_scale), (48 * e_scale));
|
2005-12-16 12:57:24 -08:00
|
|
|
|
2010-03-15 13:38:49 -07:00
|
|
|
/* General Page */
|
|
|
|
ol = e_widget_list_add(evas, 0, 0);
|
2012-06-25 03:48:42 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Flip desktop on mouse wheel"),
|
2009-04-17 13:35:04 -07:00
|
|
|
&(cfdata->flip_desk));
|
2010-03-15 13:38:49 -07:00
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-07-12 23:34:38 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Always show desktop names"),
|
2009-04-17 13:35:04 -07:00
|
|
|
&(cfdata->show_desk_names));
|
2010-03-15 13:38:49 -07:00
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-08-10 21:40:30 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Live preview"),
|
|
|
|
&(cfdata->live_preview));
|
2012-08-10 06:29:35 -07:00
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2010-03-15 13:38:49 -07:00
|
|
|
ow = e_widget_label_add(evas, _("Resistance to dragging"));
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-06-25 03:48:42 -07:00
|
|
|
ow = e_widget_slider_add(evas, 1, 0, _("%.0f px"), 0.0, 10.0, 1.0, 0, NULL,
|
2010-03-15 13:38:49 -07:00
|
|
|
&(cfdata->drag_resist), 100);
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
|
|
|
|
2009-09-10 06:51:12 -07:00
|
|
|
#if 0
|
2007-12-17 16:46:46 -08:00
|
|
|
ow = e_widget_label_add(evas, _("Select and Slide button"));
|
2010-03-15 13:38:49 -07:00
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-06-25 03:48:42 -07:00
|
|
|
ow = e_widget_button_add(evas, _("Click to set"), NULL,
|
2010-03-15 13:38:49 -07:00
|
|
|
_grab_window_show, (void *)BUTTON_DRAG, cfdata);
|
|
|
|
cfdata->gui.ob1 = ow;
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2009-09-10 06:51:12 -07:00
|
|
|
#endif
|
2007-12-17 16:46:46 -08:00
|
|
|
|
2010-03-15 13:38:49 -07:00
|
|
|
ow = e_widget_label_add(evas, _("Drag and Drop button"));
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-06-25 03:48:42 -07:00
|
|
|
ow = e_widget_button_add(evas, _("Click to set"), NULL,
|
2010-03-15 13:38:49 -07:00
|
|
|
_grab_window_show, (void *)BUTTON_NOPLACE, cfdata);
|
|
|
|
cfdata->gui.ob2 = ow;
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2007-12-17 16:46:46 -08:00
|
|
|
ow = e_widget_label_add(evas, _("Drag whole desktop"));
|
2010-03-15 13:38:49 -07:00
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-06-25 03:48:42 -07:00
|
|
|
ow = e_widget_button_add(evas, _("Click to set"), NULL,
|
2010-03-15 13:38:49 -07:00
|
|
|
_grab_window_show, (void *)BUTTON_DESK, cfdata);
|
|
|
|
cfdata->gui.ob3 = ow;
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
|
|
|
_update_btn_lbl(cfdata);
|
2012-06-25 03:48:42 -07:00
|
|
|
e_widget_toolbook_page_append(otb, NULL, _("General"), ol, 1, 0, 1, 0,
|
2010-03-15 13:38:49 -07:00
|
|
|
0.5, 0.0);
|
|
|
|
|
|
|
|
/* Popup Page */
|
|
|
|
ol = e_widget_list_add(evas, 0, 0);
|
2012-06-25 03:48:42 -07:00
|
|
|
pc = e_widget_check_add(evas, _("Show popup on desktop change"),
|
2010-03-15 13:38:49 -07:00
|
|
|
&(cfdata->popup.show));
|
|
|
|
e_widget_list_object_append(ol, pc, 1, 0, 0.5);
|
2005-12-16 12:57:24 -08:00
|
|
|
|
2007-12-17 16:46:46 -08:00
|
|
|
ow = e_widget_label_add(evas, _("Popup pager height"));
|
2010-03-15 13:38:49 -07:00
|
|
|
cfdata->gui.popup_list = eina_list_append(cfdata->gui.popup_list, ow);
|
|
|
|
e_widget_disabled_set(ow, !cfdata->popup.show);
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-06-25 03:48:42 -07:00
|
|
|
ow = e_widget_slider_add(evas, 1, 0, _("%.0f px"), 20.0, 200.0, 1.0, 0, NULL,
|
2009-04-17 13:35:04 -07:00
|
|
|
&(cfdata->popup.height), 100);
|
2010-03-15 13:38:49 -07:00
|
|
|
cfdata->gui.popup_list = eina_list_append(cfdata->gui.popup_list, ow);
|
|
|
|
e_widget_disabled_set(ow, !cfdata->popup.show);
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
|
|
|
|
2012-06-21 03:48:30 -07:00
|
|
|
ow = e_widget_label_add(evas, _("Popup duration"));
|
2010-03-15 13:38:49 -07:00
|
|
|
cfdata->gui.popup_list = eina_list_append(cfdata->gui.popup_list, ow);
|
|
|
|
e_widget_disabled_set(ow, !cfdata->popup.show);
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-06-25 03:48:42 -07:00
|
|
|
ow = e_widget_slider_add(evas, 1, 0, _("%1.1f seconds"), 0.1, 10.0, 0.1, 0,
|
2009-04-17 13:35:04 -07:00
|
|
|
&(cfdata->popup.speed), NULL, 100);
|
2010-03-15 13:38:49 -07:00
|
|
|
cfdata->gui.popup_list = eina_list_append(cfdata->gui.popup_list, ow);
|
|
|
|
e_widget_disabled_set(ow, !cfdata->popup.show);
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-06-25 03:48:42 -07:00
|
|
|
e_widget_on_change_hook_set(pc, _cb_disable_check_list,
|
2010-03-15 13:38:49 -07:00
|
|
|
cfdata->gui.popup_list);
|
2010-05-12 11:31:27 -07:00
|
|
|
ow = e_widget_label_add(evas, _("Pager action popup height"));
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-06-25 03:48:42 -07:00
|
|
|
ow = e_widget_slider_add(evas, 1, 0, _("%.0f px"), 20.0, 200.0, 1.0, 0, NULL,
|
2010-05-12 11:31:27 -07:00
|
|
|
&(cfdata->popup.act_height), 100);
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-06-25 03:48:42 -07:00
|
|
|
e_widget_toolbook_page_append(otb, NULL, _("Popup"), ol, 1, 0, 1, 0,
|
2010-03-15 13:38:49 -07:00
|
|
|
0.5, 0.0);
|
|
|
|
|
|
|
|
/* Urgent Page */
|
|
|
|
ol = e_widget_list_add(evas, 0, 0);
|
2012-06-25 03:48:42 -07:00
|
|
|
uc = e_widget_check_add(evas, _("Show popup on urgent window"),
|
2009-04-17 13:35:04 -07:00
|
|
|
&(cfdata->popup.urgent_show));
|
2010-03-15 13:38:49 -07:00
|
|
|
e_widget_list_object_append(ol, uc, 1, 0, 0.5);
|
2010-11-11 09:58:23 -08:00
|
|
|
|
|
|
|
ow = e_widget_check_add(evas, _("Urgent popup sticks on screen"),
|
2009-04-17 13:35:04 -07:00
|
|
|
&(cfdata->popup.urgent_stick));
|
2010-03-15 13:38:49 -07:00
|
|
|
cfdata->gui.urgent_list = eina_list_append(cfdata->gui.urgent_list, ow);
|
|
|
|
e_widget_disabled_set(ow, !cfdata->popup.urgent_show);
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2010-11-11 09:58:23 -08:00
|
|
|
|
|
|
|
ow = e_widget_check_add(evas, _("Show popup for focused windows"),
|
|
|
|
&(cfdata->popup.urgent_focus));
|
|
|
|
cfdata->gui.urgent_list = eina_list_append(cfdata->gui.urgent_list, ow);
|
|
|
|
e_widget_disabled_set(ow, !cfdata->popup.urgent_show);
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
|
|
|
|
2012-06-21 03:48:30 -07:00
|
|
|
ow = e_widget_label_add(evas, _("Urgent popup duration"));
|
2010-03-15 13:38:49 -07:00
|
|
|
cfdata->gui.urgent_list = eina_list_append(cfdata->gui.urgent_list, ow);
|
|
|
|
e_widget_disabled_set(ow, !cfdata->popup.urgent_show);
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-06-25 03:48:42 -07:00
|
|
|
ow = e_widget_slider_add(evas, 1, 0, _("%1.1f seconds"), 0.1, 10.0, 0.1, 0,
|
2009-04-17 13:35:04 -07:00
|
|
|
&(cfdata->popup.urgent_speed), NULL, 100);
|
2010-03-15 13:38:49 -07:00
|
|
|
cfdata->gui.urgent_list = eina_list_append(cfdata->gui.urgent_list, ow);
|
|
|
|
e_widget_disabled_set(ow, !cfdata->popup.urgent_show);
|
|
|
|
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
|
2012-06-25 03:48:42 -07:00
|
|
|
e_widget_on_change_hook_set(uc, _cb_disable_check_list,
|
2010-03-15 13:38:49 -07:00
|
|
|
cfdata->gui.urgent_list);
|
2012-06-25 03:48:42 -07:00
|
|
|
e_widget_toolbook_page_append(otb, NULL, _("Urgent Windows"), ol,
|
2010-03-15 13:38:49 -07:00
|
|
|
1, 0, 1, 0, 0.5, 0.0);
|
|
|
|
|
|
|
|
e_widget_toolbook_page_show(otb, 0);
|
|
|
|
return otb;
|
2005-12-16 12:57:24 -08:00
|
|
|
}
|
|
|
|
|
2012-06-25 03:48:42 -07:00
|
|
|
static int
|
|
|
|
_adv_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
2005-12-16 12:57:24 -08:00
|
|
|
{
|
2007-12-17 16:46:46 -08:00
|
|
|
pager_config->popup = cfdata->popup.show;
|
|
|
|
pager_config->popup_speed = cfdata->popup.speed;
|
2006-11-19 00:58:05 -08:00
|
|
|
pager_config->flip_desk = cfdata->flip_desk;
|
2012-08-10 21:40:30 -07:00
|
|
|
pager_config->disable_live_preview = !cfdata->live_preview;
|
2007-12-17 16:46:46 -08:00
|
|
|
pager_config->popup_urgent = cfdata->popup.urgent_show;
|
|
|
|
pager_config->popup_urgent_stick = cfdata->popup.urgent_stick;
|
2010-11-11 09:58:23 -08:00
|
|
|
pager_config->popup_urgent_focus = cfdata->popup.urgent_focus;
|
2007-12-17 16:46:46 -08:00
|
|
|
pager_config->popup_urgent_speed = cfdata->popup.urgent_speed;
|
2008-01-10 23:33:57 -08:00
|
|
|
pager_config->show_desk_names = cfdata->show_desk_names;
|
2008-01-06 17:30:02 -08:00
|
|
|
pager_config->popup_height = cfdata->popup.height;
|
|
|
|
pager_config->popup_act_height = cfdata->popup.act_height;
|
2007-12-17 16:46:46 -08:00
|
|
|
pager_config->drag_resist = cfdata->drag_resist;
|
|
|
|
pager_config->btn_drag = cfdata->btn.drag;
|
|
|
|
pager_config->btn_noplace = cfdata->btn.noplace;
|
|
|
|
pager_config->btn_desk = cfdata->btn.desk;
|
2012-07-11 01:50:52 -07:00
|
|
|
_pager_cb_config_updated();
|
2005-12-16 12:57:24 -08:00
|
|
|
e_config_save_queue();
|
2005-12-24 12:01:03 -08:00
|
|
|
return 1;
|
2005-12-16 12:57:24 -08:00
|
|
|
}
|
2006-11-19 00:58:05 -08:00
|
|
|
|
2012-06-25 03:48:42 -07:00
|
|
|
static int
|
|
|
|
_adv_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
2010-03-15 14:27:26 -07:00
|
|
|
{
|
2011-05-22 10:13:26 -07:00
|
|
|
if ((int)pager_config->popup != cfdata->popup.show) return 1;
|
2012-08-10 21:40:30 -07:00
|
|
|
if ((int)pager_config->disable_live_preview != !cfdata->live_preview) return 1;
|
2011-05-22 10:13:26 -07:00
|
|
|
if ((int)pager_config->show_desk_names != cfdata->show_desk_names) return 1;
|
|
|
|
if ((int)pager_config->popup_urgent != cfdata->popup.urgent_show) return 1;
|
2010-03-15 14:27:26 -07:00
|
|
|
if (pager_config->popup_speed != cfdata->popup.speed) return 1;
|
2012-06-25 03:48:42 -07:00
|
|
|
if ((int)pager_config->popup_urgent_stick != cfdata->popup.urgent_stick)
|
2011-05-22 10:13:26 -07:00
|
|
|
return 1;
|
2012-06-25 03:48:42 -07:00
|
|
|
if ((int)pager_config->popup_urgent_focus != cfdata->popup.urgent_focus)
|
2011-05-22 10:13:26 -07:00
|
|
|
return 1;
|
2012-06-25 03:48:42 -07:00
|
|
|
if (pager_config->popup_urgent_speed != cfdata->popup.urgent_speed)
|
2011-05-22 10:13:26 -07:00
|
|
|
return 1;
|
2010-03-15 14:27:26 -07:00
|
|
|
if (pager_config->popup_height != cfdata->popup.height) return 1;
|
|
|
|
if (pager_config->popup_act_height != cfdata->popup.act_height) return 1;
|
2011-05-22 10:13:26 -07:00
|
|
|
if ((int)pager_config->drag_resist != cfdata->drag_resist) return 1;
|
2010-03-15 14:27:26 -07:00
|
|
|
if (pager_config->btn_drag != cfdata->btn.drag) return 1;
|
|
|
|
if (pager_config->btn_noplace != cfdata->btn.noplace) return 1;
|
|
|
|
if (pager_config->btn_desk != cfdata->btn.desk) return 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-06-25 03:48:42 -07:00
|
|
|
static void
|
|
|
|
_update_btn_lbl(E_Config_Dialog_Data *cfdata)
|
2010-03-15 13:38:49 -07:00
|
|
|
{
|
|
|
|
char lbl[256];
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
snprintf(lbl, sizeof(lbl), _("Click to set"));
|
|
|
|
if (cfdata->btn.drag)
|
|
|
|
snprintf(lbl, sizeof(lbl), _("Button %i"), cfdata->btn.drag);
|
|
|
|
e_widget_button_label_set(cfdata->gui.ob1, lbl);
|
|
|
|
#endif
|
|
|
|
snprintf(lbl, sizeof(lbl), _("Click to set"));
|
|
|
|
if (cfdata->btn.noplace)
|
|
|
|
snprintf(lbl, sizeof(lbl), _("Button %i"), cfdata->btn.noplace);
|
|
|
|
e_widget_button_label_set(cfdata->gui.ob2, lbl);
|
|
|
|
snprintf(lbl, sizeof(lbl), _("Click to set"));
|
|
|
|
if (cfdata->btn.desk)
|
|
|
|
snprintf(lbl, sizeof(lbl), _("Button %i"), cfdata->btn.desk);
|
|
|
|
e_widget_button_label_set(cfdata->gui.ob3, lbl);
|
|
|
|
}
|
|
|
|
|
2012-08-24 06:55:26 -07:00
|
|
|
static void
|
|
|
|
_grab_window_del(void *data)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
|
|
|
|
cfdata = e_object_data_get(data);
|
|
|
|
if (!cfdata) return;
|
|
|
|
cfdata->grab.dia = NULL;
|
|
|
|
_update_btn_lbl(cfdata);
|
|
|
|
}
|
|
|
|
|
2012-06-25 03:48:42 -07:00
|
|
|
static void
|
|
|
|
_grab_window_show(void *data1, void *data2)
|
2006-11-19 00:58:05 -08:00
|
|
|
{
|
2012-08-24 06:55:26 -07:00
|
|
|
E_Config_Dialog_Data *cfdata;
|
2006-11-19 00:58:05 -08:00
|
|
|
|
2007-12-17 16:46:46 -08:00
|
|
|
if (!(cfdata = data2)) return;
|
2006-11-19 00:58:05 -08:00
|
|
|
|
2007-12-17 16:46:46 -08:00
|
|
|
cfdata->grab.btn = 0;
|
2009-09-03 09:32:48 -07:00
|
|
|
if ((long)data1 == BUTTON_DRAG)
|
2009-04-28 08:29:56 -07:00
|
|
|
cfdata->grab.btn = 1;
|
2009-09-03 09:32:48 -07:00
|
|
|
else if ((long)data1 == BUTTON_NOPLACE)
|
2009-04-28 08:29:56 -07:00
|
|
|
cfdata->grab.btn = 2;
|
2006-11-19 00:58:05 -08:00
|
|
|
|
2012-08-24 06:55:26 -07:00
|
|
|
cfdata->grab.dia = e_grab_dialog_show(cfdata->cfd->dia->win, EINA_TRUE, _grab_cb_key_down, _grab_cb_mouse_down, NULL, cfdata);
|
|
|
|
e_object_data_set(E_OBJECT(cfdata->grab.dia), cfdata);
|
|
|
|
e_object_del_attach_func_set(E_OBJECT(cfdata->grab.dia), _grab_window_del);
|
2006-11-19 00:58:05 -08:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2012-08-24 06:55:26 -07:00
|
|
|
_grab_cb_mouse_down(void *data, __UNUSED__ int type, void *event)
|
2006-11-19 00:58:05 -08:00
|
|
|
{
|
2007-12-17 16:46:46 -08:00
|
|
|
E_Config_Dialog_Data *cfdata = NULL;
|
2009-03-16 09:24:43 -07:00
|
|
|
Ecore_Event_Mouse_Button *ev;
|
2006-11-19 00:58:05 -08:00
|
|
|
|
2007-12-17 16:46:46 -08:00
|
|
|
ev = event;
|
2010-06-24 09:19:12 -07:00
|
|
|
if (!(cfdata = data)) return ECORE_CALLBACK_PASS_ON;
|
2009-04-17 13:35:04 -07:00
|
|
|
if (ev->buttons == 3)
|
2009-04-28 08:29:56 -07:00
|
|
|
{
|
2010-07-09 04:03:26 -07:00
|
|
|
e_util_dialog_show(_("Attention"),
|
2009-04-28 08:29:56 -07:00
|
|
|
_("You cannot use the right mouse button in the<br>"
|
|
|
|
"shelf for this as it is already taken by internal<br>"
|
2010-07-09 04:03:26 -07:00
|
|
|
"code for context menus.<br>"
|
|
|
|
"This button only works in the popup."));
|
2009-04-28 08:29:56 -07:00
|
|
|
}
|
2012-08-24 06:55:26 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ev->buttons == cfdata->btn.drag)
|
|
|
|
cfdata->btn.drag = 0;
|
|
|
|
else if (ev->buttons == cfdata->btn.noplace)
|
|
|
|
cfdata->btn.noplace = 0;
|
|
|
|
else if (ev->buttons == cfdata->btn.desk)
|
|
|
|
cfdata->btn.desk = 0;
|
|
|
|
|
|
|
|
if (cfdata->grab.btn == 1)
|
|
|
|
cfdata->btn.drag = ev->buttons;
|
|
|
|
else if (cfdata->grab.btn == 2)
|
|
|
|
cfdata->btn.noplace = ev->buttons;
|
|
|
|
else
|
|
|
|
cfdata->btn.desk = ev->buttons;
|
|
|
|
}
|
|
|
|
|
|
|
|
e_object_del(E_OBJECT(cfdata->grab.dia));
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2006-11-19 00:58:05 -08:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2012-08-24 06:55:26 -07:00
|
|
|
_grab_cb_key_down(void *data, __UNUSED__ int type, void *event)
|
2006-11-19 00:58:05 -08:00
|
|
|
{
|
2007-12-17 16:46:46 -08:00
|
|
|
E_Config_Dialog_Data *cfdata = NULL;
|
2009-03-16 09:24:43 -07:00
|
|
|
Ecore_Event_Key *ev;
|
2006-11-19 00:58:05 -08:00
|
|
|
|
2007-12-17 16:46:46 -08:00
|
|
|
ev = event;
|
2010-06-24 09:19:12 -07:00
|
|
|
if (!(cfdata = data)) return ECORE_CALLBACK_PASS_ON;
|
2009-04-17 13:35:04 -07:00
|
|
|
if (!strcmp(ev->keyname, "Delete"))
|
2009-04-28 08:29:56 -07:00
|
|
|
{
|
|
|
|
if (cfdata->grab.btn == 1)
|
|
|
|
cfdata->btn.drag = 0;
|
|
|
|
else if (cfdata->grab.btn == 2)
|
|
|
|
cfdata->btn.noplace = 0;
|
|
|
|
else
|
|
|
|
cfdata->btn.desk = 0;
|
|
|
|
}
|
2012-08-24 06:55:26 -07:00
|
|
|
e_object_del(E_OBJECT(cfdata->grab.dia));
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2006-11-19 00:58:05 -08:00
|
|
|
}
|
2007-04-04 02:55:40 -07:00
|
|
|
|
2012-06-25 03:48:42 -07:00
|
|
|
static void
|
|
|
|
_cb_disable_check_list(void *data, Evas_Object *obj)
|
2009-04-17 13:46:30 -07:00
|
|
|
{
|
2012-06-25 03:48:42 -07:00
|
|
|
Eina_List *list = (Eina_List *)data;
|
2009-04-17 13:46:30 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *o;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(list, l, o)
|
2009-04-28 08:29:56 -07:00
|
|
|
e_widget_disabled_set(o, !e_widget_check_checked_get(obj));
|
2009-04-17 13:46:30 -07:00
|
|
|
}
|
2012-06-25 03:48:42 -07:00
|
|
|
|