Esempio n. 1
0
SoundSettingsPage::SoundSettingsPage()
{
    soundEnabledCheckBox.setChecked(settingsCache->getSoundEnabled());
    connect(&soundEnabledCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setSoundEnabled(int)));

    QString themeName = settingsCache->getSoundThemeName();

    QStringList themeDirs = soundEngine->getAvailableThemes().keys();
    for (int i = 0; i < themeDirs.size(); i++) {
        themeBox.addItem(themeDirs[i]);
        if (themeDirs[i] == themeName)
            themeBox.setCurrentIndex(i);
    }

    connect(&themeBox, SIGNAL(currentIndexChanged(int)), this, SLOT(themeBoxChanged(int)));
    connect(&soundTestButton, SIGNAL(clicked()), soundEngine, SLOT(testSound()));

    masterVolumeSlider = new QSlider(Qt::Horizontal);
    masterVolumeSlider->setMinimum(0);
    masterVolumeSlider->setMaximum(100);
    masterVolumeSlider->setValue(settingsCache->getMasterVolume());
    masterVolumeSlider->setToolTip(QString::number(settingsCache->getMasterVolume()));
    connect(settingsCache, SIGNAL(masterVolumeChanged(int)), this, SLOT(masterVolumeChanged(int)));
    connect(masterVolumeSlider, SIGNAL(sliderReleased()), soundEngine, SLOT(testSound()));
    connect(masterVolumeSlider, SIGNAL(valueChanged(int)), settingsCache, SLOT(setMasterVolume(int)));

    masterVolumeSpinBox = new QSpinBox();
    masterVolumeSpinBox->setMinimum(0);
    masterVolumeSpinBox->setMaximum(100);
    masterVolumeSpinBox->setValue(settingsCache->getMasterVolume());
    connect(masterVolumeSlider, SIGNAL(valueChanged(int)), masterVolumeSpinBox, SLOT(setValue(int)));
    connect(masterVolumeSpinBox, SIGNAL(valueChanged(int)), masterVolumeSlider, SLOT(setValue(int)));

#if QT_VERSION < 0x050000
    masterVolumeSlider->setEnabled(false);
    masterVolumeSpinBox->setEnabled(false);
