X-Git-Url: http://git.maemo.org/git/?p=qmemory;a=blobdiff_plain;f=mainwindow.cpp;h=2bea9f2a86e9c7d9eb7f24c86c4e2fca94e77908;hp=6bdd6214356ce67b56b5e2d6f44a34e3a57a0d31;hb=ceaea0c7105f5208cbdf98fa8b36faad87ac4c19;hpb=ce607ff361d22185bdc529b0c68d833c8c48a9be diff --git a/mainwindow.cpp b/mainwindow.cpp index 6bdd621..2bea9f2 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -36,6 +36,15 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->pushButton_7,SIGNAL(clicked()),this,SLOT(clickG())); connect(ui->pushButton_8,SIGNAL(clicked()),this,SLOT(clickH())); connect(ui->pushButton_9,SIGNAL(clicked()),this,SLOT(clickI())); + ui->pushButton->setShortcut(QKeySequence("1")); + ui->pushButton_2->setShortcut(QKeySequence("2")); + ui->pushButton_3->setShortcut(QKeySequence("3")); + ui->pushButton_4->setShortcut(QKeySequence("4")); + ui->pushButton_5->setShortcut(QKeySequence("5")); + ui->pushButton_6->setShortcut(QKeySequence("6")); + ui->pushButton_7->setShortcut(QKeySequence("7")); + ui->pushButton_8->setShortcut(QKeySequence("8")); + ui->pushButton_9->setShortcut(QKeySequence("9")); tread.start(); @@ -69,8 +78,10 @@ void MainWindow::sbagliato(int score){ QString sscore("This is Best Score "); sscore.append(QString::number(score)); QMessageBox::warning(this, tr("End Game"),sscore,QMessageBox::Escape); - //tread.genera(); - exit(0); + bestScore=0; + readSettings(); + tread.genera(); + //exit(0); } QString sscore("Your Score: "); sscore.append(QString::number(score)); @@ -165,7 +176,9 @@ void MainWindow::cliccaBottone(int id) MainWindow::~MainWindow() { delete ui; + delete statusLed; } + void MainWindow::clickA(){ QSound::play("sounds/dog.wav"); emit cliccatoIlBottone(0); @@ -177,36 +190,43 @@ void MainWindow::clickB(){ emit cliccatoIlBottone(1); } + void MainWindow::clickC(){ QSound::play("sounds/cow.wav"); emit cliccatoIlBottone(2); } + void MainWindow::clickD(){ QSound::play("sounds/duck.wav"); emit cliccatoIlBottone(3); } + void MainWindow::clickE(){ QSound::play("sounds/goat.wav"); emit cliccatoIlBottone(4); } + void MainWindow::clickF(){ QSound::play("sounds/donkey.wav"); emit cliccatoIlBottone(5); } + void MainWindow::clickG(){ QSound::play("sounds/crow.wav"); emit cliccatoIlBottone(6); } + void MainWindow::clickH(){ QSound::play("sounds/rosteer.wav"); emit cliccatoIlBottone(7); } + void MainWindow::clickI(){ QSound::play("sounds/bleeeh.wav"); emit cliccatoIlBottone(8); @@ -225,6 +245,7 @@ void MainWindow::changeEvent(QEvent *e) break; } } + void MainWindow::writeSettings() { QSettings settings("Emmynet Inc.", "QMemory");