Konsole
EditProfileDialog.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 EDITPROFILEDIALOG_H
00021 #define EDITPROFILEDIALOG_H
00022
00023
00024 #include <QtGui/QAbstractItemDelegate>
00025 #include <QtCore/QPair>
00026 #include <QtCore/QHash>
00027 #include <QtCore/QSet>
00028 #include <QtCore/QPointer>
00029
00030
00031 #include <KDialog>
00032
00033
00034 #include "Profile.h"
00035
00036 class QAbstractButton;
00037 class QItemSelectionModel;
00038 class QTextCodec;
00039 class QTimeLine;
00040
00041 namespace Ui
00042 {
00043 class EditProfileDialog;
00044 }
00045
00046 namespace Konsole
00047 {
00048
00049 class Profile;
00050
00064 class EditProfileDialog : public KDialog
00065 {
00066 Q_OBJECT
00067
00068 public:
00070 EditProfileDialog(QWidget* parent = 0);
00071 virtual ~EditProfileDialog();
00072
00082 void setProfile(Profile::Ptr profile);
00083
00090 void selectProfileName();
00091
00092 public slots:
00093
00094 virtual void accept();
00095
00096 virtual void reject();
00097
00098 protected:
00099 virtual bool eventFilter(QObject* watched , QEvent* event);
00100
00101 private slots:
00102
00103 void preparePage(int);
00104
00105
00106 void save();
00107
00108
00109 void selectInitialDir();
00110 void selectIcon();
00111
00112 void profileNameChanged(const QString& text);
00113 void initialDirChanged(const QString& text);
00114 void startInSameDir(bool);
00115 void commandChanged(const QString& text);
00116 void tabTitleFormatChanged(const QString& text);
00117 void remoteTabTitleFormatChanged(const QString& text);
00118
00119 void insertTabTitleText(const QString& text);
00120 void insertRemoteTabTitleText(const QString& text);
00121
00122 void showMenuBar(bool);
00123 void showEnvironmentEditor();
00124 void tabBarVisibilityChanged(int);
00125 void tabBarPositionChanged(int);
00126 void showNewTabButton(bool);
00127
00128
00129 void setFontSize(int pointSize);
00130 void setAntialiasText(bool enable);
00131 void showFontDialog();
00132 void newColorScheme();
00133 void editColorScheme();
00134 void removeColorScheme();
00135 void colorSchemeSelected();
00136 void previewColorScheme(const QModelIndex& index);
00137 void fontSelected(const QFont&);
00138
00139 void colorSchemeAnimationUpdate();
00140
00141
00142 void noScrollBack();
00143 void fixedScrollBack();
00144 void unlimitedScrollBack();
00145
00146 void scrollBackLinesChanged(int);
00147
00148 void hideScrollBar();
00149 void showScrollBarLeft();
00150 void showScrollBarRight();
00151
00152
00153 void editKeyBinding();
00154 void newKeyBinding();
00155 void keyBindingSelected();
00156 void removeKeyBinding();
00157
00158
00159 void toggleBlinkingText(bool);
00160 void toggleFlowControl(bool);
00161 void toggleResizeWindow(bool);
00162 void togglebidiRendering(bool);
00163 void toggleBlinkingCursor(bool);
00164
00165 void setCursorShape(int);
00166 void autoCursorColor();
00167 void customCursorColor();
00168 void customCursorColorChanged(const QColor&);
00169 void wordCharactersChanged(const QString&);
00170 void setDefaultCodec(QTextCodec*);
00171
00172
00173 void delayedPreviewActivate();
00174
00175 private:
00176
00177 void setupGeneralPage(const Profile::Ptr info);
00178 void setupTabsPage(const Profile::Ptr info);
00179 void setupAppearancePage(const Profile::Ptr info);
00180 void setupKeyboardPage(const Profile::Ptr info);
00181 void setupScrollingPage(const Profile::Ptr info);
00182 void setupAdvancedPage(const Profile::Ptr info);
00183
00184 void updateColorSchemeList(bool selectCurrentScheme = false);
00185 void updateColorSchemeButtons();
00186 void updateKeyBindingsList(bool selectCurrentTranslator = false);
00187 void updateKeyBindingsButtons();
00188
00189 void showColorSchemeEditor(bool newScheme);
00190 void showKeyBindingEditor(bool newTranslator);
00191
00192 void changeCheckedItem( QAbstractItemModel* mode, const QModelIndex& to );
00193
00194 void preview(int property , const QVariant& value);
00195 void delayedPreview(int property , const QVariant& value);
00196 void unpreview(int property);
00197 void unpreviewAll();
00198 void enableIfNonEmptySelection(QWidget* widget,QItemSelectionModel* selectionModel);
00199
00200 void updateCaption(const Profile::Ptr profile);
00201 void updateTransparencyWarning();
00202
00203 static QString groupProfileNames(const ProfileGroup::Ptr group, int maxLength = -1);
00204
00205 struct RadioOption
00206 {
00207 QAbstractButton* button;
00208 int property;
00209 const char* slot;
00210 };
00211 void setupRadio(RadioOption* possible,int actual);
00212 struct ComboOption
00213 {
00214 QAbstractButton* button;
00215 int property;
00216 const char* slot;
00217 };
00218 void setupCombo(ComboOption* options , const Profile::Ptr profile);
00219
00220 const Profile::Ptr lookupProfile() const;
00221
00222 Ui::EditProfileDialog* _ui;
00223 Profile::Ptr _tempProfile;
00224 Profile::Ptr _profile;
00225
00226
00227
00228
00229
00230 QVector<bool> _pageNeedsUpdate;
00231 QHash<int,QVariant> _previewedProperties;
00232
00233 QTimeLine* _colorSchemeAnimationTimeLine;
00234
00235 QHash<int,QVariant> _delayedPreviewProperties;
00236 QTimer* _delayedPreviewTimer;
00237 };
00238
00242 class ColorSchemeViewDelegate : public QAbstractItemDelegate
00243 {
00244 Q_OBJECT
00245
00246 public:
00247 ColorSchemeViewDelegate(QObject* parent = 0);
00248
00249
00250 virtual void paint(QPainter* painter, const QStyleOptionViewItem& option,
00251 const QModelIndex& index) const;
00252 virtual QSize sizeHint( const QStyleOptionViewItem& option,
00253 const QModelIndex& index) const;
00254
00263 void setEntryTimeLine( QTimeLine* timeLine );
00264
00265 private:
00266 QPointer<QTimeLine> _entryTimeLine;
00267
00268 };
00269
00270 }
00271
00272 #endif // EDITPROFILEDIALOG_H