• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Konsole

  • kde-4.14
  • applications
  • konsole
  • src
MainWindow.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2008 by Robert Knight <robertknight@gmail.com>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301 USA.
18 */
19 
20 #ifndef MAINWINDOW_H
21 #define MAINWINDOW_H
22 
23 // Qt
24 #include <QtCore/QPointer>
25 
26 // KDE
27 #include <KXmlGuiWindow>
28 #include <KUrl>
29 
30 // Konsole
31 #include "Profile.h"
32 
33 class KAction;
34 class KActionMenu;
35 class KToggleAction;
36 
37 namespace Konsole
38 {
39 class IncrementalSearchBar;
40 class ViewManager;
41 class ViewProperties;
42 class Session;
43 class SessionController;
44 class ProfileList;
45 class BookmarkHandler;
46 
57 class MainWindow : public KXmlGuiWindow
58 {
59  Q_OBJECT
60 
61 public:
66  MainWindow();
67 
72  ViewManager* viewManager() const;
73 
81  Session* createSession(Profile::Ptr profile, const QString& directory);
82 
89  Session* createSSHSession(Profile::Ptr profile, const KUrl& url);
90 
94  void createView(Session* session);
95 
99  void setFocus();
100 
104  void setMenuBarInitialVisibility(bool visible);
105 
106  void setNavigationVisibility(int visibility);
107  void setNavigationPosition(int position);
108  void setNavigationStyleSheet(const QString& stylesheet);
109  void setNavigationStyleSheetFromFile(const KUrl& stylesheetfile);
110  void setNavigationBehavior(int behavior);
111  void setShowQuickButtons(bool show);
112 
113 signals:
114 
125  void newWindowRequest(Profile::Ptr profile,
126  const QString& directory);
127 
131  void viewDetached(Session* session);
132 
133 protected:
134  // Reimplemented for internal reasons.
135  virtual void showEvent(QShowEvent* event);
136 
137  // reimplemented from KMainWindow
138  virtual bool queryClose();
139  virtual void saveProperties(KConfigGroup& group);
140  virtual void readProperties(const KConfigGroup& group);
141  virtual void saveGlobalProperties(KConfig* config);
142  virtual void readGlobalProperties(KConfig* config);
143 
144  // reimplemented from QWidget
145  virtual bool focusNextPrevChild(bool next);
146 
147 private slots:
148  void newTab();
149  void cloneTab();
150  void newWindow();
151  void showManageProfilesDialog();
152  void activateMenuBar();
153  void showSettingsDialog();
154  void showShortcutsDialog();
155  void newFromProfile(Profile::Ptr profile);
156  void activeViewChanged(SessionController* controller);
157  void disconnectController(SessionController* controller);
158  void activeViewTitleChanged(ViewProperties*);
159 
160  void profileListChanged(const QList<QAction*>& actions);
161  void configureNotifications();
162 
163  void updateWindowIcon();
164  void updateWindowCaption();
165 
166  void openUrls(const QList<KUrl>& urls);
167 
168  // Sets the list of profiles to be displayed under the "New Tab" action
169  void setProfileList(ProfileList* list);
170 
171  void applyKonsoleSettings();
172 
173 public slots:
174  void viewFullScreen(bool fullScreen);
175 
176 private:
177  void correctStandardShortcuts();
178  void rememberMenuAccelerators();
179  void removeMenuAccelerators();
180  void restoreMenuAccelerators();
181  void setupActions();
182  void setupMainWidget();
183  QString activeSessionDir() const;
184 
191  IncrementalSearchBar* searchBar() const;
192 
196  BookmarkHandler* bookmarkHandler() const;
197 
198  // sets the active shortcuts of actions in 'dest' to the shortcuts of actions
199  // with the same name in 'source' (see KAction::ActiveShortcut)
200  static void syncActiveShortcuts(KActionCollection* dest, const KActionCollection* source);
201 
202 private:
203  ViewManager* _viewManager;
204  BookmarkHandler* _bookmarkHandler;
205  KToggleAction* _toggleMenuBarAction;
206  KActionMenu* _newTabMenuAction;
207 
208  QPointer<SessionController> _pluggedController;
209 
210  bool _menuBarInitialVisibility;
211  bool _menuBarInitialVisibilityApplied;
212 };
213 }
214 
215 #endif // MAINWINDOW_H
Konsole::MainWindow::saveGlobalProperties
virtual void saveGlobalProperties(KConfig *config)
Definition: MainWindow.cpp:614
Konsole::MainWindow::showEvent
virtual void showEvent(QShowEvent *event)
Definition: MainWindow.cpp:809
Konsole::Session
Represents a terminal session consisting of a pseudo-teletype and a terminal emulation.
Definition: Session.h:78
Konsole::SessionController
Provides the menu actions to manipulate a single terminal session and view pair.
Definition: SessionController.h:85
Konsole::MainWindow::focusNextPrevChild
virtual bool focusNextPrevChild(bool next)
Definition: MainWindow.cpp:826
Konsole::MainWindow::newWindowRequest
void newWindowRequest(Profile::Ptr profile, const QString &directory)
Emitted by the main window to request the creation of a new session in a new window.
Konsole::MainWindow::setNavigationPosition
void setNavigationPosition(int position)
Definition: MainWindow.cpp:724
Konsole::MainWindow::setMenuBarInitialVisibility
void setMenuBarInitialVisibility(bool visible)
Set the initial visibility of the menubar.
Definition: MainWindow.cpp:805
QPointer
Konsole::ProfileList
ProfileList provides a list of actions which represent session profiles that a SessionManager can cre...
Definition: ProfileList.h:51
Konsole::MainWindow::createSSHSession
Session * createSSHSession(Profile::Ptr profile, const KUrl &url)
create a new SSH session.
Definition: MainWindow.cpp:490
Konsole::MainWindow::setNavigationStyleSheetFromFile
void setNavigationStyleSheetFromFile(const KUrl &stylesheetfile)
Definition: MainWindow.cpp:739
Konsole::ViewManager
Manages the terminal display widgets in a Konsole window or part.
Definition: ViewManager.h:66
Konsole::MainWindow::createView
void createView(Session *session)
create view for the specified session
Definition: MainWindow.cpp:519
KXmlGuiWindow
Konsole::MainWindow::readProperties
virtual void readProperties(const KConfigGroup &group)
Definition: MainWindow.cpp:609
QShowEvent
Konsole::BookmarkHandler
This class handles the communication between the bookmark menu and the active session, providing a suggested title and URL when the user clicks the "Add Bookmark" item in the bookmarks menu.
Definition: BookmarkHandler.h:52
Konsole::MainWindow::viewManager
ViewManager * viewManager() const
Returns the view manager associated with this window.
Definition: MainWindow.cpp:201
Konsole::MainWindow::MainWindow
MainWindow()
Constructs a new main window.
Definition: MainWindow.cpp:73
Konsole::MainWindow::saveProperties
virtual void saveProperties(KConfigGroup &group)
Definition: MainWindow.cpp:604
Konsole::MainWindow::viewDetached
void viewDetached(Session *session)
Emitted when a view for one session is detached from this window.
Konsole::MainWindow::viewFullScreen
void viewFullScreen(bool fullScreen)
Definition: MainWindow.cpp:362
QString
QList
Konsole::MainWindow
The main window.
Definition: MainWindow.h:57
Konsole::ViewProperties
Encapsulates user-visible information about the terminal session currently being displayed in a view...
Definition: ViewProperties.h:44
Konsole::IncrementalSearchBar
A widget which allows users to search incrementally through a document for a a text string or regular...
Definition: IncrementalSearchBar.h:56
Konsole::Profile::Ptr
KSharedPtr< Profile > Ptr
Definition: Profile.h:67
Konsole::MainWindow::setNavigationBehavior
void setNavigationBehavior(int behavior)
Definition: MainWindow.cpp:734
Konsole::MainWindow::readGlobalProperties
virtual void readGlobalProperties(KConfig *config)
Definition: MainWindow.cpp:619
Konsole::MainWindow::setFocus
void setFocus()
Helper method to make this window get input focus.
Definition: MainWindow.cpp:524
Konsole::MainWindow::setShowQuickButtons
void setShowQuickButtons(bool show)
Definition: MainWindow.cpp:761
Konsole::MainWindow::setNavigationVisibility
void setNavigationVisibility(int visibility)
Definition: MainWindow.cpp:719
Konsole::MainWindow::createSession
Session * createSession(Profile::Ptr profile, const QString &directory)
Create a new session.
Definition: MainWindow.cpp:469
Konsole::MainWindow::queryClose
virtual bool queryClose()
Definition: MainWindow.cpp:535
Profile.h
Konsole::MainWindow::setNavigationStyleSheet
void setNavigationStyleSheet(const QString &stylesheet)
Definition: MainWindow.cpp:729
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal