Пример #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 ServiceBrowserWindow(Account account)
        {
            SetupUi();

            m_Account = account;
            m_HomeUri = new Uri(String.Format("xmpp:{0}?disco", account.Jid.Server));

            this.WindowTitle = String.Format("XMPP Browser - {0}", account.Jid);

            m_BackAction    = new QAction(Gui.LoadIcon("go-previous", 16), "Back", this);
            m_ForwardAction = new QAction(Gui.LoadIcon("go-next", 16), "Forward", this);
            m_ReloadAction  = new QAction(Gui.LoadIcon("view-refresh", 16), "Reload", this);
            m_StopAction    = new QAction(Gui.LoadIcon("process-stop", 16), "Stop", this);
            m_HomeAction    = new QAction(Gui.LoadIcon("go-home", 16), "Home", this);
            m_GoAction      = new QAction("Go", this);

            m_BackAction.Enabled = false;
            m_ForwardAction.Enabled = false;

            m_StopAction.Visible = false;

            m_Toolbar = new QToolBar(this);
            m_Toolbar.AddAction(m_BackAction);
            m_Toolbar.AddAction(m_ForwardAction);
            m_Toolbar.AddAction(m_ReloadAction);
            m_Toolbar.AddAction(m_StopAction);
            m_Toolbar.AddAction(m_HomeAction);

            m_AddresCombo = new QComboBox(m_Toolbar);
            m_AddresCombo.SetSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed);
            m_AddresCombo.Editable = true;
            m_Toolbar.AddWidget(m_AddresCombo);

            m_Toolbar.AddAction(m_GoAction);

            QObject.Connect<QAction>(m_Toolbar, Qt.SIGNAL("actionTriggered(QAction*)"), HandleToolbarActionTriggered);

            ((QBoxLayout)this.Layout()).InsertWidget(0, m_Toolbar);

            webView.Page().linkDelegationPolicy = QWebPage.LinkDelegationPolicy.DelegateAllLinks;

            RequestUrl(m_HomeUri);

            Gui.CenterWidgetOnScreen(this);
        }
Пример #3
0
 public void InsertAction(QAction before, QAction action)
 {
     interceptor.Invoke("insertAction##", "insertAction(QAction*, QAction*)", typeof(void), typeof(QAction), before, typeof(QAction), action);
 }
Пример #4
0
 public void RemoveAction(QAction action)
 {
     interceptor.Invoke("removeAction#", "removeAction(QAction*)", typeof(void), typeof(QAction), action);
 }
Пример #5
0
 public void Popup(QPoint pos, QAction at)
 {
     interceptor.Invoke("popup##", "popup(const QPoint&, QAction*)", typeof(void), typeof(QPoint), pos, typeof(QAction), at);
 }
Пример #6
0
 static SeparatorCodon()
 {
     s_SeparatorAction = new QAction(null);
     s_SeparatorAction.SetSeparator(true);
 }
Пример #7
0
 void HandlePresenceMenuTriggered(QAction action)
 {
     if (action.Text != "Offline")
         m_Account.Status = new ClientStatus(action.Text, String.Empty);
     else
         m_Account.Status = null;
 }
Пример #8
0
 public virtual void RemoveCustomElement(QWidget parent, QAction action)
 {
     interceptor.Invoke("removeCustomElement##", "removeCustomElement(QWidget*, QAction*)", typeof(void), typeof(QWidget), parent, typeof(QAction), action);
 }
Пример #9
0
 public QAction InsertSeparator(QAction before)
 {
     return((QAction)interceptor.Invoke("insertSeparator#", "insertSeparator(QAction*)", typeof(QAction), typeof(QAction), before));
 }
Пример #10
0
 public void RemoveAction(QAction a)
 {
     interceptor.Invoke("removeAction#", "removeAction(QAction*)", typeof(void), typeof(QAction), a);
 }
Пример #11
0
 protected void InitStyleOption(QStyleOptionMenuItem option, QAction action)
 {
     interceptor.Invoke("initStyleOption##", "initStyleOption(QStyleOptionMenuItem*, const QAction*) const", typeof(void), typeof(QStyleOptionMenuItem), option, typeof(QAction), action);
 }
