示例#1
0
文件: Focus.c 项目: jafd/wmaker
static void showData(_Panel * panel)
{
	char *str;
	int i;
	char buffer[32];

	str = GetStringForKey("FocusMode");
	if (!str)
		str = "manual";
	if (strcasecmp(str, "manual") == 0 || strcasecmp(str, "clicktofocus") == 0)
		WMSetButtonSelected(panel->kfocB[0], 1);
	else if (strcasecmp(str, "auto") == 0 || strcasecmp(str, "semiauto") == 0
		 || strcasecmp(str, "sloppy") == 0)
		WMSetButtonSelected(panel->kfocB[1], 1);
	else {
		wwarning(_("bad option value %s for option FocusMode. Using default Manual"), str);
		WMSetButtonSelected(panel->kfocB[0], 1);
	}

	 /**/ str = GetStringForKey("ColormapMode");
	if (!str)
		str = "auto";
	if (strcasecmp(str, "manual") == 0 || strcasecmp(str, "clicktofocus") == 0) {
		WMPerformButtonClick(panel->manB);
	} else if (strcasecmp(str, "auto") == 0 || strcasecmp(str, "focusfollowsmouse") == 0) {
		WMPerformButtonClick(panel->autB);
	} else {
		wwarning(_("bad option value %s for option ColormapMode. Using default Auto"), str);
		WMPerformButtonClick(panel->manB);
	}

	 /**/ i = GetIntegerForKey("RaiseDelay");
	sprintf(buffer, "%i", i);
	WMSetTextFieldText(panel->raisT, buffer);

	switch (i) {
	case 0:
		WMPerformButtonClick(panel->raisB[0]);
		break;
	case 10:
		WMPerformButtonClick(panel->raisB[1]);
		break;
	case 100:
		WMPerformButtonClick(panel->raisB[2]);
		break;
	case 350:
		WMPerformButtonClick(panel->raisB[3]);
		break;
	case 800:
		WMPerformButtonClick(panel->raisB[4]);
		break;
	}

	 /**/ WMSetButtonSelected(panel->ignB, GetBoolForKey("IgnoreFocusClick"));

	WMSetButtonSelected(panel->newB, GetBoolForKey("AutoFocus"));
	WMSetButtonSelected(panel->craisB, GetBoolForKey("CirculateRaise"));
}
示例#2
0
文件: Docks.c 项目: jafd/wmaker
static void showData(_Panel *panel)
{
	char *value;
	int i;
	for (i = 0; i < 4; i++)
	{
		value = GetStringForKey(auto_delay[i].key);
		WMSetTextFieldText(panel->autoDelayT[i], value);
		adjustButtonSelectionBasedOnValue(panel, i, value);
	}
	for (i = 0; i < 3; i++)
	{
		WMSetButtonSelected(panel->docksB[i], !GetBoolForKey(dock_config[i].disable_key));
	}
}
示例#3
0
static void showData(_Panel *panel)
{
	char *str;

	WMPerformButtonClick(panel->icoB[GetSpeedForKey("IconSlideSpeed")]);
	WMPerformButtonClick(panel->shaB[GetSpeedForKey("ShadeSpeed")]);

	str = GetStringForKey("NewStyle");
	if (str && strcasecmp(str, "next") == 0) {
		WMPerformButtonClick(panel->nextB);
	} else if (str && strcasecmp(str, "old") == 0) {
		WMPerformButtonClick(panel->oldsB);
	} else {
		WMPerformButtonClick(panel->newsB);
	}

	WMSetButtonSelected(panel->animB, !GetBoolForKey("DisableAnimations"));
	WMSetButtonSelected(panel->supB, GetBoolForKey("Superfluous"));
	WMSetButtonSelected(panel->smoB, GetBoolForKey("SmoothWorkspaceBack"));
	WMSetButtonSelected(panel->dithB, GetBoolForKey("DisableDithering"));
	WMSetSliderValue(panel->dithS, GetIntegerForKey("ColormapSize"));
	updateLabel(panel->dithS, panel);
}
示例#4
0
static void showData(_Panel * panel)
{
	char *str;
	int i;
	int a = -1, b = -1;
	float accel;
	char buffer[32];
	Display *dpy = WMScreenDisplay(WMWidgetScreen(panel->parent));

	for (i = 0; i < wlengthof(button_list); i++) {
		int action;

		str = GetStringForKey(button_list[i].db_key);
		if (button_list[i].type == T_BUTTON)
			action = getButtonAction(str);
		else
			action = getWheelAction(str);

		if (action < 0) {
			if (action == -1)
				wwarning(_("bad value %s for option %s"), str, button_list[i].db_key);
			action = button_list[i].default_action;
		}
		WMSetPopUpButtonSelectedItem(panel->mouse_action[i].popup, action);
	}

	WMSetButtonSelected(panel->disaB, GetBoolForKey("DisableWSMouseActions"));
	toggle_disabling_of_mouse_actions(panel->disaB, panel);

	 /**/ getMouseParameters(dpy, &accel, &a);
	panel->maxThreshold = WidthOfScreen(DefaultScreenOfDisplay(dpy));
	if (a > panel->maxThreshold) {
		panel->maxThreshold = a;
	}
	sprintf(buffer, "%i", a);
	WMSetTextFieldText(panel->threT, buffer);

	WMSetSliderValue(panel->speedS, (accel - 0.25F) / 0.25F);

	panel->acceleration = accel;
	sprintf(buffer, "%.2f", (double)accel);
	WMSetTextFieldText(panel->acceT, buffer);

	 /**/ b = GetIntegerForKey("DoubleClickTime");
	/* find best match */
	a = -1;
	for (i = 0; i < wlengthof(panel->ddelaB); i++) {
		if (DELAY(i) == b)
			a = i;
	}
	if (a >= 0)
		WMPerformButtonClick(panel->ddelaB[a]);
	sprintf(buffer, "%i", b);
	WMSetTextFieldText(panel->ddelaT, buffer);

	 /**/ str = GetStringForKey("ModifierKey");
	if (!str)
		str = "mod1";
	a = ModifierFromKey(dpy, str);

	if (a != -1) {
		str = modifierNames[a];

		a = 0;
		for (i = 0; i < WMGetPopUpButtonNumberOfItems(panel->grabP); i++) {
			if (strstr(WMGetPopUpButtonItem(panel->grabP, i), str)) {
				WMSetPopUpButtonSelectedItem(panel->grabP, i);
				a = 1;
				break;
			}
		}
	}

	if (a < 1) {
		char *previous;

		previous = WMGetPopUpButtonItem(panel->grabP, 0);
		if (previous != NULL)
			WMSetPopUpButtonSelectedItem(panel->grabP, 0);
		wwarning(_("modifier key %s for option ModifierKey was not recognized. Using %s as default"),
					str, previous?previous:"(empty)");
	}
}