Esempio n. 1
0
SeafileTrayIcon::SeafileTrayIcon(QObject *parent)
    : QSystemTrayIcon(parent),
      nth_trayicon_(0),
      rotate_counter_(0),
      state_(STATE_DAEMON_UP)
{
    setState(STATE_DAEMON_DOWN);
    rotate_timer_ = new QTimer(this);
    connect(rotate_timer_, SIGNAL(timeout()), this, SLOT(rotateTrayIcon()));

    refresh_timer_ = new QTimer(this);
    connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(refreshTrayIcon()));
    connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(refreshTrayIconToolTip()));

    createActions();
    createContextMenu();

    connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(onActivated(QSystemTrayIcon::ActivationReason)));

    connect(SeahubNotificationsMonitor::instance(), SIGNAL(notificationsChanged()),
            this, SLOT(onSeahubNotificationsChanged()));

#ifdef Q_OS_WIN32
    connect(this, SIGNAL(messageClicked()),
            this, SLOT(onMessageClicked()));
#endif

    hide();

    createGlobalMenuBar();
#if defined(Q_OS_MAC)
    tnm = new TrayNotificationManager(this);
#endif
}
Esempio n. 2
0
TrayIcon::TrayIcon(AppCore *core)
  : QSystemTrayIcon(core)
  , m_core(core)
  , m_message(Unknown)
{
  setIcon(QIcon(QLatin1String(":/images/icon16.png")));
  setToolTip(QString("%1 %2").arg(PRODUCT_NAME).arg(VERSION_STRING));

  m_widget = new QWidget();
  RecentItemDelegate *delegate = new RecentItemDelegate(core, this);

  m_window = new TrayWindow(core, m_widget);
  m_window->installEventFilter(this);
  m_window->recentView()->setItemDelegate(delegate);
  m_window->recentView()->setModel(core->recentModel());

  QTimer::singleShot(0, this, SLOT(show()));
  QTimer::singleShot(1000, this, SLOT(show()));

  connect(this, SIGNAL(messageClicked()), SLOT(onMessageClicked()));
  connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), SLOT(onActivated(QSystemTrayIcon::ActivationReason)));
  connect(m_window, SIGNAL(grabRect()), m_core, SLOT(grabRect()));
  connect(m_window, SIGNAL(grabScreen()), m_core, SLOT(grabScreen()));
  connect(m_window, SIGNAL(openFile()), m_core, SLOT(openFile()));
  connect(delegate, SIGNAL(closeRequest()), m_window, SLOT(close()));
  connect(delegate, SIGNAL(linkCopied(QUrl)), SLOT(onLinkCopied(QUrl)));
  connect(core->autoUpdate(), SIGNAL(done(int)), SLOT(onUpdateDone(int)));
}
Esempio n. 3
0
SeafileTrayIcon::SeafileTrayIcon(QObject *parent)
    : QSystemTrayIcon(parent),
      nth_trayicon_(0),
      rotate_counter_(0),
      state_(STATE_DAEMON_UP),
      next_message_msec_(0),
      sync_errors_dialog_(nullptr),
      about_dialog_(nullptr),
      log_dir_uploader_(nullptr)
{
    setState(STATE_DAEMON_DOWN);
    rotate_timer_ = new QTimer(this);
    connect(rotate_timer_, SIGNAL(timeout()), this, SLOT(rotateTrayIcon()));

    refresh_timer_ = new QTimer(this);
    connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(refreshTrayIcon()));
    connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(refreshTrayIconToolTip()));
#if defined(Q_OS_WIN32)
    connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(checkTrayIconMessageQueue()));
#endif

    createActions();
    createContextMenu();

    connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(onActivated(QSystemTrayIcon::ActivationReason)));

#if !defined(Q_OS_LINUX)
    connect(this, SIGNAL(messageClicked()),
            this, SLOT(onMessageClicked()));
#endif

    hide();

    createGlobalMenuBar();
#if defined(Q_OS_MAC)
    tnm = new TrayNotificationManager(this);
#endif
}
Esempio n. 4
0
	void GUIStatusBar::messageBtnClicked()
	{
		onMessageClicked();
	}
Esempio n. 5
0
CWizTrayIcon::CWizTrayIcon(CWizExplorerApp& app, QObject* parent)
    : QSystemTrayIcon(parent)
    , m_app(app)
{
    connect(this, SIGNAL(messageClicked()), SLOT(onMessageClicked()));
}