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

Konsole

EditProfileDialog.h

Go to the documentation of this file.
00001 /*
00002     Copyright 2007-2008 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 // Local
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     // reimplemented
00094     virtual void accept();
00095     // reimplemented 
00096     virtual void reject();
00097 
00098 protected:
00099     virtual bool eventFilter(QObject* watched , QEvent* event);
00100 
00101 private slots:
00102     // sets up the specified tab page if necessary
00103     void preparePage(int);
00104 
00105     // saves changes to profile
00106     void save();
00107 
00108     // general page
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     // appearance page
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     // scrolling page
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     // keyboard page
00153     void editKeyBinding();
00154     void newKeyBinding();
00155     void keyBindingSelected();
00156     void removeKeyBinding();
00157 
00158     // advanced page
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     // apply the first previewed changes stored up by delayedPreview()
00173     void delayedPreviewActivate();
00174 
00175 private:
00176     // initialize various pages of the dialog
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     // keeps track of pages which need to be updated to match the current
00227     // profile.  all elements in this vector are set to true when the 
00228     // profile is changed and individual elements are set to false 
00229     // after an update by a call to ensurePageLoaded()
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     // reimplemented
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

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