diff --git a/src/interface_qt.cpp b/src/interface_qt.cpp index 396ae7e..828814d 100644 --- a/src/interface_qt.cpp +++ b/src/interface_qt.cpp @@ -84,8 +84,12 @@ MainWindow::MainWindow(QMainWindow *parent) const libconfig::Setting &value = root[key.c_str()]; _headersize = { value[0], value[1], value[2] }; } + } + widget_find->hide(); + text_find->installEventFilter(this); + populate_tableview(); statusBar()->showMessage(tr("Try dragging an account from your webbrowser " "into this window.")); @@ -249,6 +253,28 @@ void MainWindow::remove() } } +void MainWindow::find() +{ + if (widget_find->isVisible()) + { + widget_find->hide(); + } + else + { + widget_find->show(); + text_find->setFocus(); + } +} + +bool MainWindow::eventFilter(QObject *obj, QEvent *event) +{ + if (obj == text_find && event->type() == QEvent::KeyPress) + { + // + } + return QObject::eventFilter(obj, event); +} + void MainWindow::about() { QMessageBox::about(this, tr("About Whyblocked"), diff --git a/src/interface_qt.hpp b/src/interface_qt.hpp index 2852856..3024e87 100644 --- a/src/interface_qt.hpp +++ b/src/interface_qt.hpp @@ -55,6 +55,7 @@ private: const string urls_to_hyperlinks(const string &text); void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent *event); + bool eventFilter(QObject *obj, QEvent *event); QStandardItemModel *_model; xdgcfg _config; @@ -66,6 +67,7 @@ private slots: void about(); void show_details(QModelIndex index); void populate_tableview(); + void find(); }; diff --git a/src/whyblocked.ui b/src/whyblocked.ui index dc94a4d..c32740b 100644 --- a/src/whyblocked.ui +++ b/src/whyblocked.ui @@ -25,6 +25,60 @@ + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + true + + + true + + + + + + + Search for Users/Instances + + + User/Instance + + + true + + + + + + + Search for Reasons + + + Reason + + + true + + + + + + @@ -113,6 +167,7 @@ + @@ -134,6 +189,7 @@ + @@ -232,6 +288,23 @@ Ctrl+E + + + true + + + + + + &Find + + + Find entries + + + Ctrl+F + + @@ -363,6 +436,22 @@ + + action_find + triggered() + MainWindow + find() + + + -1 + -1 + + + 299 + 299 + + + add() @@ -371,5 +460,6 @@ about() show_details(QModelIndex) edit() + find() diff --git a/translations/whyblocked_de.ts b/translations/whyblocked_de.ts index 0df554f..5f9a518 100644 --- a/translations/whyblocked_de.ts +++ b/translations/whyblocked_de.ts @@ -71,10 +71,10 @@ You can drag URLs in here - Du kannst URLs hier hineinziehen + Du kannst URLs hier hineinziehen - + Insert receipt here. Beleg hier einfügen. @@ -87,173 +87,200 @@ - + + Search for Users/Instances + Suche nach Benutzern/Instanzen + + + + Search for Reasons + Suche nach Begründungen + + + Click or press enter to view receipts Klicken oder Eingabe drücken, um Belege zu anzuzeigen - + Memory aids, proof Gedächtnisstützen, Beweise - + Toolbar Werkzeugleiste - + &Database &Datenbank - + &Help &Hilfe - + &Add &Hinzufügen - + Add user or instance Benutzer oder Instanz hinzufügen - + Ctrl+N - + Re&move Ent&fernen - + Remove user or instance Benutzer oder Instanz entfernen - + Del - + &About &Über - + About this application Über dieses Programm - + &Reload Neu &laden - + Reload database Datenbank neu laden - + Ctrl+R - + &Quit &Beenden - + Quit application Programm beenden - + Ctrl+Q - + &Edit B&earbeiten - - + + Edit entry Eintrag bearbeiten - + + &Find + &Finden + + + + Find entries + Dinde Einträge + + + + Ctrl+F + + + + + 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 518887f..3928222 100644 --- a/translations/whyblocked_en.ts +++ b/translations/whyblocked_en.ts @@ -74,7 +74,7 @@ - + Insert receipt here. @@ -87,173 +87,200 @@ - + + Search for Users/Instances + + + + + Search for Reasons + + + + Click or press enter to view receipts - + Memory aids, proof - + Toolbar - + &Database - + &Help - + &Add - + Add user or instance - + Ctrl+N - + Re&move - + Remove user or instance - + Del - + &About - + About this application - + &Reload - + Reload database - + Ctrl+R - + &Quit - + Quit application - + Ctrl+Q - + &Edit - - + + Edit entry - + + &Find + + + + + Find entries + + + + + Ctrl+F + + + + + 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: