From 4b8d314f575d9e893d8dda7431194f8b470fc888 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sun, 18 Sep 2022 11:08:01 -0400 Subject: First step to adopt mingui as part of the project -- break it! --- qdeduper/mingui.hpp | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 qdeduper/mingui.hpp (limited to 'qdeduper/mingui.hpp') diff --git a/qdeduper/mingui.hpp b/qdeduper/mingui.hpp new file mode 100644 index 0000000..b8d13ef --- /dev/null +++ b/qdeduper/mingui.hpp @@ -0,0 +1,65 @@ +#ifndef MINGUI_HPP +#define MINGUI_HPP + +#include +#include +#include +#include + +#include +#include + +class QHBoxLayout; +class QLabel; +class QStatusBar; +class QScrollArea; +class QTextEdit; +class QListView; +class QSplitter; +class QStandardItemModel; +class ImageItemDelegate; + +namespace fs = std::filesystem; + +class DeduperMainWindow : public QMainWindow +{ + Q_OBJECT +private: + QSplitter *l; + QTextEdit *infopanel; + QLabel *permamsg; + QStatusBar *sb; + QListView *lw; + QList selhk; + QStandardItemModel *im = nullptr; + ImageItemDelegate *id = nullptr; + std::size_t ngroups, curgroup; + bool nohotkeywarn; + void mark_toggle(std::size_t x); + void mark_all_but(std::size_t x); + void mark_all(); + void mark_none(); + void mark_view_update(bool update_msg = true); + fs::path::string_type common_prefix(const std::vector &fns); + std::vector marks; + std::unordered_set marked; + std::vector current_set; +protected: + void resizeEvent(QResizeEvent *e) override; + void closeEvent(QCloseEvent *e) override; +public: + DeduperMainWindow(); + + void setup_menu(); + void show_images(const std::vector &fns); + void update_distances(const std::map, double> &d); + void update_viewstatus(std::size_t cur, std::size_t size); + void save_list(); + void load_list(); +Q_SIGNALS: + void next(); + void prev(); + void switch_group(std::size_t group); +}; + +#endif -- cgit v1.2.3