Exemple #1
0
void Window::toggleTray(QSystemTrayIcon::ActivationReason reason) {
	if (cPlatform() == dbipMac && psIsActive()) return;
	if (reason == QSystemTrayIcon::Context) {
		updateTrayMenu(true);
		QTimer::singleShot(1, this, SLOT(psShowTrayMenu()));
	} else {
		if (psIsActive()) {
			minimizeToTray();
		} else {
			showFromTray(reason);
		}
	}
}
Exemple #2
0
void Window::toggleTray(QSystemTrayIcon::ActivationReason reason) {
	if (reason != QSystemTrayIcon::Context) {
		if (psIsActive()) {
			minimizeToTray();
		} else {
			showFromTray(reason);
		}
	}
}
Exemple #3
0
void Window::updateTrayMenu(bool force) {
    if (!trayIconMenu || (cPlatform() == dbipWindows && !force) || cPlatform() == dbipLinux32 || cPlatform() == dbipLinux64) return;

	bool active = psIsActive();
	QAction *first = trayIconMenu->actions().at(0);
	first->setText(lang(active ? lng_minimize_to_tray : lng_open_from_tray));
	disconnect(first, SIGNAL(triggered(bool)), 0, 0);
	connect(first, SIGNAL(triggered(bool)), this, active ? SLOT(minimizeToTray()) : SLOT(showFromTray()));
#ifndef Q_OS_WIN
	if (trayIcon) {
		trayIcon->setContextMenu((active || cPlatform() != dbipMac) ? trayIconMenu : 0);
	}
#endif
}
Exemple #4
0
bool Window::historyIsActive(int state) const {
    return psIsActive(state) && main && main->historyIsActive() && (!settings || !settings->isVisible());
}