Exemple #1
0
void PCSpeaker::notify(Notification *notification) {
	kdebugf();
	notification->acquire();
	
	QString linia;
	if (notification->type().compare("NewChat") == 0) {
		linia = config_file.readEntry("PC Speaker", "OnChatPlayString");
	}
	else if (notification->type().compare("NewMessage") == 0) {
		linia = config_file.readEntry("PC Speaker", "OnMessagePlayString");
	}
	else if (notification->type().compare("ConnectionError") == 0) {
		linia = config_file.readEntry("PC Speaker", "OnConnectionErrorPlayString");
	}
	else if (notification->type().contains("StatusChanged", true)) {
		linia = config_file.readEntry("PC Speaker", "OnNotifyPlayString");
	}
	else {
		linia = config_file.readEntry("PC Speaker", "OnOtherMessagePlayString");
	}

	if (linia.length() > 0)
		parseAndPlay(linia);
	else
	    kdebugmf(KDEBUG_ERROR, "\n\nMelody String is empty!\n");

	notification->release();
	kdebugf2();
}
Exemple #2
0
void PCSpeakerNotifier::notify(const Notification &notification)
{
	parseAndPlay(m_configuration->deprecatedApi()->readEntry("PC Speaker", notification.type + "_Sound"));
}
Exemple #3
0
void PCSpeaker::test5() {
	QString linia = dynamic_cast<QLineEdit *>(MainConfigurationWindow::instance()->widgetById("pcspeaker/OnOtherMessagePlayString"))->text();
	if (linia.length()>0)
		parseAndPlay(linia);
}