Beispiel #1
0
// This function is now implemented in ede-launch
void MainMenu::resolve_program(Fl_String cmd)
{
    char pRun[FL_PATH_MAX];

    snprintf(pRun, sizeof(pRun)-1, "ede-launch \"%s\"", cmd.c_str());
    fl_start_child_process(pRun, false);
}
Beispiel #2
0
static void LaunchApp(char *name)
{
    Fl_Config conf(fl_find_config_file("wmanager.conf", false));
    Fl_String app;
    conf.get("Applications", name, app, NULL);
    if(! app.empty())
        fl_start_child_process(app, false);
}
Beispiel #3
0
// Start utility, like "time/date" or "volume"
void startUtility(Fl_Button *, void *pName)
{
	Fl_String value;
	pGlobalConfig.get("Panel", (char*)pName, value, "");

	if(!pGlobalConfig.error() && !value.empty()) {
		value = "ede-launch \""+value;
		value += "\"";
		fl_start_child_process(value, false);
	}
}
Beispiel #4
0
void apply_colors_apps(Fl_Color fg, Fl_Color bg, Fl_Color text, Fl_String font)
{
    uchar r, g, b, r1, g1, b1, r2, g2, b2;
    fl_get_color(bg, r, g, b);
    fl_get_color(fg, r1, g1, b1);
    fl_get_color(text, r2, g2, b2);

    Fl_String filePath(fl_homedir()); 
    filePath += "/.Xdefaults";
    
    char *backgroundTypes[34] = 
    {
    "*XmList.background" ,    "*XmLGrid.background",
    "Netscape*XmList.background" ,   "Netscape*XmLGrid.background",
    "*text*background",   "*list*background",
    "*Text*background",   "*List*background", 
    "*textBackground",   "*XmTextField.background", 
    "*XmText.background",     "Netscape*XmTextField.background", 
    "Netscape*XmText.background",     "*background", 
    "*Background",  "nscal*Background",
    "*Menu*background",     "OpenWindows*WindowColor",
    "Window.Color.Background",   "netscape*background",
    "Netscape*background",   ".netscape*background",
    "Ddd*background",   "Emacs*Background",
    "Emacs*backgroundToolBarColor",//25 
    "*XmList.selectBackground" ,   "*XmLGrid.selectBackground",
    "Netscape*XmList.selectBackground" ,  "Netscape*XmLGrid.selectBackground",
    "*XmTextField.selectBackground",  "*XmText.selectBackground", 
    "Netscape*XmTextField.selectBackground",  "Netscape*XmText.selectBackground", 
    "*selectBackground" //34
		   
    };	

    FILE *colorFile = fopen(filePath, "w");
    for (int i = 0 ; i < 34; i++)
    {
        fprintf(colorFile, "%s:  #%02X%02X%02X\n", backgroundTypes[i],(short int) r, (short int) g, (short int) b);
    }	
    fprintf(colorFile, "foreground:  #%02X%02X%02X\n", r1, g1, b1);
    fprintf(colorFile, "xterm*background:  #FFFFFF\n");	//especialy for Xterm
    fclose(colorFile);

    Fl_String runString("xrdb -merge -all ");
    runString += fl_homedir(); 
    runString += "/.Xdefaults";
    
    if (fl_start_child_process(runString)==-1)
	fl_alert("Error executing xrdb program.");
}
Beispiel #5
0
void Icon::cb_execute_i()
{
    Fl_Config &iconfig = *cfg;
    iconfig.set_section("Desktop Entry");

    char *cmd=0;
    if(!iconfig.read("Exec", cmd, 0) && cmd)
    {
        char pRun[256];
        char browser[256];
        Fl_Config pGlobalConfig(fl_find_config_file("ede.conf", 0));
        pGlobalConfig.get("Web", "Browser", browser, 0, sizeof(browser));
        if(pGlobalConfig.error() && !browser) {
            strncpy(browser, "netscape", sizeof(browser));
        }

        char *location = cmd;
        char *prefix = strstr(location, ":");
        if(prefix) // it is internet resource
        {
            *prefix = '\0';
            if (!strcasecmp(location, "http") || !strcasecmp(location, "ftp") || !strcasecmp(location, "file"))
            {	snprintf(pRun, sizeof(pRun)-1, "%s %s &", browser, cmd);
            }
	    else if (!strcasecmp(location, "gg"))
	    {	snprintf(pRun, sizeof(pRun)-1, "%s http://www.google.com/search?q=\"%s\" &", browser, ++prefix);
	    }
	    else if (!strcasecmp(location, "leo"))
	    {	snprintf(pRun, sizeof(pRun)-1, "%s http://dict.leo.org/?search=\"%s\" &", browser, ++prefix);
	    }
	    else if (!strcasecmp(location, "av"))
	    {	snprintf(pRun, sizeof(pRun)-1, "%s http://www.altavista.com/sites/search/web?q=\"%s\" &", browser, ++prefix);
	    }
	    else  {
                snprintf(pRun, sizeof(pRun)-1, "%s %s &", browser, cmd);
            }
        }
	else // local executable
        {   snprintf(pRun, sizeof(pRun)-1, "%s &", cmd);
        }
        fl_start_child_process(pRun);

        free((char*)cmd);
    }
}
Beispiel #6
0
void cb_run_app(Fl_Input *i, void*)
{
	Fl_String exec(i->value());
	if ((exec == "") || (exec == " ")) 
		return;
	exec = "ede-launch \""+exec;
	exec += "\"";
	fl_start_child_process(exec, false);
	
	Fl_Input_Browser *ib = (Fl_Input_Browser *)i->parent();
	if (!ib->find(i->value())) {
		ib->add(i->value());
		Fl_String_List history;
		int c = 0;
		if (ib->children() > 15) c = ib->children() - 15;
		for (; c < ib->children(); c++) {
			 history.append(ib->child(c)->label());
		}
		pGlobalConfig.set("Panel", "RunHistory", history.to_string("|"));
		pGlobalConfig.flush();
	}

	i->value("");
}
Beispiel #7
0
/**
 * cb_button - Button callback
 * @button: The button
 * @data: button data (command for exec)
 *
 * This function is the button callback function and executes the
 * specified command with the 'system()' call.
 */
static void cb_qlb_taskbutton(Fl_Button *button, void *data)
{
	fl_start_child_process((char *)data, false);
}
Beispiel #8
0
void runUtility(Fl_Widget *, char *pCommand)
{
	char cmd[256];
	snprintf (cmd, sizeof(cmd)-1, "ede-launch %s", pCommand);
	fl_start_child_process(cmd, false);
}
Beispiel #9
0
void icons_properties(Fl_Widget *, void *arg)
{
    fl_start_child_process("eiconsconf &");
}
Beispiel #10
0
static void FindUtil(char *name)
{
    fl_start_child_process("efinder",false);
}
Beispiel #11
0
static void FastRun(char *name)
{
    fl_start_child_process("elauncher",false);
}