Exemplo n.º 1
0
    public void SetupUi(QMainWindow MainWindow)
    {
        if (MainWindow.ObjectName == "")
        {
            MainWindow.ObjectName = "MainWindow";
        }
        QSize Size = new QSize(631, 570);

        Size                                 = Size.ExpandedTo(MainWindow.MinimumSizeHint());
        MainWindow.Size                      = Size;
        MainWindow.MinimumSize               = new QSize(600, 450);
        MainWindow.WindowIcon                = new QIcon(":/main/resources/monosim_128.png");
        MenuFileNew                          = new QAction(MainWindow);
        MenuFileNew.ObjectName               = "MenuFileNew";
        MenuFileNew.icon                     = new QIcon(":/toolbar/resources/qt/document-new.png");
        MenuFileOpen                         = new QAction(MainWindow);
        MenuFileOpen.ObjectName              = "MenuFileOpen";
        MenuFileOpen.icon                    = new QIcon(":/toolbar/resources/qt/document-open.png");
        MenuFileSaveFile                     = new QAction(MainWindow);
        MenuFileSaveFile.ObjectName          = "MenuFileSaveFile";
        MenuFileSaveFile.Enabled             = false;
        MenuFileSaveFile.icon                = new QIcon(":/toolbar/resources/qt/document-save.png");
        MenuFileSaveSim                      = new QAction(MainWindow);
        MenuFileSaveSim.ObjectName           = "MenuFileSaveSim";
        MenuFileSaveSim.Enabled              = false;
        MenuFileSaveSim.icon                 = new QIcon(":/main/resources/chip_32.png");
        MenuFileClose                        = new QAction(MainWindow);
        MenuFileClose.ObjectName             = "MenuFileClose";
        MenuFileClose.Enabled                = false;
        MenuFileClose.icon                   = new QIcon(":/toolbar/resources/qt/document-close.png");
        MenuFileSettings                     = new QAction(MainWindow);
        MenuFileSettings.ObjectName          = "MenuFileSettings";
        MenuFileSettings.icon                = new QIcon(":/toolbar/resources/qt/configure.png");
        MenuFileExit                         = new QAction(MainWindow);
        MenuFileExit.ObjectName              = "MenuFileExit";
        MenuFileExit.icon                    = new QIcon(":/toolbar/resources/qt/application-exit.png");
        MenuSimConnect                       = new QAction(MainWindow);
        MenuSimConnect.ObjectName            = "MenuSimConnect";
        MenuSimConnect.icon                  = new QIcon(":/toolbar/resources/qt/network-connect.png");
        MenuSimPin                           = new QAction(MainWindow);
        MenuSimPin.ObjectName                = "MenuSimPin";
        MenuSimPin.Enabled                   = false;
        MenuSimPin.icon                      = new QIcon(":/toolbar/resources/qt/document-encrypt.png");
        MenuSimSaveFile                      = new QAction(MainWindow);
        MenuSimSaveFile.ObjectName           = "MenuSimSaveFile";
        MenuSimSaveFile.Enabled              = false;
        MenuSimSaveFile.icon                 = new QIcon(":/toolbar/resources/qt/document-save.png");
        MenuSimSaveSim                       = new QAction(MainWindow);
        MenuSimSaveSim.ObjectName            = "MenuSimSaveSim";
        MenuSimSaveSim.Enabled               = false;
        MenuSimSaveSim.icon                  = new QIcon(":/main/resources/chip_32.png");
        MenuSimDeleteAll                     = new QAction(MainWindow);
        MenuSimDeleteAll.ObjectName          = "MenuSimDeleteAll";
        MenuSimDeleteAll.Enabled             = false;
        MenuSimDeleteAll.icon                = new QIcon(":/toolbar/resources/qt/edit-delete.png");
        MenuSimDisconnect                    = new QAction(MainWindow);
        MenuSimDisconnect.ObjectName         = "MenuSimDisconnect";
        MenuSimDisconnect.Enabled            = false;
        MenuSimDisconnect.icon               = new QIcon(":/toolbar/resources/qt/network-disconnect.png");
        MenuAboutInfo                        = new QAction(MainWindow);
        MenuAboutInfo.ObjectName             = "MenuAboutInfo";
        MenuAboutInfo.icon                   = new QIcon(":/toolbar/resources/qt/dialog-information.png");
        centralwidget                        = new QWidget(MainWindow);
        centralwidget.ObjectName             = "centralwidget";
        gridLayout                           = new QGridLayout(centralwidget);
        gridLayout.ObjectName                = "gridLayout";
        splitter                             = new QSplitter(centralwidget);
        splitter.ObjectName                  = "splitter";
        splitter.Orientation                 = Qt.Orientation.Vertical;
        splitter.ChildrenCollapsible         = false;
        FrameFile                            = new QGroupBox(splitter);
        FrameFile.ObjectName                 = "FrameFile";
        FrameFile.MinimumSize                = new QSize(0, 100);
        gridLayout1                          = new QGridLayout(FrameFile);
        gridLayout1.ObjectName               = "gridLayout1";
        LstFileContacts                      = new QTreeWidget(FrameFile);
        LstFileContacts.ObjectName           = "LstFileContacts";
        LstFileContacts.Enabled              = false;
        LstFileContacts.EditTriggers         = Qyoto.Qyoto.GetCPPEnumValue("QAbstractItemView", "NoEditTriggers");
        LstFileContacts.selectionMode        = QAbstractItemView.SelectionMode.ExtendedSelection;
        LstFileContacts.ItemsExpandable      = false;
        LstFileContacts.ExpandsOnDoubleClick = false;

        gridLayout1.AddWidget(LstFileContacts, 0, 0, 1, 1);

        splitter.AddWidget(FrameFile);
        FrameSim                            = new QGroupBox(splitter);
        FrameSim.ObjectName                 = "FrameSim";
        FrameSim.MinimumSize                = new QSize(0, 100);
        gridLayout2                         = new QGridLayout(FrameSim);
        gridLayout2.ObjectName              = "gridLayout2";
        LstSimContacts                      = new QTreeWidget(FrameSim);
        LstSimContacts.ObjectName           = "LstSimContacts";
        LstSimContacts.Enabled              = false;
        LstSimContacts.EditTriggers         = Qyoto.Qyoto.GetCPPEnumValue("QAbstractItemView", "NoEditTriggers");
        LstSimContacts.selectionMode        = QAbstractItemView.SelectionMode.ExtendedSelection;
        LstSimContacts.ItemsExpandable      = false;
        LstSimContacts.ExpandsOnDoubleClick = false;

        gridLayout2.AddWidget(LstSimContacts, 0, 0, 1, 1);

        splitter.AddWidget(FrameSim);

        gridLayout.AddWidget(splitter, 0, 0, 1, 1);

        MainWindow.SetCentralWidget(centralwidget);
        MainMenu                  = new QMenuBar(MainWindow);
        MainMenu.ObjectName       = "MainMenu";
        MainMenu.Geometry         = new QRect(0, 0, 631, 24);
        MenuFileItem              = new QMenu(MainMenu);
        MenuFileItem.ObjectName   = "MenuFileItem";
        MenuReaderItem            = new QMenu(MainMenu);
        MenuReaderItem.ObjectName = "MenuReaderItem";
        MenuAboutItem             = new QMenu(MainMenu);
        MenuAboutItem.ObjectName  = "MenuAboutItem";
        MenuSimItem               = new QMenu(MainMenu);
        MenuSimItem.ObjectName    = "MenuSimItem";
        MainWindow.SetMenuBar(MainMenu);
        StatusBar            = new QStatusBar(MainWindow);
        StatusBar.ObjectName = "StatusBar";
        MainWindow.SetStatusBar(StatusBar);
        TopToolBar            = new QToolBar(MainWindow);
        TopToolBar.ObjectName = "TopToolBar";
        TopToolBar.Movable    = false;
        TopToolBar.Floatable  = false;
        MainWindow.AddToolBar(Qt.ToolBarArea.TopToolBarArea, TopToolBar);

        MainMenu.AddAction(MenuFileItem.MenuAction());
        MainMenu.AddAction(MenuReaderItem.MenuAction());
        MainMenu.AddAction(MenuSimItem.MenuAction());
        MainMenu.AddAction(MenuAboutItem.MenuAction());
        MenuFileItem.AddAction(MenuFileNew);
        MenuFileItem.AddAction(MenuFileOpen);
        MenuFileItem.AddAction(MenuFileSaveFile);
        MenuFileItem.AddAction(MenuFileSaveSim);
        MenuFileItem.AddAction(MenuFileClose);
        MenuFileItem.AddSeparator();
        MenuFileItem.AddAction(MenuFileSettings);
        MenuFileItem.AddSeparator();
        MenuFileItem.AddAction(MenuFileExit);
        MenuAboutItem.AddAction(MenuAboutInfo);
        MenuSimItem.AddAction(MenuSimConnect);
        MenuSimItem.AddAction(MenuSimPin);
        MenuSimItem.AddSeparator();
        MenuSimItem.AddAction(MenuSimSaveFile);
        MenuSimItem.AddAction(MenuSimSaveSim);
        MenuSimItem.AddAction(MenuSimDeleteAll);
        MenuSimItem.AddSeparator();
        MenuSimItem.AddAction(MenuSimDisconnect);
        TopToolBar.AddAction(MenuFileNew);
        TopToolBar.AddAction(MenuFileOpen);
        TopToolBar.AddAction(MenuFileSaveFile);
        TopToolBar.AddAction(MenuFileSaveSim);
        TopToolBar.AddAction(MenuFileClose);
        TopToolBar.AddSeparator();
        TopToolBar.AddAction(MenuFileSettings);
        TopToolBar.AddAction(MenuSimConnect);
        TopToolBar.AddAction(MenuSimPin);
        TopToolBar.AddAction(MenuSimSaveFile);
        TopToolBar.AddAction(MenuSimSaveSim);
        TopToolBar.AddAction(MenuSimDisconnect);
        TopToolBar.AddSeparator();
        TopToolBar.AddAction(MenuAboutInfo);
        TopToolBar.AddAction(MenuFileExit);

        RetranslateUi(MainWindow);

        QMetaObject.ConnectSlotsByName(MainWindow);
    } // SetupUi
