Exemplo n.º 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);
		}
	}
}
Exemplo n.º 2
0
void Window::toggleTray(QSystemTrayIcon::ActivationReason reason) {
	if (reason != QSystemTrayIcon::Context) {
		if (psIsActive()) {
			minimizeToTray();
		} else {
			showFromTray(reason);
		}
	}
}
Exemplo n.º 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
}
Exemplo n.º 4
0
bool Window::historyIsActive(int state) const {
    return psIsActive(state) && main && main->historyIsActive() && (!settings || !settings->isVisible());
}