From eab650d6dd69543c08fc4953931a62cfe0a4e142 Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 11 Jan 2019 21:13:45 +0100 Subject: [PATCH] Added settings for checkboxes in find-widget. --- src/interface_qt.cpp | 18 +++++++++++++++++- translations/whyblocked_de.ts | 30 +++++++++++++++--------------- translations/whyblocked_en.ts | 30 +++++++++++++++--------------- 3 files changed, 47 insertions(+), 31 deletions(-) diff --git a/src/interface_qt.cpp b/src/interface_qt.cpp index c4c2009..c6fc16d 100644 --- a/src/interface_qt.cpp +++ b/src/interface_qt.cpp @@ -91,6 +91,14 @@ MainWindow::MainWindow(QMainWindow *parent) _headersize = { value[0], value[1], value[2] }; } + key = "find_in"; + if (root.exists(key) && root[key.c_str()].isGroup()) + { + const libconfig::Setting &value = root[key.c_str()]; + check_user->setChecked(value["user"]); + check_reason->setChecked(value["reason"]); + } + } widget_find->hide(); @@ -107,7 +115,8 @@ MainWindow::~MainWindow() libconfig::Setting &root = _config.get_cfg().getRoot(); // We can't add an element that already exists, so we delete it beforehand. for (const string &key : - { "size", "toolbar_position", "toolbar_visible", "table_headers" }) + { "size", "toolbar_position", "toolbar_visible", "table_headers", + "find_in" }) { if (root.exists(key)) { @@ -156,6 +165,13 @@ MainWindow::~MainWindow() headers.add(libconfig::Setting::TypeInt) = tableview->horizontalHeader()->sectionSize(2); + libconfig::Setting &find_in = root.add("find_in", + libconfig::Setting::TypeGroup); + find_in.add("user", libconfig::Setting::TypeBoolean) = + check_user->isChecked(); + find_in.add("reason", libconfig::Setting::TypeBoolean) = + check_reason->isChecked(); + _config.write(); } diff --git a/translations/whyblocked_de.ts b/translations/whyblocked_de.ts index 67b2097..19cb7e4 100644 --- a/translations/whyblocked_de.ts +++ b/translations/whyblocked_de.ts @@ -74,7 +74,7 @@ Du kannst URLs hier hineinziehen - + Insert receipt here. Beleg hier einfügen. @@ -198,7 +198,7 @@ - + Edit entry Eintrag bearbeiten @@ -219,68 +219,68 @@ - + User/Instance Benutzer/Instanz - + Blocked/Silenced Blockiert/Gedämpft - + Reason Begründung - + Try dragging an account from your webbrowser into this window. Versuche, einen account von deinem webbrowser in dieses fenster zu ziehen. - + blocked blockiert - + silenced gedämpft - + Invalid selection Ungültige Auswahl - + Please select only 1 entry to edit. Bitte nur 1 Eintrag zum bearbeiten auswählen. - + Nothing selected Nichts ausgewählt - + Please select entries to remove. Bitte wähle einträge aus, die gelöscht werden sollen. - + About Whyblocked Über Whyblocked - + <p><b>Whyblocked</b> %1</p><p>Reminds you why you blocked someone.</p><p>Sourcecode: <a href="https://schlomp.space/tastytea/whyblocked">https://schlomp.space/tastytea/whyblocked</a></p><p><small>Copyright © 2018 <a href="mailto:tastytea@tastytea.de">tastytea</a>.<br>Licence GPLv3: <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPL version 3</a>.<br>This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.</small></p> <p><b>Whyblocked</b> %1</p><p>Erinnert dich, warum du jemanden blockiertest.</p><p>Quelltext: <a href="https://schlomp.space/tastytea/whyblocked">https://schlomp.space/tastytea/whyblocked</a></p><p><small>Copyright © 2018 <a href="mailto:tastytea@tastytea.de">tastytea</a>.<br>Lizenz GPLv3: <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPL version 3</a>.<br>Für dieses Programm besteht KEINERLEI GARANTIE. Dies ist freie Software, die Sie unter bestimmten Bedingungen weitergeben dürfen.</small></p> - + Receipts: Belege: diff --git a/translations/whyblocked_en.ts b/translations/whyblocked_en.ts index 17eaade..ba3ca04 100644 --- a/translations/whyblocked_en.ts +++ b/translations/whyblocked_en.ts @@ -74,7 +74,7 @@ - + Insert receipt here. @@ -198,7 +198,7 @@ - + Edit entry @@ -219,68 +219,68 @@ - + User/Instance - + Blocked/Silenced - + Reason - + Try dragging an account from your webbrowser into this window. - + blocked - + silenced - + Invalid selection - + Please select only 1 entry to edit. - + Nothing selected - + Please select entries to remove. - + About Whyblocked - + <p><b>Whyblocked</b> %1</p><p>Reminds you why you blocked someone.</p><p>Sourcecode: <a href="https://schlomp.space/tastytea/whyblocked">https://schlomp.space/tastytea/whyblocked</a></p><p><small>Copyright © 2018 <a href="mailto:tastytea@tastytea.de">tastytea</a>.<br>Licence GPLv3: <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPL version 3</a>.<br>This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.</small></p> - + Receipts: