From a64772444f9cbdd99b1609f895de4e68c193c426 Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Sun, 4 Sep 2011 12:11:17 +0800 Subject: [PATCH] reorganize some code to make it more readable. This commit is purely about style and layourt. No functionality changes. --- src/EditProfileDialog.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/EditProfileDialog.cpp b/src/EditProfileDialog.cpp index 47e5ac0f3..3332f58fb 100644 --- a/src/EditProfileDialog.cpp +++ b/src/EditProfileDialog.cpp @@ -232,32 +232,32 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr info) // basic profile options { ProfileGroup::Ptr group = info->asGroup(); - if (!group || group->profiles().count() < 2) + if ( !group || group->profiles().count() < 2) { - _ui->profileNameEdit->setClearButtonShown(true); _ui->profileNameEdit->setText( info->name() ); + _ui->profileNameEdit->setClearButtonShown(true); } else { _ui->profileNameEdit->setText( groupProfileNames(group,-1) ); - _ui->profileNameLabel->setEnabled(false); _ui->profileNameEdit->setEnabled(false); + _ui->profileNameLabel->setEnabled(false); } } ShellCommand command( info->command() , info->arguments() ); _ui->commandEdit->setText( command.fullCommand() ); - KUrlCompletion* exeCompletion = new KUrlCompletion(KUrlCompletion::ExeCompletion); exeCompletion->setParent(this); exeCompletion->setDir(QString()); _ui->commandEdit->setCompletionObject( exeCompletion ); - _ui->initialDirEdit->setText( info->defaultWorkingDirectory() ); + _ui->initialDirEdit->setText( info->defaultWorkingDirectory() ); KUrlCompletion* dirCompletion = new KUrlCompletion(KUrlCompletion::DirCompletion); dirCompletion->setParent(this); _ui->initialDirEdit->setCompletionObject( dirCompletion ); _ui->initialDirEdit->setClearButtonShown(true); + _ui->dirSelectButton->setIcon( KIcon("folder-open") ); _ui->iconSelectButton->setIcon( KIcon(info->icon()) ); _ui->startInSameDirButton->setChecked(info->property(Profile::StartInCurrentSessionDir)); @@ -278,17 +278,15 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr info) SLOT(initialDirChanged(QString)) ); connect(_ui->commandEdit , SIGNAL(textChanged(QString)) , this , SLOT(commandChanged(QString)) ); + connect(_ui->environmentEditButton , SIGNAL(clicked()) , this , + SLOT(showEnvironmentEditor()) ); connect(_ui->showMenuBarButton , SIGNAL(toggled(bool)) , this , SLOT(showMenuBar(bool)) ); connect(_ui->saveGeometryOnExitButton , SIGNAL(toggled(bool)) , this , SLOT(saveGeometryOnExit(bool)) ); - connect(_ui->showSizeWidgetButton , SIGNAL(toggled(bool)) , this , SLOT(showSizeWidget(bool)) ); - - connect(_ui->environmentEditButton , SIGNAL(clicked()) , this , - SLOT(showEnvironmentEditor()) ); } void EditProfileDialog::showEnvironmentEditor() { @@ -337,6 +335,7 @@ void EditProfileDialog::setupTabsPage(const Profile::Ptr info) << i18n("Above Terminal Displays") ); _ui->tabBarPositionCombo->setCurrentIndex(tabPosition); + _ui->newTabButton->setChecked(info->property(Profile::ShowNewAndCloseTabButtons)); // signals and slots @@ -581,11 +580,10 @@ void EditProfileDialog::updateKeyBindingsList(bool selectCurrentTranslator) if (!_ui->keyBindingList->model()) _ui->keyBindingList->setModel(new QStandardItemModel(this)); - KeyboardTranslatorManager* keyManager = KeyboardTranslatorManager::instance(); - const QString& name = lookupProfile() ->property(Profile::KeyBindings); + KeyboardTranslatorManager* keyManager = KeyboardTranslatorManager::instance(); const KeyboardTranslator* currentTranslator = keyManager->findTranslator(name); QStandardItemModel* model = qobject_cast(_ui->keyBindingList->model());