PIVX Core  5.6.99
P2P Digital Currency
consolewidget.h
Go to the documentation of this file.
1 // Copyright (c) 2019-2021 The PIVX Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef PIVX_QT_SETTINGS_CONSOLEWIDGET_H
6 #define PIVX_QT_SETTINGS_CONSOLEWIDGET_H
7 
8 #include "guiutil.h"
9 #include "net.h"
10 #include "pwidget.h"
11 #include <QCompleter>
12 #include <QWidget>
13 
14 class ClientModel;
15 class RPCTimerInterface;
16 
17 namespace Ui {
19 }
20 
21 QT_BEGIN_NAMESPACE
22 class QMenu;
23 class QItemSelection;
24 QT_END_NAMESPACE
25 
27 {
28  Q_OBJECT
29 
30 public:
31  explicit SettingsConsoleWidget(PIVXGUI* _window, QWidget *parent = nullptr);
33 
34  void loadClientModel() override;
35  void showEvent(QShowEvent *event) override;
36 
37 public Q_SLOTS:
38  void clear(bool clearHistory = true);
39  void response(int category, const QString &message) { messageInternal(category, message); };
40  void messageInternal(int category, const QString &message, bool html = false);
42  void browseHistory(int offset);
44  void scrollToEnd();
45  void onCommandsClicked();
46 
47 protected:
48  virtual bool eventFilter(QObject* obj, QEvent* event) override;
49 
50 protected Q_SLOTS:
51  void changeTheme(bool isLightTheme, QString &theme) override;
52 
53 Q_SIGNALS:
54  // For RPC command executor
55  void stopExecutor();
56  void cmdCommandRequest(const QString& command);
57 
58 private:
59  Ui::SettingsConsoleWidget *ui;
60 
61  QStringList history;
64  QCompleter *autoCompleter;
65 
66  void startExecutor();
67 
68 private Q_SLOTS:
70 
71 
72 };
73 
74 #endif // PIVX_QT_SETTINGS_CONSOLEWIDGET_H
Model for PIVX network client.
Definition: clientmodel.h:50
PIVX GUI main class.
Definition: pivxgui.h:46
void message(const QString &title, const QString &body, unsigned int style, bool *ret=nullptr)
RPC timer "driver".
Definition: server.h:104
Ui::SettingsConsoleWidget * ui
Definition: consolewidget.h:59
void messageInternal(int category, const QString &message, bool html=false)
RPCTimerInterface * rpcTimerInterface
Definition: consolewidget.h:63
SettingsConsoleWidget(PIVXGUI *_window, QWidget *parent=nullptr)
void clear(bool clearHistory=true)
QCompleter * autoCompleter
Definition: consolewidget.h:64
void loadClientModel() override
void cmdCommandRequest(const QString &command)
void changeTheme(bool isLightTheme, QString &theme) override
virtual bool eventFilter(QObject *obj, QEvent *event) override
void scrollToEnd()
Scroll console view to end.
void browseHistory(int offset)
Go forward or back in history.
void showEvent(QShowEvent *event) override
void response(int category, const QString &message)
Definition: consolewidget.h:39
bool isLightTheme()
Definition: qtutils.cpp:210