Exemplo n.º 1
0
void MainWindow::startNewGame()
{
    ListDialog *list = new ListDialog(this);
    if(list->exec() == QDialog::Accepted) {
        ui->openGLWidget->startNewGame(list->getFileName().toUtf8().constData());
    }
}
Exemplo n.º 2
0
int main( int argc, char **argv )
{
  QApplication app( argc, argv );
  ListDialog dlg;
  
  dlg.show();
  
  return app.exec();
}
Exemplo n.º 3
0
void FluidGui::soundFontAddClicked()
      {
      QFileInfoList l = fluid()->sfFiles();

      ListDialog ld;
      foreach (const QFileInfo& fi, l)
            ld.add(fi.fileName(), fi.absoluteFilePath());
      if (!ld.exec())
            return;

      QString sfName = ld.name();
      QString sfPath = ld.path();

      int n = soundFonts->count();
      QStringList sl;
      for (int i = 0; i < n; ++i) {
            QListWidgetItem* item = soundFonts->item(i);
            sl.append(item->text());
            }

      if (sl.contains(sfPath)) {
            QMessageBox::warning(this,
            tr("MuseScore"),
            QString(tr("Soundfont %1 already loaded")).arg(sfPath));
            }
      else {
            bool loaded = fluid()->addSoundFont(sfPath);
            if (!loaded) {
                  QMessageBox::warning(this,
                  tr("MuseScore"),
                  QString(tr("cannot load soundfont %1")).arg(sfPath));
                  }
            else {
                  soundFonts->insertItem(0, sfName);
                  emit sfChanged();
                  }
            }
      updateUpDownButtons();
      }