Exemplo n.º 2
0
        public RosterWidget(QWidget parent) : base(parent)
        {
            SetupUi();

            var settingsService = ServiceManager.Get <SettingsService>();

            m_RosterModel = new RosterAvatarGridModel();
            m_RosterModel.ShowTransports = settingsService.Get <bool>("RosterShowTransports");
            m_RosterModel.ShowOffline    = settingsService.Get <bool>("RosterShowOffline");
            rosterGrid.Model             = m_RosterModel;
            rosterGrid.ItemActivated    += HandleItemActivated;
            rosterGrid.ShowGroupCounts   = true;
            rosterGrid.InstallEventFilter(new KeyPressEater(delegate(QKeyEvent evnt) {
                if (!String.IsNullOrEmpty(evnt.Text()))
                {
                    rosterSearchButton.Checked = true;
                    friendSearchLineEdit.Text += evnt.Text();
                    friendSearchLineEdit.SetFocus();
                    return(true);
                }
                return(false);
            }, this));

            if (settingsService.Has("RosterIconSize"))
            {
                rosterGrid.IconSize = settingsService.Get <int>("RosterIconSize");
            }

            var accountService = ServiceManager.Get <AccountService>();

            accountService.AccountAdded   += HandleAccountAdded;
            accountService.AccountRemoved += HandleAccountRemoved;
            foreach (Account account in accountService.Accounts)
            {
                HandleAccountAdded(account);
            }

            m_ActivityFeedItems = new Dictionary <string, IActivityFeedItem>();

            rosterGrid.ContextMenuPolicy = Qt.ContextMenuPolicy.CustomContextMenu;

            m_RosterMenu = new QMenu(this);
            QObject.Connect <QAction>(m_RosterMenu, Qt.SIGNAL("triggered(QAction*)"), HandleRosterMenuTriggered);

            var rosterViewActionGroup = new QActionGroup(this);

            QObject.Connect <QAction>(rosterViewActionGroup, Qt.SIGNAL("triggered(QAction *)"), RosterViewActionGroupTriggered);

            m_GridModeAction = new QAction("View as Grid", this);
            m_GridModeAction.SetActionGroup(rosterViewActionGroup);
            m_GridModeAction.Checkable = true;
            m_RosterMenu.AddAction(m_GridModeAction);

            m_ListModeAction = new QAction("View as List", this);
            m_ListModeAction.SetActionGroup(rosterViewActionGroup);
            m_ListModeAction.Checkable = true;
            m_RosterMenu.AddAction(m_ListModeAction);

            if (settingsService.Get <bool>("RosterListMode"))
            {
                rosterGrid.ListMode      = true;
                m_ListModeAction.Checked = true;
            }
            else
            {
                rosterGrid.ListMode      = false;
                m_GridModeAction.Checked = true;
            }

            m_RosterMenu.AddSeparator();

            m_ShowOfflineAction           = new QAction("Show Offline Friends", this);
            m_ShowOfflineAction.Checkable = true;
            m_RosterMenu.AddAction(m_ShowOfflineAction);

            m_ShowTransportsAction           = new QAction("Show Transports", this);
            m_ShowTransportsAction.Checkable = true;
            m_RosterMenu.AddAction(m_ShowTransportsAction);

            m_RosterMenu.AddSeparator();

            var sliderAction = new AvatarGridZoomAction <Synapse.UI.RosterItem>(rosterGrid);

            sliderAction.ValueChanged += delegate(int value) {
                rosterGrid.IconSize = value;
                settingsService.Set("RosterIconSize", value);
            };
            m_RosterMenu.AddAction(sliderAction);

            m_InviteActions = new List <QAction>();

            m_InviteMenu = new QMenu(this);
            m_InviteMenu.MenuAction().Text = "Invite To";
            m_InviteMenu.AddAction("New Conference...");

            m_RosterItemMenu = new QMenu(this);
            QObject.Connect <QAction>(m_RosterItemMenu, Qt.SIGNAL("triggered(QAction*)"), HandleRosterItemMenuTriggered);
            QObject.Connect(m_RosterItemMenu, Qt.SIGNAL("aboutToShow()"), RosterItemMenuAboutToShow);
            QObject.Connect(m_RosterItemMenu, Qt.SIGNAL("aboutToHide()"), RosterItemMenuAboutToHide);

            m_ViewProfileAction = new QAction("View Profile", m_RosterItemMenu);
            m_RosterItemMenu.AddAction(m_ViewProfileAction);

            m_IMAction = new QAction("IM", m_RosterItemMenu);
            m_RosterItemMenu.AddAction(m_IMAction);

            m_RosterItemMenu.AddAction("Send File...");
            m_RosterItemMenu.AddMenu(m_InviteMenu);
            m_RosterItemMenu.AddAction("View History");

            foreach (IActionCodon node in AddinManager.GetExtensionNodes("/Synapse/QtClient/Roster/FriendActions"))
            {
                m_RosterItemMenu.AddAction((QAction)node.CreateInstance(this));
            }

            m_RosterItemMenu.AddSeparator();

            m_EditGroupsAction = new QAction("Edit Groups", m_RosterItemMenu);
            m_RosterItemMenu.AddAction(m_EditGroupsAction);

            m_RemoveAction = new QAction("Remove", m_RosterItemMenu);
            m_RosterItemMenu.AddAction(m_RemoveAction);

            friendSearchLineEdit.InstallEventFilter(new KeyPressEater(delegate(QKeyEvent evnt) {
                if (evnt.Key() == (int)Key.Key_Escape)
                {
                    friendSearchLineEdit.Clear();
                    rosterSearchButton.Checked = false;
                    rosterGrid.SetFocus();
                    return(true);
                }
                return(false);
            }, this));

            //QSizeGrip grip = new QSizeGrip(tabWidget);
            //tabWidget.SetCornerWidget(grip, Qt.Corner.BottomRightCorner);

            0.UpTo(9).ForEach(num => {
                QAction action  = new QAction(this);
                action.Shortcut = new QKeySequence("Alt+" + num.ToString());
                QObject.Connect(action, Qt.SIGNAL("triggered(bool)"), delegate {
                    tabWidget.CurrentIndex = num - 1;
                });
                this.AddAction(action);
            });

            var jsWindowObject = new SynapseJSObject(this);

            m_ActivityWebView.Page().linkDelegationPolicy = QWebPage.LinkDelegationPolicy.DelegateAllLinks;
            QObject.Connect <QUrl>(m_ActivityWebView, Qt.SIGNAL("linkClicked(QUrl)"), HandleActivityLinkClicked);
            QObject.Connect <bool>(m_ActivityWebView.Page(), Qt.SIGNAL("loadFinished(bool)"), HandleActivityPageLoadFinished);
            QObject.Connect(m_ActivityWebView.Page().MainFrame(), Qt.SIGNAL("javaScriptWindowObjectCleared()"), delegate {
                m_ActivityWebView.Page().MainFrame().AddToJavaScriptWindowObject("Synapse", jsWindowObject);
            });
            m_ActivityWebView.Page().MainFrame().Load("resource:/feed.html");

            //friendMucListWebView.Page().MainFrame().Load("resource:/friend-muclist.html");

            //quickJoinMucContainer.Hide();
            shoutContainer.Hide();

            QObject.Connect(shoutLineEdit, Qt.SIGNAL("textChanged(const QString &)"), delegate {
                shoutCharsLabel.Text = (140 - shoutLineEdit.Text.Length).ToString();
            });

            QObject.Connect(shoutLineEdit, Qt.SIGNAL("returnPressed()"), delegate {
                SendShout();
            });

            QVBoxLayout layout = new QVBoxLayout(m_AccountsContainer);

            layout.Margin = 0;
            m_AccountsContainer.SetLayout(layout);

            m_MucModel = new BookmarkedMUCsModel();
            mucTree.SetModel(m_MucModel);

            friendSearchContainer.Hide();

            rosterViewButton.icon     = new QIcon(new QPixmap("resource:/view-grid.png"));
            rosterSearchButton.icon   = new QIcon(new QPixmap("resource:/simple-search.png"));
            addFriendButton.icon      = new QIcon(new QPixmap("resource:/simple-add.png"));
            addMucBookmarkButton.icon = new QIcon(new QPixmap("resource:/simple-add.png"));
            feedFilterButton.icon     = new QIcon(new QPixmap("resource:/simple-search.png"));

            m_CollapseIcon           = new QIcon(new QPixmap("resource:/collapse.png"));
            m_ExpandIcon             = new QIcon(new QPixmap("resource:/expand.png"));
            toggleJoinMucButton.icon = m_CollapseIcon;

            UpdateOnlineCount();

            var shoutService = ServiceManager.Get <ShoutService>();

            shoutService.HandlerAdded   += HandleShoutHandlerAdded;
            shoutService.HandlerRemoved += HandleShoutHandlerRemoved;
            if (shoutService.Handlers.Count() > 0)
            {
                foreach (IShoutHandler handler in shoutService.Handlers)
                {
                    HandleShoutHandlerAdded(handler);
                }
            }
            else
            {
                shoutHandlersBox.Hide();
            }

            m_FeedFilterMenu = new QMenu(this);

            QObject.Connect(m_FeedFilterMenu, Qt.SIGNAL("triggered(QAction*)"), delegate(QAction action) {
                string js = Util.CreateJavascriptCall("ActivityFeed.setCategoryVisibility", action.Text.ToLower().Replace(" ", "-"), action.Checked);
                m_ActivityWebView.Page().MainFrame().EvaluateJavaScript(js);
            });

            var feedService = ServiceManager.Get <ActivityFeedService>();

            feedService.NewItem += delegate(IActivityFeedItem item) {
                lock (m_FeedItemQueue) {
                    if (!m_FeedIsLoaded)
                    {
                        m_FeedItemQueue.Enqueue(item);
                    }
                    else
                    {
                        AddActivityFeedItem(item);
                    }
                }
            };
            feedService.CategoryAdded += delegate(string category) {
                QApplication.Invoke(delegate {
                    HandleCategoryAdded(category);
                });
            };
            foreach (string category in feedService.Categories)
            {
                HandleCategoryAdded(category);
            }
        }
