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/mainwindow.h | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) (limited to 'src/mainwindow.h') diff --git a/src/mainwindow.h b/src/mainwindow.h index 7e46cec..e77e2a9 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -4,14 +4,13 @@ #include #include #include +#include #include "archive/base_archive.h" #include "src/list_item.h" #include "src/settingsdialog.h" -#include "src/widgets/status_info.h" -#include "types.h" +#include "src/widgets/tab_activity_list.h" #include "command_line.h" -#include "finddialog.h" QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } @@ -28,11 +27,12 @@ public: void act_command_line(CommandLineParsedOptions &options, QCommandLineParser &parser); public slots: - void select_list_item(QListWidgetItem* item); - void set_search_text(const QString &text); + //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); + void new_archive_opened(); private slots: void on_actionOpen_triggered(bool checked); @@ -40,25 +40,8 @@ private slots: void on_actionQuit_triggered(bool checked); void on_actionAbout_triggered(bool checked); - void on_actionAll_toots_triggered(bool checked); - void on_actionPublic_toots_triggered(bool checked); - void on_actionUnlisted_toots_triggered(bool checked); - void on_actionPrivate_toots_triggered(bool checked); - void on_actionDirect_messages_triggered(bool checked); - void on_actionOnly_with_attachment_triggered(bool checked); - void on_actionReblogs_triggered(bool checked); - void on_actionRandom_status_triggered(bool checked); - void on_actionCopy_status_triggered(bool checked); - void on_actionFind_triggered(bool checked); - void on_actionOpen_URL_triggered(bool checked); - - void on_textInputSearch_textEdited(const QString &text); - - void on_menuView_aboutToHide(); - - void on_listWidget_itemActivated(QListWidgetItem *item); - private: + void create_initial_tabs(); void reset_view_filters(); void relist_statuses(); void open_file(const QString &filename); @@ -68,17 +51,13 @@ private: void finish_open_file(const Archive::InitError& parse_error); void settingsDialog_done(int result); - FindDialog* find_dialog = nullptr; SettingsDialog* settings_dialog = nullptr; - StatusInfoWidget* status_info_widget = nullptr; + TabActivityList* activity_list_tab = nullptr; QString open_file_filename; Ui::MainWindow *ui; - ViewStatusTypes view_filters; - bool view_filters_changed = false; - Archive *data_archive = nullptr; QFutureWatcher archive_thread_watcher; -- cgit v1.2.3-54-g00ecf