summaryrefslogtreecommitdiff
path: root/src/bin/e_bg.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-19 11:13:23 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-19 11:13:23 +0000
commitddd898bdaccc57ae839d441d116ce0a789180cd3 (patch)
tree612a2ea6394d19f598f6b2dc995710ac39b35eb3 /src/bin/e_bg.c
parent7829e00b45a429e1ca21cb5308ee4dee9ae45b33 (diff)
"set as background" ctx action now sets default bg instead of current desk bg
ticket #2042 SVN revision: 81352
Diffstat (limited to 'src/bin/e_bg.c')
-rw-r--r--src/bin/e_bg.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/bin/e_bg.c b/src/bin/e_bg.c
index b392e54..be88808 100644
--- a/src/bin/e_bg.c
+++ b/src/bin/e_bg.c
@@ -448,22 +448,16 @@ e_bg_update(void)
448static void 448static void
449e_bg_handler_set(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *path) 449e_bg_handler_set(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *path)
450{ 450{
451 E_Container *con;
452 char buf[4096]; 451 char buf[4096];
453 int copy = 1; 452 int copy = 1;
454 E_Zone *zone;
455 E_Desk *desk;
456 453
457 if (!path) return; 454 if (!path) return;
458 455
459 con = e_container_current_get(e_manager_current_get());
460 if (!eina_str_has_extension(path, "edj")) 456 if (!eina_str_has_extension(path, "edj"))
461 { 457 {
462 e_import_config_dialog_show(con, path, (Ecore_End_Cb)_e_bg_handler_image_imported, NULL); 458 e_import_config_dialog_show(NULL, path, (Ecore_End_Cb)_e_bg_handler_image_imported, NULL);
463 return; 459 return;
464 } 460 }
465 zone = e_zone_current_get(con);
466 desk = e_desk_current_get(zone);
467 461
468 /* if not in system dir or user dir, copy to user dir */ 462 /* if not in system dir or user dir, copy to user dir */
469 e_prefix_data_concat_static(buf, "data/backgrounds"); 463 e_prefix_data_concat_static(buf, "data/backgrounds");
@@ -489,13 +483,13 @@ e_bg_handler_set(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char
489 if (!ecore_file_exists(buf)) 483 if (!ecore_file_exists(buf))
490 { 484 {
491 ecore_file_cp(path, buf); 485 ecore_file_cp(path, buf);
492 e_bg_add(con->num, zone->num, desk->x, desk->y, buf); 486 e_bg_default_set(buf);
493 } 487 }
494 else 488 else
495 e_bg_add(con->num, zone->num, desk->x, desk->y, path); 489 e_bg_default_set(path);
496 } 490 }
497 else 491 else
498 e_bg_add(con->num, zone->num, desk->x, desk->y, path); 492 e_bg_default_set(path);
499 493
500 e_bg_update(); 494 e_bg_update();
501 e_config_save_queue(); 495 e_config_save_queue();
@@ -559,11 +553,8 @@ _e_bg_event_bg_update_free(void *data __UNUSED__, void *event)
559static void 553static void
560_e_bg_handler_image_imported(const char *image_path, void *data __UNUSED__) 554_e_bg_handler_image_imported(const char *image_path, void *data __UNUSED__)
561{ 555{
562 E_Container *con = e_container_current_get(e_manager_current_get());
563 E_Zone *zone = e_zone_current_get(con);
564 E_Desk *desk = e_desk_current_get(zone);
565 556
566 e_bg_add(con->num, zone->num, desk->x, desk->y, image_path); 557 e_bg_default_set(image_path);
567 e_bg_update(); 558 e_bg_update();
568 e_config_save_queue(); 559 e_config_save_queue();
569} 560}