diff options
author | ConfuSomu | 2024-01-03 19:20:26 +0100 |
---|---|---|
committer | ConfuSomu | 2024-01-03 19:20:26 +0100 |
commit | 5511c195766de625bf6c4bf39950940814c27aad (patch) | |
tree | ddf2033b0d9ceb47e7177aa551705ec088af2a2f /src/widgets/tab_activity_list.h | |
parent | 00cea51b0b9431b1952cd9f771dc59f7b5de99a0 (diff) | |
download | ActorViewer-5511c195766de625bf6c4bf39950940814c27aad.tar ActorViewer-5511c195766de625bf6c4bf39950940814c27aad.tar.gz ActorViewer-5511c195766de625bf6c4bf39950940814c27aad.zip |
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!
Diffstat (limited to 'src/widgets/tab_activity_list.h')
-rw-r--r-- | src/widgets/tab_activity_list.h | 69 |
1 files changed, 69 insertions, 0 deletions
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 <QWidget> +#include <QLocale> +#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; +}; |