Exemplo n.º 3
0
    public void SetupUi(QMainWindow MainWindow)
    {
        if (MainWindow.ObjectName == "")
        MainWindow.ObjectName = "MainWindow";
        QSize Size = new QSize(631, 570);
        Size = Size.ExpandedTo(MainWindow.MinimumSizeHint());
        MainWindow.Size = Size;
        MainWindow.MinimumSize = new QSize(600, 550);
        MainWindow.WindowIcon = new QIcon(":/main/resources/Images/comex_256.png");
        action_Open = new QAction(MainWindow);
        action_Open.ObjectName = "action_Open";
        action_Open.icon = new QIcon(":/main/resources/Images/document-open.png");
        action_Close = new QAction(MainWindow);
        action_Close.ObjectName = "action_Close";
        action_Close.Enabled = false;
        action_Close.icon = new QIcon(":/main/resources/Images/document-close.png");
        action_Exit = new QAction(MainWindow);
        action_Exit.ObjectName = "action_Exit";
        action_Exit.icon = new QIcon(":/main/resources/Images/application-exit.png");
        action_Info = new QAction(MainWindow);
        action_Info.ObjectName = "action_Info";
        action_Info.icon = new QIcon(":/main/resources/Images/dialog-information.png");
        action_ATR = new QAction(MainWindow);
        action_ATR.ObjectName = "action_ATR";
        action_ATR.icon = new QIcon(":/main/resources/Images/quickopen.png");
        action_Exec_Command = new QAction(MainWindow);
        action_Exec_Command.ObjectName = "action_Exec_Command";
        action_SerialSettings = new QAction(MainWindow);
        action_SerialSettings.ObjectName = "action_SerialSettings";
        action_SerialSettings.icon = new QIcon(":/main/resources/Images/configure.png");
        centralwidget = new QWidget(MainWindow);
        centralwidget.ObjectName = "centralwidget";
        gridLayout = new QGridLayout(centralwidget);
        gridLayout.ObjectName = "gridLayout";
        FrameATR = new QGroupBox(centralwidget);
        FrameATR.ObjectName = "FrameATR";
        QSizePolicy sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed);
        sizePolicy.SetHorizontalStretch(0);
        sizePolicy.SetVerticalStretch(0);
        sizePolicy.SetHeightForWidth(FrameATR.SizePolicy.HasHeightForWidth());
        FrameATR.SizePolicy = sizePolicy;
        gridLayout1 = new QGridLayout(FrameATR);
        gridLayout1.ObjectName = "gridLayout1";
        TxtATR = new QLineEdit(FrameATR);
        TxtATR.ObjectName = "TxtATR";
        TxtATR.StyleSheet = "color: rgb(30, 109, 30);";
        TxtATR.ReadOnly = true;

        gridLayout1.AddWidget(TxtATR, 0, 0, 1, 1);

        gridLayout.AddWidget(FrameATR, 0, 0, 1, 1);

        FrameFile = new QGroupBox(centralwidget);
        FrameFile.ObjectName = "FrameFile";
        gridLayout2 = new QGridLayout(FrameFile);
        gridLayout2.ObjectName = "gridLayout2";
        LstCommands = new QListWidget(FrameFile);
        LstCommands.ObjectName = "LstCommands";
        LstCommands.EditTriggers = Qyoto.Qyoto.GetCPPEnumValue("QAbstractItemView", "NoEditTriggers");

        gridLayout2.AddWidget(LstCommands, 0, 0, 1, 1);

        gridLayout.AddWidget(FrameFile, 1, 0, 1, 1);

        FrameExchange = new QGroupBox(centralwidget);
        FrameExchange.ObjectName = "FrameExchange";
        sizePolicy.SetHeightForWidth(FrameExchange.SizePolicy.HasHeightForWidth());
        FrameExchange.SizePolicy = sizePolicy;
        gridLayout3 = new QGridLayout(FrameExchange);
        gridLayout3.ObjectName = "gridLayout3";
        LblCommand = new QLabel(FrameExchange);
        LblCommand.ObjectName = "LblCommand";

        gridLayout3.AddWidget(LblCommand, 0, 0, 1, 1);

        TxtCmd = new QLineEdit(FrameExchange);
        TxtCmd.ObjectName = "TxtCmd";
        TxtCmd.StyleSheet = "color: rgb(30, 109, 30);";

        gridLayout3.AddWidget(TxtCmd, 0, 1, 1, 1);

        BtnSend = new QPushButton(FrameExchange);
        BtnSend.ObjectName = "BtnSend";
        BtnSend.icon = new QIcon(":/main/resources/Images/arrow-right.png");

        gridLayout3.AddWidget(BtnSend, 0, 2, 1, 1);

        LblResponse = new QLabel(FrameExchange);
        LblResponse.ObjectName = "LblResponse";

        gridLayout3.AddWidget(LblResponse, 1, 0, 1, 1);

        TxtResp = new QLineEdit(FrameExchange);
        TxtResp.ObjectName = "TxtResp";
        TxtResp.StyleSheet = "color: rgb(0, 0, 255);";
        TxtResp.ReadOnly = true;

        gridLayout3.AddWidget(TxtResp, 1, 1, 1, 1);

        gridLayout.AddWidget(FrameExchange, 2, 0, 1, 1);

        MainWindow.SetCentralWidget(centralwidget);
        menubar = new QMenuBar(MainWindow);
        menubar.ObjectName = "menubar";
        menubar.Geometry = new QRect(0, 0, 631, 24);
        menu_File = new QMenu(menubar);
        menu_File.ObjectName = "menu_File";
        menu_Reader = new QMenu(menubar);
        menu_Reader.ObjectName = "menu_Reader";
        menu_About = new QMenu(menubar);
        menu_About.ObjectName = "menu_About";
        MainWindow.SetMenuBar(menubar);
        statusbar = new QStatusBar(MainWindow);
        statusbar.ObjectName = "statusbar";
        MainWindow.SetStatusBar(statusbar);
        toolBar = new QToolBar(MainWindow);
        toolBar.ObjectName = "toolBar";
        toolBar.Movable = false;
        toolBar.ToolButtonStyle = Qt.ToolButtonStyle.ToolButtonTextBesideIcon;
        toolBar.Floatable = false;
        MainWindow.AddToolBar(Qt.ToolBarArea.TopToolBarArea, toolBar);

        menubar.AddAction(menu_File.MenuAction());
        menubar.AddAction(menu_Reader.MenuAction());
        menubar.AddAction(menu_About.MenuAction());
        menu_File.AddAction(action_Open);
        menu_File.AddAction(action_Close);
        menu_File.AddSeparator();
        menu_File.AddAction(action_SerialSettings);
        menu_File.AddSeparator();
        menu_File.AddAction(action_Exit);
        menu_About.AddAction(action_Info);
        toolBar.AddAction(action_Open);
        toolBar.AddAction(action_Close);
        toolBar.AddAction(action_SerialSettings);
        toolBar.AddAction(action_ATR);
        toolBar.AddAction(action_Info);
        toolBar.AddSeparator();
        toolBar.AddAction(action_Exit);

        RetranslateUi(MainWindow);

        QMetaObject.ConnectSlotsByName(MainWindow);
    }
