63
* Constructs a new main window. Do not create new main windows directly, use Application's
64
* newMainWindow() method instead.
69
* Returns the view manager associated with this window. The view manager can be used to
70
* create new views on particular session objects inside this window.
72
ViewManager* viewManager() const;
75
* Returns the search bar.
77
* This is a convenience method. The search bar is actually owned by
78
* ViewManager, or more precisely, by ViewContainer.
80
IncrementalSearchBar* searchBar() const;
82
/** Sets the list of sessions to be displayed in the File menu */
83
void setSessionList(ProfileList* list);
86
* Returns the bookmark handler associated with this window.
88
BookmarkHandler* bookmarkHandler() const;
91
* Sets the default profile for this window.
92
* This is the default value for the profile argument
93
* when the newSessionRequest() and newWindow() signals
96
void setDefaultProfile(Profile::Ptr profile);
99
* Returns the default profile for this window.
100
* See setDefaultProfile()
102
Profile::Ptr defaultProfile() const;
106
* Emitted by the main window to request the creation of a new session.
108
* @param profile The profile to use to create the new session.
109
* @param directory Initial working directory for the new session or empty
110
* if the default working directory associated with the profile should be used.
111
* @param view The view manager owned by this main window
113
void newSessionRequest(Profile::Ptr profile,
114
const QString& directory,
118
* Emitted by the main window to request the creation of a new SSH session.
120
* @param profile The profile to use to create the new session.
121
* @param url URL for the new session
122
* @param view The view manager owned by this main window
124
void newSSHSessionRequest(Profile::Ptr profile,
129
* Emitted by the main window to request the creation of a
130
* new session in a new window.
132
* @param profile The profile to use to create the
133
* first session in the new window.
134
* @param directory Initial working directory for the new window or empty
135
* if the default working directory associated with the profile should
138
void newWindowRequest(Profile::Ptr profile,
139
const QString& directory);
142
* Emitted by the main window to request the current session to close.
144
void closeActiveSessionRequest();
147
// Reimplemented for internal reasons.
148
virtual void showEvent(QShowEvent* event);
150
// reimplemented from KMainWindow
151
virtual bool queryClose();
152
virtual void saveProperties(KConfigGroup& group);
153
virtual void readProperties(const KConfigGroup& group);
154
virtual void saveGlobalProperties(KConfig* config);
155
virtual void readGlobalProperties(KConfig* config);
157
// reimplemented from QWidget
158
virtual bool focusNextPrevChild( bool next );
163
void showManageProfilesDialog();
164
void activateMenuBar();
165
void showShortcutsDialog();
166
void newFromProfile(Profile::Ptr profile);
167
void activeViewChanged(SessionController* controller);
168
void disconnectController(SessionController* controller);
169
void activeViewTitleChanged(ViewProperties*);
171
void sessionListChanged(const QList<QAction*>& actions);
172
void viewFullScreen(bool fullScreen);
173
void configureNotifications();
175
// single shot call to set the initial visibility of the menu bar.
176
// Has no effect if the menu bar is a MacOS-style top-level menu
177
void setMenuBarInitialVisibility(bool visible);
179
void setSaveGeometryOnExit(bool visible);
181
void updateWindowIcon();
183
void openUrls(const QList<KUrl>& urls);
186
void correctShortcuts();
187
void removeMenuAccelerators();
190
QString activeSessionDir() const;
192
// sets the active shortcuts of actions in 'dest' to the shortcuts of actions
193
// with the same name in 'source' (see KAction::ActiveShortcut)
194
static void syncActiveShortcuts(KActionCollection* dest, const KActionCollection* source);
197
ViewManager* _viewManager;
198
BookmarkHandler* _bookmarkHandler;
199
KToggleAction* _toggleMenuBarAction;
200
KActionMenu* _newTabMenuAction;
202
QPointer<SessionController> _pluggedController;
204
Profile::Ptr _defaultProfile;
206
bool _menuBarInitialVisibility;
207
bool _menuBarInitialVisibilitySet;
208
bool _menuBarInitialVisibilityApplied;
63
* Constructs a new main window. Do not create new main windows directly, use Application's
64
* newMainWindow() method instead.
69
* Returns the view manager associated with this window. The view manager can be used to
70
* create new views on particular session objects inside this window.
72
ViewManager* viewManager() const;
75
* Create a new session.
77
* @param profile The profile to use to create the new session.
78
* @param directory Initial working directory for the new session or empty
79
* if the default working directory associated with the profile should be used.
81
Session* createSession(Profile::Ptr profile, const QString& directory);
84
* create a new SSH session.
86
* @param profile The profile to use to create the new session.
87
* @param url the URL representing the new SSH connection
89
Session* createSSHSession(Profile::Ptr profile, const KUrl& url);
92
* create view for the specified session
94
void createView(Session* session);
97
* Helper method to make this window get input focus
102
* Set the initial visibility of the menubar.
104
void setMenuBarInitialVisibility(bool visible);
106
void setNavigationVisibility(int visibility);
107
void setNavigationPosition(int position);
108
void setNavigationStyleSheet(const QString& stylesheet);
109
void setNavigationBehavior(int behavior);
110
void setShowQuickButtons(bool show);
115
* Emitted by the main window to request the creation of a
116
* new session in a new window.
118
* @param profile The profile to use to create the
119
* first session in the new window.
120
* @param directory Initial working directory for the new window or empty
121
* if the default working directory associated with the profile should
124
void newWindowRequest(Profile::Ptr profile,
125
const QString& directory);
128
* Emitted when a view for one session is detached from this window
130
void viewDetached(Session* session);
133
// Reimplemented for internal reasons.
134
virtual void showEvent(QShowEvent* event);
136
// reimplemented from KMainWindow
137
virtual bool queryClose();
138
virtual void saveProperties(KConfigGroup& group);
139
virtual void readProperties(const KConfigGroup& group);
140
virtual void saveGlobalProperties(KConfig* config);
141
virtual void readGlobalProperties(KConfig* config);
143
// reimplemented from QWidget
144
virtual bool focusNextPrevChild(bool next);
150
void showManageProfilesDialog();
151
void activateMenuBar();
152
void showSettingsDialog();
153
void showShortcutsDialog();
154
void newFromProfile(Profile::Ptr profile);
155
void activeViewChanged(SessionController* controller);
156
void disconnectController(SessionController* controller);
157
void activeViewTitleChanged(ViewProperties*);
159
void profileListChanged(const QList<QAction*>& actions);
160
void viewFullScreen(bool fullScreen);
161
void configureNotifications();
163
void setSaveGeometryOnExit(bool visible);
165
void updateWindowIcon();
166
void updateWindowCaption();
168
void openUrls(const QList<KUrl>& urls);
170
// Sets the list of profiles to be displayed under the "New Tab" action
171
void setProfileList(ProfileList* list);
173
void applyKonsoleSettings();
176
void correctStandardShortcuts();
177
void rememberMenuAccelerators();
178
void removeMenuAccelerators();
179
void restoreMenuAccelerators();
181
void setupMainWidget();
182
QString activeSessionDir() const;
185
* Returns the search bar.
187
* This is a convenience method. The search bar is actually owned by
188
* ViewManager, or more precisely, by ViewContainer.
190
IncrementalSearchBar* searchBar() const;
193
* Returns the bookmark handler associated with this window.
195
BookmarkHandler* bookmarkHandler() const;
197
// sets the active shortcuts of actions in 'dest' to the shortcuts of actions
198
// with the same name in 'source' (see KAction::ActiveShortcut)
199
static void syncActiveShortcuts(KActionCollection* dest, const KActionCollection* source);
202
ViewManager* _viewManager;
203
BookmarkHandler* _bookmarkHandler;
204
KToggleAction* _toggleMenuBarAction;
205
KActionMenu* _newTabMenuAction;
207
QPointer<SessionController> _pluggedController;
209
bool _menuBarInitialVisibility;
210
bool _menuBarInitialVisibilityApplied;
213
#endif // KONSOLEMAINWINDOW_H
214
#endif // MAINWINDOW_H