From 5511c195766de625bf6c4bf39950940814c27aad Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Wed, 3 Jan 2024 19:20:26 +0100 Subject: Move activity list to a tab widget This allows us to have more tabs in the future with additional information, such as information about the Actor or even other activity views. This commit was quite a lot of work and refactoring! --- src/widgets/tab_activity_list.h | 69 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/widgets/tab_activity_list.h (limited to 'src/widgets/tab_activity_list.h') diff --git a/src/widgets/tab_activity_list.h b/src/widgets/tab_activity_list.h new file mode 100644 index 0000000..ae6d426 --- /dev/null +++ b/src/widgets/tab_activity_list.h @@ -0,0 +1,69 @@ +#pragma once +#include +#include +#include "src/widgets/status_info.h" +#include "src/finddialog.h" + +QT_BEGIN_NAMESPACE +namespace Ui { class TabActivityList; } +QT_END_NAMESPACE + +class TabActivityList : public QWidget { + Q_OBJECT + +public: + struct ViewActions { + QAction* actionAll_toots = nullptr; + QAction* actionPublic_toots = nullptr; + QAction* actionUnlisted_toots = nullptr; + QAction* actionPrivate_toots = nullptr; + QAction* actionDirect_messages = nullptr; + QAction* actionOnly_with_attachment = nullptr; + } view_actions; + + + TabActivityList(Archive** archive, QWidget *parent = nullptr); + ~TabActivityList(); + +public slots: + void actionAll_toots_triggered(bool checked); + void actionPublic_toots_triggered(bool checked); + void actionUnlisted_toots_triggered(bool checked); + void actionPrivate_toots_triggered(bool checked); + void actionDirect_messages_triggered(bool checked); + void actionOnly_with_attachment_triggered(bool checked); + void actionReblogs_triggered(bool checked); + + void on_buttonRandom_clicked(); + void on_buttonCopy_clicked(); + void on_buttonSearch_clicked(); + + void actionOpen_URL_triggered(bool checked); + void menuView_aboutToHide(); + + void relist_statuses(); + + void select_list_item(QListWidgetItem* item); + void set_search_text(const QString &text); + +signals: + void search_text_changed(const QString &text, bool search_immediately = false); + +private slots: + void on_textInputSearch_textEdited(const QString &text); + void on_listWidget_itemActivated(QListWidgetItem *item); + +private: + void reset_view_filters(); + + StatusInfoWidget* status_info_widget = nullptr; + + Ui::TabActivityList* ui; + + // Pointer to MainWindow's data archive pointer + Archive **data_archive = nullptr; + FindDialog* find_dialog = nullptr; + + ViewStatusTypes view_filters; + bool view_filters_changed = false; +}; -- cgit v1.2.3-54-g00ecf