Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gui2/tgame_cache_options: New Preferences subdialog for cache management
It allows the user to browse to the cache (using a desktop API call), copy its path to clipboard, clean the cache contents (deleting stale files), or purge it entirely. This is ideal for people sticking to the same cache dir for very long and thus keeping content that was generated by previous versions of Wesnoth they might not even use anymore. Purging the cache might also aid troubleshooting (although there is a --nocache switch for that too). The dialog also makes Wesnoth slightly more transparent about its own disk usage, information which may not be readily accessible to people without the technical know-how to locate a hidden directory. For now it's accessed by pushing a button in Preferences -> General, even though this is not ideal since it is actually Advanced Preferences material given the nature of the cache. Unfortunately, the Advanced page's layout is currently monopolized by the advanced preferences options and I'm not interested right now in solving that UI design puzzle; it will have to wait, much like the Paths dialog has done and continues to do for 1.12.
- Loading branch information
Showing
8 changed files
with
505 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,267 @@ | ||
#textdomain wesnoth-lib | ||
|
||
[window] | ||
id = "game_cache_options" | ||
description = "Game data cache management dialog." | ||
|
||
[resolution] | ||
definition = "default" | ||
|
||
click_dismiss = "true" | ||
maximum_width = 600 | ||
|
||
[tooltip] | ||
id = "tooltip_large" | ||
[/tooltip] | ||
|
||
[helptip] | ||
id = "tooltip_large" | ||
[/helptip] | ||
|
||
[grid] | ||
|
||
[row] | ||
grow_factor = 0 | ||
|
||
[column] | ||
grow_factor = 1 | ||
|
||
border = "all" | ||
border_size = 5 | ||
horizontal_alignment = "left" | ||
[label] | ||
id = "title" | ||
definition = "title" | ||
|
||
label = _ "WML Cache" | ||
[/label] | ||
|
||
[/column] | ||
|
||
[/row] | ||
|
||
[row] | ||
grow_factor = 0 | ||
|
||
[column] | ||
border = "all" | ||
border_size = 5 | ||
horizontal_alignment = "left" | ||
[label] | ||
definition = "default" | ||
|
||
label = _ "Wesnoth maintains a cache of preprocessed WML data for campaigns, multiplayer scenarios, and other add-ons to speed up the loading process. The cache may be safely cleaned to free up disk space, thus removing stale files generated by older versions; or you may purge its entire contents if you are experiencing issues when loading the game data." | ||
wrap = "true" | ||
[/label] | ||
|
||
[/column] | ||
|
||
[/row] | ||
|
||
[row] | ||
grow_factor = 1 | ||
|
||
[column] | ||
horizontal_grow = "true" | ||
|
||
[grid] | ||
|
||
[row] | ||
|
||
[column] | ||
grow_factor = 0 | ||
|
||
border = "all" | ||
border_size = 5 | ||
horizontal_alignment = "left" | ||
|
||
[label] | ||
definition = "default" | ||
|
||
label = _ "Path:" | ||
[/label] | ||
|
||
[/column] | ||
|
||
[column] | ||
grow_factor = 1 | ||
|
||
border = "all" | ||
border_size = 5 | ||
horizontal_grow = "true" | ||
|
||
[text_box] | ||
id = "path" | ||
definition = "default" | ||
label = "" | ||
[/text_box] | ||
|
||
[/column] | ||
|
||
[column] | ||
grow_factor = 0 | ||
|
||
border = "all" | ||
border_size = 5 | ||
horizontal_alignment = "left" | ||
|
||
[button] | ||
id = "copy" | ||
definition = "action_copy" | ||
label = _ "filesystem^Copy" | ||
tooltip = _ "Copy this path to clipboard" | ||
[/button] | ||
|
||
[/column] | ||
|
||
[column] | ||
grow_factor = 0 | ||
|
||
border = "all" | ||
border_size = 5 | ||
horizontal_alignment = "left" | ||
|
||
[button] | ||
id = "browse" | ||
definition = "action_go" | ||
label = _ "filesystem^Browse" | ||
tooltip = _ "Browse this location using a file manager" | ||
[/button] | ||
|
||
[/column] | ||
|
||
[/row] | ||
|
||
[/grid] | ||
|
||
[/column] | ||
|
||
[/row] | ||
|
||
[row] | ||
grow_factor = 1 | ||
|
||
[column] | ||
horizontal_grow = "true" | ||
|
||
[grid] | ||
|
||
[row] | ||
|
||
[column] | ||
grow_factor = 0 | ||
|
||
border = "all" | ||
border_size = 5 | ||
horizontal_alignment = "left" | ||
|
||
[label] | ||
definition = "default" | ||
|
||
label = _ "Size:" | ||
[/label] | ||
|
||
[/column] | ||
|
||
[column] | ||
grow_factor = 1 | ||
|
||
border = "all" | ||
border_size = 5 | ||
horizontal_grow = "true" | ||
|
||
[label] | ||
definition = "default" | ||
|
||
id = "size" | ||
label = "" | ||
[/label] | ||
|
||
[/column] | ||
|
||
[column] | ||
horizontal_alignment = "right" | ||
|
||
[grid] | ||
|
||
[row] | ||
|
||
[column] | ||
border = "all" | ||
border_size = 5 | ||
|
||
[button] | ||
id = "clean" | ||
definition = "default" | ||
label = _ "cache^Clean" | ||
tooltip = _ "Clear stale and unused cache files" | ||
[/button] | ||
|
||
[/column] | ||
|
||
[column] | ||
border = "all" | ||
border_size = 5 | ||
|
||
[button] | ||
id = "purge" | ||
definition = "default" | ||
label = _ "cache^Purge" | ||
tooltip = _ "Purge the entire contents of the cache" | ||
[/button] | ||
|
||
[/column] | ||
|
||
[/row] | ||
|
||
[/grid] | ||
|
||
[/column] | ||
|
||
[/row] | ||
|
||
[/grid] | ||
|
||
[/column] | ||
|
||
[/row] | ||
|
||
[row] | ||
grow_factor = 0 | ||
|
||
[column] | ||
horizontal_alignment = "right" | ||
|
||
[grid] | ||
|
||
[row] | ||
grow_factor = 0 | ||
|
||
[column] | ||
border = "all" | ||
border_size = 5 | ||
horizontal_alignment = "right" | ||
|
||
[button] | ||
id = "ok" | ||
definition = "default" | ||
|
||
label = _ "OK" | ||
[/button] | ||
|
||
[/column] | ||
|
||
[/row] | ||
|
||
[/grid] | ||
|
||
[/column] | ||
|
||
[/row] | ||
|
||
|
||
[/grid] | ||
|
||
[/resolution] | ||
|
||
[/window] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.