Konsole
MainWindow.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KONSOLEMAINWINDOW_H
00021 #define KONSOLEMAINWINDOW_H
00022
00023
00024 #include <QtCore/QPointer>
00025
00026
00027 #include <KXmlGuiWindow>
00028 #include <KUrl>
00029
00030
00031 #include "Profile.h"
00032
00033 class KToggleAction;
00034
00035 namespace Konsole
00036 {
00037
00038 class IncrementalSearchBar;
00039 class ViewManager;
00040 class ViewProperties;
00041 class SessionController;
00042 class ProfileList;
00043 class BookmarkHandler;
00044
00055 class MainWindow : public KXmlGuiWindow
00056 {
00057 Q_OBJECT
00058
00059 public:
00064 MainWindow();
00065
00070 ViewManager* viewManager() const;
00071
00076 IncrementalSearchBar* searchBar() const;
00077
00079 void setSessionList(ProfileList* list);
00080
00084 BookmarkHandler* bookmarkHandler() const;
00085
00092 void setDefaultProfile(Profile::Ptr profile);
00093
00098 Profile::Ptr defaultProfile() const;
00099
00100
00101 signals:
00110 void newSessionRequest(Profile::Ptr profile,
00111 const QString& directory,
00112 ViewManager* view);
00113
00124 void newWindowRequest(Profile::Ptr profile,
00125 const QString& directory);
00126
00130 void closeActiveSessionRequest();
00131
00132 protected:
00133
00134 virtual bool queryClose();
00135 virtual void saveProperties(KConfigGroup& group);
00136 virtual void readProperties(const KConfigGroup& group);
00137 virtual void saveGlobalProperties(KConfig* config);
00138 virtual void readGlobalProperties(KConfig* config);
00139
00140 private slots:
00141 void newTab();
00142 void newWindow();
00143 void showManageProfilesDialog();
00144 void showRemoteConnectionDialog();
00145 void showShortcutsDialog();
00146 void newFromProfile(Profile::Ptr profile);
00147 void activeViewChanged(SessionController* controller);
00148 void activeViewTitleChanged(ViewProperties*);
00149
00150 void sessionListChanged(const QList<QAction*>& actions);
00151 void viewFullScreen(bool fullScreen);
00152 void configureNotifications();
00153
00154
00155
00156 void setMenuBarVisibleOnce(bool visible);
00157
00158 void openUrls(const QList<KUrl>& urls);
00159
00160 private:
00161 void correctShortcuts();
00162 void removeMenuAccelerators();
00163 void setupActions();
00164 void setupWidgets();
00165 QString activeSessionDir() const;
00166 void disconnectController(SessionController* controller);
00167
00168
00169
00170 static void syncActiveShortcuts(KActionCollection* dest, const KActionCollection* source);
00171
00172 private:
00173 ViewManager* _viewManager;
00174 BookmarkHandler* _bookmarkHandler;
00175 KToggleAction* _toggleMenuBarAction;
00176
00177 QPointer<SessionController> _pluggedController;
00178
00179 Profile::Ptr _defaultProfile;
00180 bool _menuBarVisibilitySet;
00181 };
00182
00183 }
00184
00185 #endif // KONSOLEMAINWINDOW_H
00186
00187
00188
00189
00190
00191
00192
00193
00194