#endif

    QGridLayout *soundGrid = new QGridLayout;
    soundGrid->addWidget(&soundEnabledCheckBox, 0, 0, 1, 3);
    soundGrid->addWidget(&masterVolumeLabel, 1, 0);
    soundGrid->addWidget(masterVolumeSlider, 1, 1);
    soundGrid->addWidget(masterVolumeSpinBox, 1, 2);
    soundGrid->addWidget(&themeLabel, 2, 0);
    soundGrid->addWidget(&themeBox, 2, 1);
    soundGrid->addWidget(&soundTestButton, 3, 1);

    soundGroupBox = new QGroupBox;
    soundGroupBox->setLayout(soundGrid);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(soundGroupBox);

    setLayout(mainLayout);
}
Esempio n. 2
0
void PageEditTeam::connectSignals()
{
    connect(this, SIGNAL(pageLeave()), this, SLOT(saveTeam()));

    signalMapper1 = new QSignalMapper(this);
    signalMapper2 = new QSignalMapper(this);

    connect(signalMapper1, SIGNAL(mapped(int)), this, SLOT(fixHHname(int)));
    connect(signalMapper2, SIGNAL(mapped(int)), this, SLOT(setRandomHogName(int)));

    for(int i = 0; i < HEDGEHOGS_PER_TEAM; i++)
    {
        connect(HHNameEdit[i], SIGNAL(editingFinished()), signalMapper1, SLOT(map()));
        signalMapper1->setMapping(HHNameEdit[i], i);

        connect(btnRandomHogName[i], SIGNAL(clicked()), signalMapper2, SLOT(map()));
        signalMapper2->setMapping(btnRandomHogName[i], i);
    }

    connect(btnRandomTeam, SIGNAL(clicked()), this, SLOT(setRandomTeam()));
    connect(btnRandomNames, SIGNAL(clicked()), this, SLOT(setRandomHogNames()));
    connect(btnRandomHats, SIGNAL(clicked()), this, SLOT(setRandomHats()));

    connect(CBTeamLvl, SIGNAL(currentIndexChanged(const int)), this, SLOT(CBTeamLvl_activated(const int)));

    connect(btnRandomTeamName, SIGNAL(clicked()), this, SLOT(setRandomTeamName()));
    connect(btnRandomGrave, SIGNAL(clicked()), this, SLOT(setRandomGrave()));
    connect(btnRandomFlag, SIGNAL(clicked()), this, SLOT(setRandomFlag()));
    connect(btnRandomVoice, SIGNAL(clicked()), this, SLOT(setRandomVoice()));
    connect(btnRandomFort, SIGNAL(clicked()), this, SLOT(setRandomFort()));

    connect(btnTestSound, SIGNAL(clicked()), this, SLOT(testSound()));

    connect(CBFort, SIGNAL(currentIndexChanged(const int)), this, SLOT(CBFort_activated(const int)));
}
Esempio n. 3
0
int TestLauncher::exec()
{
    if (mTest == "1" || mTest == "2" || mTest == "3" || mTest == "19")
        return testBackend();
    else if (mTest == "4")
        return testSound();
    else if (mTest == "5" || mTest == "6" || mTest == "7" || mTest == "18")
        return testRescale();
    else if (mTest == "8" || mTest == "9" || mTest == "10" || mTest == "17")
        return testFps();
    else if (mTest == "11")
        return testBatches();
    else if (mTest == "14" || mTest == "15" || mTest == "16" || mTest == "20")
        return testTextures();
    else if (mTest == "99")
        return testVideoDetection();
    else if (mTest == "100")
        return testInternal();
    else if (mTest == "101")
        return testDye();
    else if (mTest == "102")
        return testDraw();
    else if (mTest == "103")
        return testFps2();
    else if (mTest == "104")
        return testFps3();
    else if (mTest == "105")
        return testDyeSpeed();
    else if (mTest == "106")
        return testStackSpeed();

    return -1;
}
Esempio n. 4
0
SelectSoundDialog::SelectSoundDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SelectSoundDialog)
{

    ui->setupUi(this);
    connect(ui->browseButton,SIGNAL(clicked()),this,SLOT(browse()));

    QSettings settings("KitchenAlert","KitchenAlert");
    QString filename = settings.value("soundfile").toString();
    ui->lineEdit->setText(filename);

    bool useDefaultSoundFile = settings.value("UseDefaultSound",true).toBool();
    if (useDefaultSoundFile == true)
    {
        ui->DefaultSoundRadioButton->setChecked(true);
        ui->browseButton->setDisabled(true);
        ui->lineEdit->setDisabled(true);
    }
    else ui->CustomSoundRadioButton->setChecked(true);
//    qDebug() << "UseDefaultSoundfile is " << useDefaultSoundFile;



    isTesting_ = false;
    connect(ui->TestButton,SIGNAL(clicked()),this,SLOT(testSound()));
}
Esempio n. 5
0
OptionsWindow::~OptionsWindow()
{
	QObject::disconnect(mediaObject,SIGNAL(finished()),this,SLOT(soundEnded()));
	QObject::disconnect(ui.save,SIGNAL(clicked()),this,SLOT(setOpts()));
	QObject::disconnect(ui.browse,SIGNAL(clicked()),this,SLOT(setFilePath()));
	QObject::disconnect(ui.clear,SIGNAL(clicked()),this,SLOT(clearFilePath()));
	QObject::disconnect(ui.test,SIGNAL(clicked()),this,SLOT(testSound()));
	delete numValidator;
	delete audioOutput;
	delete mediaObject;
}
Esempio n. 6
0
void test::run()
{
   if (testSound())
      return;

   if (testVideo())
      return;

   if (testTimer())
      return;

   if (testEvents())
      return;

   thin_printf("\ntest complete.\n");
}
Esempio n. 7
0
OptionsWindow::OptionsWindow(ImageCache *i,QWidget *parent)
    : QDialog(parent),initialTheme(-1)
{
	images = i;

	ui.setupUi(this);

	mediaObject = new Phonon::MediaObject(this);
	audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
	path = Phonon::createPath(mediaObject, audioOutput);

	numValidator=new QIntValidator(1,99999,this);
	ui.minTweets->setValidator(numValidator);
	ui.tweetPruneAge->setValidator(numValidator);
	ui.tabWidget->setCurrentIndex(0);

	QObject::connect(mediaObject,SIGNAL(finished()),this,SLOT(soundEnded()));
	QObject::connect(ui.save,SIGNAL(clicked()),this,SLOT(setOpts()));
	QObject::connect(ui.browse,SIGNAL(clicked()),this,SLOT(setFilePath()));
	QObject::connect(ui.mainbrowse,SIGNAL(clicked()),this,SLOT(setUserMainStylesheetPath()));
	QObject::connect(ui.textbrowse,SIGNAL(clicked()),this,SLOT(setUserTextStylesheetPath()));
	QObject::connect(ui.reloadstylesheet,SIGNAL(clicked()),this,SLOT(handleReloadUserStylesheet()));
	QObject::connect(ui.clear,SIGNAL(clicked()),this,SLOT(clearFilePath()));
	QObject::connect(ui.test,SIGNAL(clicked()),this,SLOT(testSound()));
	QObject::connect(ui.theme,SIGNAL(currentRowChanged(int)),this,SLOT(handleThemeChange(int)));
	QObject::connect(ui.twitteraccounts,SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(handleAccountClicked(QListWidgetItem*)));
	QObject::connect(ui.twitterUser,SIGNAL(textChanged(QString)),this,SLOT(twitterUserChanged(QString)));
	QObject::connect(ui.clearoauth,SIGNAL(clicked()),this,SLOT(handleClearOAuth()));
	QObject::connect(ui.clearlang,SIGNAL(clicked()),this,SLOT(handleClearLang()));
	QObject::connect(ui.resetsettings,SIGNAL(clicked()),this,SLOT(handleResetSettings()));
	QObject::connect(ui.removeallsettings,SIGNAL(clicked()),this,SLOT(handleRemoveAllSettings()));
	QObject::connect(ui.minrefreshtime,SIGNAL(sliderMoved(int)),this,SLOT(handleMinRefreshSliderMove(int)));

	mainWindow=(Ya_st*)parent;

	setObjectName("optionswindow");

	// Populate languages
	QMap<QString,QString> lang = Translator::getLanguages();
	QList<QString> keys = lang.keys();

	for(int x=0;x<keys.size();x++) {
		ui.lang->addItem(lang.value(keys.at(x)),keys.at(x));
	}

//	QMessageBox::information (0,"assdf",tr("<style>")+Ya_st::labelCSS+tr("</style><p>You can set a default filter that will apply to all tweet columns, for example you could filter out all occurances of a particular hash tag, or all messages sent from a particular client.</p><p>To show tweets with <b class=\"hi\">certain words</b> type <b class='type'>certain words</b>. To hide other salacious terms use -salacious.</p><p>For users use @Fred, and -@Barny.</p><p>For clients use @@yasst, and -@@Spambot.</p>"));
}
Esempio n. 8
0
bool qGo::testSound(bool showmsg)
{
	// qDebug("qGo::testSound()");
	
	// Sound system supported?
	if (!QSound::available())
	{
		if (showmsg)
		{
#ifdef Q_WS_WIN
			QMessageBox::information(0, PACKAGE, tr("No sound available."));
			clickSound = NULL;
			return false;
#elif defined (Q_OS_MACX) 
			QMessageBox::information(0, PACKAGE, tr("No sound available. Qt on Mac uses QuickTime sound."));
#else
			QMessageBox::information(0, PACKAGE, tr("You are not running the Network Audio system.\n"
				"If you have the `au' command, run it in the background before this program. The latest release of the Network Audio System can be obtained from:\n\n"
				"ftp.ncd.com:/pub/ncd/technology/src/nas\n"
				"ftp.x.org:/contrib/audio/nas\n\n"
				"Release 1.2 of NAS is also included with the X11R6 contrib distribution. After installing NAS, you will then need to reconfigure Qt with NAS sound support.\n\n"
				"Nevertheless, if you have oss, sound should be working and directed to /dev/dsp"));
#endif
		}
	}
	else if (showmsg)
	{
		QMessageBox::information(0, PACKAGE, tr("Sound available."));
		return true;
	}
	
	//    qDebug("Sound available, checking for sound files...");

	// Sound files found?
	QStringList list;

	ASSERT(setting->program_dir);

#ifdef Q_WS_WIN
	list << applicationPath + "/sounds"
		<< setting->program_dir + "/sounds"
		<< "C:/Program Files/qGo/sounds"
		<< "D:/Program Files/qGo/sounds"
		<< "E:/Program Files/qGo/sounds"
		<< "C:/Programme/qGo/sounds"
		<< "D:/Programme/qGo/sounds"
		<< "E:/Programme/qGo/sounds"
		<< "./sounds";
#elif defined(Q_OS_MACX)
	//get the bundle path and find our resources like sounds
	CFURLRef bundleRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
	CFStringRef bundlePath = CFURLCopyFileSystemPath(bundleRef, kCFURLPOSIXPathStyle);
	list << (QString)CFStringGetCStringPtr(bundlePath, CFStringGetSystemEncoding())		
		+ "/Contents/Resources";
#else
	// BUG 1165950 -- it may be better to use binreloc rather than
	// DATADIR
	list << DATADIR "/sounds"
	     << setting->program_dir + "/sounds"
		<< "./share/" PACKAGE "/sounds"
		<< "/usr/share/" PACKAGE "/sounds"
		<< "/usr/local/share/" PACKAGE "/sounds"
		<< "/sounds"
		<< "./sounds"
		<< "./src/sounds";                           //SL added eb 7
	
#endif

	SearchPath sp;
	sp << list;

	clickSound   = retrieveSound("stone.wav", sp);
	talkSound    = retrieveSound("talk.wav" , sp);
	matchSound   = retrieveSound("match.wav" , sp);
	passSound    = retrieveSound("pass.wav", sp);
	gameEndSound = retrieveSound("gameend.wav" , sp);
	timeSound    = retrieveSound("tictoc.wav" , sp);
	saySound     = retrieveSound("say.wav" , sp);
	enterSound   = retrieveSound("enter.wav", sp);
	leaveSound   = retrieveSound("leave.wav" , sp);
	connectSound = retrieveSound("connect.wav", sp);

#ifdef Q_WS_WIN
	if (soundsFound() && applicationPath.isEmpty())
	{
	  QFile qFile = QFile(connectSound->fileName()); // QQQ
	  QDir * dir = sp.findDirContainingFile(qFile); // QQQ
	  QString s = dir->dirName();
	  applicationPath = s.left(s.find("/sounds"));
	  // QMessageBox::information(0, "SAVING", applicationPath);
	}
			
#endif
	if (soundsFound())
	  return true;

#ifdef Q_OS_MACX
	QMessageBox::information(0, PACKAGE, tr("No sound files in bundle, strange.\n"));
#elif ! defined(Q_WS_WIN)
	QMessageBox::information(0, PACKAGE, tr("Sound files not found.") + "\n" +
		tr("Please check for the directories") + " /usr/local/share/" + PACKAGE + "/sounds/ " + tr("or") +
		" /usr/share/" + PACKAGE + "/sounds/, " + tr("depending on your installation."));
#else

	applicationPath = setting->readEntry("PATH_SOUND");
	if (applicationPath.isEmpty())
		return testSound(false);

	QMessageBox::information(0, PACKAGE, tr("Sound files not found.") + "\n" +
			     tr("You can navigate to the main qGo directory (for example:") + " C:\\Program Files\\" + PACKAGE + " .\n" +
				 tr("If the directory was given correctly, this data will be saved and you won't"
				 "be asked\nanymore except you install qGo again into a different directory.\n"
				 "To abort this procedure, click 'Cancel' in the following dialog."));
    
	applicationPath = Q3FileDialog::getExistingDirectory(NULL, NULL, "appdir", tr("qGo directory"), true);
	
	if (applicationPath.isNull() || applicationPath.isEmpty())
	{
		QMessageBox::warning(0, PACKAGE, tr("No valid directory was given. Sound is not available."));
		return false;
	}

	// save path
   	setting->writeEntry("PATH_SOUND", applicationPath);

	// QMessageBox::information(0, "TRYING AGAIN", applicationPath);
	return testSound(false);
#endif
	return false;
}