Add option to clone favorite tools

If cloning is enabled, favorite tools will appear in the favorites panel
and in the original location.
This commit is contained in:
Lawrence Lee
2021-12-09 21:27:39 -08:00
parent acda4da226
commit f8a1deb371
11 changed files with 69 additions and 27 deletions

View File

@@ -424,6 +424,7 @@ void Options::setDefaults()
//crvOpen.clear ();
parseExtensions.clear();
favorites.clear();
cloneFavoriteTools = true;
parseExtensionsEnabled.clear();
parsedExtensions.clear();
parsedExtensionsSet.clear();
@@ -1220,6 +1221,10 @@ void Options::readFromFile(Glib::ustring fname)
favorites = keyFile.get_string_list("GUI", "Favorites");
}
if (keyFile.has_key("GUI", "FavoritesCloneTools")) {
cloneFavoriteTools = keyFile.get_boolean("GUI", "FavoritesCloneTools");
}
if (keyFile.has_key("GUI", "WindowWidth")) {
windowWidth = keyFile.get_integer("GUI", "WindowWidth");
}
@@ -2261,6 +2266,7 @@ void Options::saveToFile(Glib::ustring fname)
Glib::ArrayHandle<Glib::ustring> ahfavorites = favorites;
keyFile.set_string_list("GUI", "Favorites", ahfavorites);
keyFile.set_boolean("GUI", "FavoritesCloneTools", cloneFavoriteTools);
keyFile.set_integer("GUI", "WindowWidth", windowWidth);
keyFile.set_integer("GUI", "WindowHeight", windowHeight);
keyFile.set_integer("GUI", "WindowX", windowX);