Ejemplo n.º 1
0
void updateWorkspaces(Fl_Widget*,void*)
{
	bool showapplet;
	pGlobalConfig.get("Panel", "Workspaces", showapplet, true);
	if (!showapplet) { return; }
	mWorkspace->clear();
	mWorkspace->begin();

	char **names=0;
	int count = Fl_WM::get_workspace_count();
	int names_count = Fl_WM::get_workspace_names(names);
	int current = Fl_WM::get_current_workspace();

	for(int n=0; n<count; n++) {
		Fl_Item *i = new Fl_Item();
		i->callback(setWorkspace, (long)n);
		i->type(Fl_Item::RADIO);
		if(n<names_count && names[n]) {
			i->label(names[n]);
			free(names[n]);
		} else {
			Fl_String tmp;
			i->label(tmp.printf(tmp, "%s %d", _("Workspace") ,n+1));
		}
		if(current==n) i->set_value();
	}
	// add a divider if there are no workspaces
	if (count<1) {
		new Fl_Menu_Divider();
	}
	if(names) delete []names;

	mWorkspace->end();
}
Ejemplo n.º 2
0
void saveSchemeAs()
{
    const char *schemeName = fl_input(_("Save scheme as:"), _("New scheme"));
    if (schemeName) 
    {
	Fl_String pathScheme; 
	pathScheme.printf("%s/.ede/schemes/%s.scheme", fl_homedir().c_str(), schemeName);
	saveScheme(pathScheme);
	schemeListBox->add(fl_file_filename(pathScheme));
    }	
}
Ejemplo n.º 3
0
Fl_String get_localized_string()
{
    Fl_String locale = setlocale(LC_MESSAGES, NULL);
//    int pos = locale.rpos('_');
//    if(pos>0) locale.sub_delete(pos, locale.length()-pos);
    if(locale=="C" || locale=="POSIX") locale.clear();

    Fl_String localName;
    if(locale.empty()) localName = "Name";
    else localName.printf("Name[%s]", locale.c_str());

    return localName;
}