mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 04:20:27 +01:00
wmaker/WPrefs: Remove legacy support for deprecated apercus.
Replaced by minipreviews in December 2014. Over two years have passed.
This commit is contained in:
committed by
Carlos R. Mafra
parent
f6320d4fa5
commit
fa8121ee61
@@ -60,8 +60,6 @@ typedef struct _Panel {
|
||||
|
||||
CallbackRec callbacks;
|
||||
|
||||
Bool have_legacy_apercu;
|
||||
|
||||
WMWidget *parent;
|
||||
|
||||
WMFrame *posF;
|
||||
@@ -201,14 +199,6 @@ static void showData(_Panel * panel)
|
||||
|
||||
/* Mini-Previews for Icons */
|
||||
|
||||
/*
|
||||
* Backward Compatibility:
|
||||
* These settings changed names after 0.95.6, so to avoid breaking user's
|
||||
* config we still support the old names, and silently convert them to the
|
||||
* new settings
|
||||
* This hack should be kept for at least 2 years, that means >= 2017.
|
||||
*/
|
||||
panel->have_legacy_apercu = False;
|
||||
str = GetStringForKey("MiniwindowPreviewBalloons");
|
||||
if (str != NULL) {
|
||||
/* New names found, use them in priority */
|
||||
@@ -220,25 +210,6 @@ static void showData(_Panel * panel)
|
||||
} else {
|
||||
i = minipreview_minimum_size;
|
||||
}
|
||||
} else {
|
||||
/* No new names, try the legacy names */
|
||||
b = GetBoolForKey("MiniwindowApercuBalloons");
|
||||
if (b) {
|
||||
panel->have_legacy_apercu = True;
|
||||
i = GetIntegerForKey("ApercuSize");
|
||||
|
||||
/*
|
||||
* In the beginning, the option was coded as a multiple of the icon
|
||||
* size; then it was converted to pixel size
|
||||
*/
|
||||
if (i < 24)
|
||||
i *= GetIntegerForKey("IconSize");
|
||||
|
||||
if (i <= minipreview_minimum_size)
|
||||
i = minipreview_minimum_size + 1; /* +1 to not display as "off" */
|
||||
} else {
|
||||
i = minipreview_minimum_size;
|
||||
}
|
||||
}
|
||||
WMSetSliderValue(panel->minipreview.slider, i);
|
||||
minipreview_slider_changed(panel->minipreview.slider, panel);
|
||||
@@ -478,10 +449,6 @@ static void storeData(_Panel * panel)
|
||||
}
|
||||
SetIntegerForKey(i, "MiniPreviewSize");
|
||||
}
|
||||
if (panel->have_legacy_apercu) {
|
||||
RemoveObjectForKey("MiniwindowApercuBalloons");
|
||||
RemoveObjectForKey("ApercuSize");
|
||||
}
|
||||
|
||||
for (i = 0; i < wlengthof(icon_animation); i++) {
|
||||
if (WMGetButtonSelected(panel->animB[i])) {
|
||||
|
||||
@@ -312,17 +312,6 @@ static WOptionEnumeration seDragMaximizedWindow[] = {
|
||||
{NULL, 0, 0}
|
||||
};
|
||||
|
||||
/*
|
||||
* Backward Compatibility:
|
||||
* The Mini-Previews were introduced in 0.95.6 under the name "Apercu".
|
||||
* For compatibility, we still support the old names in configuration files,
|
||||
* which are loaded in this structure, so this should stay for at least
|
||||
* 2 years (that means until 2017) */
|
||||
static struct {
|
||||
char enable;
|
||||
int size;
|
||||
} legacy_minipreview_config;
|
||||
|
||||
/*
|
||||
* ALL entries in the tables bellow, NEED to have a default value
|
||||
* defined, and this value needs to be correct.
|
||||
@@ -527,17 +516,6 @@ WDefaultEntry optionList[] = {
|
||||
{"IgnoreGtkHints", "NO", NULL,
|
||||
&wPreferences.ignore_gtk_decoration_hints, getBool, NULL, NULL, NULL},
|
||||
|
||||
/*
|
||||
* Backward Compatibility:
|
||||
* The Mini-Previews were introduced in 0.95.6 under the name "Apercu".
|
||||
* For compatibility, we still support the old names in configuration files,
|
||||
* so this should stay for at least 2 years (that means until 2017)
|
||||
*/
|
||||
{"MiniwindowApercuBalloons", "NO", NULL,
|
||||
&legacy_minipreview_config.enable, getBool, NULL, NULL, NULL},
|
||||
{"ApercuSize", "0", NULL,
|
||||
&legacy_minipreview_config.size, getInt, NULL, NULL, NULL},
|
||||
|
||||
/* style options */
|
||||
|
||||
{"MenuStyle", "normal", seMenuStyles,
|
||||
@@ -1222,32 +1200,6 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Backward Compatibility:
|
||||
* Support the old setting names for Apercu, now called Mini-Preview
|
||||
*
|
||||
* This code should probably stay for at least 2 years, you should not consider removing
|
||||
* it before year 2017
|
||||
*/
|
||||
if (legacy_minipreview_config.enable) {
|
||||
wwarning(_("your configuration is using old syntax for Mini-Preview settings; consider running WPrefs.app to update"));
|
||||
wPreferences.miniwin_preview_balloon = legacy_minipreview_config.enable;
|
||||
|
||||
if (legacy_minipreview_config.size > 0) {
|
||||
/*
|
||||
* the option 'ApercuSize' used to be coded as a multiple of the icon size in v0.95.6
|
||||
* it is now expressed directly in pixels, but to avoid breaking user's setting we check
|
||||
* for old coding and convert it now.
|
||||
*/
|
||||
if (legacy_minipreview_config.size < 24) {
|
||||
/* 24 is the minimum icon size proposed in WPref's settings */
|
||||
wPreferences.minipreview_size = legacy_minipreview_config.size * wPreferences.icon_size;
|
||||
} else {
|
||||
wPreferences.minipreview_size = legacy_minipreview_config.size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (needs_refresh != 0 && !scr->flags.startup) {
|
||||
int foo;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user