diff options
author | ConfuSomu | 2024-01-08 08:45:17 +0100 |
---|---|---|
committer | ConfuSomu | 2024-01-08 08:45:17 +0100 |
commit | 2ae3c4cd7a4d5678f89f9e104571a934418ea265 (patch) | |
tree | 4d39af7381df4db44db6a0b20b88c083a80ef3a3 /src/widgets | |
parent | 58240fa2e1ac4234cf67374349ce606f1b6df643 (diff) | |
download | ActorViewer-2ae3c4cd7a4d5678f89f9e104571a934418ea265.tar ActorViewer-2ae3c4cd7a4d5678f89f9e104571a934418ea265.tar.gz ActorViewer-2ae3c4cd7a4d5678f89f9e104571a934418ea265.zip |
Make mastodonpp support configurable
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/tab_activity_list.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/widgets/tab_activity_list.cpp b/src/widgets/tab_activity_list.cpp index faa6138..63d6fbf 100644 --- a/src/widgets/tab_activity_list.cpp +++ b/src/widgets/tab_activity_list.cpp @@ -9,6 +9,7 @@ #include <QRandomGenerator> #include <QClipboard> #include <QMimeData> +#include <QMessageBox> TabActivityList::TabActivityList(Archive** archive, QWidget* parent) : data_archive(archive), QWidget(parent), ui(new Ui::TabActivityList) @@ -91,11 +92,15 @@ void TabActivityList::actionOpen_URL_triggered(bool checked) { // Really hacky code but works as a PoC and allows testing if (ok and not url.isEmpty()) { Instance* instance = Instance::create_instance(); - APPost* post = instance->get_post_from_url(url); - // Activity will be freed by StatusInfoWidget - APActivity* activity = new APActivity({.object = post}); - status_info_widget->do_process_activity(activity); - delete instance; instance = nullptr; + if (instance) { + APPost* post = instance->get_post_from_url(url); + // Activity will be freed by StatusInfoWidget + APActivity* activity = new APActivity({.object = post}); + status_info_widget->do_process_activity(activity); + delete instance; instance = nullptr; + } else + // Best is to remove option from menu, should be douable if the preprocessor touches .ui files + QMessageBox::critical(this, tr("Open status from URL"), tr("Could not create Instance object.\nPerhaps network support was disabled at compile time?")); } } |