Пример #12
0
 public new void AddAction(QAction action)
 {
     interceptor.Invoke("addAction#", "addAction(QAction*)", typeof(void), typeof(QAction), action);
 }
Пример #13
0
 public QRect ActionGeometry(QAction arg1)
 {
     return((QRect)interceptor.Invoke("actionGeometry#", "actionGeometry(QAction*) const", typeof(QRect), typeof(QAction), arg1));
 }
Пример #14
0
 public static QAction Exec(List <QAction> actions, QPoint pos, QAction at, QWidget parent)
 {
     return((QAction)staticInterceptor.Invoke("exec?###", "exec(QList<QAction*>, const QPoint&, QAction*, QWidget*)", typeof(QAction), typeof(List <QAction>), actions, typeof(QPoint), pos, typeof(QAction), at, typeof(QWidget), parent));
 }
Пример #15
0
 public QAction Exec(QPoint pos, QAction at)
 {
     return((QAction)interceptor.Invoke("exec##", "exec(const QPoint&, QAction*)", typeof(QAction), typeof(QPoint), pos, typeof(QAction), at));
 }
Пример #16
0
 /// <remarks>
 ///  Sets the label's buddy to buddy.
 ///  See QLabel#setBuddy() for details.
 ///      </remarks>        <short>    Sets the label's buddy to buddy.</short>
 public void SetBuddy(QAction buddy)
 {
     interceptor.Invoke("setBuddy#", "setBuddy(QAction*)", typeof(void), typeof(QAction), buddy);
 }
Пример #17
0
 public QAction InsertMenu(QAction before, QMenu menu)
 {
     return((QAction)interceptor.Invoke("insertMenu##", "insertMenu(QAction*, QMenu*)", typeof(QAction), typeof(QAction), before, typeof(QMenu), menu));
 }
Пример #18
0
 protected virtual KMenu ContextMenu(QAction action)
 {
     return (KMenu) interceptor.Invoke("contextMenu#", "contextMenu(QAction*)", typeof(KMenu), typeof(QAction), action);
 }
Пример #19
0
 public void SetActiveAction(QAction action)
 {
     interceptor.Invoke("setActiveAction#", "setActiveAction(QAction*)", typeof(void), typeof(QAction), action);
 }
Пример #20
0
 public void SetDefaultAction(QAction arg1)
 {
     interceptor.Invoke("setDefaultAction#", "setDefaultAction(QAction*)", typeof(void), typeof(QAction), arg1);
 }
Пример #21
0
 void HandleToolbarActionTriggered(QAction action)
 {
     if (action == m_GoAction) {
         RequestUrl(new Uri(m_AddresCombo.LineEdit().Text));
     } else if (action == m_HomeAction) {
         RequestUrl(m_HomeUri);
     }
 }
Пример #22
0
 public QAction InsertWidget(QAction before, QWidget widget)
 {
     return((QAction)interceptor.Invoke("insertWidget##", "insertWidget(QAction*, QWidget*)", typeof(QAction), typeof(QAction), before, typeof(QWidget), widget));
 }
