mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-08 22:42:34 -04:00
Make search always visible (PR #67)
* Moved search bar to toolbar and consolidated search options into dropdown list * Updated GUI tests to be atomic and rewrote search tests * Searches are saved between databases * Search is cleared when all databases are closed * Implemented global search shortcut (CTRL+F) and a notification bar when in search mode
This commit is contained in:
parent
3f80134f07
commit
13983d0e51
15 changed files with 512 additions and 417 deletions
|
@ -39,12 +39,9 @@ class KeePass1OpenWidget;
|
|||
class QFile;
|
||||
class QMenu;
|
||||
class QSplitter;
|
||||
class QLabel;
|
||||
class UnlockDatabaseWidget;
|
||||
|
||||
namespace Ui {
|
||||
class SearchWidget;
|
||||
}
|
||||
|
||||
class DatabaseWidget : public QStackedWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -64,6 +61,7 @@ public:
|
|||
bool dbHasKey() const;
|
||||
bool canDeleteCurrentGroup() const;
|
||||
bool isInSearchMode() const;
|
||||
QString getCurrentSearch();
|
||||
int addWidget(QWidget* w);
|
||||
void setCurrentIndex(int index);
|
||||
void setCurrentWidget(QWidget* widget);
|
||||
|
@ -101,9 +99,7 @@ Q_SIGNALS:
|
|||
void searchModeActivated();
|
||||
void splitterSizesChanged();
|
||||
void entryColumnSizesChanged();
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject* object, QEvent* event) override;
|
||||
void updateSearch(QString text);
|
||||
|
||||
public Q_SLOTS:
|
||||
void createEntry();
|
||||
|
@ -127,7 +123,11 @@ public Q_SLOTS:
|
|||
void switchToOpenDatabase(const QString& fileName);
|
||||
void switchToOpenDatabase(const QString& fileName, const QString& password, const QString& keyFile);
|
||||
void switchToImportKeepass1(const QString& fileName);
|
||||
void openSearch();
|
||||
// Search related slots
|
||||
void search(const QString& searchtext);
|
||||
void setSearchCaseSensitive(bool state);
|
||||
void setSearchCurrentGroup(bool state);
|
||||
void endSearch();
|
||||
|
||||
private Q_SLOTS:
|
||||
void entryActivationSignalReceived(Entry* entry, EntryModel::ModelColumn column);
|
||||
|
@ -144,11 +144,6 @@ private Q_SLOTS:
|
|||
void unlockDatabase(bool accepted);
|
||||
void emitCurrentModeChanged();
|
||||
void clearLastGroup(Group* group);
|
||||
void search();
|
||||
void startSearch();
|
||||
void startSearchTimer();
|
||||
void showSearch();
|
||||
void closeSearch();
|
||||
|
||||
private:
|
||||
void setClipboardTextAndMinimize(const QString& text);
|
||||
|
@ -156,8 +151,6 @@ private:
|
|||
void replaceDatabase(Database* db);
|
||||
|
||||
Database* m_db;
|
||||
const QScopedPointer<Ui::SearchWidget> m_searchUi;
|
||||
QWidget* const m_searchWidget;
|
||||
QWidget* m_mainWidget;
|
||||
EditEntryWidget* m_editEntryWidget;
|
||||
EditEntryWidget* m_historyEditEntryWidget;
|
||||
|
@ -170,13 +163,18 @@ private:
|
|||
QSplitter* m_splitter;
|
||||
GroupView* m_groupView;
|
||||
EntryView* m_entryView;
|
||||
QLabel* m_searchingLabel;
|
||||
Group* m_newGroup;
|
||||
Entry* m_newEntry;
|
||||
Group* m_newParent;
|
||||
Group* m_lastGroup;
|
||||
QTimer* m_searchTimer;
|
||||
QString m_filename;
|
||||
Uuid m_groupBeforeLock;
|
||||
|
||||
// Search state
|
||||
QString m_lastSearchText;
|
||||
bool m_searchCaseSensitive;
|
||||
bool m_searchCurrentGroup;
|
||||
};
|
||||
|
||||
#endif // KEEPASSX_DATABASEWIDGET_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue