When selecting bgs, if the current bg is what we selected in the list, disable the ok/apply buttons

SVN revision: 19697
This commit is contained in:
Christopher Michael 2006-01-10 15:04:04 +00:00
parent 962a108024
commit 9eb2e91ee1
1 changed files with 13 additions and 1 deletions

View File

@ -24,6 +24,7 @@ struct _CFData
{ {
/*- BASIC -*/ /*- BASIC -*/
char *file ; char *file ;
char *current_file;
/*- ADVANCED -*/ /*- ADVANCED -*/
int bg_method; int bg_method;
}; };
@ -58,6 +59,7 @@ static void
_fill_data(CFData *cfdata) _fill_data(CFData *cfdata)
{ {
cfdata->bg_method = BG_SET_DEFAULT_DESK; cfdata->bg_method = BG_SET_DEFAULT_DESK;
cfdata->current_file = strdup(e_config->desktop_default_background);
/* TODO: get default bg */ /* TODO: get default bg */
} }
@ -79,6 +81,7 @@ static void
_free_data(E_Config_Dialog *cfd, CFData *cfdata) _free_data(E_Config_Dialog *cfd, CFData *cfdata)
{ {
/* Free the cfdata */ /* Free the cfdata */
free(cfdata->current_file);
free(cfdata); free(cfdata);
} }
@ -90,6 +93,7 @@ _basic_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
e_config->desktop_default_background = evas_stringshare_add(cfdata->file); e_config->desktop_default_background = evas_stringshare_add(cfdata->file);
e_bg_update(); e_bg_update();
e_config_save_queue(); e_config_save_queue();
cfdata->current_file = strdup(cfdata->file);
return 1; /* Apply was OK */ return 1; /* Apply was OK */
} }
@ -97,9 +101,16 @@ void
_e_config_bg_cb_standard(void *data) _e_config_bg_cb_standard(void *data)
{ {
E_Cfg_Bg_Data *d; E_Cfg_Bg_Data *d;
CFData *cfdata;
d = data; d = data;
e_widget_image_object_set(d->cfd->data, e_thumb_evas_object_get(d->file, d->cfd->dia->win->evas, 200, 160, 1)); e_widget_image_object_set(d->cfd->data, e_thumb_evas_object_get(d->file, d->cfd->dia->win->evas, 200, 160, 1));
cfdata = d->cfd->cfdata;
if (!strcmp(d->file, cfdata->current_file))
{
e_dialog_button_disable_num_set(d->cfd->dia, 0, 1);
e_dialog_button_disable_num_set(d->cfd->dia, 1, 1);
}
} }
/**--GUI--**/ /**--GUI--**/
@ -149,6 +160,7 @@ _advanced_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
e_config->desktop_default_background = evas_stringshare_add(cfdata->file); e_config->desktop_default_background = evas_stringshare_add(cfdata->file);
e_bg_update(); e_bg_update();
e_config_save_queue(); e_config_save_queue();
cfdata->current_file = strdup(cfdata->file);
break; break;
case BG_SET_THIS_DESK: case BG_SET_THIS_DESK:
d = e_desk_current_get(z); d = e_desk_current_get(z);