Пример #23
0
        public GlobalActions()
        {
            m_AccountsMenu = new QMenu();

            m_QuitAction = new QAction(Gui.LoadIcon("application-exit"), "Quit", this);
            m_QuitAction.Shortcut = new QKeySequence("Ctrl+Q");
            QObject.Connect(m_QuitAction, Qt.SIGNAL("triggered()"), HandleQuitActionTriggered);

            m_ShowPreferencesAction = new QAction(Gui.LoadIcon("preferences-desktop"), "Preferences", this);
            QObject.Connect(m_ShowPreferencesAction, Qt.SIGNAL("triggered()"), HandleShowPreferencesActionTriggered);

            m_SendFeedbackAction = new QAction("Send Feedback...", this);
            QObject.Connect(m_SendFeedbackAction, Qt.SIGNAL("triggered()"), HandleSendFeedbackActionTriggered);

            m_ShowBrowserAction = new QAction(Gui.LoadIcon("system-search"), "Discover Services...", this);
            QObject.Connect(m_ShowBrowserAction, Qt.SIGNAL("triggered()"), HandleShowBrowserActionTriggered);

            m_NewMessageAction = new QAction(Gui.LoadIcon("document-new"), "New Message...", this);

            m_JoinMucAction = new QAction(Gui.LoadIcon("internet-group-chat"), "Create/Join Conference...", this);

            m_EditProfileAction = new QAction(Gui.LoadIcon("user-info"), "Edit Profile...", this);
            QObject.Connect(m_EditProfileAction, Qt.SIGNAL("triggered()"), HandleEditProfileActionTriggered);

            m_AboutAction = new QAction(Gui.LoadIcon("help-about"), "About", this);
            QObject.Connect(m_AboutAction, Qt.SIGNAL("triggered()"), HandleAboutActionTriggered);

            m_PresenceMenu = new QMenu();

            QActionGroup group = new QActionGroup(this);
            group.Exclusive = true;

            m_AvailableAction = m_PresenceMenu.AddAction("Available");
            group.AddAction(m_AvailableAction);
            m_AvailableAction.Checkable = true;

            m_FreeToChatAction = m_PresenceMenu.AddAction("Free To Chat");
            group.AddAction(m_FreeToChatAction);
            m_FreeToChatAction.Checkable = true;

            m_AwayAction = m_PresenceMenu.AddAction("Away");
            group.AddAction(m_AwayAction);
            m_AwayAction.Checkable = true;

            m_ExtendedAwayAction = m_PresenceMenu.AddAction("Extended Away");
            group.AddAction(m_ExtendedAwayAction);
            m_ExtendedAwayAction.Checkable = true;

            m_DoNotDisturbAction = m_PresenceMenu.AddAction("Do Not Disturb");
            group.AddAction(m_DoNotDisturbAction);
            m_DoNotDisturbAction.Checkable = true;

            m_PresenceMenu.AddSeparator();

            m_OfflineAction = m_PresenceMenu.AddAction("Offline");
            group.AddAction(m_OfflineAction);
            m_OfflineAction.Checkable = true;

            m_ChangeStatusAction = new QAction("Change Status", this);
            m_ChangeStatusAction.SetMenu(m_PresenceMenu);
        }
Пример #24
0
 void HandlePresenceMenuTriggered(QAction action)
 {
     m_Account.Status = new ClientStatus(action.Text, String.Empty);
 }
Пример #25
0
 public QWidget WidgetForAction(QAction action)
 {
     return((QWidget)interceptor.Invoke("widgetForAction#", "widgetForAction(QAction*) const", typeof(QWidget), typeof(QAction), action));
 }
Пример #26
0
 /// <remarks>
 ///  Adds an action to the runner's action registry.
 ///  The QAction must be created within the GUI thread;
 ///  do not create it within the match method of AbstractRunner.
 /// <param> name="id" A unique identifier string
 /// </param><param> name="action" The QAction to be stored
 ///          </param></remarks>        <short>    Adds an action to the runner's action registry.</short>
 protected void AddAction(string id, QAction action)
 {
     interceptor.Invoke("addAction$#", "addAction(const QString&, QAction*)", typeof(void), typeof(string), id, typeof(QAction), action);
 }
Пример #27
0
 public QRect ActionGeometry(QAction action)
 {
     return (QRect) interceptor.Invoke("actionGeometry#", "actionGeometry(QAction*) const", typeof(QRect), typeof(QAction), action);
 }
Пример #28
0
 /// <remarks>
 ///  Adds the action to our collection under the given name
 ///      </remarks>        <short>    Adds the action to our collection under the given name      </short>
 public void AddAction(string name, QAction action)
 {
     interceptor.Invoke("addAction$#", "addAction(QString, QAction*)", typeof(void), typeof(string), name, typeof(QAction), action);
 }
Пример #29
0
 public QAction InsertSeparator(QAction before)
 {
     return (QAction) interceptor.Invoke("insertSeparator#", "insertSeparator(QAction*)", typeof(QAction), typeof(QAction), before);
 }
