Beispiel #1
0
void MediaNotifier::notify(KFileItem &medium)
{
    kdDebug() << "Notification triggered." << endl;

    NotifierSettings *settings = new NotifierSettings();

    if(settings->autoActionForMimetype(medium.mimetype()) == 0L)
    {
        QValueList< NotifierAction * > actions = settings->actionsForMimetype(medium.mimetype());

        // If only one action remains, it's the "do nothing" action
        // no need to popup in this case.
        if(actions.size() > 1)
        {
            NotificationDialog *dialog = new NotificationDialog(medium, settings);
            dialog->show();
        }
    }
    else
    {
        NotifierAction *action = settings->autoActionForMimetype(medium.mimetype());
        action->execute(medium);
        delete settings;
    }
}
Beispiel #2
0
void Application::showNotification(Notification *notification)
{
	if (SettingsManager::getValue(QLatin1String("Interface/UseNativeNotifications")).toBool() && m_platformIntegration && m_platformIntegration->canShowNotifications())
	{
		m_platformIntegration->showNotification(notification);
	}
	else
	{
		NotificationDialog *dialog = new NotificationDialog(notification);
		dialog->show();
	}
}
void WindowsPlatformIntegration::showNotification(Notification *notification)
{
	TrayIcon *trayIcon = Application::getInstance()->getTrayIcon();

	if (trayIcon && QSystemTrayIcon::supportsMessages())
	{
		trayIcon->showMessage(notification);
	}
	else
	{
		NotificationDialog *dialog = new NotificationDialog(notification);
		dialog->show();
	}
}