Run icon action via menu 'Open'

This commit is contained in:
Sanel Zukan 2009-07-09 13:59:51 +00:00
parent e147228f53
commit b6d080e414
2 changed files with 11 additions and 1 deletions

View File

@ -54,11 +54,12 @@ EDELIB_NS_USING(ICON_SIZE_TINY)
EDELIB_NS_USING(input)
EDELIB_NS_USING(run_async)
static void open_cb(Fl_Widget*, void* d);
static void rename_cb(Fl_Widget*, void* d);
static void props_cb(Fl_Widget*, void* d);
static MenuItem icon_menu[] = {
{_("&Open"), 0, 0},
{_("&Open"), 0, open_cb, 0},
{_("&Rename"), 0, rename_cb, 0},
{_("&Delete"), 0, 0, 0, FL_MENU_DIVIDER},
{_("&Properties"), 0, props_cb, 0},
@ -72,6 +73,13 @@ static MenuItem icon_trash_menu[] = {
{0}
};
static void open_cb(Fl_Widget*, void* d) {
DesktopIcon* di = (DesktopIcon*)d;
IconSettings* s = di->get_settings();
run_async("ede-launch %s", s->cmd.c_str());
}
static void rename_cb(Fl_Widget*, void* d) {
DesktopIcon* di = (DesktopIcon*)d;

View File

@ -57,6 +57,8 @@ public:
int drag_icon_x(void);
int drag_icon_y(void);
IconSettings* get_settings(void) { return settings; }
/*
* This is 'enhanced' (in some sense) redraw(). Redrawing
* icon will not fully redraw label nor focus box, which laid outside