diff --git a/data/keyboard-layouts/CMakeLists.txt b/data/keyboard-layouts/CMakeLists.txt index 52fc191c2..0a6fd2af5 100644 --- a/data/keyboard-layouts/CMakeLists.txt +++ b/data/keyboard-layouts/CMakeLists.txt @@ -1,8 +1,8 @@ install( FILES + default.keytab linux.keytab vt420pc.keytab solaris.keytab README.KeyTab - README.default.Keytab DESTINATION ${DATA_INSTALL_DIR}/konsole ) diff --git a/data/keyboard-layouts/README.default.Keytab b/data/keyboard-layouts/default.keytab similarity index 93% rename from data/keyboard-layouts/README.default.Keytab rename to data/keyboard-layouts/default.keytab index 5ddd45982..f84293d9b 100644 --- a/data/keyboard-layouts/README.default.Keytab +++ b/data/keyboard-layouts/default.keytab @@ -1,13 +1,4 @@ # [README.default.Keytab] Buildin Keyboard Table - -# -------------------------------------------------------------- -# -# This file is used to create the buildin keyboard table. -# It is included for reference purpose with the *.keytab -# files that are loaded dynamically. -# -# Modifying it does not have any effect (unless you -# derive the default.keytab.h and recompile konsole). # # To customize your keyboard, copy this file to something # ending with .keytab and change it to meet you needs. @@ -16,7 +7,7 @@ # # -------------------------------------------------------------- -keyboard "XTerm (XFree 4.x.x)" +keyboard "Default (XFree 4)" # -------------------------------------------------------------- # diff --git a/desktop/konsoleui.rc b/desktop/konsoleui.rc index a7f9a97cc..460508fb9 100644 --- a/desktop/konsoleui.rc +++ b/desktop/konsoleui.rc @@ -8,7 +8,7 @@ - + diff --git a/src/EditProfileDialog.cpp b/src/EditProfileDialog.cpp index a412cb61f..04aa17f41 100644 --- a/src/EditProfileDialog.cpp +++ b/src/EditProfileDialog.cpp @@ -61,8 +61,17 @@ EditProfileDialog::EditProfileDialog(QWidget* parent) _ui = new Ui::EditProfileDialog(); _ui->setupUi(mainWidget()); - _pageInvalidated.resize( _ui->tabWidget->count() ); - + // there are various setupXYZPage() methods to load the items + // for each page and update their states to match the profile + // being edited. + // + // these are only called when needed ( ie. when the user clicks + // the tab to move to that page ). + // + // the _pageNeedsUpdate vector keeps track of the pages that have + // not been updated since the last profile change and will need + // to be refreshed when the user switches to them + _pageNeedsUpdate.resize( _ui->tabWidget->count() ); connect( _ui->tabWidget , SIGNAL(currentChanged(int)) , this , SLOT(ensurePageLoaded(int)) ); @@ -113,16 +122,13 @@ void EditProfileDialog::setProfile(const QString& key) // update caption setCaption( i18n("Edit Profile \"%1\"",info->name()) ); - // setup each page of the dialog - _pageInvalidated.fill(true); + // mark each page of the dialog as out of date + // and force an update of the currently visible page + // + // the other pages will be updated as necessary + _pageNeedsUpdate.fill(true); ensurePageLoaded( _ui->tabWidget->currentIndex() ); - // setupGeneralPage(info); - // setupAppearancePage(info); - // setupKeyboardPage(info); - // setupScrollingPage(info); - // setupAdvancedPage(info); - if ( _tempProfile ) { delete _tempProfile; @@ -133,10 +139,10 @@ void EditProfileDialog::ensurePageLoaded(int page) { const Profile* info = SessionManager::instance()->profile(_profileKey); - Q_ASSERT( _pageInvalidated.count() > page ); + Q_ASSERT( _pageNeedsUpdate.count() > page ); Q_ASSERT( info ); - if ( _pageInvalidated[page] ) + if ( _pageNeedsUpdate[page] ) { QWidget* pageWidget = _ui->tabWidget->widget(page); @@ -153,7 +159,7 @@ void EditProfileDialog::ensurePageLoaded(int page) else Q_ASSERT(false); - _pageInvalidated[page] = false; + _pageNeedsUpdate[page] = false; } } void EditProfileDialog::setupGeneralPage(const Profile* info) diff --git a/src/EditProfileDialog.h b/src/EditProfileDialog.h index cc1803273..dc937700d 100644 --- a/src/EditProfileDialog.h +++ b/src/EditProfileDialog.h @@ -191,7 +191,11 @@ private: Profile* _tempProfile; QString _profileKey; - QVector _pageInvalidated; + // keeps track of pages which need to be updated to match the current + // profile. all elements in this vector are set to true when the + // profile is changed and individual elements are set to false + // after an update by a call to ensurePageLoaded() + QVector _pageNeedsUpdate; QHash _previewedProperties; }; diff --git a/src/EditProfileDialog.ui b/src/EditProfileDialog.ui index 280c1b4e3..651f32749 100644 --- a/src/EditProfileDialog.ui +++ b/src/EditProfileDialog.ui @@ -5,8 +5,8 @@ 0 0 - 456 - 516 + 521 + 596 @@ -492,88 +492,6 @@ - - - Keyboard Setup - - - - - - Key Bindings - - - true - - - - - - - 32 - 32 - - - - - - - - Create a new key bindings list based upon the selected bindings - - - New... - - - - - - - Edit the selected key bindings list - - - Edit... - - - - - - - Delete the selected key bindings list - - - Remove - - - - - - - Use the selected key bindings list in this profile - - - Select - - - - - - - Qt::Vertical - - - - 71 - 101 - - - - - - - - - Scrolling @@ -744,6 +662,98 @@ + + + Keyboard Setup + + + + + + Key Bindings + + + true + + + + + + Key bindings control how combinations of key presses in the terminal window are converted into the stream of characters which is sent to the current terminal program. + + + true + + + + + + + + 32 + 32 + + + + + + + + Create a new key bindings list based upon the selected bindings + + + New... + + + + + + + Edit the selected key bindings list + + + Edit... + + + + + + + Delete the selected key bindings list + + + Remove + + + + + + + Use the selected key bindings list in this profile + + + Select + + + + + + + Qt::Vertical + + + + 71 + 101 + + + + + + + + + Advanced diff --git a/src/KeyBindingEditor.cpp b/src/KeyBindingEditor.cpp index 4d4980259..0acaf707f 100644 --- a/src/KeyBindingEditor.cpp +++ b/src/KeyBindingEditor.cpp @@ -48,6 +48,10 @@ KeyBindingEditor::KeyBindingEditor(QWidget* parent) _ui->keyBindingTable->setHorizontalHeaderLabels(labels); _ui->keyBindingTable->horizontalHeader()->setStretchLastSection(true); _ui->keyBindingTable->verticalHeader()->hide(); + + // test area + connect( _ui->testAreaInputEdit , SIGNAL(textChanged(const QString&)) , this , + SLOT(updateTestAreaOutput(const QString&)) ); } KeyBindingEditor::~KeyBindingEditor() @@ -55,6 +59,13 @@ KeyBindingEditor::~KeyBindingEditor() delete _ui; } +void KeyBindingEditor::updateTestAreaOutput(const QString& input) +{ + // TODO : Run 'input' text through the keyboard translator + + +} + void KeyBindingEditor::setDescription(const QString& newDescription) { if ( description() != newDescription ) diff --git a/src/KeyBindingEditor.h b/src/KeyBindingEditor.h index 16bbd9240..2db95f0fc 100644 --- a/src/KeyBindingEditor.h +++ b/src/KeyBindingEditor.h @@ -34,9 +34,10 @@ namespace Konsole class KeyboardTranslator; /** - * A dialog which allows the user to edit a key bindings list, - * which maps between key combinations and text produced - * in the shell when those combinations are pressed. + * A dialog which allows the user to edit a key bindings list + * which maps between key combinations input by the user and + * the character sequence sent to the terminal when those + * combinations are pressed. * * The dialog can be initialised with the settings of an * existing key bindings list using the setup() method. @@ -72,12 +73,23 @@ public: QString description() const; public slots: + /** + * Sets the text of the editor's description field. + */ void setDescription(const QString& description); - + +private slots: + void updateTestAreaOutput(const QString& input); + private: void setupKeyBindingTable(const KeyboardTranslator* translator); Ui::KeyBindingEditor* _ui; + + // translator to which modifications are made as the user makes + // changes in the UI. + // this is initialized as a copy of the translator specified + // when setup() is called KeyboardTranslator* _translator; }; diff --git a/src/KeyBindingEditor.ui b/src/KeyBindingEditor.ui index 903b579a7..3cd5aca9a 100644 --- a/src/KeyBindingEditor.ui +++ b/src/KeyBindingEditor.ui @@ -5,8 +5,8 @@ 0 0 - 400 - 300 + 302 + 395 @@ -40,7 +40,63 @@ - + + + + 0 + 1 + + + + + + + + Qt::Vertical + + + + 20 + 16 + + + + + + + + Test Area + + + true + + + + + + Input: + + + + + + + + + + Output: + + + + + + + true + + + + + diff --git a/src/KeyTrans.cpp b/src/KeyTrans.cpp index 394f5156f..46903a8c1 100644 --- a/src/KeyTrans.cpp +++ b/src/KeyTrans.cpp @@ -93,9 +93,9 @@ KeyTrans::KeyTrans(const QString& path) ,m_numb(0) ,m_fileRead(false) { - if (m_path=="[buildin]") + if (m_path=="[builtin]") { - m_id = "default"; + m_id = "builtin"; } else { @@ -408,7 +408,7 @@ void KeyTrans::readConfig(bool headerOnly) QIODevice* buf(0); QByteArray* txt = 0; - if (m_path=="[buildin]") + if (m_path=="[builtin]") { txt = new QByteArray( #include "default.keytab.h" @@ -785,7 +785,7 @@ void KeyTrans::loadAll() syms = new KeyTransSymbols; //defaultKeyTrans()->addKeyTrans(); - KeyTrans* sc = new KeyTrans("[buildin]"); + KeyTrans* sc = new KeyTrans("[builtin]"); sc->addKeyTrans(); QStringList lst = KGlobal::dirs()->findAllResources("data", "konsole/*.keytab");