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