Пример #30
0
 public void AddAction(QAction action)
 {
     interceptor.Invoke("addAction#", "addAction(QAction*)", typeof(void), typeof(QAction), action);
 }
Пример #31
0
 public QAction InsertWidget(QAction before, QWidget widget)
 {
     return (QAction) interceptor.Invoke("insertWidget##", "insertWidget(QAction*, QWidget*)", typeof(QAction), typeof(QAction), before, typeof(QWidget), widget);
 }
Пример #32
0
 public void InsertActions(QAction before, List<QAction> actions)
 {
     interceptor.Invoke("insertActions#?", "insertActions(QAction*, QList<QAction*>)", typeof(void), typeof(QAction), before, typeof(List<QAction>), actions);
 }
Пример #33
0
 public QWidget WidgetForAction(QAction action)
 {
     return (QWidget) interceptor.Invoke("widgetForAction#", "widgetForAction(QAction*) const", typeof(QWidget), typeof(QAction), action);
 }
Пример #34
0
 /// <remarks>
 ///  Sets the context menu title action to <code>action.</code>
 ///  The following code shows how to change the current title.
 ///  <code>
 ///  QAction titleAction = contextMenuTitle();
 ///  titleAction.SetText("New Title");
 ///  setContextMenuTitle(titleAction);
 ///  </code>
 /// </remarks>        <short>    Sets the context menu title action to <code>action.</code></short>
 public void SetContextMenuTitle(QAction action)
 {
     interceptor.Invoke("setContextMenuTitle#", "setContextMenuTitle(QAction*)", typeof(void), typeof(QAction), action);
 }
Пример #35
0
 public void Activate(QAction.ActionEvent arg1)
 {
     interceptor.Invoke("activate$", "activate(QAction::ActionEvent)", typeof(void), typeof(QAction.ActionEvent), arg1);
 }
Пример #36
0
 /// <remarks>
 ///  Creates a toolbar label setting a buddy for the label.
 /// <param> name="buddy" The action whose widget which is focused when the label's accelerator is
 ///  typed.
 /// </param><param> name="text" The label's and the action's text.
 /// </param><param> name="parent" This action's parent.
 ///      </param></remarks>        <short>    Creates a toolbar label setting a buddy for the label.</short>
 public KToolBarLabelAction(QAction buddy, string text, QObject parent)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KToolBarLabelAction#$#", "KToolBarLabelAction(QAction*, const QString&, QObject*)", typeof(void), typeof(QAction), buddy, typeof(string), text, typeof(QObject), parent);
 }
Пример #37
0
 public QAction AddAction(QAction a)
 {
     return (QAction) interceptor.Invoke("addAction#", "addAction(QAction*)", typeof(QAction), typeof(QAction), a);
 }
Пример #38
0
 public QAction AddAction(QAction a)
 {
     return((QAction)interceptor.Invoke("addAction#", "addAction(QAction*)", typeof(QAction), typeof(QAction), a));
 }
Пример #39
0
 /// <remarks>
 ///  Adds \a action to the list of URLs, with \a url and title \a name.
 ///  Do not use addAction(QAction), as no url will be associated, and
 ///  consequently urlSelected() will not be emitted when \a action is selected.
 ///    </remarks>        <short>    Adds \a action to the list of URLs, with \a url and title \a name.</short>
 public void AddAction(QAction action, KUrl url, string name)
 {
     interceptor.Invoke("addAction##$", "addAction(QAction*, const KUrl&, const QString&)", typeof(void), typeof(QAction), action, typeof(KUrl), url, typeof(string), name);
 }
Пример #40
0
 /// <remarks>
 ///  Adds the action to our collection under the given name
 ///          </remarks>        <short>    Adds the action to our collection under the given name          </short>
 public void AddAction(string name, QAction action)
 {
     applet.AddAction(name, action);
 }
Пример #41
0
 public override QAction RemoveAction(QAction action)
 {
     return (QAction) interceptor.Invoke("removeAction#", "removeAction(QAction*)", typeof(QAction), typeof(QAction), action);
 }
