From 4c762b2516bc664293c2aec072074f1e34dda8c3 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 18 Mar 2025 21:19:28 +0530 Subject: Remove all the ui bits because screw it, lets unix a bit more --- include/InputMediator.hpp | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'include/InputMediator.hpp') diff --git a/include/InputMediator.hpp b/include/InputMediator.hpp index 6025536..4aaa6c1 100644 --- a/include/InputMediator.hpp +++ b/include/InputMediator.hpp @@ -5,60 +5,24 @@ #include "LuaRuntime.hpp" #include "utils.hpp" -#include "widgets/InputLine.hpp" #include "widgets/WebViewStack.hpp" -// TODO: Rethink evaluation -class EvaluationType { -public: - EvaluationType() {} - virtual ~EvaluationType() = default; -}; -class NoopEval : public EvaluationType {}; - class InputMediator : public QObject { Q_OBJECT public: - InputMediator(InputLine *inputLine, WebViewStack *webViewStack, - LuaRuntime *luaRuntime); - - void showURLInput(QString url = "", OpenType openType = OpenType::OpenUrl); - void showCommandInput(QString command = ""); - void showTabsInput(QString command = ""); - void hideInputLine(); + InputMediator(WebViewStack *webViewStack, LuaRuntime *luaRuntime); DELEGATE(webViewStack, openUrl, openUrl) DELEGATE(webViewStack, currentUrl, currentUrl) DELEGATE(webViewStack, next, nextWebView) DELEGATE(webViewStack, previous, previousWebView) DELEGATE(webViewStack, closeCurrent, closeCurrentWebView) - DELEGATE(inputLine, getInputText, getInputText) private: - void showInputLine(); void evaluateCommand(QString command); - void setEvaluationType(EvaluationType *); - -private slots: - void onInputSubmit(QString input); private: - InputLine *inputLine; WebViewStack *webViewStack; LuaRuntime *luaRuntime; - EvaluationType *currentEvaluationType = new NoopEval(); -}; - -class UrlEval : public EvaluationType { -public: - UrlEval(OpenType type) : EvaluationType(), openType(type) {} - OpenType type() { return openType; } - -private: - OpenType openType; }; - -class CommandEval : public EvaluationType {}; - -class TabsEval : public EvaluationType {}; -- cgit v1.3.1