Changeset View
Changeset View
Standalone View
Standalone View
src/panels/terminal/terminalpanel.h
Show All 16 Lines | |||||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | ||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ | ||
19 | 19 | | |||
20 | #ifndef TERMINALPANEL_H | 20 | #ifndef TERMINALPANEL_H | ||
21 | #define TERMINALPANEL_H | 21 | #define TERMINALPANEL_H | ||
22 | 22 | | |||
23 | #include "panels/panel.h" | 23 | #include "panels/panel.h" | ||
24 | 24 | | |||
25 | #include <KPluginFactory> | ||||
26 | | ||||
25 | #include <QQueue> | 27 | #include <QQueue> | ||
26 | 28 | | |||
27 | class TerminalInterface; | 29 | class TerminalInterface; | ||
30 | class KMessageWidget; | ||||
28 | class QVBoxLayout; | 31 | class QVBoxLayout; | ||
29 | class QWidget; | 32 | class QWidget; | ||
30 | 33 | | |||
31 | namespace KIO { | 34 | namespace KIO { | ||
32 | class StatJob; | 35 | class StatJob; | ||
33 | } | 36 | } | ||
34 | 37 | | |||
35 | namespace KParts { | 38 | namespace KParts { | ||
Show All 31 Lines | 66 | signals: | |||
67 | * Is emitted if the an URL change is requested. | 70 | * Is emitted if the an URL change is requested. | ||
68 | */ | 71 | */ | ||
69 | void changeUrl(const QUrl& url); | 72 | void changeUrl(const QUrl& url); | ||
70 | 73 | | |||
71 | protected: | 74 | protected: | ||
72 | bool urlChanged() override; | 75 | bool urlChanged() override; | ||
73 | 76 | | |||
74 | void showEvent(QShowEvent* event) override; | 77 | void showEvent(QShowEvent* event) override; | ||
78 | void hideEvent(QHideEvent *event) override; | ||||
75 | 79 | | |||
76 | private slots: | 80 | private slots: | ||
77 | void slotMostLocalUrlResult(KJob* job); | 81 | void slotMostLocalUrlResult(KJob* job); | ||
78 | void slotKonsolePartCurrentDirectoryChanged(const QString& dir); | 82 | void slotKonsolePartCurrentDirectoryChanged(const QString& dir); | ||
79 | 83 | | |||
80 | private: | 84 | private: | ||
81 | enum class HistoryPolicy { | 85 | enum class HistoryPolicy { | ||
82 | AddToHistory, | 86 | AddToHistory, | ||
83 | SkipHistory | 87 | SkipHistory | ||
84 | }; | 88 | }; | ||
85 | 89 | | |||
86 | void changeDir(const QUrl& url); | 90 | void changeDir(const QUrl& url); | ||
87 | void sendCdToTerminal(const QString& path, HistoryPolicy addToHistory = HistoryPolicy::AddToHistory); | 91 | void sendCdToTerminal(const QString& path, HistoryPolicy addToHistory = HistoryPolicy::AddToHistory); | ||
88 | 92 | | |||
89 | private: | 93 | private: | ||
90 | bool m_clearTerminal; | 94 | bool m_clearTerminal; | ||
91 | KIO::StatJob* m_mostLocalUrlJob; | 95 | KIO::StatJob* m_mostLocalUrlJob; | ||
92 | 96 | | |||
93 | QVBoxLayout* m_layout; | 97 | QVBoxLayout* m_layout; | ||
94 | TerminalInterface* m_terminal; | 98 | TerminalInterface* m_terminal; | ||
95 | QWidget* m_terminalWidget; | 99 | QWidget* m_terminalWidget; | ||
96 | KParts::ReadOnlyPart* m_konsolePart; | 100 | KParts::ReadOnlyPart* m_konsolePart; | ||
97 | QString m_konsolePartCurrentDirectory; | 101 | QString m_konsolePartCurrentDirectory; | ||
98 | QQueue<QString> m_sendCdToTerminalHistory; | 102 | QQueue<QString> m_sendCdToTerminalHistory; | ||
103 | KMessageWidget* m_konsolePartMissingMessage; | ||||
104 | QTimer* m_isKonsoleInstalledTimer; | ||||
105 | | ||||
106 | KPluginFactory* konsolePartFactory(); | ||||
99 | }; | 107 | }; | ||
100 | 108 | | |||
101 | #endif // TERMINALPANEL_H | 109 | #endif // TERMINALPANEL_H |