void SeafileTrayIcon::createActions() { disable_auto_sync_action_ = new QAction(tr("Disable auto sync"), this); connect(disable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(disableAutoSync())); enable_auto_sync_action_ = new QAction(tr("Enable auto sync"), this); connect(enable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(enableAutoSync())); view_unread_seahub_notifications_action_ = new QAction(tr("View unread notifications"), this); connect(view_unread_seahub_notifications_action_, SIGNAL(triggered()), this, SLOT(viewUnreadNotifications())); quit_action_ = new QAction(tr("&Quit"), this); connect(quit_action_, SIGNAL(triggered()), this, SLOT(quitSeafile())); toggle_main_window_action_ = new QAction(tr("Show main window"), this); connect(toggle_main_window_action_, SIGNAL(triggered()), this, SLOT(toggleMainWindow())); settings_action_ = new QAction(tr("Settings"), this); connect(settings_action_, SIGNAL(triggered()), this, SLOT(showSettingsWindow())); open_log_directory_action_ = new QAction(tr("Open &logs folder"), this); open_log_directory_action_->setStatusTip(tr("open seafile log directory")); connect(open_log_directory_action_, SIGNAL(triggered()), this, SLOT(openLogDirectory())); about_action_ = new QAction(tr("&About"), this); about_action_->setStatusTip(tr("Show the application's About box")); connect(about_action_, SIGNAL(triggered()), this, SLOT(about())); open_help_action_ = new QAction(tr("&Online help"), this); open_help_action_->setStatusTip(tr("open seafile online help")); connect(open_help_action_, SIGNAL(triggered()), this, SLOT(openHelp())); }
Toy* Toys::AddToy(Toy::EnumToyType type) { Toy *toy = Toy::Create(type, m_pClient, /*parent*/0, GetWindowFlags()); if( toy ) { connect(toy, SIGNAL(recvWidgetsChanged()), this, SLOT(onRecvWidgetsChanged())); connect(toy, SIGNAL(closing(Toy*)), this, SLOT(onToyClosing(Toy*))); connect(toy, SIGNAL(changed()), this, SLOT(onToyChanged())); connect(toy, SIGNAL(toggleMainWindow()), this, SLOT(onToyToggledMainWindow())); if(m_Opacity != 100) toy->setWindowOpacity(m_Opacity * 0.01); m_List.push_back(toy); if( !m_Loading ) { toy->showNormal(); BuildRecvWidgetsTable(); toy->raise(); } emit changed(); } return toy; }
void SeafileTrayIcon::createActions() { disable_auto_sync_action_ = new QAction(tr("Disable auto sync"), this); connect(disable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(disableAutoSync())); enable_auto_sync_action_ = new QAction(tr("Enable auto sync"), this); connect(enable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(enableAutoSync())); quit_action_ = new QAction(tr("&Quit"), this); connect(quit_action_, SIGNAL(triggered()), this, SLOT(quitSeafile())); toggle_main_window_action_ = new QAction(tr("Show main window"), this); connect(toggle_main_window_action_, SIGNAL(triggered()), this, SLOT(toggleMainWindow())); settings_action_ = new QAction(tr("Settings"), this); connect(settings_action_, SIGNAL(triggered()), this, SLOT(showSettingsWindow())); about_action_ = new QAction(tr("&About"), this); about_action_->setStatusTip(tr("Show the application's About box")); connect(about_action_, SIGNAL(triggered()), this, SLOT(about())); open_help_action_ = new QAction(tr("&Online help"), this); open_help_action_->setStatusTip(tr("open seafile online help")); connect(open_help_action_, SIGNAL(triggered()), this, SLOT(openHelp())); }
void SeafileTrayIcon::onClick() { if (state_ == STATE_HAVE_UNREAD_MESSAGE) { viewUnreadNotifications(); } else { toggleMainWindow(); } }
void SeafileTrayIcon::onActivated(QSystemTrayIcon::ActivationReason reason) { qDebug("onActivated: %d", reason); #ifndef Q_WS_MAC switch(reason) { case QSystemTrayIcon::Trigger: // single click case QSystemTrayIcon::MiddleClick: case QSystemTrayIcon::DoubleClick: toggleMainWindow(); break; default: return; } #endif }
void SeafileTrayIcon::createActions() { disable_auto_sync_action_ = new QAction(tr("Disable auto sync"), this); connect(disable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(disableAutoSync())); enable_auto_sync_action_ = new QAction(tr("Enable auto sync"), this); connect(enable_auto_sync_action_, SIGNAL(triggered()), this, SLOT(enableAutoSync())); quit_action_ = new QAction(tr("&Quit"), this); connect(quit_action_, SIGNAL(triggered()), this, SLOT(quitSeafile())); toggle_main_window_action_ = new QAction(tr("Show main window"), this); connect(toggle_main_window_action_, SIGNAL(triggered()), this, SLOT(toggleMainWindow())); settings_action_ = new QAction(tr("Settings"), this); connect(settings_action_, SIGNAL(triggered()), this, SLOT(showSettingsWindow())); }
void SeafileTrayIcon::onActivated(QSystemTrayIcon::ActivationReason reason) { qDebug("onActivated: %d", reason); #if defined(Q_WS_MAC) MainWindow *main_win = seafApplet->mainWindow(); if (main_win->isVisible()) { main_win->showWindow(); main_win->raise(); main_win->activateWindow(); } #else switch(reason) { case QSystemTrayIcon::Trigger: // single click case QSystemTrayIcon::MiddleClick: case QSystemTrayIcon::DoubleClick: toggleMainWindow(); break; default: return; } #endif }
void Toys::onToyToggledMainWindow() { emit toggleMainWindow(); }