Пример #42
0
 /// <remarks>
 ///  Sets the selected action
 ///          </remarks>        <short>    Sets the selected action          </short>
 public void SetSelectedAction(QAction action)
 {
     interceptor.Invoke("setSelectedAction#", "setSelectedAction(QAction*)", typeof(void), typeof(QAction), action);
 }
Пример #43
0
 public virtual void RemoveContainer(QWidget container, QWidget parent, QDomElement element, QAction containerAction)
 {
     interceptor.Invoke("removeContainer####", "removeContainer(QWidget*, QWidget*, QDomElement&, QAction*)", typeof(void), typeof(QWidget), container, typeof(QWidget), parent, typeof(QDomElement), element, typeof(QAction), containerAction);
 }
Пример #44
0
        public AccountStatusWidget(Account account, RosterWidget parent, MainWindow parentWindow)
            : base(parent)
        {
            SetupUi();

            m_ParentWindow = parentWindow;

            m_EditProfileDialog = new EditProfileDialog(account, this.TopLevelWidget());

            m_AvatarLabel.Cursor = new QCursor(CursorShape.PointingHandCursor);
            m_AvatarLabel.Clicked += delegate {
                if (m_Account.ConnectionState == AccountConnectionState.Connected) {
                    m_EditProfileDialog.Show(2);
                    m_EditProfileDialog.ActivateWindow();
                } else {
                    // FIXME: It really wouldn't be so hard to make this work.
                    // On connect, check to see if it was changed and update server.
                    QMessageBox.Warning(this.TopLevelWidget(), "Synapse", "Cannot edit avatar when you're not connected.");
                }
            };

            m_Account = account;
            m_Account.ConnectionStateChanged += OnAccountStateChanged;
            m_Account.StatusChanged += OnAccountStateChanged;
            m_Account.MyVCardUpdated += HandleMyVCardUpdated;
            m_Account.AvatarManager.AvatarUpdated += HandleAvatarUpdated;
            OnAccountStateChanged(account);

            HandleAvatarUpdated(m_Account.Jid.Bare, null);

            HandleMyVCardUpdated(null, EventArgs.Empty);
            m_NameLabel.TextFormat = TextFormat.RichText;

            HandleAvatarUpdated(m_Account.Jid.Bare, m_Account.GetProperty("AvatarHash"));

            m_PresenceMenu = new QMenu(this);
            QObject.Connect(m_PresenceMenu, Qt.SIGNAL("aboutToShow()"), HandlePresenceMenuAboutToShow);
            QObject.Connect<QAction>(m_PresenceMenu, Qt.SIGNAL("triggered(QAction*)"), HandlePresenceMenuTriggered);

            QActionGroup group = new QActionGroup(this);
            group.Exclusive = true;

            m_AvailableAction = m_PresenceMenu.AddAction("Available");
            group.AddAction(m_AvailableAction);
            m_AvailableAction.Checkable = true;

            m_FreeToChatAction = m_PresenceMenu.AddAction("Free To Chat");
            group.AddAction(m_FreeToChatAction);
            m_FreeToChatAction.Checkable = true;

            m_AwayAction = m_PresenceMenu.AddAction("Away");
            group.AddAction(m_AwayAction);
            m_AwayAction.Checkable = true;

            m_ExtendedAwayAction = m_PresenceMenu.AddAction("Extended Away");
            group.AddAction(m_ExtendedAwayAction);
            m_ExtendedAwayAction.Checkable = true;

            m_DoNotDisturbAction = m_PresenceMenu.AddAction("Do Not Disturb");
            group.AddAction(m_DoNotDisturbAction);
            m_DoNotDisturbAction.Checkable = true;

            m_PresenceMenu.AddSeparator();

            m_OfflineAction = m_PresenceMenu.AddAction("Offline");
            group.AddAction(m_OfflineAction);
            m_OfflineAction.Checkable = true;
        }
Пример #45
0
 public QActionEvent(int type, QAction action) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QActionEvent$#", "QActionEvent(int, QAction*)", typeof(void), typeof(int), type, typeof(QAction), action);
 }