Disable feel of editing for built-in schemes
authorunc0rr
Mon, 13 Apr 2009 12:23:29 +0000
changeset 1984 955b049eb099
parent 1983 fd1f418ea577
child 1985 0792e1485d07
Disable feel of editing for built-in schemes
QTfrontend/pages.cpp
QTfrontend/pages.h
--- 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) :
--- 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