예제 #1
1
        public TrayIcon(QObject parent)
            : base(parent)
        {
            m_ShowMainWindowAction = new QAction("Show Synapse", this);
            m_ShowMainWindowAction.Checkable = true;
            QObject.Connect(m_ShowMainWindowAction, Qt.SIGNAL("triggered()"), HandleShowMainWindowActionTriggered);

            m_ShowDebugWindowAction = new QAction("Debug Window", this);
            m_ShowDebugWindowAction.Checkable = true;
            QObject.Connect(m_ShowDebugWindowAction, Qt.SIGNAL("triggered()"), HandleShowDebugWindowActionTriggered);

            m_Menu = new QMenu();
            m_Menu.AddAction(m_ShowMainWindowAction);
            m_Menu.AddAction(m_ShowDebugWindowAction);
            m_Menu.AddSeparator();
            m_Menu.AddAction(Gui.GlobalActions.NewMessageAction);
            m_Menu.AddAction(Gui.GlobalActions.JoinConferenceAction);
            m_Menu.AddAction(Gui.GlobalActions.ShowBrowserAction);
            m_Menu.AddAction(Gui.GlobalActions.EditProfileAction);
            m_Menu.AddAction(Gui.GlobalActions.ChangeStatusAction);
            m_Menu.AddSeparator();
            m_Menu.AddAction(Gui.GlobalActions.ShowPreferencesAction);
            m_Menu.AddSeparator();
            m_Menu.AddAction(Gui.GlobalActions.AboutAction);
            m_Menu.AddAction(Gui.GlobalActions.SendFeedbackAction);
            m_Menu.AddSeparator();
            m_Menu.AddAction(Gui.GlobalActions.QuitAction);
            QObject.Connect(m_Menu, Qt.SIGNAL("aboutToShow()"), HandleMenuAboutToShow);

            QPixmap pixmap = new QPixmap("resource:/octy-22.png");
            QIcon icon = new QIcon(pixmap);
            m_Icon = new QSystemTrayIcon(icon);
            m_Icon.SetContextMenu(m_Menu);

            QObject.Connect<QSystemTrayIcon.ActivationReason>(m_Icon, Qt.SIGNAL("activated(QSystemTrayIcon::ActivationReason)"), HandleTrayActivated);
        }
예제 #2
0
 public void ShowMessage(string title, string msg, QSystemTrayIcon.MessageIcon icon)
 {
     interceptor.Invoke("showMessage$$$", "showMessage(const QString&, const QString&, QSystemTrayIcon::MessageIcon)", typeof(void), typeof(string), title, typeof(string), msg, typeof(QSystemTrayIcon.MessageIcon), icon);
 }
예제 #3
0
파일: KPassivePopup.cs 프로젝트: KDE/kimono
 public static KPassivePopup Message(int popupStyle, string caption, string text, QPixmap icon, QSystemTrayIcon parent)
 {
     return (KPassivePopup) staticInterceptor.Invoke("message$$$##", "message(int, const QString&, const QString&, const QPixmap&, QSystemTrayIcon*)", typeof(KPassivePopup), typeof(int), popupStyle, typeof(string), caption, typeof(string), text, typeof(QPixmap), icon, typeof(QSystemTrayIcon), parent);
 }
예제 #4
0
파일: KPassivePopup.cs 프로젝트: KDE/kimono
 /// <remarks>
 ///  Convenience method that displays popup with the specified caption and message
 ///  beside the icon of the specified QSystemTrayIcon.
 ///  Note that the returned object is destroyed when it is hidden.
 /// </remarks>        <short>    Convenience method that displays popup with the specified caption and message  beside the icon of the specified QSystemTrayIcon.</short>
 ///         <see> setAutoDelete</see>
 public static KPassivePopup Message(string caption, string text, QSystemTrayIcon parent)
 {
     return (KPassivePopup) staticInterceptor.Invoke("message$$#", "message(const QString&, const QString&, QSystemTrayIcon*)", typeof(KPassivePopup), typeof(string), caption, typeof(string), text, typeof(QSystemTrayIcon), parent);
 }
예제 #5
0
 void IDisposable.Dispose()
 {
     Hide();
     m_Icon.Dispose();
     m_Icon = null;
 }
예제 #6
0
 void HandleTrayActivated(QSystemTrayIcon.ActivationReason reason)
 {
     if (reason == QSystemTrayIcon.ActivationReason.Trigger) {
         if (Gui.MainWindow.IsVisible())
             Gui.MainWindow.Hide();
         else
             Gui.MainWindow.Show();
     }
 }