void ServerWidget::slot_choice( int choice ) { switch( choice ) { case 0: { QString filename; switch( _group->id( _group->selected() ) ) { case 0: filename = SCENAR_PATH + "demo_1player.scn"; break; case 1: filename = SCENAR_PATH + "demo_2players.scn"; break; case 2: filename = _radio3->getText(); break; } emit sig_load( filename ); break; } case 1: emit sig_save(); break; case 2: emit sig_stop(); break; } }
/** add comments here */ ServerInterface::ServerInterface() :QMainWindow() { setCaption( "Attal - Lords of Doom (Server)" ); initMenuBar(); initStatusBar(); DataTheme.init(); _widget = new ServerWidget( this ); setCentralWidget( _widget ); connect( _widget, SIGNAL( sig_stop() ), SLOT( slot_stop() ) ); connect( _widget, SIGNAL( sig_load( QString ) ), SLOT( slot_load( QString ) ) ); connect( _widget, SIGNAL( sig_save() ), SLOT( slot_save() ) ); setMinimumSize( 350, 200 ); if( !init() ) { logDD( "quit" ); qApp->quit(); } connect( _server, SIGNAL( sig_endConnection( QString ) ), _widget, SLOT( slot_endConnection( QString ) ) ); }
void gesamtbild::spielfensteraufbau() { qWarning() << "spielfensteraufbau"; QGridLayout *gridlayout = new QGridLayout(this); //Fuer Hauptfenster gameview->setParent(this); // gameview->resize(700,700); gameview->move(0,0); gameview->setFocus(); gridlayout->addWidget(gameview,0,0,1,1); // { // QImage *img = new QImage(":img/sonstige/mapfarbdef.png"); // gameview->schiffbar = img->pixel(0,0); // gameview->anlegestelle = img->pixel(0,1); // gameview->strand_weich = img->pixel(0,2); // gameview->strand_hart = img->pixel(0,3); // gameview->nschiffbar = img->pixel(0,4); // delete img; // } // QImage testimg = QImage(":img/testimg/gros.gif"); qWarning() << "SFA1"; menupanel = new SeaTabPanel(); // menupanel->create(); qWarning() << "created"; // menupanel->setParent(this); gridlayout->addWidget(menupanel,0,1,1,1); qWarning()<< "gameview->setFocus(); (gb->spiel)"; // // qWarning() << "Vor Ladungszeugs"; // for(int i = 0; i < const_warenanzahl; i++) // { // menupanel->ware[i]->setText(QString("%1").arg(GAMEDATA->activeShip()->cargo().ware[i])); // } // // fuellung->setText(QString("Belegt: %1 von %2").arg(GAMEDATA->active_ship->cargo.gesamtladung, GAMEDATA->active_ship->ladekapazitaet)); // { // menupanel->taler->setText(QString("%1").arg(GAMEDATA->activeShip()->cargo().taler).prepend(tr("Money: "))); // QString flstring = QString("%1").arg(GAMEDATA->activeShip()->cargo().fuellung); // flstring.append(QString("/%1 belegt").arg(GAMEDATA->activeShip()->cargo().kapazitaet)); // menupanel->fuellung->setText(flstring); // } // menupanel->setGameData(GAMEDATA); menupanel->show(); gridlayout->setColumnStretch(0,7); gridlayout->setColumnStretch(1,2); connect(gameview,SIGNAL(destroyed()),this,SLOT(close())); connect(gameview, SIGNAL(sig_trade()), this, SLOT(handel())); // connect(gameview,SIGNAL(handel()),gameview,SLOT(hide())); connect(gameview, SIGNAL(sig_anlegbar(bool)), menupanel->anlegen,SLOT(setEnabled(bool))); connect(gameview, SIGNAL(SIGgeschwindigkeit(int)), menupanel->geschwindigkeitsanzeige,SLOT(setValue(int))); connect(gameview, SIGNAL(sig_time()),this,SLOT(zeitanzeige())); connect(gameview, SIGNAL(sig_save()),this,SLOT(speicherndialog())); connect(gameview, SIGNAL(sig_menu()), this, SLOT(spielmenu())); connect(menupanel->anlegen, SIGNAL(clicked()), this, SLOT(landmenu())); connect(menupanel->schuss, SIGNAL(clicked()), gameview, SLOT(schuss())); connect(menupanel->anlegen, SIGNAL(clicked()), gameview, SLOT(landgang())); // connect(anlegen, SIGNAL(clicked()), anlegen, SLOT(hide())); // connect(menupanel->anlegen, SIGNAL(clicked()), menupanel->ablegen, SLOT(show())); // connect(menupanel->ablegen, SIGNAL(clicked()), this, SLOT(seemenu())); // connect(menupanel->ablegen, SIGNAL(clicked()), gameview, SLOT(ablegen())); // connect(ablegen, SIGNAL(clicked()), anlegen, SLOT(show())); // connect(ablegen, SIGNAL(clicked()), ablegen, SLOT(hide())); connect(menupanel->geschwindigkeitsregler,SIGNAL(valueChanged(int)), gameview, SLOT(segelsetzen(int))); TERMINAL->resize(width(), height()/2); TERMINAL->setParent(this); TERMINAL->setWindowFlags(Qt::Popup); TERMINAL->hide(); connect(gameview, SIGNAL(sig_konsole()), TERMINAL, SLOT(show())); // connect(TERMINAL, SIGNAL(sig_loadMap(QString)), gameview, SLOT(karteladen(QString))); connect(TERMINAL, SIGNAL(sig_command(QString)), this, SLOT(execCommand(QString))); }