aboutsummaryrefslogtreecommitdiff
path: root/src/QuickMedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r--src/QuickMedia.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index db0f9f6..1191ecb 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -9,6 +9,7 @@
#include "../plugins/Matrix.hpp"
#include "../plugins/Pleroma.hpp"
#include "../plugins/FileManager.hpp"
+#include "../plugins/Pipe.hpp"
#include "../include/Scale.hpp"
#include "../include/Program.hpp"
#include "../include/VideoPlayer.hpp"
@@ -396,7 +397,7 @@ namespace QuickMedia {
static void usage() {
fprintf(stderr, "usage: QuickMedia <plugin> [--tor] [--no-video] [--use-system-mpv-config] [--dir <directory>]\n");
fprintf(stderr, "OPTIONS:\n");
- fprintf(stderr, " plugin The plugin to use. Should be either 4chan, manganelo, mangatown, mangadex, pornhub, youtube, nyaa.si, matrix or file-manager\n");
+ fprintf(stderr, " plugin The plugin to use. Should be either 4chan, manganelo, mangatown, mangadex, pornhub, youtube, nyaa.si, matrix, file-manager or pipe\n");
fprintf(stderr, " --no-video Only play audio when playing a video. Disabled by default\n");
fprintf(stderr, " --tor Use tor. Disabled by default\n");
fprintf(stderr, " --use-system-mpv-config Use system mpv config instead of no config. Disabled by default\n");
@@ -455,6 +456,8 @@ namespace QuickMedia {
plugin_logo_path = resources_root + "images/pleroma_logo.png";
} else if(strcmp(argv[i], "file-manager") == 0) {
plugin_name = argv[i];
+ } else if(strcmp(argv[i], "pipe") == 0) {
+ plugin_name = argv[i];
}
}
@@ -597,6 +600,10 @@ namespace QuickMedia {
auto file_manager_body = create_body();
file_manager_page->get_files_in_directory(file_manager_body->items);
tabs.push_back(Tab{std::move(file_manager_body), std::move(file_manager_page), create_search_bar("Search...", SEARCH_DELAY_FILTER)});
+ } else if(strcmp(plugin_name, "pipe") == 0) {
+ auto pipe_body = create_body();
+ PipePage::load_body_items_from_stdin(pipe_body->items);
+ tabs.push_back(Tab{std::move(pipe_body), std::make_unique<PipePage>(this), create_search_bar("Search...", SEARCH_DELAY_FILTER)});
} else if(strcmp(plugin_name, "youtube") == 0) {
auto search_body = create_body();
tabs.push_back(Tab{std::move(search_body), std::make_unique<YoutubeSearchPage>(this), create_search_bar("Search...", 350)});
@@ -1817,8 +1824,6 @@ namespace QuickMedia {
window_size.y = event.size.height;
sf::FloatRect visible_area(0, 0, window_size.x, window_size.y);
window.setView(sf::View(visible_area));
- } else if(event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) {
- current_page = previous_page;
}
}