mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Added EdeProgramBare rule, that will link with FLTK libs, without images
libstartup-notification checks in configure.in ede-launch now uses startup notification protocol via ede-launch-sn helper Added removal of /tmp/.evoke.lock at the startup, in case evoke crashed during sesssion
This commit is contained in:
parent
84589d3ad7
commit
51b488fb14
@ -86,6 +86,10 @@ COMPOSITELIB ?= @COMPOSITE_LIBS@ ;
|
||||
HALINCLUDE ?= @HAL_CFLAGS@ ;
|
||||
HALLIB ?= @HAL_LIBS@ ;
|
||||
|
||||
# startup-notification
|
||||
STARTUP_NOTIFICATION_INCLUDE ?= @LIBSTARTUP_NOTIFICATION_CFLAGS@ ;
|
||||
STARTUP_NOTIFICATION_LIB ?= @LIBSTARTUP_NOTIFICATION_LIBS@ ;
|
||||
|
||||
# X libraries (could be empty if are on standard paths)
|
||||
X_CFLAGS ?= @X_CFLAGS@ ;
|
||||
X_LIBS ?= @X_LIBS@ ;
|
||||
|
@ -90,6 +90,27 @@ rule EdeProgram
|
||||
}
|
||||
}
|
||||
|
||||
# EdeProgramBare [target] : [sources] : [noinstall] ;
|
||||
# Creates EDE specific programs. They will be linked with EDELIBLIB
|
||||
# and FLTKLIB. If [noinstall] is given, [target] will not be installed wit 'jam install'.
|
||||
rule EdeProgramBare
|
||||
{
|
||||
if ! $(EDELIBINCLUDE) || ! $(EDELIBLIB) {
|
||||
Echo "EDELIBINCLUDE or EDELIBLIB not defined; $(1) will not be built" ;
|
||||
return ;
|
||||
}
|
||||
|
||||
MakeProgramPrivate $(1) : $(2)
|
||||
: $(EDELIBLIB) $(FLTKLIB_NOIMAGES) $(STDLIB)
|
||||
: $(GLOBALFLAGS) $(EDELIBINCLUDE) $(FLTKINCLUDE) ;
|
||||
|
||||
if $(3) != "noinstall" {
|
||||
InstallEdeProgram $(1) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
# EfltkProgram [target] : [sources] : [noinstall] ;
|
||||
# Creates programs that will be linked with efltk. If [noinstall] is given,
|
||||
# [target] will not be installed wit 'jam install'.
|
||||
|
@ -95,6 +95,15 @@ if test "$enable_hal" = "yes"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES(LIBSTARTUP_NOTIFICATION, [libstartup-notification-1.0],
|
||||
[have_libstartup_notification=yes], [have_libstartup_notification=no])
|
||||
if test "$have_libstartup_notification" = "yes"; then
|
||||
AC_DEFINE(HAVE_LIBSTARTUP_NOTIFICATION, 1, [Define to 1 if you have libstartup-notification libraries])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
|
||||
PKG_CHECK_MODULES(EDELIB, [edelib],, [have_edelib=no])
|
||||
if test "$have_edelib" = "no"; then
|
||||
AC_MSG_ERROR(edelib not found! You must install it first)
|
||||
|
@ -65,5 +65,8 @@ if [ "$XSETROOT" ]; then
|
||||
$XSETROOT -solid black
|
||||
fi
|
||||
|
||||
# remove leftovers if evoke crashed
|
||||
rm -f /tmp/.evoke.lock
|
||||
|
||||
# start the session
|
||||
evoke --startup --autostart-safe
|
||||
|
@ -12,5 +12,9 @@ SubDir TOP ede-launch ;
|
||||
|
||||
SOURCE = ede-launch.cpp ;
|
||||
|
||||
EdeProgram ede-launch : $(SOURCE) ;
|
||||
EdeProgram ede-launch : $(SOURCE) ;
|
||||
TranslationStrings locale : $(SOURCE) ;
|
||||
|
||||
ObjectC++Flags ede-launch-sn.cpp : $(STARTUP_NOTIFICATION_INCLUDE) ;
|
||||
EdeProgramBare ede-launch-sn : ede-launch-sn.cpp ;
|
||||
LinkAgainst ede-launch-sn : $(STARTUP_NOTIFICATION_LIB) ;
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <FL/x.H>
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_Box.H>
|
||||
#include <FL/Fl_Button.H>
|
||||
@ -22,7 +23,9 @@
|
||||
#include <edelib/Window.h>
|
||||
#include <edelib/Nls.h>
|
||||
#include <edelib/Debug.h>
|
||||
#include <edelib/Missing.h>
|
||||
#include <edelib/MessageBox.h>
|
||||
|
||||
#include "icons/run.xpm"
|
||||
|
||||
/*
|
||||
@ -32,6 +35,7 @@
|
||||
#define LaunchWindow edelib::Window
|
||||
|
||||
EDELIB_NS_USING(run_sync)
|
||||
EDELIB_NS_USING(run_async)
|
||||
EDELIB_NS_USING(alert)
|
||||
|
||||
static Fl_Pixmap image_run(run_xpm);
|
||||
@ -179,15 +183,22 @@ static int start_child_process_with_core(const char* cmd) {
|
||||
}
|
||||
|
||||
static bool start_child(const char* cmd) {
|
||||
run_async("ede-launch-sn --program %s --icon applications-order", cmd);
|
||||
|
||||
int ret = start_child_process_with_core(cmd);
|
||||
|
||||
if(ret == 199) {
|
||||
alert(_("Program '%s' not found"), cmd);
|
||||
alert(_("Program '%s' not found.\n\nPlease check if given path to the executable was correct or adjust $PATH environment variable to point to the directory where target executable exists"), cmd);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(ret == EACCES) {
|
||||
alert(_("You do not have enough permissions to execute '%s'"), cmd);
|
||||
/* now check the if file is executable since EACCES is common error if not so */
|
||||
if(access(cmd, X_OK) != 0)
|
||||
alert(_("You are trying to execute '%s', but it is not executable file"), cmd);
|
||||
else
|
||||
alert(_("You do not have enough permissions to execute '%s'"), cmd);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -211,13 +222,13 @@ static void ok_cb(Fl_Widget*, void* w) {
|
||||
|
||||
/* TODO: is 'cmd' safe after hide? */
|
||||
if(in_term->value()) {
|
||||
char buff[128];
|
||||
char buf[128];
|
||||
char* term = getenv("TERM");
|
||||
if(!term)
|
||||
term = "xterm";
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s -e %s", term, cmd);
|
||||
started = start_child(buff);
|
||||
snprintf(buf, sizeof(buf), "%s -e %s", term, cmd);
|
||||
started = start_child(buf);
|
||||
} else {
|
||||
started = start_child(cmd);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user