Поддержка звука/отключения шифрования/использование сжатия/выбора мониторов/отключения прорисовки шрифтов

This commit is contained in:
Alexander Zhirov 2022-07-13 08:58:34 +03:00
parent 719f159b9a
commit b9f02e4211
4 changed files with 58 additions and 4 deletions

View File

@ -18,9 +18,13 @@ void settingsLoad()
addParameterKey(PARAMETER_SERVER, "/v:", true, true, NULL, NULL); addParameterKey(PARAMETER_SERVER, "/v:", true, true, NULL, NULL);
addParameterKey(PARAMETER_USERNAME, "/u:", true, true, NULL, NULL); addParameterKey(PARAMETER_USERNAME, "/u:", true, true, NULL, NULL);
addParameterKey(PARAMETER_PASSWORD, "/p:", true, true, NULL, NULL); addParameterKey(PARAMETER_PASSWORD, "/p:", true, true, NULL, NULL);
addParameterKey(PARAMETER_CERTIGNORE, "/cert-ignore", false, true, NULL, NULL); addParameterKey(PARAMETER_CERTIGNORE, "/cert-ignore", true, true, NULL, NULL);
addParameterKey(PARAMETER_THEMES, "-themes", false, true, NULL, NULL); addParameterKey(PARAMETER_THEMES, "-themes", false, true, NULL, NULL);
addParameterKey(PARAMETER_WALLPAPER, "-wallpaper", false, true, NULL, NULL); addParameterKey(PARAMETER_WALLPAPER, "-wallpaper", false, true, NULL, NULL);
addParameterKey(PARAMETER_ENCRYPTION, "-encryption", false, true, NULL, NULL);
addParameterKey(PARAMETER_FONTS, "-fonts", false, true, NULL, NULL);
addParameterKey(PARAMETER_SOUND, "/sound", false, true, NULL, NULL);
addParameterKey(PARAMETER_COMPRESSION, "+compression", false, true, NULL, NULL);
addParameterKey(PARAMETER_FULLSCREEN, "/f", false, true, NULL, NULL); addParameterKey(PARAMETER_FULLSCREEN, "/f", false, true, NULL, NULL);
addParameterKey(PARAMETER_MULTIMONITOR, "/multimon", false, true, getParameter(PARAMETER_FULLSCREEN), NULL); addParameterKey(PARAMETER_MULTIMONITOR, "/multimon", false, true, getParameter(PARAMETER_FULLSCREEN), NULL);
addParameterKey(PARAMETER_AUTHENTICATION, "-authentication", true, true, NULL, NULL); addParameterKey(PARAMETER_AUTHENTICATION, "-authentication", true, true, NULL, NULL);
@ -35,6 +39,9 @@ void settingsLoad()
addParameterValue(PARAMETER_BITSPERPIXEL, VALUES_BITSPERPIXEL_24, "24", false); addParameterValue(PARAMETER_BITSPERPIXEL, VALUES_BITSPERPIXEL_24, "24", false);
addParameterValue(PARAMETER_BITSPERPIXEL, VALUES_BITSPERPIXEL_32, "32", false); addParameterValue(PARAMETER_BITSPERPIXEL, VALUES_BITSPERPIXEL_32, "32", false);
addParameterKey(PARAMETER_USB, "/a:drive,USB,", true, true, NULL, NULL);
addParameterValue(PARAMETER_USB, VALUES_USB_DRIVE, "/mnt/usbdevice", true);
addParameterKey(PARAMETER_MONITORS, "/monitors:", false, true, getParameter(PARAMETER_FULLSCREEN), getParameter(PARAMETER_MULTIMONITOR)); addParameterKey(PARAMETER_MONITORS, "/monitors:", false, true, getParameter(PARAMETER_FULLSCREEN), getParameter(PARAMETER_MULTIMONITOR));
x_info *monitors = getXInfo(); x_info *monitors = getXInfo();
for (size_t i = 0; i < monitors->count; ++i) for (size_t i = 0; i < monitors->count; ++i)

View File

