pass in sdli
authornemo
Sat, 17 Oct 2009 04:57:05 +0000
changeset 2516 effafd586a4e
parent 2515 51d3f4b6293a
child 2517 6ed1fba6da18
pass in sdli
QTfrontend/pages.cpp
QTfrontend/pages.h
QTfrontend/ui_hwform.cpp
--- a/QTfrontend/pages.cpp	Sat Oct 17 01:28:49 2009 +0000
+++ b/QTfrontend/pages.cpp	Sat Oct 17 04:57:05 2009 +0000
@@ -98,9 +98,10 @@
 	BtnExit = addButton(":/res/Exit.png", pageLayout, 4, 0, 1, 1, true);
 }
 
-PageEditTeam::PageEditTeam(QWidget* parent, SDLInteraction & sdli) :
+PageEditTeam::PageEditTeam(QWidget* parent, SDLInteraction * sdli) :
   AbstractPage(parent)
 {
+    mySdli = sdli;
 	QGridLayout * pageLayout = new QGridLayout(this);
 	QTabWidget * tbw = new QTabWidget(this);
 	QWidget * page1 = new QWidget(this);
@@ -196,7 +197,7 @@
 		hbox->addWidget(CBVoicepack, 100);
 		BtnTestSound = addButton(":/res/PlaySound.png", hbox, 1, true);
 		hbox->setStretchFactor(BtnTestSound, 1);
-		connect(BtnTestSound, SIGNAL(clicked()), this, SLOT(testSound(sdli)));
+		connect(BtnTestSound, SIGNAL(clicked()), this, SLOT(testSound()));
 		GBTLayout->addLayout(hbox);
 	}
 
@@ -287,11 +288,11 @@
 	FortPreview->setPixmap(pix);
 }
 
-void PageEditTeam::testSound(SDLInteraction &sdli)
+void PageEditTeam::testSound()
 {
 	Mix_Music *sound;
 	QDir tmpdir;
-	sdli.SDLMusicInit();
+	mySdli->SDLMusicInit();
 	
 	tmpdir.cd(datadir->absolutePath());
 	tmpdir.cd("Sounds/voices");
--- a/QTfrontend/pages.h	Sat Oct 17 01:28:49 2009 +0000
+++ b/QTfrontend/pages.h	Sat Oct 17 04:57:05 2009 +0000
@@ -148,7 +148,7 @@
 	Q_OBJECT
 
 public:
-	PageEditTeam(QWidget* parent, SDLInteraction & sdli);
+	PageEditTeam(QWidget* parent, SDLInteraction * sdli);
 	QSignalMapper* signalMapper;
 	QGroupBox *GBoxHedgehogs;
 	QGroupBox *GBoxTeam;
@@ -170,11 +170,14 @@
 	QComboBox * CBBind[BINDS_NUMBER];
 	QPushButton * randTeamButton;
 
+private:
+    SDLInteraction * mySdli;
+
 public slots:
 	void CBFort_activated(const QString & gravename);
 
 private slots:
-	void testSound(SDLInteraction & sdli);
+	void testSound();
 };
 
 class PageMultiplayer : public AbstractPage
--- a/QTfrontend/ui_hwform.cpp	Sat Oct 17 01:28:49 2009 +0000
+++ b/QTfrontend/ui_hwform.cpp	Sat Oct 17 04:57:05 2009 +0000
@@ -57,7 +57,7 @@
 {
 	Pages = new QStackedLayout(Parent);
 
-	pageEditTeam = new PageEditTeam(Parent, HWForm->sdli);
+	pageEditTeam = new PageEditTeam(Parent, &HWForm->sdli);
 	Pages->addWidget(pageEditTeam);
 
 	pageOptions = new PageOptions();