92
90
void applyProfileToView(TerminalDisplay* view , const Profile::Ptr profile);
95
* Applies the container-specific settings associated with specified @p
96
* profile to the view container @p container.
98
void applyProfileToContainer(ViewContainer* container , const Profile::Ptr profile);
101
93
* Return the main widget for the view manager which
102
94
* holds all of the views managed by this ViewManager instance.
128
* This enum describes where newly created tab should be placed.
130
enum NewTabBehavior {
131
/** Put newly created tab at the end. */
132
PutNewTabAtTheEnd = 0,
133
/** Put newly created tab right after current tab. */
134
PutNewTabAfterCurrentTab = 1
137
138
* Sets the type of widget provided to navigate between open sessions
138
139
* in a container. The changes will only apply to newly created containers.
165
166
void saveSessions(KConfigGroup& group);
166
167
void restoreSessions(const KConfigGroup& group);
169
void setNavigationVisibility(int visibility);
170
void setNavigationPosition(int position);
171
void setNavigationBehavior(int behavior);
172
void setNavigationStyleSheet(const QString& styleSheet);
173
void setShowQuickButtons(bool show);
175
int managerId() const;
169
178
/** Emitted when the last view is removed from the view manager */
218
227
/** DBus slot that returns the number of sessions in the current view. */
228
Q_SCRIPTABLE int sessionCount();
221
230
/** DBus slot that returns the current (active) session window */
222
int currentSession();
231
Q_SCRIPTABLE int currentSession();
224
233
/** DBus slot that creates a new session in the current view.
225
234
* @param profile the name of the profile to be used
226
235
* @param directory the working directory where the session is
229
int newSession(QString profile, QString directory);
238
Q_SCRIPTABLE int newSession(QString profile, QString directory);
240
// TODO: its semantic is application-wide. Move it to more appropriate place
241
// DBus slot that returns the name of default profile
242
Q_SCRIPTABLE QString defaultProfile();
244
// TODO: its semantic is application-wide. Move it to more appropriate place
231
245
// DBus slot that returns a string list of defined (known) profiles
232
QStringList profileList();
246
Q_SCRIPTABLE QStringList profileList();
234
248
/** DBus slot that creates a new session in the current view with the associated
235
249
* default profile and the default working directory
251
Q_SCRIPTABLE int newSession();
239
253
/** DBus slot that changes the view port to the next session */
254
Q_SCRIPTABLE void nextSession();
242
256
/** DBus slot that changes the view port to the previous session */
257
Q_SCRIPTABLE void prevSession();
245
259
/** DBus slot that switches the current session (as returned by
246
260
* currentSession()) with the left (or previous) one in the
247
261
* navigation tab.
249
void moveSessionLeft();
263
Q_SCRIPTABLE void moveSessionLeft();
251
265
/** DBus slot that Switches the current session (as returned by
252
266
* currentSession()) with the right (or next) one in the navigation
255
void moveSessionRight();
269
Q_SCRIPTABLE void moveSessionRight();
257
271
/** DBus slot that sets ALL tabs' width to match their text */
258
void setTabWidthToText(bool);
272
Q_SCRIPTABLE void setTabWidthToText(bool);
261
275
// called when the "Split View Left/Right" menu item is selected
262
276
void splitLeftRight();
263
277
void splitTopBottom();
264
void closeActiveView();
265
void closeOtherViews();
266
void expandActiveView();
267
void shrinkActiveView();
278
void closeActiveContainer();
279
void closeOtherContainers();
280
void expandActiveContainer();
281
void shrinkActiveContainer();
269
283
// called when the "Detach View" menu item is selected
270
284
void detachActiveView();
273
287
// called when a session terminates - the view manager will delete any
274
288
// views associated with the session
275
289
void sessionFinished();
276
// called when the container requests to close a particular view
277
void viewCloseRequest(QWidget* widget);
290
// called when one view has been destroyed
291
void viewDestroyed(QWidget* widget);
279
293
// controller detects when an associated view is given the focus
280
294
// and emits a signal. ViewManager listens for that signal
284
298
// called when the active view in a ViewContainer changes, so
285
299
// that we can plug the appropriate actions into the UI
286
void viewActivated( QWidget* view );
300
void viewActivated(QWidget* view);
288
302
// called when "Next View" shortcut is activated
329
343
void createView(Session* session, ViewContainer* container, int index);
330
const ColorScheme* colorSchemeForProfile(const Profile::Ptr profile) const;
344
static const ColorScheme* colorSchemeForProfile(const Profile::Ptr profile);
332
346
void setupActions();
333
347
void focusActiveView();
334
void registerView(TerminalDisplay* view);
335
void unregisterView(TerminalDisplay* view);
337
349
// takes a view from a view container owned by a different manager and places it in
338
350
// newContainer owned by this manager
339
void takeView(ViewManager* otherManager , ViewContainer* otherContainer, ViewContainer* newContainer, TerminalDisplay* view);
351
void takeView(ViewManager* otherManager , ViewContainer* otherContainer, ViewContainer* newContainer, TerminalDisplay* view);
340
352
void splitView(Qt::Orientation orientation);
342
354
// creates a new container which can hold terminal displays
343
// 'profile' specifies the profile to use to get initial
344
// settings (eg. navigation position) for the container
345
ViewContainer* createContainer(const Profile::Ptr profile);
355
ViewContainer* createContainer();
346
356
// removes a container and emits appropriate signals
347
357
void removeContainer(ViewContainer* container);
356
366
// about the session ( such as title and associated icon ) to the display.
357
367
SessionController* createController(Session* session , TerminalDisplay* display);
359
// create menu for 'new tab' button
360
QMenu* createNewViewMenu();
362
370
QPointer<ViewSplitter> _viewSplitter;
363
371
QPointer<SessionController> _pluggedController;
365
QHash<TerminalDisplay*,Session*> _sessionMap;
373
QHash<TerminalDisplay*, Session*> _sessionMap;
367
375
KActionCollection* _actionCollection;
368
376
QSignalMapper* _containerSignalMapper;
369
NavigationMethod _navigationMethod;
378
NavigationMethod _navigationMethod;
380
ViewContainer::NavigationVisibility _navigationVisibility;
381
ViewContainer::NavigationPosition _navigationPosition;
382
bool _showQuickButtons;
383
NewTabBehavior _newTabBehavior;
384
QString _navigationStyleSheet;
387
static int lastManagerId;