diff --git a/ede-desktop/IconDialog.cpp b/ede-desktop/IconDialog.cpp index 8f02e81..4b146f4 100644 --- a/ede-desktop/IconDialog.cpp +++ b/ede-desktop/IconDialog.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -152,14 +153,22 @@ static void img_browse_cb(Fl_Widget*, void*) { img->redraw(); } +static void file_browse_cb(Fl_Widget*, void*) { + const char *p = fl_file_chooser(_("Choose program path to execute"), "*", 0, 0); + if(!p) return; + execute->value(p); +} + void icon_dialog_icon_create(void) { win = new Fl_Window(430, 170, _("Create desktop icon")); img = new Fl_Button(10, 10, 75, 75); img->callback(img_browse_cb); + img->tooltip(_("Click to select icon")); 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:")); browse = new Fl_Button(395, 70, 25, 25, "..."); + browse->callback(file_browse_cb); icon_type = new Fl_Choice(205, 100, 215, 25, _("Type:")); icon_type->down_box(FL_BORDER_BOX); icon_type->menu(menu_items); diff --git a/ede-desktop/ede-desktop.cpp b/ede-desktop/ede-desktop.cpp index 0aecb83..c4cec8e 100644 --- a/ede-desktop/ede-desktop.cpp +++ b/ede-desktop/ede-desktop.cpp @@ -25,9 +25,13 @@ #include #include #include +#include +#include +#include #include #include +#include #include #include #include @@ -92,6 +96,7 @@ EDELIB_NS_USING(netwm_callback_add) EDELIB_NS_USING(netwm_callback_remove) EDELIB_NS_USING(font_cache_find) EDELIB_NS_USING(file_test) +EDELIB_NS_USING(file_remove) EDELIB_NS_USING(dir_home) EDELIB_NS_USING(build_filename) EDELIB_NS_USING(FILE_TEST_IS_DIR) @@ -568,7 +573,12 @@ DesktopIcon* Desktop::find_icon_by_path(const char* path, DesktopIconListIter* r } bool Desktop::remove_icon(DesktopIcon *d, bool real_delete) { - bool ret = remove_icon_by_path(d->path().c_str()); + bool ret = true; + + if(real_delete) + ret = file_remove(d->path().c_str()); + + remove_icon_by_path(d->path().c_str()); return ret; }