diff --git a/ede-desktop/IconDialog.cpp b/ede-desktop/IconDialog.cpp index 4b146f4..807f01a 100644 --- a/ede-desktop/IconDialog.cpp +++ b/ede-desktop/IconDialog.cpp @@ -31,13 +31,16 @@ #include #include #include +#include #include "IconDialog.h" #include "DesktopIcon.h" #include "ede-desktop.h" -EDELIB_NS_USING_LIST(9, (str_tolower, icon_chooser, dir_home, build_filename, alert, - ICON_SIZE_HUGE, String, DesktopFile, DESK_FILE_TYPE_APPLICATION)) +EDELIB_NS_USING_LIST(10, (str_tolower, icon_chooser, dir_home, build_filename, alert, + ICON_SIZE_HUGE, String, IconLoader, DesktopFile, DESK_FILE_TYPE_APPLICATION)) + +#define DEFAULT_ICON "empty" /* it is safe to be globals */ static Fl_Window *win; @@ -100,7 +103,7 @@ static void ok_cb(Fl_Widget*, void*) { df.set_icon(p); } } else { - df.set_icon("empty"); + df.set_icon(DEFAULT_ICON); } df.set_exec(execute->value()); @@ -164,6 +167,7 @@ void icon_dialog_icon_create(void) { img = new Fl_Button(10, 10, 75, 75); img->callback(img_browse_cb); img->tooltip(_("Click to select icon")); + IconLoader::set(img, DEFAULT_ICON, ICON_SIZE_HUGE); name = new Fl_Input(205, 10, 215, 25, _("Name:")); comment = new Fl_Input(205, 40, 215, 25, _("Comment:")); execute = new Fl_Input(205, 70, 185, 25, _("Execute:")); diff --git a/ede-desktop/ede-desktop.cpp b/ede-desktop/ede-desktop.cpp index 1b60ecd..31c1f5f 100644 --- a/ede-desktop/ede-desktop.cpp +++ b/ede-desktop/ede-desktop.cpp @@ -575,10 +575,16 @@ DesktopIcon* Desktop::find_icon_by_path(const char* path, DesktopIconListIter* r bool Desktop::remove_icon(DesktopIcon *d, bool real_delete) { bool ret = true; - if(real_delete) + if(real_delete) { + dir_watch_off(); ret = file_remove(d->path().c_str()); + Fl::wait(1); + dir_watch_on(); + } remove_icon_by_path(d->path().c_str()); + /* TODO: reimplement as 'fast_redraw()' from DesktopIcon */ + redraw(); return ret; } @@ -610,7 +616,6 @@ bool Desktop::remove_icon_by_path(const char* path) { /* Fl_Group::remove() does not delete child, just pops it out */ remove(ic); delete ic; - return true; }