@ -17,12 +17,17 @@ typedef enum
PARAMETER_CERTIGNORE, PARAMETER_CERTIGNORE,
PARAMETER_THEMES, PARAMETER_THEMES,
PARAMETER_WALLPAPER, PARAMETER_WALLPAPER,
PARAMETER_ENCRYPTION,
PARAMETER_FONTS,
PARAMETER_SOUND,
PARAMETER_COMPRESSION,
PARAMETER_MONITORS, PARAMETER_MONITORS,
PARAMETER_MULTIMONITOR, PARAMETER_MULTIMONITOR,
PARAMETER_FULLSCREEN, PARAMETER_FULLSCREEN,
PARAMETER_AUTHENTICATION, PARAMETER_AUTHENTICATION,
PARAMETER_SECURITY, PARAMETER_SECURITY,
PARAMETER_BITSPERPIXEL, PARAMETER_BITSPERPIXEL,
PARAMETER_USB
} Parameter; } Parameter;
#endif /* PARAMETERS_H_ */ #endif /* PARAMETERS_H_ */

View File

@ -62,6 +62,30 @@ static int settingsTglWallpaper(Ihandle *self)
return IUP_DEFAULT; return IUP_DEFAULT;
} }
static int settingsTglSound(Ihandle *self)
{
changeParameter(PARAMETER_SOUND);
return IUP_DEFAULT;
}
static int settingsTglFonts(Ihandle *self)
{
changeParameter(PARAMETER_FONTS);
return IUP_DEFAULT;
}
static int settingsTglEncryption(Ihandle *self)
{
changeParameter(PARAMETER_ENCRYPTION);
return IUP_DEFAULT;
}
static int settingsTglCompression(Ihandle *self)
{
changeParameter(PARAMETER_COMPRESSION);
return IUP_DEFAULT;
}
static int settingsUseSecurity(Ihandle *self) static int settingsUseSecurity(Ihandle *self)
{ {
changeParameter(PARAMETER_SECURITY); changeParameter(PARAMETER_SECURITY);
@ -169,7 +193,7 @@ static int settingsTglFullscreen(Ihandle *self)
{ {
changeParameter(PARAMETER_FULLSCREEN); changeParameter(PARAMETER_FULLSCREEN);
toggleActive(self, "SETTINGS_TGL_MULTIMONITOR"); toggleActive(self, "SETTINGS_TGL_MULTIMONITOR");
IupSetInt(IupGetDialogChild(self, "MONITORS"), "ACTIVE", !IupGetInt(IupGetDialogChild(self, "SETTINGS_TGL_MULTIMONITOR"), "VALUE")); IupSetInt(IupGetDialogChild(self, "MONITORS"), "ACTIVE", !IupGetInt(IupGetDialogChild(self, "SETTINGS_TGL_MULTIMONITOR"), "VALUE") && IupGetInt(IupGetDialogChild(self, "SETTINGS_TGL_FULLSCREEN"), "VALUE"));
setParameter(PARAMETER_MONITORS, !IupGetInt(IupGetDialogChild(self, "SETTINGS_TGL_MULTIMONITOR"), "VALUE")); setParameter(PARAMETER_MONITORS, !IupGetInt(IupGetDialogChild(self, "SETTINGS_TGL_MULTIMONITOR"), "VALUE"));
return IUP_DEFAULT; return IUP_DEFAULT;
} }
@ -179,17 +203,26 @@ static int settingsTglFullscreen(Ihandle *self)
*/ */
static Ihandle* settingsBoxCheckbox() static Ihandle* settingsBoxCheckbox()
{ {
Ihandle *tglAuthentication, *tglCertIgnore, *tglThemes, *tglWallpaper; Ihandle *tglAuthentication, *tglCertIgnore, *tglThemes, *tglWallpaper, *tglSound, *tglFonts, *tglEncryption, *tglCompression;
tglAuthentication = IupToggle("Аутентификация", NULL); tglAuthentication = IupToggle("Аутентификация", NULL);
tglCertIgnore = IupToggle("Игнорировать сертификат", NULL); tglCertIgnore = IupToggle("Игнорировать сертификат", NULL);
tglThemes = IupToggle("Отключить темы", NULL); tglThemes = IupToggle("Отключить темы", NULL);
tglWallpaper = IupToggle("Отключить обои", NULL); tglWallpaper = IupToggle("Отключить обои", NULL);
tglSound = IupToggle("Поддержка звука", NULL);
tglFonts = IupToggle("Отключить прорисовку шрифтов", NULL);
tglEncryption = IupToggle("Отключить шифрование", NULL);
tglCompression = IupToggle("Сжатие данных", NULL);
IupSetInt(tglAuthentication, "VALUE", getSetParameter(PARAMETER_AUTHENTICATION)); IupSetInt(tglAuthentication, "VALUE", getSetParameter(PARAMETER_AUTHENTICATION));
IupSetInt(tglCertIgnore, "VALUE", getSetParameter(PARAMETER_CERTIGNORE)); IupSetInt(tglCertIgnore, "VALUE", getSetParameter(PARAMETER_CERTIGNORE));
IupSetInt(tglThemes, "VALUE", getSetParameter(PARAMETER_THEMES)); IupSetInt(tglThemes, "VALUE", getSetParameter(PARAMETER_THEMES));
IupSetInt(tglWallpaper, "VALUE", getSetParameter(PARAMETER_WALLPAPER)); IupSetInt(tglWallpaper, "VALUE", getSetParameter(PARAMETER_WALLPAPER));
IupSetInt(tglSound, "VALUE", getSetParameter(PARAMETER_SOUND));
IupSetInt(tglFonts, "VALUE", getSetParameter(PARAMETER_FONTS));
IupSetInt(tglEncryption, "VALUE", getSetParameter(PARAMETER_ENCRYPTION));
IupSetInt(tglCompression, "VALUE", getSetParameter(PARAMETER_COMPRESSION));
return IupSetAttributes( return IupSetAttributes(
IupFrame( IupFrame(
@ -201,6 +234,14 @@ static Ihandle* settingsBoxCheckbox()
IupSetCallbacks(IupSetAttributes(tglThemes, "NAME=SETTINGS_TGL_THEMES"), "ACTION", (Icallback) settingsTglThemes, IupSetCallbacks(IupSetAttributes(tglThemes, "NAME=SETTINGS_TGL_THEMES"), "ACTION", (Icallback) settingsTglThemes,
NULL), NULL),
IupSetCallbacks(IupSetAttributes(tglWallpaper, "NAME=SETTINGS_TGL_WALLPAPER"), "ACTION", (Icallback) settingsTglWallpaper, IupSetCallbacks(IupSetAttributes(tglWallpaper, "NAME=SETTINGS_TGL_WALLPAPER"), "ACTION", (Icallback) settingsTglWallpaper,
NULL), IupSetCallbacks(IupSetAttributes(tglSound, "NAME=SETTINGS_TGL_SOUND"), "ACTION", (Icallback) settingsTglSound,
NULL), IupSetCallbacks(IupSetAttributes(tglFonts, "NAME=SETTINGS_TGL_FONTS"), "ACTION", (Icallback) settingsTglFonts,
NULL),
IupSetCallbacks(IupSetAttributes(tglEncryption, "NAME=SETTINGS_TGL_ENCRYPTION"), "ACTION",
(Icallback) settingsTglEncryption,
NULL),
IupSetCallbacks(IupSetAttributes(tglCompression, "NAME=SETTINGS_TGL_COMPRESSION"), "ACTION",
(Icallback) settingsTglCompression,
NULL), NULL),
NULL)), "TITLE=\"Общие\", MARGIN=10x10"); NULL)), "TITLE=\"Общие\", MARGIN=10x10");
} }

View File

@ -20,7 +20,8 @@ typedef enum
VALUES_BITSPERPIXEL_8, VALUES_BITSPERPIXEL_8,
VALUES_BITSPERPIXEL_16, VALUES_BITSPERPIXEL_16,
VALUES_BITSPERPIXEL_24, VALUES_BITSPERPIXEL_24,
VALUES_BITSPERPIXEL_32 VALUES_BITSPERPIXEL_32,
VALUES_USB_DRIVE
} Value; } Value;
#endif /* VALUE_H_ */ #endif /* VALUE_H_ */