Exemplo n.º 4
0
    public void SetupUi(QMainWindow MainWindow)
    {
        if (MainWindow.ObjectName == "")
        {
            MainWindow.ObjectName = "MainWindow";
        }
        QSize Size = new QSize(631, 570);

        Size                             = Size.ExpandedTo(MainWindow.MinimumSizeHint());
        MainWindow.Size                  = Size;
        MainWindow.MinimumSize           = new QSize(600, 550);
        MainWindow.WindowIcon            = new QIcon(":/main/resources/Images/comex_256.png");
        action_Open                      = new QAction(MainWindow);
        action_Open.ObjectName           = "action_Open";
        action_Open.icon                 = new QIcon(":/main/resources/Images/document-open.png");
        action_Close                     = new QAction(MainWindow);
        action_Close.ObjectName          = "action_Close";
        action_Close.Enabled             = false;
        action_Close.icon                = new QIcon(":/main/resources/Images/document-close.png");
        action_Exit                      = new QAction(MainWindow);
        action_Exit.ObjectName           = "action_Exit";
        action_Exit.icon                 = new QIcon(":/main/resources/Images/application-exit.png");
        action_Info                      = new QAction(MainWindow);
        action_Info.ObjectName           = "action_Info";
        action_Info.icon                 = new QIcon(":/main/resources/Images/dialog-information.png");
        action_ATR                       = new QAction(MainWindow);
        action_ATR.ObjectName            = "action_ATR";
        action_ATR.icon                  = new QIcon(":/main/resources/Images/quickopen.png");
        action_Exec_Command              = new QAction(MainWindow);
        action_Exec_Command.ObjectName   = "action_Exec_Command";
        action_SerialSettings            = new QAction(MainWindow);
        action_SerialSettings.ObjectName = "action_SerialSettings";
        action_SerialSettings.icon       = new QIcon(":/main/resources/Images/configure.png");
        centralwidget                    = new QWidget(MainWindow);
        centralwidget.ObjectName         = "centralwidget";
        gridLayout                       = new QGridLayout(centralwidget);
        gridLayout.ObjectName            = "gridLayout";
        FrameATR                         = new QGroupBox(centralwidget);
        FrameATR.ObjectName              = "FrameATR";
        QSizePolicy sizePolicy = new QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed);

        sizePolicy.SetHorizontalStretch(0);
        sizePolicy.SetVerticalStretch(0);
        sizePolicy.SetHeightForWidth(FrameATR.SizePolicy.HasHeightForWidth());
        FrameATR.SizePolicy    = sizePolicy;
        gridLayout1            = new QGridLayout(FrameATR);
        gridLayout1.ObjectName = "gridLayout1";
        TxtATR            = new QLineEdit(FrameATR);
        TxtATR.ObjectName = "TxtATR";
        TxtATR.StyleSheet = "color: rgb(30, 109, 30);";
        TxtATR.ReadOnly   = true;

        gridLayout1.AddWidget(TxtATR, 0, 0, 1, 1);


        gridLayout.AddWidget(FrameATR, 0, 0, 1, 1);

        FrameFile                = new QGroupBox(centralwidget);
        FrameFile.ObjectName     = "FrameFile";
        gridLayout2              = new QGridLayout(FrameFile);
        gridLayout2.ObjectName   = "gridLayout2";
        LstCommands              = new QListWidget(FrameFile);
        LstCommands.ObjectName   = "LstCommands";
        LstCommands.EditTriggers = Qyoto.Qyoto.GetCPPEnumValue("QAbstractItemView", "NoEditTriggers");

        gridLayout2.AddWidget(LstCommands, 0, 0, 1, 1);


        gridLayout.AddWidget(FrameFile, 1, 0, 1, 1);

        FrameExchange            = new QGroupBox(centralwidget);
        FrameExchange.ObjectName = "FrameExchange";
        sizePolicy.SetHeightForWidth(FrameExchange.SizePolicy.HasHeightForWidth());
        FrameExchange.SizePolicy = sizePolicy;
        gridLayout3            = new QGridLayout(FrameExchange);
        gridLayout3.ObjectName = "gridLayout3";
        LblCommand             = new QLabel(FrameExchange);
        LblCommand.ObjectName  = "LblCommand";

        gridLayout3.AddWidget(LblCommand, 0, 0, 1, 1);

        TxtCmd            = new QLineEdit(FrameExchange);
        TxtCmd.ObjectName = "TxtCmd";
        TxtCmd.StyleSheet = "color: rgb(30, 109, 30);";

        gridLayout3.AddWidget(TxtCmd, 0, 1, 1, 1);

        BtnSend            = new QPushButton(FrameExchange);
        BtnSend.ObjectName = "BtnSend";
        BtnSend.icon       = new QIcon(":/main/resources/Images/arrow-right.png");

        gridLayout3.AddWidget(BtnSend, 0, 2, 1, 1);

        LblResponse            = new QLabel(FrameExchange);
        LblResponse.ObjectName = "LblResponse";

        gridLayout3.AddWidget(LblResponse, 1, 0, 1, 1);

        TxtResp            = new QLineEdit(FrameExchange);
        TxtResp.ObjectName = "TxtResp";
        TxtResp.StyleSheet = "color: rgb(0, 0, 255);";
        TxtResp.ReadOnly   = true;

        gridLayout3.AddWidget(TxtResp, 1, 1, 1, 1);


        gridLayout.AddWidget(FrameExchange, 2, 0, 1, 1);

        MainWindow.SetCentralWidget(centralwidget);
        menubar                = new QMenuBar(MainWindow);
        menubar.ObjectName     = "menubar";
        menubar.Geometry       = new QRect(0, 0, 631, 24);
        menu_File              = new QMenu(menubar);
        menu_File.ObjectName   = "menu_File";
        menu_Reader            = new QMenu(menubar);
        menu_Reader.ObjectName = "menu_Reader";
        menu_About             = new QMenu(menubar);
        menu_About.ObjectName  = "menu_About";
        MainWindow.SetMenuBar(menubar);
        statusbar            = new QStatusBar(MainWindow);
        statusbar.ObjectName = "statusbar";
        MainWindow.SetStatusBar(statusbar);
        toolBar                 = new QToolBar(MainWindow);
        toolBar.ObjectName      = "toolBar";
        toolBar.Movable         = false;
        toolBar.ToolButtonStyle = Qt.ToolButtonStyle.ToolButtonTextBesideIcon;
        toolBar.Floatable       = false;
        MainWindow.AddToolBar(Qt.ToolBarArea.TopToolBarArea, toolBar);

        menubar.AddAction(menu_File.MenuAction());
        menubar.AddAction(menu_Reader.MenuAction());
        menubar.AddAction(menu_About.MenuAction());
        menu_File.AddAction(action_Open);
        menu_File.AddAction(action_Close);
        menu_File.AddSeparator();
        menu_File.AddAction(action_SerialSettings);
        menu_File.AddSeparator();
        menu_File.AddAction(action_Exit);
        menu_About.AddAction(action_Info);
        toolBar.AddAction(action_Open);
        toolBar.AddAction(action_Close);
        toolBar.AddAction(action_SerialSettings);
        toolBar.AddAction(action_ATR);
        toolBar.AddAction(action_Info);
        toolBar.AddSeparator();
        toolBar.AddAction(action_Exit);

        RetranslateUi(MainWindow);

        QMetaObject.ConnectSlotsByName(MainWindow);
    } // SetupUi