Changeset View
Changeset View
Standalone View
Standalone View
krusader/GUI/kcmdline.h
Show All 39 Lines | |||||
40 | class KCMDModeButton; | 40 | class KCMDModeButton; | ||
41 | 41 | | |||
42 | class CmdLineCombo : public KHistoryComboBox | 42 | class CmdLineCombo : public KHistoryComboBox | ||
43 | { | 43 | { | ||
44 | Q_OBJECT | 44 | Q_OBJECT | ||
45 | public: | 45 | public: | ||
46 | explicit CmdLineCombo(QWidget *parent); | 46 | explicit CmdLineCombo(QWidget *parent); | ||
47 | 47 | | |||
48 | bool eventFilter(QObject *watched, QEvent *e) Q_DECL_OVERRIDE; | 48 | bool eventFilter(QObject *watched, QEvent *e) override; | ||
49 | 49 | | |||
50 | QString path() { | 50 | QString path() { | ||
51 | return _path; | 51 | return _path; | ||
52 | } | 52 | } | ||
53 | void setPath(QString path); | 53 | void setPath(QString path); | ||
54 | 54 | | |||
55 | signals: | 55 | signals: | ||
56 | void returnToPanel(); | 56 | void returnToPanel(); | ||
57 | 57 | | |||
58 | protected slots: | 58 | protected slots: | ||
59 | void doLayout(); | 59 | void doLayout(); | ||
60 | 60 | | |||
61 | protected: | 61 | protected: | ||
62 | void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; | 62 | void resizeEvent(QResizeEvent *e) override; | ||
63 | void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE; | 63 | void keyPressEvent(QKeyEvent *e) override; | ||
64 | 64 | | |||
65 | void updateLineEditGeometry(); | 65 | void updateLineEditGeometry(); | ||
66 | 66 | | |||
67 | QLabel *_pathLabel; | 67 | QLabel *_pathLabel; | ||
68 | QString _path; | 68 | QString _path; | ||
69 | bool _handlingLineEditResize; | 69 | bool _handlingLineEditResize; | ||
70 | }; | 70 | }; | ||
71 | 71 | | |||
72 | 72 | | |||
73 | class KCMDLine : public QWidget, KrActionBase | 73 | class KCMDLine : public QWidget, KrActionBase | ||
74 | { | 74 | { | ||
75 | Q_OBJECT | 75 | Q_OBJECT | ||
76 | public: | 76 | public: | ||
77 | explicit KCMDLine(QWidget *parent = nullptr); | 77 | explicit KCMDLine(QWidget *parent = nullptr); | ||
78 | ~KCMDLine() override; | 78 | ~KCMDLine() override; | ||
79 | void setCurrent(const QString &path); | 79 | void setCurrent(const QString &path); | ||
80 | //virtual methods from KrActionBase | 80 | //virtual methods from KrActionBase | ||
81 | void setText(const QString& text); | 81 | void setText(const QString& text); | ||
82 | QString command() const Q_DECL_OVERRIDE; | 82 | QString command() const override; | ||
83 | ExecType execType() const Q_DECL_OVERRIDE; | 83 | ExecType execType() const override; | ||
84 | QString startpath() const Q_DECL_OVERRIDE; | 84 | QString startpath() const override; | ||
85 | QString user() const Q_DECL_OVERRIDE; | 85 | QString user() const override; | ||
86 | QString text() const Q_DECL_OVERRIDE; | 86 | QString text() const override; | ||
87 | bool acceptURLs() const Q_DECL_OVERRIDE; | 87 | bool acceptURLs() const override; | ||
88 | bool confirmExecution() const Q_DECL_OVERRIDE; | 88 | bool confirmExecution() const override; | ||
89 | bool doSubstitution() const Q_DECL_OVERRIDE; | 89 | bool doSubstitution() const override; | ||
90 | 90 | | |||
91 | signals: | 91 | signals: | ||
92 | void signalRun(); | 92 | void signalRun(); | ||
93 | 93 | | |||
94 | public slots: | 94 | public slots: | ||
95 | void slotReturnFocus(); // returns keyboard focus to panel | 95 | void slotReturnFocus(); // returns keyboard focus to panel | ||
96 | void slotRun(); | 96 | void slotRun(); | ||
97 | void addPlaceholder(); | 97 | void addPlaceholder(); | ||
98 | void addText(const QString& text) { | 98 | void addText(const QString& text) { | ||
99 | cmdLine->lineEdit()->setText(cmdLine->lineEdit()->text() + text); | 99 | cmdLine->lineEdit()->setText(cmdLine->lineEdit()->text() + text); | ||
100 | } | 100 | } | ||
101 | void popup() { | 101 | void popup() { | ||
102 | cmdLine->showPopup(); | 102 | cmdLine->showPopup(); | ||
103 | } | 103 | } | ||
104 | 104 | | |||
105 | protected: | 105 | protected: | ||
106 | void focusInEvent(QFocusEvent*) Q_DECL_OVERRIDE { | 106 | void focusInEvent(QFocusEvent*) override { | ||
107 | cmdLine->setFocus(); | 107 | cmdLine->setFocus(); | ||
108 | } | 108 | } | ||
109 | 109 | | |||
110 | void calcLabelSize(); | 110 | void calcLabelSize(); | ||
111 | 111 | | |||
112 | private: | 112 | private: | ||
113 | CmdLineCombo *cmdLine; | 113 | CmdLineCombo *cmdLine; | ||
114 | KCMDModeButton *terminal; | 114 | KCMDModeButton *terminal; | ||
115 | QToolButton *buttonAddPlaceholder; | 115 | QToolButton *buttonAddPlaceholder; | ||
116 | KShellCompletion completion; | 116 | KShellCompletion completion; | ||
117 | }; | 117 | }; | ||
118 | 118 | | |||
119 | #endif | 119 | #endif |