Added settings for checkboxes in find-widget.
All checks were successful
the build was successful

This commit is contained in:
tastytea 2019-01-11 21:13:45 +01:00
parent dd83e11338
commit eab650d6dd
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
3 changed files with 47 additions and 31 deletions

View File

@ -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();
}

View File

@ -74,7 +74,7 @@
<translation>Du kannst URLs hier hineinziehen</translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="449"/>
<location filename="../src/interface_qt.cpp" line="465"/>
<source>Insert receipt here.</source>
<translation>Beleg hier einfügen.</translation>
</message>
@ -198,7 +198,7 @@
</message>
<message>
<location filename="../src/whyblocked.ui" line="285"/>
<location filename="../src/interface_qt.cpp" line="223"/>
<location filename="../src/interface_qt.cpp" line="239"/>
<source>Edit entry</source>
<translation>Eintrag bearbeiten</translation>
</message>
@ -219,68 +219,68 @@
</message>
<message>
<location filename="../src/whyblocked.ui" line="59"/>
<location filename="../src/interface_qt.cpp" line="167"/>
<location filename="../src/interface_qt.cpp" line="183"/>
<source>User/Instance</source>
<translation>Benutzer/Instanz</translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="168"/>
<location filename="../src/interface_qt.cpp" line="184"/>
<source>Blocked/Silenced</source>
<translation>Blockiert/Gedämpft</translation>
</message>
<message>
<location filename="../src/whyblocked.ui" line="72"/>
<location filename="../src/interface_qt.cpp" line="169"/>
<location filename="../src/interface_qt.cpp" line="185"/>
<source>Reason</source>
<translation>Begründung</translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="101"/>
<location filename="../src/interface_qt.cpp" line="109"/>
<source>Try dragging an account from your webbrowser into this window.</source>
<translation>Versuche, einen account von deinem webbrowser in dieses fenster zu ziehen.</translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="197"/>
<location filename="../src/interface_qt.cpp" line="213"/>
<source>blocked</source>
<translation>blockiert</translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="201"/>
<location filename="../src/interface_qt.cpp" line="217"/>
<source>silenced</source>
<translation>gedämpft</translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="217"/>
<location filename="../src/interface_qt.cpp" line="233"/>
<source>Invalid selection</source>
<translation>Ungültige Auswahl</translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="218"/>
<location filename="../src/interface_qt.cpp" line="234"/>
<source>Please select only 1 entry to edit.</source>
<translation>Bitte nur 1 Eintrag zum bearbeiten auswählen.</translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="261"/>
<location filename="../src/interface_qt.cpp" line="277"/>
<source>Nothing selected</source>
<translation>Nichts ausgewählt</translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="262"/>
<location filename="../src/interface_qt.cpp" line="278"/>
<source>Please select entries to remove.</source>
<translation>Bitte wähle einträge aus, die gelöscht werden sollen.</translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="328"/>
<location filename="../src/interface_qt.cpp" line="344"/>
<source>About Whyblocked</source>
<translation>Über Whyblocked</translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="329"/>
<location filename="../src/interface_qt.cpp" line="345"/>
<source>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Reminds you why you blocked someone.&lt;/p&gt;&lt;p&gt;Sourcecode: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Licence GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.&lt;/small&gt;&lt;/p&gt;</source>
<translation>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Erinnert dich, warum du jemanden blockiertest.&lt;/p&gt;&lt;p&gt;Quelltext: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Lizenz GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;Für dieses Programm besteht KEINERLEI GARANTIE. Dies ist freie Software, die Sie unter bestimmten Bedingungen weitergeben dürfen.&lt;/small&gt;&lt;/p&gt;</translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="352"/>
<location filename="../src/interface_qt.cpp" line="368"/>
<source>Receipts:</source>
<translation>Belege:</translation>
</message>

View File

@ -74,7 +74,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="449"/>
<location filename="../src/interface_qt.cpp" line="465"/>
<source>Insert receipt here.</source>
<translation type="unfinished"></translation>
</message>
@ -198,7 +198,7 @@
</message>
<message>
<location filename="../src/whyblocked.ui" line="285"/>
<location filename="../src/interface_qt.cpp" line="223"/>
<location filename="../src/interface_qt.cpp" line="239"/>
<source>Edit entry</source>
<translation type="unfinished"></translation>
</message>
@ -219,68 +219,68 @@
</message>
<message>
<location filename="../src/whyblocked.ui" line="59"/>
<location filename="../src/interface_qt.cpp" line="167"/>
<location filename="../src/interface_qt.cpp" line="183"/>
<source>User/Instance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="168"/>
<location filename="../src/interface_qt.cpp" line="184"/>
<source>Blocked/Silenced</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/whyblocked.ui" line="72"/>
<location filename="../src/interface_qt.cpp" line="169"/>
<location filename="../src/interface_qt.cpp" line="185"/>
<source>Reason</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="101"/>
<location filename="../src/interface_qt.cpp" line="109"/>
<source>Try dragging an account from your webbrowser into this window.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="197"/>
<location filename="../src/interface_qt.cpp" line="213"/>
<source>blocked</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="201"/>
<location filename="../src/interface_qt.cpp" line="217"/>
<source>silenced</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="217"/>
<location filename="../src/interface_qt.cpp" line="233"/>
<source>Invalid selection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="218"/>
<location filename="../src/interface_qt.cpp" line="234"/>
<source>Please select only 1 entry to edit.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="261"/>
<location filename="../src/interface_qt.cpp" line="277"/>
<source>Nothing selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="262"/>
<location filename="../src/interface_qt.cpp" line="278"/>
<source>Please select entries to remove.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="328"/>
<location filename="../src/interface_qt.cpp" line="344"/>
<source>About Whyblocked</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="329"/>
<location filename="../src/interface_qt.cpp" line="345"/>
<source>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Reminds you why you blocked someone.&lt;/p&gt;&lt;p&gt;Sourcecode: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Licence GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.&lt;/small&gt;&lt;/p&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/interface_qt.cpp" line="352"/>
<location filename="../src/interface_qt.cpp" line="368"/>
<source>Receipts:</source>
<translation type="unfinished"></translation>
</message>