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

Konsole

  • sources
  • kde-4.12
  • applications
  • konsole
  • src
EditProfileDialog.h
Go to the documentation of this file.
1 /*
2  Copyright 2007-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 EDITPROFILEDIALOG_H
21 #define EDITPROFILEDIALOG_H
22 
23 // Qt
24 #include <QAbstractItemDelegate>
25 #include <QtCore/QHash>
26 #include <QtCore/QPointer>
27 
28 // KDE
29 #include <KDialog>
30 
31 // Konsole
32 #include "Profile.h"
33 #include "Enumeration.h"
34 #include "ColorScheme.h"
35 #include "ColorSchemeEditor.h"
36 
37 class QAbstractButton;
38 class QItemSelectionModel;
39 class QTextCodec;
40 
41 namespace Ui
42 {
43 class EditProfileDialog;
44 }
45 
46 namespace Konsole
47 {
61 class KONSOLEPRIVATE_EXPORT EditProfileDialog : public KDialog
62 {
63  Q_OBJECT
64 
65 public:
67  explicit EditProfileDialog(QWidget* parent = 0);
68  virtual ~EditProfileDialog();
69 
79  void setProfile(Profile::Ptr profile);
80 
87  void selectProfileName();
88  const Profile::Ptr lookupProfile() const;
89 
90 public slots:
91  // reimplemented
92  virtual void accept();
93  // reimplemented
94  virtual void reject();
95 
96 protected:
97  virtual bool eventFilter(QObject* watched , QEvent* event);
98 
99 private slots:
100  // sets up the specified tab page if necessary
101  void preparePage(int);
102 
103  // saves changes to profile
104  void save();
105 
106  // general page
107  void selectInitialDir();
108  void selectIcon();
109 
110  void profileNameChanged(const QString& text);
111  void initialDirChanged(const QString& text);
112  void startInSameDir(bool);
113  void commandChanged(const QString& text);
114  void tabTitleFormatChanged(const QString& text);
115  void remoteTabTitleFormatChanged(const QString& text);
116 
117  void showTerminalSizeHint(bool);
118  void saveGeometryOnExit(bool);
119  void showEnvironmentEditor();
120  void silenceSecondsChanged(int);
121 
122  // appearance page
123  void setFontSize(double pointSize);
124  void setFontInputValue(const QFont&);
125  void setAntialiasText(bool enable);
126  void setBoldIntense(bool enable);
127  void showFontDialog();
128  void newColorScheme();
129  void editColorScheme();
130  void saveColorScheme(const ColorScheme& scheme, bool isNewScheme);
131  void removeColorScheme();
132  void colorSchemeSelected();
133  void previewColorScheme(const QModelIndex& index);
134  void fontSelected(const QFont&);
135  void toggleMouseWheelZoom(bool enable);
136 
137  // scrolling page
138  void historyModeChanged(Enum::HistoryModeEnum mode);
139 
140  void historySizeChanged(int);
141 
142  void hideScrollBar();
143  void showScrollBarLeft();
144  void showScrollBarRight();
145 
146  void scrollFullPage();
147  void scrollHalfPage();
148 
149  // keyboard page
150  void editKeyBinding();
151  void newKeyBinding();
152  void keyBindingSelected();
153  void removeKeyBinding();
154 
155  // mouse page
156  void toggleUnderlineLinks(bool);
157  void toggleOpenLinksByDirectClick(bool);
158  void toggleCtrlRequiredForDrag(bool);
159  void toggleCopyTextToClipboard(bool);
160  void toggleTrimTrailingSpacesInSelectedText(bool);
161  void pasteFromX11Selection();
162  void pasteFromClipboard();
163 
164  void TripleClickModeChanged(int);
165  void wordCharactersChanged(const QString&);
166 
167  // advanced page
168  void toggleBlinkingText(bool);
169  void toggleFlowControl(bool);
170  void togglebidiRendering(bool);
171  void lineSpacingChanged(int);
172  void toggleBlinkingCursor(bool);
173 
174  void setCursorShape(int);
175  void autoCursorColor();
176  void customCursorColor();
177  void customCursorColorChanged(const QColor&);
178  void setDefaultCodec(QTextCodec*);
179 
180  // apply the first previewed changes stored up by delayedPreview()
181  void delayedPreviewActivate();
182 
183 private:
184  // initialize various pages of the dialog
185  void setupGeneralPage(const Profile::Ptr profile);
186  void setupTabsPage(const Profile::Ptr profile);
187  void setupAppearancePage(const Profile::Ptr profile);
188  void setupKeyboardPage(const Profile::Ptr profile);
189  void setupScrollingPage(const Profile::Ptr profile);
190  void setupAdvancedPage(const Profile::Ptr profile);
191  void setupMousePage(const Profile::Ptr info);
192 
193  void updateColorSchemeList(bool selectCurrentScheme = false);
194  void updateColorSchemeButtons();
195  void updateKeyBindingsList(bool selectCurrentTranslator = false);
196  void updateKeyBindingsButtons();
197 
198  void showColorSchemeEditor(bool isNewScheme);
199  void closeColorSchemeEditor();
200  void showKeyBindingEditor(bool newTranslator);
201 
202  void preview(int property , const QVariant& value);
203  void delayedPreview(int property , const QVariant& value);
204  void unpreview(int property);
205  void unpreviewAll();
206  void enableIfNonEmptySelection(QWidget* widget, QItemSelectionModel* selectionModel);
207 
208  void updateCaption(const Profile::Ptr profile);
209  void updateTransparencyWarning();
210 
211  // Update _tempProfile in a way of respecting the apply button.
212  // When used with some previewed property, this method should
213  // always come after the preview operation.
214  void updateTempProfileProperty(Profile::Property, const QVariant& value);
215 
216  // helper method for creating an empty & hidden profile and assigning
217  // it to _tempProfile.
218  void createTempProfile();
219 
220  // Enable or disable apply button, used only within
221  // updateTempProfileProperty().
222  void updateButtonApply();
223 
224  static QString groupProfileNames(const ProfileGroup::Ptr group, int maxLength = -1);
225 
226  struct RadioOption {
227  QAbstractButton* button;
228  int value;
229  const char* slot;
230  };
231  void setupRadio(RadioOption* possibilities, int actual);
232  struct BooleanOption {
233  QAbstractButton* button;
234  Profile::Property property;
235  const char* slot;
236  };
237  void setupCheckBoxes(BooleanOption* options , const Profile::Ptr profile);
238 
239  Ui::EditProfileDialog* _ui;
240  Profile::Ptr _tempProfile;
241  Profile::Ptr _profile;
242 
243  // keeps track of pages which need to be updated to match the current
244  // profile. all elements in this vector are set to true when the
245  // profile is changed and individual elements are set to false
246  // after an update by a call to ensurePageLoaded()
247  QVector<bool> _pageNeedsUpdate;
248  QHash<int, QVariant> _previewedProperties;
249 
250  QHash<int, QVariant> _delayedPreviewProperties;
251  QTimer* _delayedPreviewTimer;
252 
253  ColorSchemeEditor* _colorDialog;
254 };
255 
259 class ColorSchemeViewDelegate : public QAbstractItemDelegate
260 {
261  Q_OBJECT
262 
263 public:
264  explicit ColorSchemeViewDelegate(QObject* parent = 0);
265 
266  // reimplemented
267  virtual void paint(QPainter* painter, const QStyleOptionViewItem& option,
268  const QModelIndex& index) const;
269  virtual QSize sizeHint(const QStyleOptionViewItem& option,
270  const QModelIndex& index) const;
271 };
272 }
273 
274 #endif // EDITPROFILEDIALOG_H
QAbstractItemDelegate
QWidget
Konsole::ProfileGroup::Ptr
KSharedPtr< ProfileGroup > Ptr
Definition: Profile.h:601
KDialog
Konsole::ColorSchemeViewDelegate::paint
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: EditProfileDialog.cpp:1251
QObject
Konsole::Profile::Property
Property
This enum describes the available properties which a Profile may consist of.
Definition: Profile.h:77
Konsole::ColorSchemeViewDelegate::ColorSchemeViewDelegate
ColorSchemeViewDelegate(QObject *parent=0)
Definition: EditProfileDialog.cpp:1246
Konsole::EditProfileDialog
A dialog which allows the user to edit a profile.
Definition: EditProfileDialog.h:61
ColorSchemeEditor.h
Enumeration.h
Konsole::Enum::HistoryModeEnum
HistoryModeEnum
This enum describes the modes available to remember lines of output produced by the terminal...
Definition: Enumeration.h:38
ColorScheme.h
Konsole::Profile::Ptr
KSharedPtr< Profile > Ptr
Definition: Profile.h:67
Konsole::ColorSchemeViewDelegate::sizeHint
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: EditProfileDialog.cpp:1349
Konsole::ColorSchemeViewDelegate
A delegate which can display and edit color schemes in a view.
Definition: EditProfileDialog.h:259
Konsole::ColorSchemeEditor
A dialog for editing color schemes.
Definition: ColorSchemeEditor.h:55
KONSOLEPRIVATE_EXPORT
#define KONSOLEPRIVATE_EXPORT
Definition: konsole_export.h:33
Profile.h
Konsole::ColorScheme
Represents a color scheme for a terminal display.
Definition: ColorScheme.h:72
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:24 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
  • Applications
  •   Libraries
  •     libkonq
  • 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