From 621a58de48877f53d6165e63bc9f371997675e22 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sat, 21 Oct 2006 02:32:14 +0000 Subject: [PATCH] patches (see devel list) :) SVN revision: 26725 --- TODO | 4 -- src/bin/e_border.c | 27 ++++++++----- src/bin/e_desklock.c | 7 ++++ src/bin/e_entry.c | 2 +- src/bin/e_int_border_prop.c | 2 + src/bin/e_int_config_desklock.c | 4 ++ src/bin/e_widget_entry.c | 21 +++++++++++ src/bin/e_widget_entry.h | 1 + src/modules/temperature/e_mod_config.c | 52 ++++++++++++++++++++++++++ src/modules/temperature/e_mod_main.c | 4 +- src/modules/temperature/e_mod_main.h | 1 + 11 files changed, 109 insertions(+), 16 deletions(-) diff --git a/TODO b/TODO index ec2f678d9..e48aab478 100644 --- a/TODO +++ b/TODO @@ -8,10 +8,6 @@ Some of the things (in very short form) that need to be done to E17... BUGS / FIXES ------------------------------------------------------------------------------- -* BUG: if maximize policy == fullscreen then weird things happen on - maximize and unmaximize with gvim (probably gvim tries to resize itself - on maximize and it screws e's account keeping) but on unmax it ends up - just moving a bit, not going down in size. * BUG: smart placement seems to screw up if a shelf is at the top of the screen * BUG: e17 screen res diaolg doesnt work under xephyr - why? * BUG: "match this window only" doesnt fall back to other unused remembers diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 8704a05e6..5ad5c176d 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -1684,7 +1684,7 @@ e_border_maximize(E_Border *bd, E_Maximize max) if ((bd->shaded) || (bd->shading)) return; if (bd->fullscreen) e_border_unfullscreen(bd); - /* Only allow changes in vertical/ horisontal maximization */ + /* Only allow changes in vertical/ horizontal maximization */ if (((bd->maximized & E_MAXIMIZE_DIRECTION) == (max & E_MAXIMIZE_DIRECTION)) || ((bd->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH)) return; if (bd->new_client) @@ -1899,18 +1899,29 @@ e_border_unmaximize(E_Border *bd, E_Maximize max) if (dir & E_MAXIMIZE_HORIZONTAL) { /* Remove vertical */ + int w,h; + signal = 0; bd->maximized &= ~E_MAXIMIZE_VERTICAL; - e_border_move_resize(bd, bd->x, bd->saved.y, bd->w, bd->saved.h); + w = bd->w; + h = bd->saved.h; + e_border_resize_limit(bd, &w, &h); + e_border_resize_limit(bd, &w, &h); + e_border_move_resize(bd, bd->x, bd->saved.y, w, h); bd->saved.y = bd->saved.h = 0; e_hints_window_size_set(bd); } else if (dir & E_MAXIMIZE_VERTICAL) { - /* Remove horisontal */ + /* Remove horizontal */ + int w,h; + signal = 0; bd->maximized &= ~E_MAXIMIZE_HORIZONTAL; - e_border_move_resize(bd, bd->saved.x, bd->y, bd->saved.w, bd->h); + w = bd->saved.w; + h = bd->h; + e_border_resize_limit(bd, &w, &h); + e_border_move_resize(bd, bd->saved.x, bd->y, w, h); bd->saved.x = bd->saved.w = 0; e_hints_window_size_set(bd); } @@ -1928,6 +1939,7 @@ e_border_unmaximize(E_Border *bd, E_Maximize max) else h = bd->h; bd->maximized = E_MAXIMIZE_NONE; + e_border_resize_limit(bd, &w, &h); e_border_move_resize(bd, x, y, w, h); bd->saved.x = bd->saved.y = bd->saved.w = bd->saved.h = 0; e_hints_window_size_unset(bd); @@ -3544,12 +3556,7 @@ _e_border_cb_window_configure_request(void *data, int ev_type, void *ev) } else { - if ((bd->maximized & E_MAXIMIZE_TYPE) != E_MAXIMIZE_NONE) - { - bd->saved.w = w; - bd->saved.h = h; - } - else + if ((bd->maximized & E_MAXIMIZE_TYPE) == E_MAXIMIZE_NONE) e_border_resize(bd, w, h); } } diff --git a/src/bin/e_desklock.c b/src/bin/e_desklock.c index 1766bfa13..21a35863b 100644 --- a/src/bin/e_desklock.c +++ b/src/bin/e_desklock.c @@ -84,6 +84,10 @@ e_desklock_init(void) if (e_config->desklock_use_timeout) ecore_x_screensaver_timeout_set(e_config->desklock_timeout); } + + if (e_config->desklock_background) + e_filereg_register(e_config->desklock_background); + return 1; } @@ -91,6 +95,9 @@ EAPI int e_desklock_shutdown(void) { e_desklock_hide(); + if (e_config->desklock_background) + e_filereg_deregister(e_config->desklock_background); + return 1; } diff --git a/src/bin/e_entry.c b/src/bin/e_entry.c index 979b70964..d45119148 100644 --- a/src/bin/e_entry.c +++ b/src/bin/e_entry.c @@ -594,7 +594,7 @@ static void _e_entry_key_down_windows(Evas_Object *entry, Evas_Event_Key_Down *e } } /* Otherwise, we insert the corresponding character */ - else if ((event->string) && + else if ((event->string) && ((sd->enabled)) && ((strlen(event->string) != 1) || (event->string[0] >= 0x20))) { if (selecting) diff --git a/src/bin/e_int_border_prop.c b/src/bin/e_int_border_prop.c index 06043fc81..dc7f42914 100644 --- a/src/bin/e_int_border_prop.c +++ b/src/bin/e_int_border_prop.c @@ -300,6 +300,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf e_widget_frametable_object_append(of, ob, x, y, 1, 1, 1, 1, 1, 1); \ ob = e_widget_entry_add(evas, &(cfdata->val)); \ if (!cfdata->val) e_widget_disabled_set(ob, 1); \ + e_widget_entry_readonly_set(ob, 1); \ e_widget_min_size_get(ob, &mw, &mh); \ e_widget_min_size_set(ob, 160, mh); \ e_widget_frametable_object_append(of, ob, x + 1, y, 1, 1, 1, 1, 1, 1); \ @@ -309,6 +310,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf ob = e_widget_label_add(evas, label); \ e_widget_frametable_object_append(of, ob, x, y, 1, 1, 1, 1, 1, 1); \ ob = e_widget_check_add(evas, "", &(cfdata->val)); \ + e_widget_disabled_set(ob, 1); \ e_widget_frametable_object_append(of, ob, x + 1, y, 1, 1, 1, 1, 1, 1); \ } diff --git a/src/bin/e_int_config_desklock.c b/src/bin/e_int_config_desklock.c index b85b49384..4b7b878d5 100644 --- a/src/bin/e_int_config_desklock.c +++ b/src/bin/e_int_config_desklock.c @@ -499,8 +499,12 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) if (cfdata->bg) { if (e_config->desklock_background) + { + e_filereg_deregister(e_config->desklock_background); evas_stringshare_del(e_config->desklock_background); + } e_config->desklock_background = evas_stringshare_add(cfdata->bg); + e_filereg_register(e_config->desklock_background); } if (_e_desklock_zone_num_get() > 1) diff --git a/src/bin/e_widget_entry.c b/src/bin/e_widget_entry.c index c10e5ad65..f40a8a926 100644 --- a/src/bin/e_widget_entry.c +++ b/src/bin/e_widget_entry.c @@ -131,6 +131,27 @@ e_widget_entry_password_set(Evas_Object *entry, int password_mode) e_entry_password_set(wd->o_entry, password_mode); } +/** + * Sets whether or not the entry widget is user-editable. This still + * allows copying and selecting, just no inserting or deleting of text. + * + * @param entry an entry widget + * @param readonly 1 to enable read-only mode, 0 to turn it off + */ +EAPI void +e_widget_entry_readonly_set(Evas_Object *entry, int readonly_mode) +{ + E_Widget_Data *wd; + + if (!(entry) || (!(wd = e_widget_data_get(entry)))) + return; + + if (readonly_mode) + e_entry_disable(wd->o_entry); + else + e_entry_enable(wd->o_entry); +} + /** * Gets the editable object of the entry widget. It will allow you to have * better control on the text, the cursor or the selection of the entry with diff --git a/src/bin/e_widget_entry.h b/src/bin/e_widget_entry.h index 9323f4614..6d2cf2e75 100644 --- a/src/bin/e_widget_entry.h +++ b/src/bin/e_widget_entry.h @@ -11,6 +11,7 @@ EAPI void e_widget_entry_text_set (Evas_Object *entry, const EAPI const char *e_widget_entry_text_get (Evas_Object *entry); EAPI void e_widget_entry_clear (Evas_Object *entry); EAPI void e_widget_entry_password_set (Evas_Object *entry, int password_mode); +EAPI void e_widget_entry_readonly_set (Evas_Object *entry, int readonly_mode); EAPI Evas_Object *e_widget_entry_editable_object_get (Evas_Object *entry); #endif diff --git a/src/modules/temperature/e_mod_config.c b/src/modules/temperature/e_mod_config.c index a7ca970f3..7e27af9b5 100644 --- a/src/modules/temperature/e_mod_config.c +++ b/src/modules/temperature/e_mod_config.c @@ -29,6 +29,7 @@ struct _E_Config_Dialog_Data int high_temp; int sensor; + int acpizone; }; /* Protos */ @@ -67,6 +68,7 @@ static void _fill_data(E_Config_Dialog_Data *cfdata) { double p; + Ecore_List *therms; cfdata->units = temperature_config->units; if (temperature_config->units == CELCIUS) @@ -117,6 +119,20 @@ _fill_data(E_Config_Dialog_Data *cfdata) else if (!strcmp(temperature_config->sensor_name, "temp3")) cfdata->sensor = 2; } + cfdata->acpizone= 0; + if (temperature_config->acpi_sel) + { + therms = ecore_file_ls("/proc/acpi/thermal_zone"); + char *tzone; + int n = 0; + while ((tzone = ecore_list_next(therms))) + { + if (!strcmp(temperature_config->acpi_sel, tzone)) + cfdata->acpizone = n; + else n++; + } + ecore_list_destroy(therms); + } } static void * @@ -293,6 +309,25 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data } } } + else + { + if (!ecore_list_is_empty(therms)) + { + of = e_widget_framelist_add(evas, _("ACPI Temperature"), 0); + rg = e_widget_radio_group_new(&(cfdata->acpizone)); + char *tzone; + int n = 0; + while ((tzone = ecore_list_next(therms))) + { + ob = e_widget_radio_add(evas, _(tzone), n, rg); + e_widget_framelist_object_append(of, ob); + n++; + } + e_widget_list_object_append(o, of, 1, 1, 0.5); + ecore_list_destroy(therms); + therms = NULL; + } + } if (therms) ecore_list_destroy(therms); #endif @@ -381,6 +416,23 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) temperature_config->sensor_name = evas_stringshare_add("temp3"); break; } + if (temperature_config->acpi_sel) + evas_stringshare_del(temperature_config->acpi_sel); + temperature_config->acpi_sel = NULL; + int n = 0; + Ecore_List *therms; + char *tzone; + therms = ecore_file_ls("/proc/acpi/thermal_zone"); + if ((therms) || !ecore_list_is_empty(therms)) + { + while ((tzone = ecore_list_next(therms))) + { + if (n == cfdata->acpizone) + temperature_config->acpi_sel = evas_stringshare_add(tzone); + n++; + } + } + ecore_list_destroy(therms); _temperature_face_cb_config_updated(); e_config_save_queue(); return 1; diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c index ad8f53081..e3eb979f0 100644 --- a/src/modules/temperature/e_mod_main.c +++ b/src/modules/temperature/e_mod_main.c @@ -276,7 +276,7 @@ _temperature_cb_check(void *data) { char *p, *q; FILE *f; - + name = temperature_config->acpi_sel; snprintf(buf, sizeof(buf), "/proc/acpi/thermal_zone/%s/temperature", name); f = fopen(buf, "rb"); if (f) @@ -403,6 +403,7 @@ e_modapi_init(E_Module *m) E_CONFIG_VAL(D, T, high, INT); E_CONFIG_VAL(D, T, sensor_name, STR); E_CONFIG_VAL(D, T, units, INT); + E_CONFIG_VAL(D, T, acpi_sel, STR); temperature_config = e_config_domain_load("module.temperature", conf_edd); if (!temperature_config) @@ -413,6 +414,7 @@ e_modapi_init(E_Module *m) temperature_config->high = 80; temperature_config->sensor_name = evas_stringshare_add("temp1"); temperature_config->units = CELCIUS; + temperature_config->acpi_sel = evas_stringshare_add("TZ1"); } E_CONFIG_LIMIT(temperature_config->poll_time, 0.5, 1000.0); E_CONFIG_LIMIT(temperature_config->low, 0, 100); diff --git a/src/modules/temperature/e_mod_main.h b/src/modules/temperature/e_mod_main.h index 7192edc95..58cf19124 100644 --- a/src/modules/temperature/e_mod_main.h +++ b/src/modules/temperature/e_mod_main.h @@ -18,6 +18,7 @@ struct _Config double poll_time; int low, high; const char *sensor_name; + const char *acpi_sel; Unit units; /* just config state */ E_Module *module;