diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-06-30 02:02:57 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-06-30 02:02:57 +0200 |
commit | 421a46e3d3036ea0dea4889125ee58309d0ed21e (patch) | |
tree | b3665ec5c94c991c7dba5436580ffd4047395aa8 /gui/ConsoleWindow.h | |
parent | 5179aed3a066dfc9885a75d36a0e64c48aa448f7 (diff) | |
download | MultiMC-421a46e3d3036ea0dea4889125ee58309d0ed21e.tar MultiMC-421a46e3d3036ea0dea4889125ee58309d0ed21e.tar.gz MultiMC-421a46e3d3036ea0dea4889125ee58309d0ed21e.tar.lz MultiMC-421a46e3d3036ea0dea4889125ee58309d0ed21e.tar.xz MultiMC-421a46e3d3036ea0dea4889125ee58309d0ed21e.zip |
Redo the console window. Log is now a page. Console window has relevant pages.
Dirty fix for screenshot thumbnail generation. Needs more QTimer.
Diffstat (limited to 'gui/ConsoleWindow.h')
-rw-r--r-- | gui/ConsoleWindow.h | 45 |
1 files changed, 7 insertions, 38 deletions
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 <QSystemTrayIcon> #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; }; |