Added settings for checkboxes in find-widget.

develop
tastytea 2019-01-11 21:13:45 +01:00
parent dd83e11338
commit eab650d6dd
No known key found for this signature in database
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] }; _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(); widget_find->hide();
@ -107,7 +115,8 @@ MainWindow::~MainWindow()
libconfig::Setting &root = _config.get_cfg().getRoot(); libconfig::Setting &root = _config.get_cfg().getRoot();
// We can't add an element that already exists, so we delete it beforehand. // We can't add an element that already exists, so we delete it beforehand.
for (const string &key : for (const string &key :
{ "size", "toolbar_position", "toolbar_visible", "table_headers" }) { "size", "toolbar_position", "toolbar_visible", "table_headers",
"find_in" })
{ {
if (root.exists(key)) if (root.exists(key))
{ {
@ -156,6 +165,13 @@ MainWindow::~MainWindow()
headers.add(libconfig::Setting::TypeInt) = headers.add(libconfig::Setting::TypeInt) =
tableview->horizontalHeader()->sectionSize(2); 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(); _config.write();
} }

View File

@ -74,7 +74,7 @@
<translation>Du kannst URLs hier hineinziehen</translation> <translation>Du kannst URLs hier hineinziehen</translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="449"/> <location filename="../src/interface_qt.cpp" line="465"/>
<source>Insert receipt here.</source> <source>Insert receipt here.</source>
<translation>Beleg hier einfügen.</translation> <translation>Beleg hier einfügen.</translation>
</message> </message>
@ -198,7 +198,7 @@
</message> </message>
<message> <message>
<location filename="../src/whyblocked.ui" line="285"/> <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> <source>Edit entry</source>
<translation>Eintrag bearbeiten</translation> <translation>Eintrag bearbeiten</translation>
</message> </message>
@ -219,68 +219,68 @@
</message> </message>
<message> <message>
<location filename="../src/whyblocked.ui" line="59"/> <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> <source>User/Instance</source>
<translation>Benutzer/Instanz</translation> <translation>Benutzer/Instanz</translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="168"/> <location filename="../src/interface_qt.cpp" line="184"/>
<source>Blocked/Silenced</source> <source>Blocked/Silenced</source>
<translation>Blockiert/Gedämpft</translation> <translation>Blockiert/Gedämpft</translation>
</message> </message>
<message> <message>
<location filename="../src/whyblocked.ui" line="72"/> <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> <source>Reason</source>
<translation>Begründung</translation> <translation>Begründung</translation>
</message> </message>
<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> <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> <translation>Versuche, einen account von deinem webbrowser in dieses fenster zu ziehen.</translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="197"/> <location filename="../src/interface_qt.cpp" line="213"/>
<source>blocked</source> <source>blocked</source>
<translation>blockiert</translation> <translation>blockiert</translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="201"/> <location filename="../src/interface_qt.cpp" line="217"/>
<source>silenced</source> <source>silenced</source>
<translation>gedämpft</translation> <translation>gedämpft</translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="217"/> <location filename="../src/interface_qt.cpp" line="233"/>
<source>Invalid selection</source> <source>Invalid selection</source>
<translation>Ungültige Auswahl</translation> <translation>Ungültige Auswahl</translation>
</message> </message>
<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> <source>Please select only 1 entry to edit.</source>
<translation>Bitte nur 1 Eintrag zum bearbeiten auswählen.</translation> <translation>Bitte nur 1 Eintrag zum bearbeiten auswählen.</translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="261"/> <location filename="../src/interface_qt.cpp" line="277"/>
<source>Nothing selected</source> <source>Nothing selected</source>
<translation>Nichts ausgewählt</translation> <translation>Nichts ausgewählt</translation>
</message> </message>
<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> <source>Please select entries to remove.</source>
<translation>Bitte wähle einträge aus, die gelöscht werden sollen.</translation> <translation>Bitte wähle einträge aus, die gelöscht werden sollen.</translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="328"/> <location filename="../src/interface_qt.cpp" line="344"/>
<source>About Whyblocked</source> <source>About Whyblocked</source>
<translation>Über Whyblocked</translation> <translation>Über Whyblocked</translation>
</message> </message>
<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> <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> <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>
<message> <message>
<location filename="../src/interface_qt.cpp" line="352"/> <location filename="../src/interface_qt.cpp" line="368"/>
<source>Receipts:</source> <source>Receipts:</source>
<translation>Belege:</translation> <translation>Belege:</translation>
</message> </message>

View File

@ -74,7 +74,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="449"/> <location filename="../src/interface_qt.cpp" line="465"/>
<source>Insert receipt here.</source> <source>Insert receipt here.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -198,7 +198,7 @@
</message> </message>
<message> <message>
<location filename="../src/whyblocked.ui" line="285"/> <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> <source>Edit entry</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -219,68 +219,68 @@
</message> </message>
<message> <message>
<location filename="../src/whyblocked.ui" line="59"/> <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> <source>User/Instance</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="168"/> <location filename="../src/interface_qt.cpp" line="184"/>
<source>Blocked/Silenced</source> <source>Blocked/Silenced</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/whyblocked.ui" line="72"/> <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> <source>Reason</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>Try dragging an account from your webbrowser into this window.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="197"/> <location filename="../src/interface_qt.cpp" line="213"/>
<source>blocked</source> <source>blocked</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="201"/> <location filename="../src/interface_qt.cpp" line="217"/>
<source>silenced</source> <source>silenced</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="217"/> <location filename="../src/interface_qt.cpp" line="233"/>
<source>Invalid selection</source> <source>Invalid selection</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>Please select only 1 entry to edit.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="261"/> <location filename="../src/interface_qt.cpp" line="277"/>
<source>Nothing selected</source> <source>Nothing selected</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>Please select entries to remove.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="328"/> <location filename="../src/interface_qt.cpp" line="344"/>
<source>About Whyblocked</source> <source>About Whyblocked</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <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> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/interface_qt.cpp" line="352"/> <location filename="../src/interface_qt.cpp" line="368"/>
<source>Receipts:</source> <source>Receipts:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>