Frontend Fullscreen mode added
authordisplacer
Thu, 07 Aug 2008 13:30:09 +0000
changeset 1162 91bf5e3e558d
parent 1161 edf18b880beb
child 1163 5186cf914549
Frontend Fullscreen mode added
QTfrontend/gameuiconfig.cpp
QTfrontend/gameuiconfig.h
QTfrontend/hwform.cpp
QTfrontend/hwform.h
QTfrontend/pages.cpp
QTfrontend/pages.h
--- a/QTfrontend/gameuiconfig.cpp	Thu Aug 07 12:09:52 2008 +0000
+++ b/QTfrontend/gameuiconfig.cpp	Thu Aug 07 13:30:09 2008 +0000
@@ -38,6 +38,8 @@
 	int t = Form->ui.pageOptions->CBResolution->findText(value("video/resolution").toString());
 	Form->ui.pageOptions->CBResolution->setCurrentIndex((t < 0) ? 0 : t);
 	Form->ui.pageOptions->CBFullscreen->setChecked(value("video/fullscreen", false).toBool());
+	bool ffscr=value("video/frontendfullscreen", false).toBool();
+	Form->ui.pageOptions->CBFrontendFullscreen->setChecked(ffscr);
 
 	Form->ui.pageOptions->CBEnableSound->setChecked(value("audio/sound", true).toBool());
 	Form->ui.pageOptions->CBEnableMusic->setChecked(value("audio/music", true).toBool());
@@ -76,6 +78,9 @@
 {
 	setValue("video/resolution", Form->ui.pageOptions->CBResolution->currentText());
 	setValue("video/fullscreen", vid_Fullscreen());
+	bool ffscr=isFrontendFullscreen();
+	setValue("video/frontendfullscreen", ffscr);
+	emit frontendFullscreen(ffscr);
 
 	setValue("audio/sound", isSoundEnabled());
 	setValue("audio/music", isMusicEnabled());
@@ -112,6 +117,11 @@
 	return Form->ui.pageOptions->CBFullscreen->isChecked();
 }
 
+bool GameUIConfig::isFrontendFullscreen() const
+{
+  return Form->ui.pageOptions->CBFrontendFullscreen->isChecked();
+}
+
 bool GameUIConfig::isSoundEnabled()
 {
 	return Form->ui.pageOptions->CBEnableSound->isChecked();
--- a/QTfrontend/gameuiconfig.h	Thu Aug 07 12:09:52 2008 +0000
+++ b/QTfrontend/gameuiconfig.h	Thu Aug 07 13:30:09 2008 +0000
@@ -42,6 +42,10 @@
 	quint8 timerInterval();
 	quint8 bitDepth();
 	QString netNick();
+	bool isFrontendFullscreen() const;
+
+ signals:
+	void frontendFullscreen(bool value);
 
 public slots:
 	void SaveOptions();
--- a/QTfrontend/hwform.cpp	Thu Aug 07 12:09:52 2008 +0000
+++ b/QTfrontend/hwform.cpp	Thu Aug 07 13:30:09 2008 +0000
@@ -54,6 +54,9 @@
 	UpdateTeamsLists();
 	UpdateWeapons();
 
+	connect(config, SIGNAL(frontendFullscreen(bool)), this, SLOT(onFrontendFullscreen(bool)));
+	onFrontendFullscreen(config->isFrontendFullscreen());
+
 	connect(ui.pageMain->BtnSinglePlayer,	SIGNAL(clicked()),	this, SLOT(GoToSinglePlayer()));
 	connect(ui.pageMain->BtnSetup,	SIGNAL(clicked()),	this, SLOT(GoToSetup()));
 	connect(ui.pageMain->BtnNet,	SIGNAL(clicked()),	this, SLOT(GoToNet()));
@@ -127,6 +130,12 @@
 	GoToPage(ID_PAGE_MAIN);
 }
 
+void HWForm::onFrontendFullscreen(bool value)
+{
+  qDebug() << "fullscreen = " << value;
+  setWindowState(windowState() | (value ? Qt::WindowFullScreen : Qt::WindowNoState));
+}
+
 void HWForm::UpdateWeapons()
 {
   // FIXME: rewrite this with boost (or TR1/0x)
--- a/QTfrontend/hwform.h	Thu Aug 07 12:09:52 2008 +0000
+++ b/QTfrontend/hwform.h	Thu Aug 07 13:30:09 2008 +0000
@@ -83,6 +83,7 @@
 	void CreateNetGame();
 	void UpdateWeapons();
 	void NetWeaponNameChanged(const QString& name);
+	void onFrontendFullscreen(bool value);
 
 private:
 	void _NetConnect(const QString & hostName, quint16 port, const QString & nick);
--- a/QTfrontend/pages.cpp	Thu Aug 07 12:09:52 2008 +0000
+++ b/QTfrontend/pages.cpp	Thu Aug 07 13:30:09 2008 +0000
@@ -311,6 +311,10 @@
 	CBFullscreen->setText(QCheckBox::tr("Fullscreen"));
 	GBAlayout->addWidget(CBFullscreen);
 
+	CBFrontendFullscreen = new QCheckBox(AGGroupBox);
+	CBFrontendFullscreen->setText(QCheckBox::tr("Frontend fullscreen"));
+	GBAlayout->addWidget(CBFrontendFullscreen);
+
 	CBEnableSound = new QCheckBox(AGGroupBox);
 	CBEnableSound->setText(QCheckBox::tr("Enable sound"));
 	GBAlayout->addWidget(CBEnableSound);
--- a/QTfrontend/pages.h	Thu Aug 07 12:09:52 2008 +0000
+++ b/QTfrontend/pages.h	Thu Aug 07 13:30:09 2008 +0000
@@ -192,6 +192,7 @@
 	QCheckBox *CBEnableSound;
 	QCheckBox *CBEnableMusic;
 	QCheckBox *CBFullscreen;
+	QCheckBox *CBFrontendFullscreen;
 	QCheckBox *CBShowFPS;
 	QCheckBox *CBAltDamage;
 	FPSEdit *fpsedit;