Changeset View
Changeset View
Standalone View
Standalone View
src/ViewManager.h
Show All 33 Lines | |||||
34 | namespace Konsole { | 34 | namespace Konsole { | ||
35 | class ColorScheme; | 35 | class ColorScheme; | ||
36 | class Session; | 36 | class Session; | ||
37 | class TerminalDisplay; | 37 | class TerminalDisplay; | ||
38 | class TabbedViewContainer; | 38 | class TabbedViewContainer; | ||
39 | class SessionController; | 39 | class SessionController; | ||
40 | class ViewProperties; | 40 | class ViewProperties; | ||
41 | class ViewSplitter; | 41 | class ViewSplitter; | ||
42 | class TabbedViewContainer; | ||||
42 | 43 | | |||
43 | /** | 44 | /** | ||
44 | * Manages the terminal display widgets in a Konsole window or part. | 45 | * Manages the terminal display widgets in a Konsole window or part. | ||
45 | * | 46 | * | ||
46 | * When a view manager is created, it constructs a splitter widget ( accessed via | 47 | * When a view manager is created, it constructs a splitter widget ( accessed via | ||
47 | * widget() ) to hold one or more view containers. Each view container holds | 48 | * widget() ) to hold one or more view containers. Each view container holds | ||
48 | * one or more terminal displays and a navigation widget ( eg. tabs or a list ) | 49 | * one or more terminal displays and a navigation widget ( eg. tabs or a list ) | ||
49 | * to allow the user to navigate between the displays in that container. | 50 | * to allow the user to navigate between the displays in that container. | ||
Show All 22 Lines | 68 | public: | |||
72 | */ | 73 | */ | ||
73 | ViewManager(QObject *parent, KActionCollection *collection); | 74 | ViewManager(QObject *parent, KActionCollection *collection); | ||
74 | ~ViewManager() Q_DECL_OVERRIDE; | 75 | ~ViewManager() Q_DECL_OVERRIDE; | ||
75 | 76 | | |||
76 | /** | 77 | /** | ||
77 | * Creates a new view to display the output from and deliver input to @p session. | 78 | * Creates a new view to display the output from and deliver input to @p session. | ||
78 | * Constructs a new container to hold the views if no container has yet been created. | 79 | * Constructs a new container to hold the views if no container has yet been created. | ||
79 | */ | 80 | */ | ||
80 | void createView(Session *session); | 81 | void createView(TabbedViewContainer *tabWidget, Session *session); | ||
81 | 82 | | |||
82 | /** | 83 | /** | ||
83 | * Applies the view-specific settings associated with specified @p profile | 84 | * Applies the view-specific settings associated with specified @p profile | ||
84 | * to the terminal display @p view. | 85 | * to the terminal display @p view. | ||
85 | */ | 86 | */ | ||
86 | void applyProfileToView(TerminalDisplay *view, const Profile::Ptr profile); | 87 | void applyProfileToView(TerminalDisplay *view, const Profile::Ptr profile); | ||
87 | 88 | | |||
88 | /** | 89 | /** | ||
▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Line(s) | 188 | { | |||
188 | return _sessionMap.values(); | 189 | return _sessionMap.values(); | ||
189 | } | 190 | } | ||
190 | 191 | | |||
191 | /** | 192 | /** | ||
192 | * Returns whether the @p profile has the blur setting enabled | 193 | * Returns whether the @p profile has the blur setting enabled | ||
193 | */ | 194 | */ | ||
194 | static bool profileHasBlurEnabled(const Profile::Ptr profile); | 195 | static bool profileHasBlurEnabled(const Profile::Ptr profile); | ||
195 | 196 | | |||
197 | /** returns the active tab from the view | ||||
198 | */ | ||||
199 | TabbedViewContainer *activeContainer(); | ||||
200 | | ||||
196 | Q_SIGNALS: | 201 | Q_SIGNALS: | ||
197 | /** Emitted when the last view is removed from the view manager */ | 202 | /** Emitted when the last view is removed from the view manager */ | ||
198 | void empty(); | 203 | void empty(); | ||
199 | 204 | | |||
200 | /** Emitted when a session is detached from a view owned by this ViewManager */ | 205 | /** Emitted when a session is detached from a view owned by this ViewManager */ | ||
201 | void viewDetached(Session *session); | 206 | void viewDetached(Session *session); | ||
202 | 207 | | |||
203 | /** | 208 | /** | ||
Show All 30 Lines | |||||
234 | * activated. | 239 | * activated. | ||
235 | */ | 240 | */ | ||
236 | void setMenuBarVisibleRequest(bool); | 241 | void setMenuBarVisibleRequest(bool); | ||
237 | void updateWindowIcon(); | 242 | void updateWindowIcon(); | ||
238 | 243 | | |||
239 | void blurSettingChanged(bool); | 244 | void blurSettingChanged(bool); | ||
240 | 245 | | |||
241 | /** Requests creation of a new view with the default profile. */ | 246 | /** Requests creation of a new view with the default profile. */ | ||
242 | void newViewRequest(); | 247 | void newViewRequest(TabbedViewContainer *tabWidget); | ||
243 | /** Requests creation of a new view, with the selected profile. */ | 248 | /** Requests creation of a new view, with the selected profile. */ | ||
244 | void newViewRequest(Profile::Ptr); | 249 | void newViewWithProfileRequest(TabbedViewContainer *tabWidget, Profile::Ptr); | ||
245 | 250 | | |||
246 | public Q_SLOTS: | 251 | public Q_SLOTS: | ||
247 | /** DBus slot that returns the number of sessions in the current view. */ | 252 | /** DBus slot that returns the number of sessions in the current view. */ | ||
248 | Q_SCRIPTABLE int sessionCount(); | 253 | Q_SCRIPTABLE int sessionCount(); | ||
249 | 254 | | |||
250 | /** | 255 | /** | ||
251 | * DBus slot that returns the unique ids of the sessions in the | 256 | * DBus slot that returns the unique ids of the sessions in the | ||
252 | * current view. The returned list is not sorted. | 257 | * current view. The returned list is not sorted. | ||
▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Line(s) | 315 | private Q_SLOTS: | |||
370 | // in the current container | 375 | // in the current container | ||
371 | void switchToView(int index); | 376 | void switchToView(int index); | ||
372 | 377 | | |||
373 | // called when a SessionController gains focus | 378 | // called when a SessionController gains focus | ||
374 | void controllerChanged(SessionController *controller); | 379 | void controllerChanged(SessionController *controller); | ||
375 | 380 | | |||
376 | // called when a ViewContainer requests a view be | 381 | // called when a ViewContainer requests a view be | ||
377 | // moved | 382 | // moved | ||
378 | void containerMoveViewRequest(int index, int id, | 383 | void containerMoveViewRequest(int index, int sessionControllerId); | ||
379 | TabbedViewContainer *sourceTabbedContainer); | | |||
380 | 384 | | |||
381 | void detachView(TabbedViewContainer *container, QWidget *view); | 385 | void detachView(TabbedViewContainer *container, QWidget *view); | ||
382 | 386 | | |||
383 | private: | 387 | private: | ||
384 | Q_DISABLE_COPY(ViewManager) | 388 | Q_DISABLE_COPY(ViewManager) | ||
385 | 389 | | |||
386 | void createView(Session *session, TabbedViewContainer *container, int index); | 390 | void createView(Session *session, TabbedViewContainer *container, int index); | ||
387 | static const ColorScheme *colorSchemeForProfile(const Profile::Ptr profile); | 391 | static const ColorScheme *colorSchemeForProfile(const Profile::Ptr profile); | ||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |