# HG changeset patch # User unc0rr # Date 1239625409 0 # Node ID 955b049eb0994c7ed3951e87b185e5bd2cb49041 # Parent fd1f418ea5775f82d8b1802137c5f39f571f5be1 Disable feel of editing for built-in schemes diff -r fd1f418ea577 -r 955b049eb099 QTfrontend/pages.cpp --- a/QTfrontend/pages.cpp Mon Apr 13 12:17:40 2009 +0000 +++ b/QTfrontend/pages.cpp Mon Apr 13 12:23:29 2009 +0000 @@ -863,8 +863,8 @@ pageLayout->addWidget(gb, 1,0,13,4); - QGroupBox * gbGameModes = new QGroupBox(QGroupBox::tr("Game Modifiers"), gb); - QGroupBox * gbBasicSettings = new QGroupBox(QGroupBox::tr("Basic Settings"), gb); + gbGameModes = new QGroupBox(QGroupBox::tr("Game Modifiers"), gb); + gbBasicSettings = new QGroupBox(QGroupBox::tr("Basic Settings"), gb); gbGameModes->setStyleSheet(".QGroupBox {" "background-color: #130f2c; background-image:url();" @@ -1014,6 +1014,7 @@ connect(BtnNew, SIGNAL(clicked()), this, SLOT(newRow())); connect(BtnDelete, SIGNAL(clicked()), this, SLOT(deleteRow())); connect(selectScheme, SIGNAL(currentIndexChanged(int)), mapper, SLOT(setCurrentIndex(int))); + connect(selectScheme, SIGNAL(currentIndexChanged(int)), this, SLOT(schemeSelected(int))); } void PageScheme::setModel(QAbstractItemModel * model) @@ -1052,6 +1053,13 @@ model->removeRow(selectScheme->currentIndex()); } +void PageScheme::schemeSelected(int n) +{ + gbGameModes->setEnabled(n >= 4); // FIXME: derive number from model + gbBasicSettings->setEnabled(n >= 4); + LE_name->setEnabled(n >= 4); +} + ///////////////////////////////////////////////// PageAdmin::PageAdmin(QWidget* parent) : diff -r fd1f418ea577 -r 955b049eb099 QTfrontend/pages.h --- a/QTfrontend/pages.h Mon Apr 13 12:17:40 2009 +0000 +++ b/QTfrontend/pages.h Mon Apr 13 12:23:29 2009 +0000 @@ -433,9 +433,13 @@ QLineEdit * LE_name; QComboBox * selectScheme; + QGroupBox * gbGameModes; + QGroupBox * gbBasicSettings; + private slots: void newRow(); void deleteRow(); + void schemeSelected(int); }; class PageAdmin : public AbstractPage