2024-03-19 20:42:32 +00:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2024-03-20 09:47:05 +00:00
|
|
|
#include "finder.h"
|
2024-03-19 20:42:32 +00:00
|
|
|
#include <QMainWindow>
|
2024-03-20 09:47:05 +00:00
|
|
|
#include <QStandardItemModel>
|
2024-03-20 09:16:46 +00:00
|
|
|
#include <QStringListModel>
|
2024-03-20 20:45:06 +00:00
|
|
|
#include <filesystem>
|
2024-03-19 20:42:32 +00:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
|
|
|
}
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2024-03-20 09:16:46 +00:00
|
|
|
private:
|
|
|
|
std::vector<std::string> word_list_;
|
|
|
|
QStringListModel result_model_;
|
2024-03-20 09:47:05 +00:00
|
|
|
QStandardItemModel search_algorithms_;
|
2024-03-20 20:45:06 +00:00
|
|
|
QStandardItemModel word_list_sources_;
|
2024-03-20 14:20:46 +00:00
|
|
|
std::unique_ptr<Finder> finder_;
|
2024-03-20 09:16:46 +00:00
|
|
|
|
2024-03-19 20:42:32 +00:00
|
|
|
public:
|
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
~MainWindow();
|
|
|
|
|
2024-03-20 09:16:46 +00:00
|
|
|
private:
|
2024-03-20 09:47:05 +00:00
|
|
|
void setupAlgorithmSelector();
|
2024-03-20 20:45:06 +00:00
|
|
|
void setupWordListSourceSelector();
|
|
|
|
void setupWordList();
|
2024-03-20 09:47:05 +00:00
|
|
|
void generateWordList();
|
2024-03-20 20:45:06 +00:00
|
|
|
void loadWordList(std::filesystem::path path);
|
2024-03-20 09:47:05 +00:00
|
|
|
void search(const QString &search_term);
|
2024-03-20 14:20:46 +00:00
|
|
|
void createSelectedFinder();
|
2024-03-20 12:25:28 +00:00
|
|
|
void showResults(const std::forward_list<const std::string *> &results);
|
2024-03-20 09:47:05 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_searchInput_textChanged(const QString &search_term);
|
|
|
|
void on_searchAlgorithmSelector_currentIndexChanged(int);
|
2024-03-20 20:45:06 +00:00
|
|
|
void on_wordListSourceSelector_currentIndexChanged(int);
|
|
|
|
void on_wordListSizeSelector_valueChanged(int);
|
2024-03-20 09:16:46 +00:00
|
|
|
|
2024-03-19 20:42:32 +00:00
|
|
|
private:
|
|
|
|
Ui::MainWindow *ui;
|
|
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|