From 421a46e3d3036ea0dea4889125ee58309d0ed21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 30 Jun 2014 02:02:57 +0200 Subject: Redo the console window. Log is now a page. Console window has relevant pages. Dirty fix for screenshot thumbnail generation. Needs more QTimer. --- gui/ConsoleWindow.h | 45 +++++++-------------------------------------- 1 file changed, 7 insertions(+), 38 deletions(-) (limited to 'gui/ConsoleWindow.h') diff --git a/gui/ConsoleWindow.h b/gui/ConsoleWindow.h index 17c64392..97600baa 100644 --- a/gui/ConsoleWindow.h +++ b/gui/ConsoleWindow.h @@ -19,18 +19,15 @@ #include #include "logic/MinecraftProcess.h" -namespace Ui -{ -class ConsoleWindow; -} - +class QPushButton; +class PageContainer; class ConsoleWindow : public QMainWindow { Q_OBJECT public: explicit ConsoleWindow(MinecraftProcess *proc, QWidget *parent = 0); - ~ConsoleWindow(); + virtual ~ConsoleWindow() {}; /** * @brief specify if the window is allowed to close @@ -39,38 +36,12 @@ public: */ void setMayClose(bool mayclose); -private: - /** - * @brief write a colored paragraph - * @param data the string - * @param color the css color name - * this will only insert a single paragraph. - * \n are ignored. a real \n is always appended. - */ - void writeColor(QString text, const char *color, const char *background); - signals: void isClosing(); -public -slots: - /** - * @brief write a string - * @param data the string - * @param mode the WriteMode - * lines have to be put through this as a whole! - */ - void write(QString data, MessageLevel::Enum level = MessageLevel::MultiMC); - - /** - * @brief clear the text widget - */ - void clear(); - private slots: void on_closeButton_clicked(); - void on_btnScreenshots_clicked(); void on_btnKillMinecraft_clicked(); void onEnded(InstancePtr instance, int code, QProcess::ExitStatus status); @@ -79,18 +50,16 @@ slots: // FIXME: add handlers for the other MinecraftProcess signals (pre/post launch command // failures) - void on_btnPaste_clicked(); void iconActivated(QSystemTrayIcon::ActivationReason); void toggleConsole(); protected: void closeEvent(QCloseEvent *); private: - Ui::ConsoleWindow *ui = nullptr; - MinecraftProcess *proc = nullptr; + MinecraftProcess *m_proc = nullptr; bool m_mayclose = true; - int m_last_scroll_value = 0; - bool m_scroll_active = true; QSystemTrayIcon *m_trayIcon = nullptr; - int m_saved_offset = 0; + PageContainer *m_container = nullptr; + QPushButton *m_closeButton = nullptr; + QPushButton *m_killButton = nullptr; }; -- cgit v1.2.3