• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Konsole

EditProfileDialog.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2007 by Robert Knight <robertknight@gmail.com>
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301  USA.
00018 */
00019 
00020 #ifndef EDITPROFILEDIALOG_H
00021 #define EDITPROFILEDIALOG_H
00022 
00023 // Qt
00024 #include <QtGui/QAbstractItemDelegate>
00025 #include <QtCore/QPair>
00026 #include <QtCore/QHash>
00027 #include <QtCore/QSet>
00028 #include <QtCore/QPointer>
00029 
00030 // KDE
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     // reimplemented
00091     virtual void accept();
00092     // reimplemented 
00093     virtual void reject();
00094 
00095 protected:
00096     virtual bool eventFilter(QObject* watched , QEvent* event);
00097 
00098 private slots:
00099     // sets up the specified tab page if necessary
00100     void preparePage(int);
00101 
00102     // saves changes to profile
00103     void save();
00104 
00105     // general page
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     // appearance page
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     // scrolling page
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     // keyboard page
00147     void editKeyBinding();
00148     void newKeyBinding();
00149     void keyBindingSelected();
00150     void removeKeyBinding();
00151 
00152     // advanced page
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     // apply the first previewed changes stored up by delayedPreview()
00166     void delayedPreviewActivate();
00167 
00168 private:
00169     // initialize various pages of the dialog
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     // keeps track of pages which need to be updated to match the current
00218     // profile.  all elements in this vector are set to true when the 
00219     // profile is changed and individual elements are set to false 
00220     // after an update by a call to ensurePageLoaded()
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     // reimplemented
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

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • Konsole
  • Libraries
  •   libkonq
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal