• 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
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 terminalColumnsEntryChanged(int);
118  void terminalRowsEntryChanged(int);
119  void showTerminalSizeHint(bool);
120  void showEnvironmentEditor();
121  void silenceSecondsChanged(int);
122 
123  // appearance page
124  void setFontSize(double pointSize);
125  void setFontInputValue(const QFont&);
126  void setAntialiasText(bool enable);
127  void setBoldIntense(bool enable);
128  void showFontDialog();
129  void newColorScheme();
130  void editColorScheme();
131  void saveColorScheme(const ColorScheme& scheme, bool isNewScheme);
132  void removeColorScheme();
133  void colorSchemeSelected();
134  void previewColorScheme(const QModelIndex& index);
135  void fontSelected(const QFont&);
136  void toggleMouseWheelZoom(bool enable);
137 
138  // scrolling page
139  void historyModeChanged(Enum::HistoryModeEnum mode);
140 
141  void historySizeChanged(int);
142 
143  void hideScrollBar();
144  void showScrollBarLeft();
145  void showScrollBarRight();
146 
147  void scrollFullPage();
148  void scrollHalfPage();
149 
150  // keyboard page
151  void editKeyBinding();
152  void newKeyBinding();
153  void keyBindingSelected();
154  void removeKeyBinding();
155 
156  // mouse page
157  void toggleUnderlineLinks(bool);
158  void toggleOpenLinksByDirectClick(bool);
159  void toggleCtrlRequiredForDrag(bool);
160  void toggleCopyTextToClipboard(bool);
161  void toggleTrimTrailingSpacesInSelectedText(bool);
162  void pasteFromX11Selection();
163  void pasteFromClipboard();
164 
165  void TripleClickModeChanged(int);
166  void wordCharactersChanged(const QString&);
167 
168  // advanced page
169  void toggleBlinkingText(bool);
170  void toggleFlowControl(bool);
171  void togglebidiRendering(bool);
172  void lineSpacingChanged(int);
173  void toggleBlinkingCursor(bool);
174 
175  void setCursorShape(int);
176  void autoCursorColor();
177  void customCursorColor();
178  void customCursorColorChanged(const QColor&);
179  void setDefaultCodec(QTextCodec*);
180 
181  // apply the first previewed changes stored up by delayedPreview()
182  void delayedPreviewActivate();
183 
184 private:
185  // initialize various pages of the dialog
186  void setupGeneralPage(const Profile::Ptr profile);
187  void setupTabsPage(const Profile::Ptr profile);
188  void setupAppearancePage(const Profile::Ptr profile);
189  void setupKeyboardPage(const Profile::Ptr profile);
190  void setupScrollingPage(const Profile::Ptr profile);
191  void setupAdvancedPage(const Profile::Ptr profile);
192  void setupMousePage(const Profile::Ptr info);
193 
194  void updateColorSchemeList(bool selectCurrentScheme = false);
195  void updateColorSchemeButtons();
196  void updateKeyBindingsList(bool selectCurrentTranslator = false);
197  void updateKeyBindingsButtons();
198 
199  void showColorSchemeEditor(bool isNewScheme);
200  void closeColorSchemeEditor();
201  void showKeyBindingEditor(bool newTranslator);
202 
203  void preview(int property , const QVariant& value);
204  void delayedPreview(int property , const QVariant& value);
205  void unpreview(int property);
206  void unpreviewAll();
207  void enableIfNonEmptySelection(QWidget* widget, QItemSelectionModel* selectionModel);
208 
209  void updateCaption(const Profile::Ptr profile);
210  void updateTransparencyWarning();
211 
212  // Update _tempProfile in a way of respecting the apply button.
213  // When used with some previewed property, this method should
214  // always come after the preview operation.
215  void updateTempProfileProperty(Profile::Property, const QVariant& value);
216 
217  // helper method for creating an empty & hidden profile and assigning
218  // it to _tempProfile.
219  void createTempProfile();
220 
221  // Enable or disable apply button, used only within
222  // updateTempProfileProperty().
223  void updateButtonApply();
224 
225  static QString groupProfileNames(const ProfileGroup::Ptr group, int maxLength = -1);
226 
227  struct RadioOption {
228  QAbstractButton* button;
229  int value;
230  const char* slot;
231  };
232  void setupRadio(RadioOption* possibilities, int actual);
233  struct BooleanOption {
234  QAbstractButton* button;
235  Profile::Property property;
236  const char* slot;
237  };
238  void setupCheckBoxes(BooleanOption* options , const Profile::Ptr profile);
239 
240  Ui::EditProfileDialog* _ui;
241  Profile::Ptr _tempProfile;
242  Profile::Ptr _profile;
243 
244  // keeps track of pages which need to be updated to match the current
245  // profile. all elements in this vector are set to true when the
246  // profile is changed and individual elements are set to false
247  // after an update by a call to ensurePageLoaded()
248  QVector<bool> _pageNeedsUpdate;
249  QHash<int, QVariant> _previewedProperties;
250 
251  QHash<int, QVariant> _delayedPreviewProperties;
252  QTimer* _delayedPreviewTimer;
253 
254  ColorSchemeEditor* _colorDialog;
255 };
256 
260 class ColorSchemeViewDelegate : public QAbstractItemDelegate
261 {
262  Q_OBJECT
263 
264 public:
265  explicit ColorSchemeViewDelegate(QObject* parent = 0);
266 
267  // reimplemented
268  virtual void paint(QPainter* painter, const QStyleOptionViewItem& option,
269  const QModelIndex& index) const;
270  virtual QSize sizeHint(const QStyleOptionViewItem& option,
271  const QModelIndex& index) const;
272 };
273 }
274 
275 #endif // EDITPROFILEDIALOG_H
QModelIndex
QEvent
QWidget
QFont
Konsole::ProfileGroup::Ptr
KSharedPtr< ProfileGroup > Ptr
Definition: Profile.h:602
KDialog
Konsole::ColorSchemeViewDelegate::paint
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: EditProfileDialog.cpp:1261
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:1256
Konsole::EditProfileDialog
A dialog which allows the user to edit a profile.
Definition: EditProfileDialog.h:61
ColorSchemeEditor.h
QTimer
QHash< int, QVariant >
QStyleOptionViewItem
QObject
QPainter
QString
Enumeration.h
QColor
QTextCodec
QSize
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:1354
QAbstractButton
Konsole::ColorSchemeViewDelegate
A delegate which can display and edit color schemes in a view.
Definition: EditProfileDialog.h:260
QVector< bool >
Konsole::ColorSchemeEditor
A dialog for editing color schemes.
Definition: ColorSchemeEditor.h:55
KONSOLEPRIVATE_EXPORT
#define KONSOLEPRIVATE_EXPORT
Definition: konsole_export.h:33
QItemSelectionModel
QObject::parent
QObject * parent() const
Profile.h
Konsole::ColorScheme
Represents a color scheme for a terminal display.
Definition: ColorScheme.h:72
QVariant
QAbstractItemDelegate
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