예제 #1
0
 def showDoc(self):
     self.docview = QtWebKit.QWebView()
     self.docview.load(
         QtCore.QUrl.fromLocalFile(
             "/opt/tinyos-2.1.1/doc/nesdoc/telosb/index.html"))
     self.docview.show()
예제 #2
0
    def setupUi(self, MainDialog):
        MainDialog.setObjectName(_fromUtf8("MainDialog"))
        MainDialog.resize(994, 647)
        icon = QtGui.QIcon()
        icon.addPixmap(
            QtGui.QPixmap(_fromUtf8(":/plugins/qgis2web/icons/qgis2web.png")),
            QtGui.QIcon.Normal, QtGui.QIcon.Off)
        MainDialog.setWindowIcon(icon)
        self.horizontalLayout_3 = QtGui.QHBoxLayout(MainDialog)
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.tabWidget = QtGui.QTabWidget(MainDialog)
        self.tabWidget.setAutoFillBackground(True)
        self.tabWidget.setObjectName(_fromUtf8("tabWidget"))
        self.tab = QtGui.QWidget()
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.tab.sizePolicy().hasHeightForWidth())
        self.tab.setSizePolicy(sizePolicy)
        self.tab.setObjectName(_fromUtf8("tab"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.tab)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.splitter_2 = QtGui.QSplitter(self.tab)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.splitter_2.sizePolicy().hasHeightForWidth())
        self.splitter_2.setSizePolicy(sizePolicy)
        self.splitter_2.setOrientation(QtCore.Qt.Horizontal)
        self.splitter_2.setObjectName(_fromUtf8("splitter_2"))
        self.layoutWidget = QtGui.QWidget(self.splitter_2)
        self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.splitter = QtGui.QSplitter(self.layoutWidget)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setObjectName(_fromUtf8("splitter"))
        self.layersTree = QtGui.QTreeWidget(self.splitter)
        self.layersTree.setMinimumSize(QtCore.QSize(400, 0))
        self.layersTree.setHorizontalScrollBarPolicy(
            QtCore.Qt.ScrollBarAlwaysOff)
        self.layersTree.setObjectName(_fromUtf8("layersTree"))
        self.layersTree.headerItem().setText(0, _fromUtf8("1"))
        self.layersTree.header().setVisible(False)
        self.layersTree.header().setDefaultSectionSize(200)
        self.widget = QtGui.QWidget(self.splitter)
        self.widget.setMinimumSize(QtCore.QSize(0, 0))
        self.widget.setObjectName(_fromUtf8("widget"))
        self.verticalLayout_5 = QtGui.QVBoxLayout(self.widget)
        self.verticalLayout_5.setSpacing(6)
        self.verticalLayout_5.setMargin(0)
        self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5"))
        self.paramsTreeOL = QtGui.QTreeWidget(self.widget)
        self.paramsTreeOL.setMinimumSize(QtCore.QSize(300, 0))
        self.paramsTreeOL.setFrameShape(QtGui.QFrame.StyledPanel)
        self.paramsTreeOL.setFrameShadow(QtGui.QFrame.Sunken)
        self.paramsTreeOL.setHorizontalScrollBarPolicy(
            QtCore.Qt.ScrollBarAlwaysOff)
        self.paramsTreeOL.setAutoScroll(False)
        self.paramsTreeOL.setObjectName(_fromUtf8("paramsTreeOL"))
        self.paramsTreeOL.header().setVisible(False)
        self.paramsTreeOL.header().setCascadingSectionResizes(False)
        self.paramsTreeOL.header().setDefaultSectionSize(200)
        self.verticalLayout_5.addWidget(self.paramsTreeOL)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setContentsMargins(-1, -1, -1, 6)
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        spacerItem = QtGui.QSpacerItem(5, 20, QtGui.QSizePolicy.Fixed,
                                       QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.ol3 = QtGui.QRadioButton(self.widget)
        self.ol3.setChecked(True)
        self.ol3.setObjectName(_fromUtf8("ol3"))
        self.mapFormat = QtGui.QButtonGroup(MainDialog)
        self.mapFormat.setObjectName(_fromUtf8("mapFormat"))
        self.mapFormat.addButton(self.ol3)
        self.horizontalLayout_2.addWidget(self.ol3)
        self.leaflet = QtGui.QRadioButton(self.widget)
        self.leaflet.setObjectName(_fromUtf8("leaflet"))
        self.mapFormat.addButton(self.leaflet)
        self.horizontalLayout_2.addWidget(self.leaflet)
        self.buttonPreview = QtGui.QPushButton(self.widget)
        self.buttonPreview.setMinimumSize(QtCore.QSize(0, 24))
        icon1 = QtGui.QIcon()
        icon1.addPixmap(
            QtGui.QPixmap(_fromUtf8(":/plugins/qgis2web/icons/preview.gif")),
            QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.buttonPreview.setIcon(icon1)
        self.buttonPreview.setObjectName(_fromUtf8("buttonPreview"))
        self.horizontalLayout_2.addWidget(self.buttonPreview)
        self.buttonExport = QtGui.QPushButton(self.widget)
        self.buttonExport.setIcon(icon)
        self.buttonExport.setObjectName(_fromUtf8("buttonExport"))
        self.horizontalLayout_2.addWidget(self.buttonExport)
        self.verticalLayout_5.addLayout(self.horizontalLayout_2)
        self.verticalLayout.addWidget(self.splitter)
        self.verticalLayoutWidget_2 = QtGui.QWidget(self.splitter_2)
        self.verticalLayoutWidget_2.setObjectName(
            _fromUtf8("verticalLayoutWidget_2"))
        self.verticalLayout_2 = QtGui.QVBoxLayout(self.verticalLayoutWidget_2)
        self.verticalLayout_2.setMargin(0)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.preview = QtWebKit.QWebView(self.verticalLayoutWidget_2)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.preview.sizePolicy().hasHeightForWidth())
        self.preview.setSizePolicy(sizePolicy)
        self.preview.setUrl(QtCore.QUrl(_fromUtf8("about:blank")))
        self.preview.setObjectName(_fromUtf8("preview"))
        self.preview.settings().setAttribute(
            QtWebKit.QWebSettings.DeveloperExtrasEnabled, True)
        self.verticalLayout_2.addWidget(self.preview)
        self.basemaps = QtGui.QListWidget(self.verticalLayoutWidget_2)
        self.basemaps.setObjectName(_fromUtf8("basemaps"))
        self.verticalLayout_2.addWidget(self.basemaps)
        self.horizontalLayout.addWidget(self.splitter_2)
        self.tabWidget.addTab(self.tab, _fromUtf8(""))
        self.tab_2 = QtGui.QWidget()
        self.tab_2.setStyleSheet(
            _fromUtf8("background-color: rgb(255, 255, 255);"))
        self.tab_2.setObjectName(_fromUtf8("tab_2"))
        self.horizontalLayout_4 = QtGui.QHBoxLayout(self.tab_2)
        self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
        self.helpField = QtGui.QTextBrowser(self.tab_2)
        font = QtGui.QFont()
        font.setPointSize(11)
        self.helpField.setFont(font)
        self.helpField.setStyleSheet(_fromUtf8("padding: 10px;"))
        self.helpField.setFrameShape(QtGui.QFrame.NoFrame)
        self.helpField.setFrameShadow(QtGui.QFrame.Plain)
        self.helpField.setLineWidth(0)
        self.helpField.setObjectName(_fromUtf8("helpField"))
        self.horizontalLayout_4.addWidget(self.helpField)
        self.tabWidget.addTab(self.tab_2, _fromUtf8(""))
        self.horizontalLayout_3.addWidget(self.tabWidget)

        self.retranslateUi(MainDialog)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(MainDialog)
예제 #3
0
 def setupUi(self):
     self.resize(700, 500)
     self.tree = QtGui.QTreeWidget()
     self.tree.setHeaderHidden(True)
     self.tree.setMinimumWidth(300)
     QObject.connect(self.tree,
                     QtCore.SIGNAL("itemClicked(QTreeWidgetItem*, int)"),
                     self.changeItem)
     self.groupIcon = QtGui.QIcon()
     self.groupIcon.addPixmap(
         self.style().standardPixmap(QtGui.QStyle.SP_DirClosedIcon),
         QtGui.QIcon.Normal, QtGui.QIcon.Off)
     self.groupIcon.addPixmap(
         self.style().standardPixmap(QtGui.QStyle.SP_DirOpenIcon),
         QtGui.QIcon.Normal, QtGui.QIcon.On)
     self.keyIcon = QtGui.QIcon()
     self.keyIcon.addPixmap(self.style().standardPixmap(
         QtGui.QStyle.SP_FileIcon))
     self.fillTree()
     self.setWindowTitle("Help editor")
     self.horizontalLayout = QtGui.QHBoxLayout()
     self.horizontalLayout.setSpacing(15)
     self.horizontalLayout.setMargin(0)
     self.label = QtGui.QLabel()
     self.label.setText(
         "Select elements on the tree and fill their description in the text box below"
     )
     self.labelName = QtGui.QLabel()
     self.labelName.setText("Algorithm description")
     self.text = QtGui.QTextEdit()
     self.text.setMinimumHeight(200)
     self.verticalLayout = QtGui.QVBoxLayout()
     self.verticalLayout.setSpacing(5)
     self.verticalLayout.setMargin(0)
     self.verticalLayout.addWidget(self.tree)
     self.verticalLayout.addSpacing(20)
     self.verticalLayout.addWidget(self.label)
     self.verticalLayout.addSpacing(20)
     self.verticalLayout.addWidget(self.labelName)
     self.verticalLayout.addWidget(self.text)
     self.horizontalLayout.addLayout(self.verticalLayout)
     self.webView = QtWebKit.QWebView()
     self.webView.setMinimumWidth(300)
     self.webView.setHtml(self.getHtml())
     self.horizontalLayout.addWidget(self.webView)
     self.closeButton = QtGui.QPushButton()
     self.closeButton.setText("Cancel")
     self.saveButton = QtGui.QPushButton()
     self.saveButton.setText("OK")
     self.horizontalLayout2 = QtGui.QHBoxLayout()
     self.horizontalLayout2.setSpacing(2)
     self.horizontalLayout2.setMargin(0)
     self.horizontalLayout2.addStretch(1000)
     self.horizontalLayout2.addWidget(self.saveButton)
     self.horizontalLayout2.addWidget(self.closeButton)
     QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"),
                     self.closeWindow)
     QObject.connect(self.saveButton, QtCore.SIGNAL("clicked()"),
                     self.saveHelp)
     self.verticalLayout2 = QtGui.QVBoxLayout()
     self.verticalLayout2.setSpacing(2)
     self.verticalLayout2.setMargin(0)
     self.verticalLayout2.addLayout(self.horizontalLayout)
     self.verticalLayout2.addLayout(self.horizontalLayout2)
     self.setLayout(self.verticalLayout2)
     QtCore.QMetaObject.connectSlotsByName(self)
     self.updateHtmlView()
예제 #4
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.setWindowModality(QtCore.Qt.NonModal)
        MainWindow.resize(993, 628)
        MainWindow.setAutoFillBackground(True)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.gridLayout_2 = QtGui.QGridLayout(self.centralwidget)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.File_Selector_Box = QtGui.QComboBox(self.centralwidget)
        self.File_Selector_Box.setObjectName(_fromUtf8("File_Selector_Box"))
        self.gridLayout_2.addWidget(self.File_Selector_Box, 0, 0, 1, 2)
        self.gridLayout_6 = QtGui.QGridLayout()
        self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6"))
        self.groupBox = QtGui.QGroupBox(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.groupBox.sizePolicy().hasHeightForWidth())
        self.groupBox.setSizePolicy(sizePolicy)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout_4 = QtGui.QGridLayout(self.groupBox)
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.Id_List = QtGui.QListWidget(self.groupBox)
        self.Id_List.setEnabled(True)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.Id_List.sizePolicy().hasHeightForWidth())
        self.Id_List.setSizePolicy(sizePolicy)
        self.Id_List.setSelectionMode(
            QtGui.QAbstractItemView.ExtendedSelection)
        self.Id_List.setObjectName(_fromUtf8("Id_List"))
        self.gridLayout_4.addWidget(self.Id_List, 0, 0, 1, 1)
        self.gridLayout_6.addWidget(self.groupBox, 0, 0, 1, 1)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.Analyze_Btn = QtGui.QCommandLinkButton(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.Analyze_Btn.sizePolicy().hasHeightForWidth())
        self.Analyze_Btn.setSizePolicy(sizePolicy)
        self.Analyze_Btn.setObjectName(_fromUtf8("Analyze_Btn"))
        self.horizontalLayout_2.addWidget(self.Analyze_Btn)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem1)
        self.gridLayout_6.addLayout(self.horizontalLayout_2, 5, 0, 1, 1)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.New_Class_Btn = QtGui.QPushButton(self.centralwidget)
        self.New_Class_Btn.setObjectName(_fromUtf8("New_Class_Btn"))
        self.horizontalLayout.addWidget(self.New_Class_Btn)
        self.Save_Class_Btn = QtGui.QPushButton(self.centralwidget)
        self.Save_Class_Btn.setObjectName(_fromUtf8("Save_Class_Btn"))
        self.horizontalLayout.addWidget(self.Save_Class_Btn)
        self.Delete_Class_Btn = QtGui.QPushButton(self.centralwidget)
        self.Delete_Class_Btn.setObjectName(_fromUtf8("Delete_Class_Btn"))
        self.horizontalLayout.addWidget(self.Delete_Class_Btn)
        self.Reset_Plate_Btn = QtGui.QPushButton(self.centralwidget)
        self.Reset_Plate_Btn.setObjectName(_fromUtf8("Reset_Plate_Btn"))
        self.horizontalLayout.addWidget(self.Reset_Plate_Btn)
        self.gridLayout_6.addLayout(self.horizontalLayout, 3, 0, 1, 1)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.Load_Layout_Btn = QtGui.QPushButton(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.Load_Layout_Btn.sizePolicy().hasHeightForWidth())
        self.Load_Layout_Btn.setSizePolicy(sizePolicy)
        self.Load_Layout_Btn.setMinimumSize(QtCore.QSize(80, 0))
        self.Load_Layout_Btn.setMaximumSize(QtCore.QSize(100, 16777215))
        self.Load_Layout_Btn.setObjectName(_fromUtf8("Load_Layout_Btn"))
        self.horizontalLayout_3.addWidget(self.Load_Layout_Btn)
        self.Save_Layout_Btn = QtGui.QPushButton(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.Save_Layout_Btn.sizePolicy().hasHeightForWidth())
        self.Save_Layout_Btn.setSizePolicy(sizePolicy)
        self.Save_Layout_Btn.setMinimumSize(QtCore.QSize(80, 0))
        self.Save_Layout_Btn.setMaximumSize(QtCore.QSize(100, 16777215))
        self.Save_Layout_Btn.setObjectName(_fromUtf8("Save_Layout_Btn"))
        self.horizontalLayout_3.addWidget(self.Save_Layout_Btn)
        self.gridLayout_6.addLayout(self.horizontalLayout_3, 4, 0, 1, 1)
        self.groupBox_2 = QtGui.QGroupBox(self.centralwidget)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.formLayout = QtGui.QFormLayout(self.groupBox_2)
        self.formLayout.setFieldGrowthPolicy(
            QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setObjectName(_fromUtf8("formLayout"))
        self.Treatments_List = QtGui.QListWidget(self.groupBox_2)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.Treatments_List.sizePolicy().hasHeightForWidth())
        self.Treatments_List.setSizePolicy(sizePolicy)
        self.Treatments_List.setObjectName(_fromUtf8("Treatments_List"))
        self.formLayout.setWidget(0, QtGui.QFormLayout.SpanningRole,
                                  self.Treatments_List)
        self.horizontalLayout_4 = QtGui.QHBoxLayout()
        self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
        self.Set_Positive_Control = QtGui.QPushButton(self.groupBox_2)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.Set_Positive_Control.sizePolicy().hasHeightForWidth())
        self.Set_Positive_Control.setSizePolicy(sizePolicy)
        self.Set_Positive_Control.setMinimumSize(QtCore.QSize(130, 0))
        self.Set_Positive_Control.setMaximumSize(QtCore.QSize(150, 16777215))
        self.Set_Positive_Control.setObjectName(
            _fromUtf8("Set_Positive_Control"))
        self.horizontalLayout_4.addWidget(self.Set_Positive_Control)
        spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_4.addItem(spacerItem2)
        self.Set_Negative_Control = QtGui.QPushButton(self.groupBox_2)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.Set_Negative_Control.sizePolicy().hasHeightForWidth())
        self.Set_Negative_Control.setSizePolicy(sizePolicy)
        self.Set_Negative_Control.setMinimumSize(QtCore.QSize(130, 0))
        self.Set_Negative_Control.setMaximumSize(QtCore.QSize(150, 16777215))
        self.Set_Negative_Control.setObjectName(
            _fromUtf8("Set_Negative_Control"))
        self.horizontalLayout_4.addWidget(self.Set_Negative_Control)
        self.formLayout.setLayout(1, QtGui.QFormLayout.SpanningRole,
                                  self.horizontalLayout_4)
        self.gridLayout_6.addWidget(self.groupBox_2, 1, 0, 1, 1)
        self.gridLayout_2.addLayout(self.gridLayout_6, 1, 0, 1, 1)
        self.groupBox_3 = QtGui.QGroupBox(self.centralwidget)
        self.groupBox_3.setMinimumSize(QtCore.QSize(550, 380))
        self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
        self.gridLayout = QtGui.QGridLayout(self.groupBox_3)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.webView = QtWebKit.QWebView(self.groupBox_3)
        self.webView.setMinimumSize(QtCore.QSize(0, 216))
        self.webView.setUrl(QtCore.QUrl(_fromUtf8("about:blank")))
        self.webView.setObjectName(_fromUtf8("webView"))
        self.gridLayout.addWidget(self.webView, 0, 0, 1, 1)
        self.gridLayout_2.addWidget(self.groupBox_3, 1, 1, 1, 1)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 993, 26))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        self.menuWell_Analysis_Selector = QtGui.QMenu(self.menubar)
        self.menuWell_Analysis_Selector.setObjectName(
            _fromUtf8("menuWell_Analysis_Selector"))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)
        self.toolBar = QtGui.QToolBar(MainWindow)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.toolBar.sizePolicy().hasHeightForWidth())
        self.toolBar.setSizePolicy(sizePolicy)
        self.toolBar.setLayoutDirection(QtCore.Qt.LeftToRight)
        self.toolBar.setMovable(True)
        self.toolBar.setAllowedAreas(QtCore.Qt.AllToolBarAreas)
        self.toolBar.setFloatable(True)
        self.toolBar.setObjectName(_fromUtf8("toolBar"))
        MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
        self.actionOpen_Files = QtGui.QAction(MainWindow)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/Images/open.png")),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionOpen_Files.setIcon(icon)
        self.actionOpen_Files.setObjectName(_fromUtf8("actionOpen_Files"))
        self.actionCreate_Analysis_Class = QtGui.QAction(MainWindow)
        self.actionCreate_Analysis_Class.setObjectName(
            _fromUtf8("actionCreate_Analysis_Class"))
        self.actionExit = QtGui.QAction(MainWindow)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/Images/exit.png")),
                        QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionExit.setIcon(icon1)
        self.actionExit.setObjectName(_fromUtf8("actionExit"))
        self.action_Undo = QtGui.QAction(MainWindow)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(
            QtGui.QPixmap(
                _fromUtf8(
                    "../../../AppData/Local/Continuum/Anaconda3/Lib/site-packages/PyQt4/examples/mainwindows/dockwidgets/images/undo.png"
                )), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.action_Undo.setIcon(icon2)
        self.action_Undo.setObjectName(_fromUtf8("action_Undo"))
        self.actionReset_Plate = QtGui.QAction(MainWindow)
        self.actionReset_Plate.setObjectName(_fromUtf8("actionReset_Plate"))
        self.actionSave_Class = QtGui.QAction(MainWindow)
        self.actionSave_Class.setObjectName(_fromUtf8("actionSave_Class"))
        self.actionPreferences = QtGui.QAction(MainWindow)
        icon3 = QtGui.QIcon()
        icon3.addPixmap(
            QtGui.QPixmap(_fromUtf8(":/Images/preferences-system.png")),
            QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionPreferences.setIcon(icon3)
        self.actionPreferences.setObjectName(_fromUtf8("actionPreferences"))
        self.menuWell_Analysis_Selector.addAction(self.actionOpen_Files)
        self.menuWell_Analysis_Selector.addSeparator()
        self.menuWell_Analysis_Selector.addAction(self.actionPreferences)
        self.menuWell_Analysis_Selector.addAction(self.actionExit)
        self.menubar.addAction(self.menuWell_Analysis_Selector.menuAction())
        self.toolBar.addAction(self.actionOpen_Files)
        self.toolBar.addAction(self.actionPreferences)

        self.retranslateUi(MainWindow)
        QtCore.QObject.connect(self.actionExit,
                               QtCore.SIGNAL(_fromUtf8("triggered()")),
                               MainWindow.close)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
예제 #5
0
    def __init__(self, chart_data_model, parent=None):
        QtGui.QWidget.__init__(self, parent)

        self.summary_chart = ChartWidgetSummary(chart_data_model, self)
        self.summary_chart.setMaximumHeight(220)

        self.summary_line_edit = SummaryLineEdit(self)

        self.notes_widget = NotesWidget(self)
        self.notes_widget.set_type(NotesWidget.CLINICAL)

        self.bpe_widget = BPEWidget()
        self.bpe_widget.setFocusPolicy(QtCore.Qt.NoFocus)

        self.treatment_summary = QtWebKit.QWebView(self)
        self.treatment_summary.setHtml("Treatment<br />Plan")
        self.treatment_summary.setMaximumWidth(150)

        self.menu_bar = QtGui.QToolBar(self)
        self.menu_bar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)

        ## TODO placeholder icon
        icon = QtGui.QIcon.fromTheme("dialog-question")
        self.action_exam = QtGui.QAction(icon, _("Perform Exam"), self)
        self.menu_bar.addAction(self.action_exam)

        self.action_hygienist = QtGui.QAction(icon, "Hygienist Shortcuts",
                                              self)
        self.menu_bar.addAction(self.action_hygienist)

        self.action_xray = QtGui.QAction(icon, "X-ray Shortcuts", self)
        self.menu_bar.addAction(self.action_xray)

        self.menu_bar.addSeparator()
        self.action_fee = QtGui.QAction(icon, _("Show Fee Widget"), self)
        self.menu_bar.addAction(self.action_fee)

        middle_widget = QtGui.QWidget(self)
        middle_layout = QtGui.QVBoxLayout(middle_widget)
        middle_layout.setMargin(0)
        middle_layout.addWidget(self.summary_line_edit)
        middle_layout.addWidget(self.notes_widget)

        right_widget = QtGui.QWidget(self)
        right_layout = QtGui.QVBoxLayout(right_widget)
        right_layout.setMargin(0)
        right_layout.addWidget(self.bpe_widget)
        right_layout.addWidget(self.treatment_summary)

        layout = QtGui.QGridLayout(self)
        layout.setMargin(3)
        layout.setSpacing(3)
        layout.addWidget(self.summary_chart, 0, 0, 1, 2)
        layout.addWidget(middle_widget, 1, 0)
        layout.addWidget(right_widget, 1, 1)
        layout.addWidget(self.menu_bar, 2, 0, 2, 1)

        layout.setRowStretch(0, 3)
        layout.setRowStretch(1, 3)
        layout.setRowStretch(2, 0)

        self.set_enabled(False)
        self.connect_signals()
예제 #6
0
    def setupUi(self):
        main_vbox = QtGui.QVBoxLayout()
        self.setLayout(main_vbox)

        buttons_hbox = QtGui.QHBoxLayout()
        self.open_pick_button = QtGui.QPushButton('Open Picks')
        openPick = functools.partial(self.open_pick_file)
        self.open_pick_button.released.connect(openPick)
        buttons_hbox.addWidget(self.open_pick_button)

        self.open_cat_button = QtGui.QPushButton('Open Catalogue')
        openCat = functools.partial(self.open_cat_file)
        self.open_cat_button.released.connect(openCat)
        self.open_cat_button.setEnabled(False)
        buttons_hbox.addWidget(self.open_cat_button)

        self.open_ref_xml_button = QtGui.QPushButton('Open Ref StationXML')
        openRefXml = functools.partial(self.open_ref_xml_file)
        self.open_ref_xml_button.released.connect(openRefXml)
        self.open_ref_xml_button.setEnabled(False)
        buttons_hbox.addWidget(self.open_ref_xml_button)

        self.open_xml_button = QtGui.QPushButton('Open StationXML')
        openXml = functools.partial(self.open_xml_file)
        self.open_xml_button.released.connect(openXml)
        self.open_xml_button.setEnabled(False)
        buttons_hbox.addWidget(self.open_xml_button)

        self.sort_drop_down_button = QtGui.QPushButton('Sort')
        self.sort_drop_down_button.setEnabled(False)
        buttons_hbox.addWidget(self.sort_drop_down_button)

        # Button for plotting for single station
        self.plot_single_stn_button = QtGui.QPushButton('Plot Single Stn')
        self.plot_single_stn_button.setEnabled(False)
        buttons_hbox.addWidget(self.plot_single_stn_button)

        # button to display waveforms for station or event
        self.display_waveforms_button = QtGui.QPushButton('Display Waveforms')
        self.display_waveforms_button.setEnabled(False)
        buttons_hbox.addWidget(self.display_waveforms_button)

        # Button to Bring all events together onto a closer X axis
        self.gather_events_checkbox = QtGui.QCheckBox('Gather Events')
        Gather = functools.partial(self.gather_events_checkbox_selected)
        self.gather_events_checkbox.stateChanged.connect(Gather)
        self.gather_events_checkbox.setEnabled(False)
        buttons_hbox.addWidget(self.gather_events_checkbox)

        main_vbox.addLayout(buttons_hbox)

        centre_hbox = QtGui.QHBoxLayout()

        left_grid_lay = QtGui.QGridLayout()

        self.p_graph_view = pg.GraphicsLayoutWidget()
        # self.single_stn_p_graph_view = pg.GraphicsLayoutWidget()

        left_grid_lay.addWidget(self.p_graph_view, 0, 0, 3, 6)

        self.col_grad_w = pg.GradientWidget(orientation='bottom')
        self.col_grad_w.loadPreset('spectrum')
        self.col_grad_w.setEnabled(False)
        self.col_grad_w.setToolTip("""
                - Click a triangle to change its color
                - Drag triangles to move
                - Click in an empty area to add a new color
                - Right click a triangle to remove
                """)

        self.max_lb = QtGui.QLabel("Max")
        self.min_lb = QtGui.QLabel("Min")

        self.reset_view_tool_button = QtGui.QPushButton()
        self.reset_view_tool_button.setIcon(QtGui.QIcon('eLsS8.png'))
        self.reset_view_tool_button.released.connect(self.reset_plot_view)
        self.reset_view_tool_button.setToolTip(
            "Reset the scatter plot zoom and sort method")

        left_grid_lay.addWidget(self.col_grad_w, 4, 1, 1, 2)
        left_grid_lay.addWidget(self.min_lb, 4, 0, 1, 1)
        left_grid_lay.addWidget(self.max_lb, 4, 4, 1, 1)
        left_grid_lay.addWidget(self.reset_view_tool_button, 4, 5, 1, 1)

        centre_hbox.addLayout(left_grid_lay)

        # Open StreetMAP view
        map_view = self.map_view = QtWebKit.QWebView()
        cache = QtNetwork.QNetworkDiskCache()
        cache.setCacheDirectory("cache")
        map_view.page().networkAccessManager().setCache(cache)
        map_view.page().networkAccessManager()

        map_view.page().mainFrame().addToJavaScriptWindowObject(
            "MainWindow", self)
        map_view.page().setLinkDelegationPolicy(
            QtWebKit.QWebPage.DelegateAllLinks)
        map_view.load(QtCore.QUrl('map.html'))
        map_view.loadFinished.connect(self.onLoadFinished)
        map_view.linkClicked.connect(QtGui.QDesktopServices.openUrl)

        centre_hbox.addWidget(map_view)

        main_vbox.addLayout(centre_hbox)
예제 #7
0
    def __init__(self):
        # Determine where module is located (needed for finding ICO & PNG files)
        try:
            test = sys.frozen
            self.rootDir = os.path.dirname(sys.executable)
        except:
            self.rootDir = __file__.replace("library.zip", "")
            if os.path.islink(self.rootDir):
                self.rootDir = os.path.realpath(self.rootDir)
            self.rootDir = os.path.dirname(os.path.abspath(self.rootDir))

        uifile = None

        try:
            from pkg_resources import resource_filename
            uifile = resource_filename(__name__, 'ui/winMain.ui')
        except:
            uifile = os.path.join(self.rootDir, "ui", "winMain.ui")

        self.app = QtGui.QApplication(sys.argv)

        # Create the main window and set all text so that translations are handled via gettext
        Ui_winMain, base_class = uic.loadUiType(uifile)
        self.winMain = QtGui.QMainWindow()
        self.winMain.setWindowFlags(QtCore.Qt.Dialog)
        self.uiMain = Ui_winMain()
        self.uiMain.setupUi(self.winMain)

        self.webMainExists = True
        try:
            self.webMain = QtWebKit.QWebView(self.uiMain.centralwidget)
            self.webMain.setGeometry(QtCore.QRect(5, 130, 390, 280))
            self.webMain.setUrl(QtCore.QUrl("about:blank"))
        except:
            self.webMainExists = False
            self.webMain = QtGui.QTextBrowser(self.uiMain.centralwidget)
            self.webMain.setGeometry(QtCore.QRect(5, 130, 390, 280))
            self.webMain.setTextInteractionFlags(
                QtCore.Qt.TextSelectableByMouse)
            self.webMain.setOpenLinks(False)

        # Centre window on screen
        screen = QtGui.QDesktopWidget().screenGeometry()
        size = self.winMain.geometry()
        self.winMain.move((screen.width() - size.width()) / 2,
                          (screen.height() - size.height()) / 2)

        # Connect signals to functions
        QtCore.QObject.connect(self.uiMain.btnLogin,
                               QtCore.SIGNAL("clicked()"),
                               self.btnLoginClicked)
        QtCore.QObject.connect(self.uiMain.txtAccount,
                               QtCore.SIGNAL("returnPressed()"),
                               self.txtAccountEnter)
        QtCore.QObject.connect(self.uiMain.txtPassword,
                               QtCore.SIGNAL("returnPressed()"),
                               self.txtPasswordEnter)
        QtCore.QObject.connect(self.uiMain.actionExit,
                               QtCore.SIGNAL("triggered()"),
                               self.winMain.close)
        QtCore.QObject.connect(self.uiMain.actionAbout,
                               QtCore.SIGNAL("triggered()"),
                               self.actionAboutSelected)
        QtCore.QObject.connect(self.uiMain.actionPatch,
                               QtCore.SIGNAL("triggered()"),
                               self.actionPatchSelected)
        QtCore.QObject.connect(self.uiMain.actionOptions,
                               QtCore.SIGNAL("triggered()"),
                               self.actionOptionsSelected)
        QtCore.QObject.connect(self.uiMain.actionSettings_Wizard,
                               QtCore.SIGNAL("triggered()"),
                               self.actionWizardSelected)
        QtCore.QObject.connect(self.uiMain.actionSwitch_Game,
                               QtCore.SIGNAL("triggered()"),
                               self.actionSwitchSelected)
        QtCore.QObject.connect(self.uiMain.actionCheck_Bottle,
                               QtCore.SIGNAL("triggered()"),
                               self.actionCheckSelected)
        QtCore.QObject.connect(self.uiMain.actionHideWinMain,
                               QtCore.SIGNAL("triggered()"),
                               self.actionHideWinMainSelected)
        QtCore.QObject.connect(self.winMain, QtCore.SIGNAL("AddLog(QString)"),
                               self.AddLog)
        QtCore.QObject.connect(
            self.winMain, QtCore.SIGNAL("ReturnLangConfig(PyQt_PyObject)"),
            self.GetLanguageConfig)
        QtCore.QObject.connect(
            self.winMain, QtCore.SIGNAL("ReturnBaseConfig(PyQt_PyObject)"),
            self.GetBaseConfig)
        QtCore.QObject.connect(
            self.winMain, QtCore.SIGNAL("ReturnGLSDataCentre(PyQt_PyObject)"),
            self.GetGLSDataCentre)
        QtCore.QObject.connect(
            self.winMain,
            QtCore.SIGNAL("ReturnWorldQueueConfig(PyQt_PyObject)"),
            self.GetWorldQueueConfig)
        QtCore.QObject.connect(self.winMain,
                               QtCore.SIGNAL("ReturnNews(QString)"),
                               self.GetNews)

        # Disable login and save settings buttons
        self.uiMain.btnLogin.setEnabled(False)
        self.uiMain.chkSaveSettings.setEnabled(False)

        # Initialise variables
        self.settings = None
        self.osType = DetermineOS()
        self.gameType = DetermineGame()
        self.configFile = ""
        self.currentGame = None

        self.InitialSetup()
예제 #8
0
파일: ghost.py 프로젝트: todun/Ghost.py
    def __init__(self,
                 user_agent=default_user_agent,
                 wait_timeout=8,
                 wait_callback=None,
                 log_level=logging.WARNING,
                 display=False,
                 viewport_size=(800, 600),
                 cache_dir='/tmp/ghost.py'):
        self.http_resources = []

        self.user_agent = user_agent
        self.wait_timeout = wait_timeout
        self.wait_callback = wait_callback

        self.loaded = True

        if not sys.platform.startswith('win') and not 'DISPLAY' in os.environ\
                and not hasattr(Ghost, 'xvfb'):
            try:
                os.environ['DISPLAY'] = ':99'
                Ghost.xvfb = subprocess.Popen(['Xvfb', ':99'])
            except OSError:
                raise Exception('Xvfb is required to a ghost run oustside ' +\
                    'an X instance')

        self.display = display

        if not Ghost._app:
            Ghost._app = QApplication.instance() or QApplication(['ghost'])

        self.page = GhostWebPage(Ghost._app)
        QtWebKit.QWebSettings.setMaximumPagesInCache(0)
        QtWebKit.QWebSettings.setObjectCacheCapacities(0, 0, 0)

        self.page.setForwardUnsupportedContent(True)

        self.set_viewport_size(*viewport_size)

        # Page signals
        self.page.loadFinished.connect(self._page_loaded)
        self.page.loadStarted.connect(self._page_load_started)
        self.page.unsupportedContent.connect(self._unsupported_content)

        self.manager = self.page.networkAccessManager()
        self.manager.finished.connect(self._request_ended)
        # Cache
        self.cache = QNetworkDiskCache()
        self.cache.setCacheDirectory(cache_dir)
        self.manager.setCache(self.cache)
        # Cookie jar
        self.cookie_jar = QNetworkCookieJar()
        self.manager.setCookieJar(self.cookie_jar)
        # User Agent
        self.page.setUserAgent(self.user_agent)

        self.page.networkAccessManager().authenticationRequired\
            .connect(self._authenticate)
        self.page.networkAccessManager().proxyAuthenticationRequired\
            .connect(self._authenticate)

        self.main_frame = self.page.mainFrame()

        logger.setLevel(log_level)

        if self.display:
            self.webview = QtWebKit.QWebView()
            self.webview.setPage(self.page)
            self.webview.show()
예제 #9
0
파일: sPYder.py 프로젝트: daystalker/sPYder
		def tabber():
			##tab functions##
			fin_url=''
			def TabLabel0():
				print ''
			def TabLabel(t):
				if t==True and not html.title()=='':
					ind=tab_widget.currentIndex()
					tab_widget.setTabText(ind,html.title())
					#fin_url=QtWebKit.QWebView.getUrl()

			def UrlChanged(url):
				ind=tab_index()
				tb_url.setText(url.toString())
				#tab_widget.setTabText(ind,html.title())
				load_prog.setValue(0)
				html.load(QtCore.QUrl(tb_url.text()))
				html.show()
				
			def FinalUrlChanged(url):
				ind=tab_index()
				tb_url.setText(url.toString())
				tab_widget.setTabText(ind,html.title())
				load_prog.setValue(100)
				#TabLabel(True)

			#tab inits
			tabcentral=QtGui.QWidget()
			tabframe=QtGui.QFrame(tabcentral)
			tabgrid = QtGui.QVBoxLayout(tabframe)
			tabgrid.setMargin(0)
			tabgrid.setSpacing(0)
			tabmain = QtGui.QHBoxLayout(tabcentral)
			tabmain.setSpacing(0)
			tabmain.setMargin(1)
			
			#address
			tb_url = QtGui.QLineEdit(tabframe)
			
			##buttons
			bt_back = QtGui.QPushButton(tabframe)
			bt_ahead = QtGui.QPushButton(tabframe)
			bt_add = QtGui.QPushButton(tabframe)
			bt_rem = QtGui.QPushButton(tabframe)
			bt_go = QtGui.QPushButton(tabframe)
			
			###button styles and activities
			bt_back.setIcon(QtGui.QIcon().fromTheme("go-previous"))
			bt_ahead.setIcon(QtGui.QIcon().fromTheme("go-next"))
			
			bt_go.setText('Go')
			bt_go.setFixedWidth(50)
			bt_add.setText('+')
			bt_add.setFixedWidth(50)
			bt_add.clicked.connect(adder)
			bt_rem.setText('-')
			bt_rem.setFixedWidth(50)
			bt_rem.clicked.connect(remover)
			load_prog=QtGui.QProgressBar()
			load_prog.setGeometry(40,80,20,20)
			load_prog.setFixedWidth(80)
			address_area=QtGui.QHBoxLayout()
			address_area.addWidget(bt_back)
			address_area.addWidget(bt_ahead)
			address_area.addWidget(tb_url)
			address_area.addWidget(bt_go)			
			address_area.addWidget(bt_add)
			address_area.addWidget(bt_rem)
			address_area.addWidget(load_prog)
			tabgrid.addLayout(address_area)
			html=QtWebKit.QWebView()
			
			##address delegates
			html.page().setLinkDelegationPolicy(QtWebKit.QWebPage.DelegateAllLinks)
			html.connect(html, QtCore.SIGNAL("linkClicked(const QUrl&)"), UrlChanged)
			html.connect(html, QtCore.SIGNAL("loadStarted()"), TabLabel0)
			html.connect(html, QtCore.SIGNAL("loadFinished(bool)"), TabLabel)
			html.connect(html, QtCore.SIGNAL("urlChanged(const QUrl&)"), FinalUrlChanged)
			tabgrid.addWidget(html)
			tabmain.addWidget(tabframe)

			
			#browse
			default_url = "www.google.com"
			def browse():
				"""
				Make a web browse on a specific url and show the page on the
				Webview widget.
				"""
				curl = tb_url.text() if tb_url.text() else default_url
				if curl==default_url:
					url='http://'+default_url
				else:
					purl=curl
					purl=curl.split(' ')
					print purl
					if len(purl)==1 and '.' in curl:
						if not curl[:7]=='http://':
							url='http://'+curl
					else:
						url='http://www.google.co.in/?client=ubuntu#channel=fs&q='+purl[0]
						for i in range(1,len(purl)):
							url+=str('+'+purl[i])
				html.load(QtCore.QUrl(url))
				html.show()
				TabLabel(True)
			
			tabmain.connect(tb_url, QtCore.SIGNAL("returnPressed()"), browse)
			tabmain.connect(bt_go, QtCore.SIGNAL("clicked()"), browse)
			tabmain.connect(bt_back, QtCore.SIGNAL("clicked()"), html.back)
			tabmain.connect(bt_ahead, QtCore.SIGNAL("clicked()"), html.forward)
			tb_url.setText(default_url)
			browse()
			return tabcentral
예제 #10
0
파일: mainFrame.py 프로젝트: kad4/gengui
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.setWindowModality(QtCore.Qt.ApplicationModal)
        MainWindow.resize(700, 500)
        MainWindow.setMinimumSize(QtCore.QSize(700, 500))
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8("../favicon.png")),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        MainWindow.setWindowIcon(icon)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget)
        self.horizontalLayout.setMargin(5)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.widget = QtGui.QWidget(self.centralwidget)
        self.widget.setObjectName(_fromUtf8("widget"))
        self.verticalLayout_2 = QtGui.QVBoxLayout(self.widget)
        self.verticalLayout_2.setContentsMargins(-1, -1, 0, -1)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.widget_3 = QtGui.QWidget(self.widget)
        self.widget_3.setObjectName(_fromUtf8("widget_3"))
        self.horizontalLayout_2 = QtGui.QHBoxLayout(self.widget_3)
        self.horizontalLayout_2.setSpacing(0)
        self.horizontalLayout_2.setSizeConstraint(QtGui.QLayout.SetMinimumSize)
        self.horizontalLayout_2.setMargin(0)
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.trendingButton = QtGui.QPushButton(self.widget_3)
        self.trendingButton.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
        self.trendingButton.setCheckable(True)
        self.trendingButton.setChecked(True)
        self.trendingButton.setFlat(True)
        self.trendingButton.setObjectName(_fromUtf8("trendingButton"))
        self.horizontalLayout_2.addWidget(self.trendingButton)
        self.recommendedButton = QtGui.QPushButton(self.widget_3)
        self.recommendedButton.setStyleSheet(_fromUtf8("`"))
        self.recommendedButton.setCheckable(True)
        self.recommendedButton.setFlat(True)
        self.recommendedButton.setObjectName(_fromUtf8("recommendedButton"))
        self.horizontalLayout_2.addWidget(self.recommendedButton)
        self.verticalLayout_2.addWidget(self.widget_3)
        self.widget_4 = QtGui.QWidget(self.widget)
        self.widget_4.setObjectName(_fromUtf8("widget_4"))
        self.verticalLayout_4 = QtGui.QVBoxLayout(self.widget_4)
        self.verticalLayout_4.setSpacing(0)
        self.verticalLayout_4.setMargin(0)
        self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
        self.itemList = QtGui.QListWidget(self.widget_4)
        self.itemList.setEditTriggers(
            QtGui.QAbstractItemView.CurrentChanged
            | QtGui.QAbstractItemView.SelectedClicked)
        self.itemList.setViewMode(QtGui.QListView.ListMode)
        self.itemList.setSelectionRectVisible(True)
        self.itemList.setObjectName(_fromUtf8("itemList"))
        self.verticalLayout_4.addWidget(self.itemList)
        self.frame_6 = QtGui.QFrame(self.widget_4)
        self.frame_6.setAutoFillBackground(False)
        self.frame_6.setStyleSheet(
            _fromUtf8("background-color: rgb(255, 255, 255);\n"
                      "border-top-color: rgba(255, 255, 255, 0);"))
        self.frame_6.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frame_6.setObjectName(_fromUtf8("frame_6"))
        self.verticalLayout_5 = QtGui.QVBoxLayout(self.frame_6)
        self.verticalLayout_5.setSpacing(0)
        self.verticalLayout_5.setMargin(0)
        self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5"))
        self.reloadButton = QtGui.QPushButton(self.frame_6)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Segoe UI Symbol"))
        self.reloadButton.setFont(font)
        self.reloadButton.setFlat(True)
        self.reloadButton.setObjectName(_fromUtf8("reloadButton"))
        self.verticalLayout_5.addWidget(self.reloadButton)
        self.verticalLayout_4.addWidget(self.frame_6)
        self.verticalLayout_2.addWidget(self.widget_4)
        self.horizontalLayout.addWidget(self.widget)
        self.widget_2 = QtGui.QWidget(self.centralwidget)
        self.widget_2.setObjectName(_fromUtf8("widget_2"))
        self.verticalLayout = QtGui.QVBoxLayout(self.widget_2)
        self.verticalLayout.setContentsMargins(0, -1, -1, -1)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.frame_4 = QtGui.QFrame(self.widget_2)
        self.frame_4.setStyleSheet(_fromUtf8("border-color: rgb(0, 0, 0);"))
        self.frame_4.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frame_4.setObjectName(_fromUtf8("frame_4"))
        self.verticalLayout_3 = QtGui.QVBoxLayout(self.frame_4)
        self.verticalLayout_3.setSpacing(1)
        self.verticalLayout_3.setMargin(0)
        self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
        self.webView = QtWebKit.QWebView(self.frame_4)
        self.webView.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
        self.webView.setAcceptDrops(False)
        self.webView.setAutoFillBackground(False)
        self.webView.setStyleSheet(_fromUtf8(""))
        self.webView.setUrl(QtCore.QUrl(_fromUtf8("about:blank")))
        self.webView.setObjectName(_fromUtf8("webView"))
        self.verticalLayout_3.addWidget(self.webView)
        self.widget_5 = QtGui.QWidget(self.frame_4)
        self.widget_5.setAutoFillBackground(False)
        self.widget_5.setStyleSheet(
            _fromUtf8("background-color: rgb(255, 255, 255);"))
        self.widget_5.setObjectName(_fromUtf8("widget_5"))
        self.horizontalLayout_3 = QtGui.QHBoxLayout(self.widget_5)
        self.horizontalLayout_3.setSpacing(0)
        self.horizontalLayout_3.setMargin(0)
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.likeButton = QtGui.QPushButton(self.widget_5)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Segoe UI Symbol"))
        self.likeButton.setFont(font)
        self.likeButton.setStyleSheet(_fromUtf8(""))
        self.likeButton.setCheckable(True)
        self.likeButton.setFlat(True)
        self.likeButton.setObjectName(_fromUtf8("likeButton"))
        self.horizontalLayout_3.addWidget(self.likeButton)
        self.dislikeButton = QtGui.QPushButton(self.widget_5)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Segoe UI Symbol"))
        self.dislikeButton.setFont(font)
        self.dislikeButton.setStyleSheet(_fromUtf8(""))
        self.dislikeButton.setCheckable(True)
        self.dislikeButton.setFlat(True)
        self.dislikeButton.setObjectName(_fromUtf8("dislikeButton"))
        self.horizontalLayout_3.addWidget(self.dislikeButton)
        self.line_2 = QtGui.QFrame(self.widget_5)
        self.line_2.setFrameShape(QtGui.QFrame.VLine)
        self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_2.setObjectName(_fromUtf8("line_2"))
        self.horizontalLayout_3.addWidget(self.line_2)
        self.redirectButton = QtGui.QPushButton(self.widget_5)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Segoe UI Symbol"))
        self.redirectButton.setFont(font)
        self.redirectButton.setStyleSheet(_fromUtf8(""))
        self.redirectButton.setFlat(True)
        self.redirectButton.setObjectName(_fromUtf8("redirectButton"))
        self.horizontalLayout_3.addWidget(self.redirectButton)
        self.line = QtGui.QFrame(self.widget_5)
        self.line.setFrameShape(QtGui.QFrame.VLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        self.horizontalLayout_3.addWidget(self.line)
        self.logoutButton = QtGui.QPushButton(self.widget_5)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Segoe UI Symbol"))
        self.logoutButton.setFont(font)
        self.logoutButton.setFlat(True)
        self.logoutButton.setObjectName(_fromUtf8("logoutButton"))
        self.horizontalLayout_3.addWidget(self.logoutButton)
        self.horizontalLayout_3.setStretch(0, 2)
        self.horizontalLayout_3.setStretch(1, 2)
        self.horizontalLayout_3.setStretch(3, 1)
        self.horizontalLayout_3.setStretch(5, 1)
        self.verticalLayout_3.addWidget(self.widget_5)
        self.verticalLayout_3.setStretch(1, 1)
        self.verticalLayout.addWidget(self.frame_4)
        self.horizontalLayout.addWidget(self.widget_2)
        self.horizontalLayout.setStretch(0, 4)
        self.horizontalLayout.setStretch(1, 9)
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QObject.connect(self.trendingButton,
                               QtCore.SIGNAL(_fromUtf8("released()")),
                               self.recommendedButton.toggle)
        QtCore.QObject.connect(self.recommendedButton,
                               QtCore.SIGNAL(_fromUtf8("released()")),
                               self.trendingButton.toggle)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
예제 #11
0
    def __init__(self, url, container):
        self.container = container
        QtGui.QWidget.__init__(self)
        self.pbar = QtGui.QProgressBar(maximumWidth=120, visible=False)
        self.wb = QtWebKit.QWebView(
            loadProgress=lambda v: (self.pbar.show(), self.pbar.setValue(v))
            if self.amCurrent() else None,
            loadFinished=self.pbar.hide,
            loadStarted=lambda: self.pbar.show() if self.amCurrent() else None,
            titleChanged=lambda t: container.tabs.setTabText(
                container.tabs.indexOf(self), t) or
            (container.setWindowTitle(t) if self.amCurrent() else None),
            iconChanged=lambda: container.tabs.setTabIcon(
                container.tabs.indexOf(self), self.wb.icon()))
        self.wb.page().networkAccessManager().setCookieJar(container.cookies)
        self.wb.page().setForwardUnsupportedContent(True)
        self.wb.page().unsupportedContent.connect(container.fetch)
        self.wb.page().downloadRequested.connect(lambda req: container.fetch(
            self.page().networkAccessManager().get(req)))

        self.setLayout(QtGui.QVBoxLayout())
        self.tb = QtGui.QToolBar("Main Toolbar", self)
        self.layout().addWidget(self.tb)
        self.layout().addWidget(self.wb)
        for a, sc in [[QtWebKit.QWebPage.Back, "Alt+Left"],
                      [QtWebKit.QWebPage.Forward, "Alt+Right"],
                      [QtWebKit.QWebPage.Reload, "Ctrl+r"]]:
            self.tb.addAction(self.wb.pageAction(a))
            self.wb.pageAction(a).setShortcut(sc)

        self.url = QtGui.QLineEdit(returnPressed=lambda: self.wb.setUrl(
            QtCore.QUrl.fromUserInput(self.url.text())))
        self.url.setCompleter(container.completer)
        self.tb.addWidget(self.url)
        self.tb.addAction(container.star)

        # FIXME: if I was seriously golfing, all of these can go in a single lambda
        self.wb.urlChanged.connect(lambda u: self.url.setText(u.toString()))
        self.wb.urlChanged.connect(
            lambda u: container.addToHistory(unicode(u.toString())))
        self.wb.urlChanged.connect(lambda u: container.star.setChecked(
            unicode(u.toString()) in container.bookmarks)
                                   if self.amCurrent() else None)

        # FIXME: do this using a tooltip
        #self.wb.page().linkHovered.connect(lambda l: container.statusBar().showMessage(l, 3000))

        self.search = QtGui.QLineEdit(
            visible=False,
            maximumWidth=200,
            returnPressed=lambda: self.wb.findText(self.search.text()),
            textChanged=lambda: self.wb.findText(self.search.text()))
        self.showSearch = QtGui.QShortcut(
            "Ctrl+F",
            self,
            activated=lambda: self.search.show() or self.search.setFocus())
        self.hideSearch = QtGui.QShortcut(
            "Esc",
            self,
            activated=lambda: (self.search.hide(), self.setFocus()))

        self.wb.setLayout(QtGui.QVBoxLayout())
        self.wb.layout().addWidget(self.search, 0, QtCore.Qt.AlignRight)
        self.wb.layout().addStretch()
        self.wb.layout().addWidget(self.pbar, 0, QtCore.Qt.AlignRight)

        self.do_close = QtGui.QShortcut(
            "Ctrl+W",
            self,
            activated=lambda: container.tabs.removeTab(
                container.tabs.indexOf(self)))
        self.do_quit = QtGui.QShortcut("Ctrl+q",
                                       self,
                                       activated=lambda: container.close())
        self.zoomIn = QtGui.QShortcut("Ctrl++",
                                      self,
                                      activated=lambda: self.wb.setZoomFactor(
                                          self.wb.zoomFactor() + 0.2))
        self.zoomOut = QtGui.QShortcut("Ctrl+-",
                                       self,
                                       activated=lambda: self.wb.setZoomFactor(
                                           self.wb.zoomFactor() - 0.2))
        self.zoomOne = QtGui.QShortcut(
            "Ctrl+0", self, activated=lambda: self.wb.setZoomFactor(1))
        self.urlFocus = QtGui.QShortcut("Ctrl+l",
                                        self,
                                        activated=self.url.setFocus)

        self.previewer = QtGui.QPrintPreviewDialog(
            paintRequested=self.wb.print_)
        self.do_print = QtGui.QShortcut("Ctrl+p",
                                        self,
                                        activated=self.previewer.exec_)
        self.wb.settings().setAttribute(QtWebKit.QWebSettings.PluginsEnabled,
                                        True)
        self.wb.settings().setIconDatabasePath(tempfile.mkdtemp())

        self.wb.load(url)
예제 #12
0
    def __init__(self, parent=None):
        QtGui.QStackedWidget.__init__(self, parent)
        self.diary_widget = parent
        self.patient_label = QtGui.QLabel()

        icon = QtGui.QIcon(":/search.png")
        self.get_patient_button = QtGui.QPushButton(icon, "")
        self.get_patient_button.setMaximumWidth(40)

        self.appt_listView = DraggableList(self)
        self.block_listView = DraggableList(self)
        self.item_delegate = ColouredItemDelegate(self)

        self.appointment_model = SimpleListModel(self)
        self.appt_listView.setModel(self.appointment_model)
        self.appt_listView.setItemDelegate(self.item_delegate)
        self.appt_listView.setSelectionModel(
            self.appointment_model.selection_model)
        self.appt_listView.setSelectionMode(
            QtGui.QListView.ContiguousSelection)

        block_model = BlockListModel(self)
        self.block_listView.setModel(block_model)

        icon = QtGui.QIcon(":vcalendar.png")
        diary_button = QtGui.QPushButton(icon, _("Diary"))
        diary_button.setToolTip(_("Open the patient's diary"))

        icon = QtGui.QIcon(":settings.png")
        settings_button = QtGui.QPushButton(icon, _("Options"))
        settings_button.setToolTip(_("Appointment Settings"))

        icon = QtGui.QIcon(":back.png")
        self.prev_appt_button = QtGui.QPushButton(icon, "")
        self.prev_appt_button.setToolTip(_("Previous appointment"))

        icon = QtGui.QIcon(":forward.png")
        self.next_appt_button = QtGui.QPushButton(icon, "")
        self.next_appt_button.setToolTip(_("Next available appointment"))

        icon = QtGui.QIcon(":forward.png")
        self.next_day_button = QtGui.QPushButton(icon, "")
        self.next_day_button.setToolTip(_("Next Day or Week"))

        icon = QtGui.QIcon(":back.png")
        self.prev_day_button = QtGui.QPushButton(icon, "")
        self.prev_day_button.setToolTip(_("Previous Day or Week"))

        icon = QtGui.QIcon(":first.png")
        self.first_appt_button = QtGui.QPushButton(icon, "")
        self.first_appt_button.setToolTip(_("First available appointment"))

        self.appt_controls_frame = QtGui.QWidget()
        layout = QtGui.QGridLayout(self.appt_controls_frame)
        layout.setMargin(1)
        layout.setSpacing(2)
        layout.addWidget(diary_button, 0, 0, 1, 2)
        layout.addWidget(settings_button, 0, 3, 1, 2)
        layout.addWidget(self.prev_day_button, 1, 0)
        layout.addWidget(self.prev_appt_button, 1, 1)
        layout.addWidget(self.first_appt_button, 1, 2)
        layout.addWidget(self.next_appt_button, 1, 3)
        layout.addWidget(self.next_day_button, 1, 4)

        self.appt_controls_frame.setSizePolicy(
            QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                              QtGui.QSizePolicy.Minimum))

        self.search_criteria_webview = QtWebKit.QWebView(self)
        self.search_criteria_webview.setMinimumHeight(100)
        self.search_criteria_webview.setHtml(
            _("No appointment selected for scheduling"))

        # now arrange the stacked widget

        # page 0 - Browsing mode
        self.browsing_webview = QtWebKit.QWebView()
        self.reset_browsing_webview()
        self.addWidget(self.browsing_webview)

        # page 1 -- scheduling mode
        widg = QtGui.QWidget()
        layout = QtGui.QGridLayout(widg)
        layout.setMargin(0)
        layout.addWidget(self.patient_label, 0, 0)
        layout.addWidget(self.get_patient_button, 0, 1)
        layout.addWidget(self.appt_listView, 2, 0, 1, 2)
        layout.addWidget(self.appt_controls_frame, 3, 0, 1, 2)
        layout.addWidget(self.search_criteria_webview, 4, 0, 1, 2)
        self.addWidget(widg)

        # page 2 -- blocking mode
        widg = QtGui.QWidget()
        layout = QtGui.QVBoxLayout(widg)
        layout.addWidget(self.block_listView)
        self.addWidget(widg)

        # page 4 -- notes mode
        self.notes_label = QtGui.QLabel(_("Select a patient to edit notes"))
        self.addWidget(self.notes_label)

        # connect signals
        self.get_patient_button.clicked.connect(self.find_patient)
        settings_button.clicked.connect(self.show_settings_dialog)
        self.prev_appt_button.clicked.connect(self.show_prev_appt)
        self.next_appt_button.clicked.connect(self.show_next_appt)
        self.prev_day_button.clicked.connect(self.show_prev_day)
        self.next_day_button.clicked.connect(self.show_next_day)
        self.first_appt_button.clicked.connect(self.find_first_appointment)

        diary_button.clicked.connect(self.show_pt_diary)

        self.appt_listView.selectionModel().selectionChanged.connect(
            self.selection_changed)
        self.appt_listView.doubleClicked.connect(self.appointment_2x_clicked)
예제 #13
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.setEnabled(True)
        MainWindow.resize(846, 749)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        MainWindow.setMinimumSize(QtCore.QSize(846, 749))
        MainWindow.setMaximumSize(QtCore.QSize(846, 749))
        MainWindow.setAcceptDrops(False)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(os.path.join(IMGFOLDER, "icon.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        MainWindow.setWindowIcon(icon)
        MainWindow.setToolTip(_fromUtf8(""))
        MainWindow.setAutoFillBackground(False)
        MainWindow.setDocumentMode(False)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))

        ## Pushbutton
        self.validateData = QtGui.QPushButton(self.centralwidget)
        self.validateData.setGeometry(QtCore.QRect(10, 620, 111, 23))
        self.validateData.setObjectName(_fromUtf8("validateData"))
        self.validateData.raise_()

        self.uploadZip = QtGui.QToolButton(self.centralwidget)
        self.uploadZip.setGeometry(QtCore.QRect(160, 620, 111, 23))
        self.uploadZip.setObjectName(_fromUtf8("uploadZip"))
        self.uploadZip.raise_()

        self.publishAgol = QtGui.QToolButton(self.centralwidget)
        self.publishAgol.setGeometry(QtCore.QRect(310, 620, 101, 23))
        self.publishAgol.setObjectName(_fromUtf8("publishAgol"))
        self.publishAgol.raise_()

        self.publishOpendata = QtGui.QToolButton(self.centralwidget)
        self.publishOpendata.setGeometry(QtCore.QRect(450, 620, 101, 23))
        self.publishOpendata.setObjectName(_fromUtf8("publishOpendata"))
        self.publishOpendata.raise_()

        self.publishMetadata = QtGui.QToolButton(self.centralwidget)
        self.publishMetadata.setGeometry(QtCore.QRect(590, 620, 101, 23))
        self.publishMetadata.setObjectName(_fromUtf8("publishMetadata"))
        self.publishMetadata.raise_()

        self.generateReport = QtGui.QToolButton(self.centralwidget)
        self.generateReport.setGeometry(QtCore.QRect(770, 615, 50, 41))
        self.generateReport.setText(_fromUtf8(""))
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(os.path.join(IMGFOLDER, "refresh.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.generateReport.setIcon(icon)
        self.generateReport.setIconSize(QtCore.QSize(20, 20))
        self.generateReport.setObjectName(_fromUtf8("generateReport"))
        self.generateReport.raise_()

        ## Grupos
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.InfoMetadata = QtGui.QGroupBox(self.centralwidget)
        self.InfoMetadata.setGeometry(QtCore.QRect(10, 20, 411, 401))
        self.InfoMetadata.setFont(font)
        self.InfoMetadata.setObjectName(_fromUtf8("InfoMetadata"))

        self.InfoPublication = QtGui.QGroupBox(self.centralwidget)
        self.InfoPublication.setGeometry(QtCore.QRect(10, 430, 411, 181))
        self.InfoPublication.setFont(font)
        self.InfoPublication.setObjectName(_fromUtf8("InfoPublication"))

        self.InfoObservacion = QtGui.QGroupBox(self.centralwidget)
        self.InfoObservacion.setGeometry(QtCore.QRect(440, 480, 391, 131))
        self.InfoObservacion.setFont(font)
        self.InfoObservacion.setObjectName(_fromUtf8("InfoObservacion"))

        self.InfoObservacion.raise_()
        self.InfoPublication.raise_()
        self.InfoMetadata.raise_()

        # ids
        font = QtGui.QFont()
        font.setBold(False)
        font.setWeight(50)
        self.id01_title = QtGui.QLabel(self.InfoMetadata)
        self.id01_title.setGeometry(QtCore.QRect(20, 30, 111, 16))
        self.id01_title.setFont(font)
        self.id01_title.setObjectName(_fromUtf8("id01_title"))

        self.id02_desc = QtGui.QLabel(self.InfoMetadata)
        self.id02_desc.setGeometry(QtCore.QRect(20, 60, 111, 16))
        self.id02_desc.setFont(font)
        self.id02_desc.setObjectName(_fromUtf8("id02_desc"))

        self.id03_method = QtGui.QLabel(self.InfoMetadata)
        self.id03_method.setGeometry(QtCore.QRect(20, 150, 111, 16))
        self.id03_method.setFont(font)
        self.id03_method.setObjectName(_fromUtf8("id03_method"))

        self.id04_resp = QtGui.QLabel(self.InfoMetadata)
        self.id04_resp.setGeometry(QtCore.QRect(20, 180, 111, 16))
        self.id04_resp.setFont(font)
        self.id04_resp.setObjectName(_fromUtf8("id04_resp"))

        self.id05_tags = QtGui.QLabel(self.InfoMetadata)
        self.id05_tags.setGeometry(QtCore.QRect(20, 210, 111, 16))
        self.id05_tags.setFont(font)
        self.id05_tags.setObjectName(_fromUtf8("id05_tags"))

        self.id06_ubic = QtGui.QLabel(self.InfoMetadata)
        self.id06_ubic.setGeometry(QtCore.QRect(20, 240, 111, 16))
        self.id06_ubic.setFont(font)
        self.id06_ubic.setObjectName(_fromUtf8("id06_ubic"))

        self.id07_scale = QtGui.QLabel(self.InfoMetadata)
        self.id07_scale.setGeometry(QtCore.QRect(20, 270, 111, 16))
        self.id07_scale.setFont(font)
        self.id07_scale.setObjectName(_fromUtf8("id07_scale"))

        self.id08_format = QtGui.QLabel(self.InfoMetadata)
        self.id08_format.setGeometry(QtCore.QRect(20, 300, 111, 16))
        self.id08_format.setFont(font)
        self.id08_format.setObjectName(_fromUtf8("id08_format"))

        self.id09_date = QtGui.QLabel(self.InfoMetadata)
        self.id09_date.setGeometry(QtCore.QRect(220, 300, 111, 20))
        self.id09_date.setFont(font)
        self.id09_date.setObjectName(_fromUtf8("id09_date"))

        self.id10_situation = QtGui.QLabel(self.InfoMetadata)
        self.id10_situation.setGeometry(QtCore.QRect(20, 330, 111, 16))
        self.id10_situation.setFont(font)
        self.id10_situation.setObjectName(_fromUtf8("id10_situation"))

        self.id11_update = QtGui.QLabel(self.InfoMetadata)
        self.id11_update.setGeometry(QtCore.QRect(220, 330, 111, 20))
        self.id11_update.setFont(font)
        self.id11_update.setObjectName(_fromUtf8("id11_update"))

        self.id12_restr = QtGui.QLabel(self.InfoMetadata)
        self.id12_restr.setGeometry(QtCore.QRect(20, 360, 111, 16))
        self.id12_restr.setFont(font)
        self.id12_restr.setObjectName(_fromUtf8("id12_restr"))

        self.id13_access = QtGui.QLabel(self.InfoMetadata)
        self.id13_access.setGeometry(QtCore.QRect(220, 360, 111, 20))
        self.id13_access.setFont(font)
        self.id13_access.setObjectName(_fromUtf8("id13_access"))

        self.id14_autorization = QtGui.QLabel(self.InfoPublication)
        self.id14_autorization.setGeometry(QtCore.QRect(20, 110, 161, 16))
        self.id14_autorization.setFont(font)
        self.id14_autorization.setObjectName(_fromUtf8("id14_autorization"))

        # Textos
        self.text01_title = QtGui.QLineEdit(self.InfoMetadata)
        self.text01_title.setGeometry(QtCore.QRect(130, 30, 261, 20))
        self.text01_title.setFont(font)
        self.text01_title.setObjectName(_fromUtf8("text01_title"))

        self.text02_desc = QtGui.QTextEdit(self.InfoMetadata)
        self.text02_desc.setGeometry(QtCore.QRect(130, 60, 261, 81))
        self.text02_desc.setFont(font)
        self.text02_desc.setObjectName(_fromUtf8("text02_desc"))

        self.text03_method = QtGui.QTextEdit(self.InfoMetadata)
        self.text03_method.setGeometry(QtCore.QRect(130, 150, 261, 20))
        self.text03_method.setFont(font)
        self.text03_method.setObjectName(_fromUtf8("text03_method"))

        self.text04_resp = QtGui.QLineEdit(self.InfoMetadata)
        self.text04_resp.setGeometry(QtCore.QRect(130, 180, 261, 20))
        self.text04_resp.setFont(font)
        self.text04_resp.setObjectName(_fromUtf8("text04_resp"))

        self.text05_tags = QtGui.QLineEdit(self.InfoMetadata)
        self.text05_tags.setGeometry(QtCore.QRect(130, 210, 261, 20))
        self.text05_tags.setFont(font)
        self.text05_tags.setObjectName(_fromUtf8("text05_tags"))

        self.text06_ubic = QtGui.QLineEdit(self.InfoMetadata)
        self.text06_ubic.setGeometry(QtCore.QRect(130, 240, 261, 20))
        self.text06_ubic.setFont(font)
        self.text06_ubic.setObjectName(_fromUtf8("text06_ubic"))

        self.text07_scale = QtGui.QLineEdit(self.InfoMetadata)
        self.text07_scale.setGeometry(QtCore.QRect(130, 270, 261, 20))
        self.text07_scale.setFont(font)
        self.text07_scale.setObjectName(_fromUtf8("text07_scale"))

        self.text08_webpage = QtGui.QLineEdit(self.InfoPublication)
        self.text08_webpage.setGeometry(QtCore.QRect(20, 40, 371, 20))
        self.text08_webpage.setFont(font)
        self.text08_webpage.setObjectName(_fromUtf8("text08_webpage"))

        self.text09_geocatmin = QtGui.QLineEdit(self.InfoPublication)
        self.text09_geocatmin.setGeometry(QtCore.QRect(20, 80, 371, 20))
        self.text09_geocatmin.setFont(font)
        self.text09_geocatmin.setObjectName(_fromUtf8("text09_geocatmin"))

        self.text10_obs = QtGui.QTextEdit(self.InfoObservacion)
        self.text10_obs.setGeometry(QtCore.QRect(10, 20, 371, 101))
        self.text10_obs.setObjectName(_fromUtf8("text10_obs"))

        # Combos
        font = QtGui.QFont()
        font.setBold(False)
        font.setWeight(50)
        self.cb01_format = QtGui.QComboBox(self.InfoMetadata)
        self.cb01_format.setGeometry(QtCore.QRect(130, 300, 81, 22))
        self.cb01_format.setFont(font)
        self.cb01_format.setObjectName(_fromUtf8("cb01_format"))
        self.cb01_format.addItem(_fromUtf8(""))
        self.cb01_format.addItem(_fromUtf8(""))
        self.cb01_format.addItem(_fromUtf8(""))
        self.cb01_format.addItem(_fromUtf8(""))
        self.cb01_format.addItem(_fromUtf8(""))

        self.cb02_situation = QtGui.QComboBox(self.InfoMetadata)
        self.cb02_situation.setGeometry(QtCore.QRect(130, 330, 81, 22))
        self.cb02_situation.setFont(font)
        self.cb02_situation.setObjectName(_fromUtf8("cb02_situation"))
        self.cb02_situation.addItem(_fromUtf8(""))
        self.cb02_situation.addItem(_fromUtf8(""))

        self.cb03_update = QtGui.QComboBox(self.InfoMetadata)
        self.cb03_update.setGeometry(QtCore.QRect(300, 330, 91, 22))
        self.cb03_update.setFont(font)
        self.cb03_update.setObjectName(_fromUtf8("cb03_update"))
        self.cb03_update.addItem(_fromUtf8(""))
        self.cb03_update.addItem(_fromUtf8(""))
        self.cb03_update.addItem(_fromUtf8(""))

        self.cb04_restr = QtGui.QComboBox(self.InfoMetadata)
        self.cb04_restr.setGeometry(QtCore.QRect(130, 360, 81, 22))
        self.cb04_restr.setFont(font)
        self.cb04_restr.setObjectName(_fromUtf8("cb04_restr"))
        self.cb04_restr.addItem(_fromUtf8(""))
        self.cb04_restr.addItem(_fromUtf8(""))

        self.cb05_access = QtGui.QComboBox(self.InfoMetadata)
        self.cb05_access.setGeometry(QtCore.QRect(300, 360, 91, 22))
        self.cb05_access.setFont(font)
        self.cb05_access.setObjectName(_fromUtf8("cb05_access"))
        self.cb05_access.addItem(_fromUtf8(""))
        self.cb05_access.addItem(_fromUtf8(""))
        self.cb05_access.addItem(_fromUtf8(""))

        # Checkbox
        self.ch01_webpage = QtGui.QCheckBox(self.InfoPublication)
        self.ch01_webpage.setGeometry(QtCore.QRect(20, 20, 101, 17))
        self.ch01_webpage.setFont(font)
        self.ch01_webpage.setChecked(True)
        self.ch01_webpage.setObjectName(_fromUtf8("ch01_webpage"))

        self.ch02_geocatmin = QtGui.QCheckBox(self.InfoPublication)
        self.ch02_geocatmin.setGeometry(QtCore.QRect(20, 60, 101, 17))
        self.ch02_geocatmin.setFont(font)
        self.ch02_geocatmin.setChecked(True)
        self.ch02_geocatmin.setObjectName(_fromUtf8("ch02_geocatmin"))

        self.ch03_capa = QtGui.QCheckBox(self.InfoPublication)
        self.ch03_capa.setGeometry(QtCore.QRect(20, 130, 101, 17))
        self.ch03_capa.setFont(font)
        self.ch03_capa.setObjectName(_fromUtf8("ch03_capa"))

        self.ch04_wms = QtGui.QCheckBox(self.InfoPublication)
        self.ch04_wms.setGeometry(QtCore.QRect(100, 130, 101, 17))
        self.ch04_wms.setFont(font)
        self.ch04_wms.setObjectName(_fromUtf8("ch04_wms"))

        self.ch05_shp = QtGui.QCheckBox(self.InfoPublication)
        self.ch05_shp.setGeometry(QtCore.QRect(200, 130, 101, 17))
        self.ch05_shp.setFont(font)
        self.ch05_shp.setObjectName(_fromUtf8("ch05_shp"))

        self.ch06_kml = QtGui.QCheckBox(self.InfoPublication)
        self.ch06_kml.setGeometry(QtCore.QRect(20, 150, 101, 16))
        self.ch06_kml.setFont(font)
        self.ch06_kml.setObjectName(_fromUtf8("ch06_kml"))

        self.ch07_opendata = QtGui.QCheckBox(self.InfoPublication)
        self.ch07_opendata.setGeometry(QtCore.QRect(100, 150, 101, 17))
        self.ch07_opendata.setFont(font)
        self.ch07_opendata.setObjectName(_fromUtf8("ch07_opendata"))

        self.ch08_csvxls = QtGui.QCheckBox(self.InfoPublication)
        self.ch08_csvxls.setGeometry(QtCore.QRect(200, 150, 101, 16))
        self.ch08_csvxls.setFont(font)
        self.ch08_csvxls.setObjectName(_fromUtf8("ch08_csvxls"))

        self.ch09_other = QtGui.QCheckBox(self.InfoPublication)
        self.ch09_other.setGeometry(QtCore.QRect(290, 140, 101, 17))
        self.ch09_other.setFont(font)
        self.ch09_other.setObjectName(_fromUtf8("ch09_other"))

        # Date
        self.date_edit = QtGui.QDateEdit(self.InfoMetadata)
        # self.dateEdit.setDisplayFormat('dd/MM/yyyy')
        self.date_edit.setGeometry(QtCore.QRect(290, 300, 110, 22))
        self.date_edit.setFont(font)
        self.date_edit.setObjectName(_fromUtf8("date_edit"))

        # ViewStatus
        self.statusValue = QtGui.QTextEdit(self.centralwidget)
        self.statusValue.setGeometry(QtCore.QRect(10, 660, 821, 71))
        font = QtGui.QFont()
        font.setStrikeOut(False)
        self.statusValue.setTextColor(QtGui.QColor(153, 0, 0))
        self.statusValue.setFont(font)
        self.statusValue.setFrameShadow(QtGui.QFrame.Sunken)
        self.statusValue.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
        self.statusValue.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        self.statusValue.setTabChangesFocus(False)
        self.statusValue.setReadOnly(True)
        self.statusValue.setObjectName(_fromUtf8("statusValue"))

        self.redColor = QtGui.QColor(255, 0, 0)

        # Html
        self.view = QtWebKit.QWebView(self.centralwidget)
        self.view.setGeometry(QtCore.QRect(440, 30, 391, 441))
        self.view.setUrl(QtCore.QUrl(_fromUtf8(os.path.join(STATIC, 'index.html'))))
        # self.view.setUrl(QtCore.QUrl(_fromUtf8('dev\static\index.html')))
        self.view.setObjectName(_fromUtf8("webView"))

        cache = QtNetwork.QNetworkDiskCache()
        cache.setCacheDirectory(os.path.join(BASE_DIR, "cache"))
        self.view.page().networkAccessManager().setCache(cache)
        self.view.page().networkAccessManager()

        self.view.page().mainFrame().addToJavaScriptWindowObject("MainWindow", MainWindow)
        self.view.page().setLinkDelegationPolicy(QtWebKit.QWebPage.DelegateAllLinks)
        self.view.loadFinished.connect(self.onLoadFinished)
        self.view.linkClicked.connect(QtGui.QDesktopServices.openUrl)

        # MainWindow
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)
        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
예제 #14
0
import sys
from PyQt4 import QtCore, QtGui, QtWebKit, QtNetwork

app = QtGui.QApplication(sys.argv)
dialog = QtGui.QDialog()
layout = QtGui.QVBoxLayout(dialog)
web_view = QtWebKit.QWebView()
layout.addWidget(web_view)

request = QtNetwork.QNetworkRequest()
request.setUrl(
    QtCore.QUrl(
        "https://www.google.com/search?safe=active&site=&tbm=isch&source=hp&biw=1161&bih=655&q=allah&oq=allah&gs_l=img.3...1748.2393.0.2639.6.6.0.0.0.0.0.0..0.0....0...1ac.1.64.img..6.0.0.0.jrlwtcqdSk4"
    ))
request.setRawHeader(
    "User-Agent",
    "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36"
)
web_view.load(request)
print web_view.page().settings().testAttribute(
    QtWebKit.QWebSettings.JavascriptEnabled)

# web_view.load(QtCore.QUrl('https://www.google.com/search?safe=active&site=&tbm=isch&source=hp&biw=1161&bih=655&q=allah&oq=allah&gs_l=img.3...1748.2393.0.2639.6.6.0.0.0.0.0.0..0.0....0...1ac.1.64.img..6.0.0.0.jrlwtcqdSk4'))
dialog.show()
app.exec_()
예제 #15
0
#!/usr/bin/env python
import sys
from PyQt4 import QtGui, QtCore, QtWebKit

app = QtGui.QApplication(sys.argv)
web = QtWebKit.QWebView()
web.load(QtCore.QUrl("http://google.hk"))
web.show()
sys.exit(app.exec_())
예제 #16
0
    def __init__(self):

        QtGui.QMainWindow.__init__(self)
        self.resize(1400, 800)
        self.centralwidget = QtGui.QWidget(self)
        self.setWindowTitle("Systemprogramming")

        self.mainLayout = QtGui.QHBoxLayout(self.centralwidget)
        self.mainLayout.setSpacing(0)
        self.mainLayout.setMargin(1)

        self.frame = QtGui.QFrame(self.centralwidget)

        self.gridLayout = QtGui.QVBoxLayout(self.frame)
        self.gridLayout.setMargin(5)
        self.gridLayout.setSpacing(0)

        self.horizontalLayout = QtGui.QHBoxLayout()

        self.tb_url = QtGui.QLineEdit(self.frame)
        self.bt_back = QtGui.QPushButton(self.frame)
        self.bt_ahead = QtGui.QPushButton(self.frame)
        self.refresh = QtGui.QPushButton(self.frame)
        self.gecmis = QtGui.QPushButton(self.frame)

        self.listWidget = QtGui.QListWidget(self)
        self.listWidget.setGeometry(QtCore.QRect(0, 35, 1365, 800))
        self.listWidget.setObjectName(_fromUtf8("listWidget"))
        self.listWidget.hide()

        self.bt_back.setIcon(QtGui.QIcon().fromTheme("go-previous"))
        self.bt_ahead.setIcon(QtGui.QIcon().fromTheme("go-next"))
        self.refresh.setIcon(QtGui.QIcon().fromTheme("view-refresh"))
        self.gecmis.setText(_translate("MainWindow", "gecmiş", None))

        self.horizontalLayout.addWidget(self.bt_back)
        self.horizontalLayout.addWidget(self.bt_ahead)
        self.horizontalLayout.addWidget(self.refresh)
        self.horizontalLayout.addWidget(self.tb_url)
        self.horizontalLayout.addWidget(self.gecmis)
        self.gridLayout.addLayout(self.horizontalLayout)

        self.html = QtWebKit.QWebView()
        self.gridLayout.addWidget(self.html)
        self.mainLayout.addWidget(self.frame)
        self.setCentralWidget(self.centralwidget)

        self.pushButton = QtGui.QPushButton(self.centralwidget)
        self.pushButton.setGeometry(QtCore.QRect(1360, 32, 31, 26))
        self.pushButton.setText(_translate("MainWindow", "x", None))
        self.pushButton.hide()

        self.connect(self.tb_url, QtCore.SIGNAL("returnPressed()"),
                     self.browse)
        self.connect(self.bt_back, QtCore.SIGNAL("clicked()"), self.html.back)
        self.connect(self.bt_ahead, QtCore.SIGNAL("clicked()"),
                     self.html.forward)
        self.connect(self.gecmis, QtCore.SIGNAL("clicked()"), self.ac)
        self.connect(self.refresh, QtCore.SIGNAL("clicked()"),
                     self.html.reload)
        self.connect(self.pushButton, QtCore.SIGNAL("clicked()"), self.kapat)

        an = datetime.datetime.now()
        veriYil = []
        veriYil1 = []
        gecmisListe = []
        gecmisListe = getir.getir.liste(self)

        for v in range(gecmisListe.__len__()):
            veriYil.append(
                datetime.datetime.strptime(gecmisListe[v][1],
                                           "%Y-%m-%d %H:%M:%S.%f"))
            print(gecmisListe[v][1])
            print(veriYil[v])
            print(veriYil)
            for c in range(veriYil.__len__()):
                if str(datetime.datetime.strftime(
                        veriYil[v], "%d-%B-%Y")) not in str(veriYil1):
                    print("yok")
                    veriYil1.append(
                        datetime.datetime.strftime(veriYil[v], "%d-%B-%Y"))
                    a = str(datetime.datetime.strftime(veriYil[v], "%d-%B-%Y"))
                    b = str(datetime.datetime.strftime(veriYil[v], "%H:%M:%S"))

                    self.listWidget.addItem(
                        "                                          " + str(a))
                    self.listWidget.addItem(str(b) + "   " + gecmisListe[v][2])
                    break

                else:
                    print("var")
                    b = str(datetime.datetime.strftime(veriYil[v], "%H:%M:%S"))
                    self.listWidget.addItem(str(b) + "   " + gecmisListe[v][2])

                    break

        self.default_url = "http://google.com"
        self.tb_url.setText(self.default_url)
        self.browse()

        self.enter = QtGui.QPushButton(self)
        self.enter.resize(0, 0)
        self.enter.clicked.connect(self.Enter)
        self.enter.setShortcut("Return")

        self.connect(self.listWidget,
                     QtCore.SIGNAL("itemDoubleClicked(QListWidgetItem *)"),
                     self.sil_click)
예제 #17
0
파일: depot.py 프로젝트: electimon/turbine
    def SetupUi_Depot(self):
        '''Envoi l'affichage du dépôt et de ses objets, le tout est composé en deux partie, sur deux onglets
        Le premier, le dépôt à proprement parler, l'autre l'onglet des téléchargements, liste les téléchargements en cours'''

        self.listeTelechargement = []  # Contiendra la liste des instances de téléchargement
        # Compte les itérations de boucles pour le téléchargement, utilisé pour
        # calculer le temps restant
        self.iterationBoucleTele = 0
        # Le titre de l'onglet téléchargement dans le dépot clignotera quand ça passer à True
        self.clignote_depot = False
        self.val_clignote_depot = 0

        # self.tab_2 est défini dans le fichier source 'interface'
        # Layout principal du dépot:
        self.gridlayoutD = QtGui.QGridLayout(self.tab_2)
        self.gridlayoutD.setObjectName("gridlayoutD")

        # Sous barre d'onglet de l'onglet dépôt
        self.tabDepot = QtGui.QTabWidget(self.tab_2)
        self.tabDepot.setTabPosition(QtGui.QTabWidget.West)  # Rend la barre verticale

        try:
            # Vire l'encadrement de l'onglet (uniquement dispo depuis Qt 4.5).
            self.tabDepot.setDocumentMode(True)
        except AttributeError:
            pass

        self.tabDepot.setObjectName("tabDepot")
        self.gridlayoutD.addWidget(self.tabDepot, 0, 0)
        #

        self.tab_2_1 = QtGui.QWidget(self.tabDepot)  # Dépot
        self.tab_2_1.setObjectName("tab_2_1")

        self.tab_2_2 = QtGui.QWidget(self.tabDepot)  # Téléchargements
        self.tab_2_2.setObjectName("tab_2_2")

        self.tabDepot.addTab(self.tab_2_1, "")
        self.tabDepot.addTab(self.tab_2_2, "")

        self.tabDepot.setTabIcon(0, QtGui.QIcon(dossier_racine + "/res/txt_oxygen.png"))
        self.IconOngletTelechargement1 = QtGui.QIcon(dossier_racine + "/res/telech1.png")
        self.IconOngletTelechargement2 = QtGui.QIcon(dossier_racine + "/res/transp.png")
        self.tabDepot.setTabIcon(1, self.IconOngletTelechargement1)

        # Layouts du dépot:
        self.gridlayout_2 = QtGui.QGridLayout(self.tab_2_1)  # Principal
        self.gridlayout_2.setObjectName("gridlayout_2")

        self.gridlayout_2_1 = QtGui.QGridLayout()  # Conteneur à droite
        self.gridlayout_2_1.setObjectName("gridlayout_2_1")

        self.gridlayout_2_1h = QtGui.QHBoxLayout()  # En haut dans le conteneur de droite
        self.gridlayout_2_1h.setObjectName("gridlayout_2_1h")

        self.gridlayout_2_2 = QtGui.QVBoxLayout()  # Au millieu dans le conteneur de droite
        self.gridlayout_2_2.setObjectName("gridlayout_2_2")

        self.gridlayout_2_3 = QtGui.QVBoxLayout()  # Conteneur en bas dans le conteneur de droite
        self.gridlayout_2_3.setObjectName("gridlayout_2_3")

        self.gridlayout_2_h_m = QtGui.QHBoxLayout()  # Entre la description et la capture d'écran
        self.gridlayout_2_h_m.setObjectName("gridlayout_2_h_m")

        self.gridlayout_2_v_m = QtGui.QHBoxLayout()  # Capture d'écran
        self.gridlayout_2_v_m.setObjectName("gridlayout_2_v_m")

        self.gridlayout_2_v = QtGui.QVBoxLayout()  # Vertical à gauche dans le principal
        self.gridlayout_2_v.setObjectName("gridlayout_2_v")

        self.gridlayout_2.addLayout(self.gridlayout_2_v, 0, 0)
        self.gridlayout_2.addLayout(self.gridlayout_2_1, 0, 1)
        self.gridlayout_2_1.addLayout(self.gridlayout_2_1h, 0, 0)
        self.gridlayout_2_1.addLayout(self.gridlayout_2_2, 1, 0)
        self.gridlayout_2_1.addLayout(self.gridlayout_2_3, 2, 0)

        self.gridlayout_2_3.addLayout(self.gridlayout_2_h_m)
        self.gridlayout_2_3.addLayout(self.gridlayout_2_v_m)

        # Nouveau
        # Dans le conteneur en haut à droite (Nom du jeu)
        self.gridlayout_2_1_0v = QtGui.QVBoxLayout()
        self.gridlayout_2_1_0v.setObjectName("gridlayout_2_1_0v")

        # Dans le conteneur en haut à droite (Genre, taille, licence)
        self.gridlayout_2_1_2g = QtGui.QGridLayout()
        self.gridlayout_2_1_2g.setObjectName("gridlayout_2_1_2g")
        # /Nouveau

        # Fin des layouts du dépot
        #

        self.label_8 = QtGui.QLabel(self.tab_2_1)
        self.label_8.setObjectName("label_8")
        self.gridlayout_2_v.addWidget(self.label_8)

        self.comboBox = QtGui.QComboBox(self.tab_2_1)
        self.comboBox.setObjectName("comboBox")

        self.gridlayout_2_v.addWidget(self.comboBox)

        self.combo_license = QtGui.QComboBox(self.tab_2_1)
        self.combo_license.setObjectName("combo_license")
        self.gridlayout_2_v.addWidget(self.combo_license)

        self.label = QtGui.QLabel(self.tab_2_1)
        self.label.setObjectName("label")
        self.gridlayout_2_v.addWidget(self.label)

        self.widget_liste_jeux = QtGui.QListWidget(self.tab_2_1)
        self.widget_liste_jeux.setObjectName("widget_liste_jeux")

        self.widget_liste_jeux.setMinimumSize(QtCore.QSize(200, 200))  # rep
        self.widget_liste_jeux.setMaximumSize(QtCore.QSize(250, 1280))

        self.gridlayout_2_v.addWidget(self.widget_liste_jeux)

        self.boutton_installer = QtGui.QPushButton(self.tab_2_1)
        self.boutton_installer.setObjectName("boutton_installer")
        self.boutton_installer.setEnabled(False)
        self.gridlayout_2_v.addWidget(self.boutton_installer)

        self.boutton_supprimer = QtGui.QPushButton(self.tab_2_1)
        self.boutton_supprimer.setObjectName("boutton_supprimer")
        self.boutton_supprimer.setEnabled(False)
        self.gridlayout_2_v.addWidget(self.boutton_supprimer)

        self.boutton_maj = QtGui.QPushButton(self.tab_2_1)
        self.boutton_maj.setObjectName("boutton_maj")
        self.boutton_maj.setEnabled(False)
        self.gridlayout_2_v.addWidget(self.boutton_maj)

        self.label_2 = QtGui.QLabel(self.tab_2_1)
        self.label_2.setObjectName("label_2")
        self.gridlayout_2_2.addWidget(self.label_2)

        if WebKit:  # Si QtWebkit est disponible...
            self.texte_description = QtWebKit.QWebView(self.tab_2_1)
            self.config_description = self.texte_description.settings()
            print QtWebKit.QWebSettings.FixedFont
            try:
                self.config_description.setFontFamily(QtWebKit.QWebSettings.FixedFont, "")
            except TypeError, x:
                print "self.config_description.setFontFamily():", str(x)
            self.texte_description.setTextSizeMultiplier(0.9)
예제 #18
0
파일: GRobot.py 프로젝트: Python3pkg/GRobot
    def __init__(self, user_agent=default_user_agent, operate_timeout=10, loading_timeout=60, log_level=logging.WARNING,
                 display=False, viewport_size=(1024, 768), accept_language='en,*', ignore_ssl_errors=True,
                 cache_dir=os.path.join(tempfile.gettempdir(), "GRobot"),
                 image_enabled=True, plugins_enabled=False, java_enabled=False, javascript_enabled=True,
                 plugin_path=None, develop=False, proxy=None, sleep=0.5, jquery_namespace='GRobot'):
        """GRobot manages a QWebPage.
    
        @param user_agent: The default User-Agent header.
        @param operate_timeout: Operation timeout.
        @param loading_timeout: The page loading timeout.
        @param log_level: The optional logging level.
        @param display: A boolean that tells GRobot to displays UI.
        @param viewport_size: A tupple that sets initial viewport size.
        @param accept_language: Set the webkit accept language. 
        @param ignore_ssl_errors: A boolean that forces ignore ssl errors.
        @param cache_dir: A directory path where to store cache datas.
        @param image_enabled: Enable images.
        @param plugins_enabled: Enable plugins (like Flash).
        @param java_enabled: Enable Java JRE.
        @param javascript_enabled: Enable Javascript.
        @param plugin_path: Array with paths to plugin directories (default ['/usr/lib/mozilla/plugins'])
        @param develop: Enable the Webkit Inspector.
        @param proxy: Set a Socks5,HTTP{S} Proxy
        @param sleep: Sleep `sleep` second,after operate
        @param jquery_namespace: Set the jQuery namespace.
        """

        GRobot.exit_lock.acquire()

        if GRobot._kill_loop:
            gevent.kill(GRobot._kill_loop)
            GRobot._kill_loop=None

        logger.setLevel(log_level)

        plugin_path = plugin_path or ['/usr/lib/mozilla/plugins', ]

        GRobot._liveRobot += 1

        self.develop = develop
        self.inspector = None
        self.plugin = False
        self.exitLoop = False
        self._deleted = False

        self.set_proxy(proxy)

        self.sleep = sleep
        self.jquery_namespace = jquery_namespace
        self.popup_messages = None
        self.accept_language = accept_language

        self._loaded = True

        self._confirm_expected = None
        self._prompt_expected = None
        self._upload_file = None
        self._alert = None

        self.http_resources = []

        self.user_agent = user_agent

        self.loading_timeout = loading_timeout
        self.operate_timeout = operate_timeout

        self.ignore_ssl_errors = ignore_ssl_errors

        if not sys.platform.startswith('win') and not 'DISPLAY' in os.environ \
            and not hasattr(GRobot, 'xvfb'):
            try:
                os.environ['DISPLAY'] = ':99'
                GRobot.xvfb = subprocess.Popen(['Xvfb', ':99'])
            except OSError:
                raise Exception('Xvfb is required to a GRobot run oustside ' + \
                                'an X instance')

        self.display = display

        if not GRobot._app:
            GRobot._app = QApplication.instance() or QApplication(['GRobot'])
            if plugin_path:
                for p in plugin_path:
                    GRobot._app.addLibraryPath(p)

        self.page = GRobotWebPage(self, GRobot._app)

        QtWebKit.QWebSettings.setMaximumPagesInCache(0)
        QtWebKit.QWebSettings.setObjectCacheCapacities(0, 0, 0)
        QtWebKit.QWebSettings.globalSettings().setAttribute(QtWebKit.QWebSettings.LocalStorageEnabled, True)

        self.page.setForwardUnsupportedContent(True)

        # Page signals
        self.page.loadFinished.connect(self._page_loaded)
        self.page.loadStarted.connect(self._page_load_started)
        self.page.unsupportedContent.connect(self._unsupported_content)

        self.manager = self.page.networkAccessManager()

        #TODO:Think about how to handle the network accessible signal
        #self.manager.networkAccessibleChanged.connect()

        self.manager.finished.connect(self._request_ended)
        self.manager.sslErrors.connect(self._on_manager_ssl_errors)

        # Cache
        self.cache = QNetworkDiskCache()
        self.cache.setCacheDirectory(cache_dir)

        self.manager.setCache(self.cache)

        # Cookie jar
        self.cookie_jar = QNetworkCookieJar()
        self.manager.setCookieJar(self.cookie_jar)

        # User Agent
        self.page.setUserAgent(self.user_agent)

        self.page.networkAccessManager().authenticationRequired \
            .connect(self._authenticate)
        self.page.networkAccessManager().proxyAuthenticationRequired \
            .connect(self._authenticate)

        self.main_frame = self.page.mainFrame()

        self.webview = None

        self.viewport_size = viewport_size

        self.webview = QtWebKit.QWebView()
        self.webview.setPage(self.page)

        self.webview.show() if display else self.webview.hide()

        self.set_viewport_size(*viewport_size)

        self.page.settings().setAttribute(QtWebKit.QWebSettings.PluginsEnabled, plugins_enabled)
        self.page.settings().setAttribute(QtWebKit.QWebSettings.JavaEnabled, java_enabled)
        self.page.settings().setAttribute(QWebSettings.DeveloperExtrasEnabled, self.develop)

        self.enable_image = image_enabled
        self.enable_javascript = javascript_enabled

        #always open link in current window instead of new window
        self.page.setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
        self.page.linkClicked.connect(self._link_clicked)

        #start the qt main loop
        GRobot._loop = QtMainLoop(GRobot._app)
        GRobot._loop.start()
        GRobot.exit_lock.release()
예제 #19
0
 def shot(self):
     webView = QtWebKit.QWebView(self)
     webView.load(QtCore.QUrl(self.url))
     self.webPage = webView.page()
     self.connect(webView, QtCore.SIGNAL("loadFinished(bool)"),
                  self.savePage)
예제 #20
0
controller = Dock("Controller")
d3 = Dock("Node Controls")
flowchart_dock = Dock("Connections")

# Place docks on screen
global_data.area.addDock(ex_info, 'left')
global_data.area.addDock(background_info, 'above', ex_info)
global_data.area.addDock(d3, 'right', ex_info)
global_data.area.addDock(controller, 'bottom', d3)
global_data.area.addDock(global_data.tool_dock, 'right')
global_data.area.addDock(flowchart_dock, 'bottom', global_data.tool_dock)

## Add widgets into each dock

# Add instructions widget for exercise
instructions = QtWebKit.QWebView()
# add the widget to a slot on the window
w1 = pg.LayoutWidget()
w1.addWidget(instructions, row=2, col=0)
ex_info.addWidget(w1)

# Add background widget for assignment
background = QtWebKit.QWebView()
background_info.addWidget(background)

## restore button
restoreBtn = QtGui.QPushButton('Restore default view')
restoreBtn.setEnabled(False)
w1.addWidget(label, row=0, col=0)
w1.addWidget(restoreBtn, row=3, col=0)
예제 #21
0
 def __init__(self):
     QtGui.QMainWindow.__init__(self)
     self.tabs = QtGui.QTabWidget(self,
                                  tabsClosable=True,
                                  movable=True,
                                  elideMode=QtCore.Qt.ElideRight,
                                  currentChanged=self.currentTabChanged,
                                  tabCloseRequested=self.closeTabRequested)
     self.bottom = QtWebKit.QWebView(self)
     self.setWindowTitle("vIPer")
     self.splitter = QtGui.QSplitter(self)
     self.setCentralWidget(self.splitter)
     self.splitter.addWidget(self.tabs)
     self.splitter.addWidget(self.bottom)
     self.bottom.setVisible(False)
     self.tabWidgets = []
     self.titleHistory = []
     self.path = QtCore.QDir.currentPath()
     self.newtab = QtGui.QAction(QtGui.QIcon.fromTheme("document-new"),
                                 "New Tab",
                                 self,
                                 triggered=self.newTabTriggered,
                                 shortcut="Ctrl+t")
     self.htmler = QtGui.QAction(QtGui.QIcon.fromTheme("go-down"),
                                 "Htmler",
                                 self,
                                 triggered=self.screenHtmled,
                                 shortcut="Ctrl+j")
     self.slider = QtGui.QAction(QtGui.QIcon.fromTheme("go-jump"),
                                 "Slider",
                                 self,
                                 triggered=self.screenSlided,
                                 shortcut="Ctrl+k")
     self.splitterV = QtGui.QAction(
         QtGui.QIcon.fromTheme("object-flip-vertical"),
         "Split vertically",
         self,
         triggered=self.screenSplittedVhtml,
         shortcut="F9")
     self.splitterV.setMenu(QtGui.QMenu())
     self.splitterV.menu().addAction(
         QtGui.QAction('HTML', self, triggered=self.screenSplittedVhtml))
     self.splitterV.menu().addAction(
         QtGui.QAction('SLIDE', self, triggered=self.screenSplittedVslide))
     self.splitterH = QtGui.QAction(
         QtGui.QIcon.fromTheme("object-flip-horizontal"),
         "Split horizontally",
         self,
         triggered=self.screenSplittedHhtml,
         shortcut="F10")
     self.splitterH.setMenu(QtGui.QMenu())
     self.splitterH.menu().addAction(
         QtGui.QAction('HTML', self, triggered=self.screenSplittedHhtml))
     self.splitterH.menu().addAction(
         QtGui.QAction('SLIDE', self, triggered=self.screenSplittedHslide))
     self.recorder = QtGui.QAction(
         QtGui.QIcon.fromTheme("media-playback-start"),
         "Record",
         self,
         triggered=self.screenRecorded,
         shortcut="Ctrl+r")
     self.stopper = QtGui.QAction(
         QtGui.QIcon.fromTheme("media-playback-stop"),
         "Stop",
         self,
         triggered=self.screenStopped,
         shortcut="Ctrl+Alt+s")
     self.addAction(
         QtGui.QAction("Split Screen",
                       self,
                       checkable=True,
                       toggled=self.splitToggled,
                       shortcut="F11"))
     self.addAction(
         QtGui.QAction("Full Screen",
                       self,
                       checkable=True,
                       toggled=self.screenToggled,
                       shortcut="F12"))
     self.helper = QtGui.QAction(QtGui.QIcon.fromTheme("help-faq"),
                                 "Help",
                                 self,
                                 triggered=self.newHelpTabTriggered,
                                 shortcut="Ctrl+h")
     self.full = HTMLExporter()
     self.html = '.html'
     self.rev = SlidesExporter()
     self.rev_html = '.slides.html'
     self.server = ServePostProcessor()
     self.servePool = []
     self.horizontal = QtCore.Qt.Horizontal
     self.vertical = QtCore.Qt.Vertical
     self.addTab(QtCore.QUrl('http://127.0.0.1:8888/'))
예제 #22
0
파일: start.py 프로젝트: Arinda95/Speakr
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(650, 330)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8("imgs/icon.png")),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        MainWindow.setWindowIcon(icon)
        MainWindow.setStyleSheet(_fromUtf8("background-color: black;"))
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.gridLayout_2 = QtGui.QGridLayout(self.centralwidget)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.webView = QtWebKit.QWebView(self.centralwidget)
        self.webView.setUrl(QtCore.QUrl(_fromUtf8("about:blank")))
        self.webView.setObjectName(_fromUtf8("webView"))
        self.webView.setStyleSheet(
            _fromUtf8("background-color: rgb(255, 255, 255);\n"
                      "border-radius: 5px"))
        cwd = os.getcwd()
        self.webView.setUrl(
            QtCore.QUrl(_fromUtf8("file:///" + cwd + "/imgs/icon.png")))
        self.gridLayout.addWidget(self.webView, 0, 0, 9, 1)
        self.pushButton_about = QtGui.QPushButton(self.centralwidget)
        self.pushButton_about.setObjectName(_fromUtf8("pushButton_about"))
        self.gridLayout.addWidget(self.pushButton_about, 0, 4, 1, 1)
        self.pushButton_about.setStyleSheet(
            _fromUtf8("background-color: rgb(53, 53, 53);\n"
                      "font: 25 10pt \"Roboto Bold\";\n"
                      "color: rgb(230, 230, 230);\n"
                      "padding: 5px;\n"
                      "border-radius: 2px;"))

        self.comboBox = QtGui.QComboBox(self.centralwidget)
        self.comboBox.setObjectName(_fromUtf8("comboBox"))
        self.gridLayout.addWidget(self.comboBox, 4, 1, 1, 4)
        ##
        rece_list = open("conf/rece.svcg").readlines()
        self.comboBox.addItems(rece_list)
        self.comboBox.setStyleSheet(
            _fromUtf8("background-color: white;\n"
                      "color: rgb(0, 0, 0);\n"
                      "padding: 5px;\n"
                      "border-radius: 2px"))

        self.pushButton_browse = QtGui.QPushButton(self.centralwidget)
        self.pushButton_browse.setObjectName(_fromUtf8("pushButton_browse"))
        self.gridLayout.addWidget(self.pushButton_browse, 2, 4, 1, 1)
        self.pushButton_browse.setStyleSheet(
            _fromUtf8("background-color: rgb(53, 53, 53);\n"
                      "font: 25 10pt \"Roboto Bold\";\n"
                      "color: rgb(230, 230, 230);\n"
                      "padding: 5px;\n"
                      "border-radius: 2px;"))
        self.lineEdit = QtGui.QLineEdit(self.centralwidget)
        self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
        self.gridLayout.addWidget(self.lineEdit, 2, 1, 1, 3)
        self.lineEdit.setStyleSheet(
            _fromUtf8("background-color: white;\n"
                      "color: rgb(0, 0, 0);\n"
                      "font: 25 10pt \"Roboto Bold\";\n"
                      "padding: 5px;\n"
                      "border-radius: 2px"))
        self.pushButton_sns = QtGui.QPushButton(self.centralwidget)
        self.pushButton_sns.setObjectName(_fromUtf8("pushButton_sns"))
        self.gridLayout.addWidget(self.pushButton_sns, 6, 1, 1, 4)
        self.pushButton_sns.setStyleSheet(
            _fromUtf8(
                "background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 186, 86, 255), stop:0.465909 rgba(235, 112, 61, 255), stop:1 rgba(167, 28, 0, 255));\n"
                "color: rgb(255, 255, 255);\n"
                "font: 25 10pt \"Roboto bold\";\n"
                "padding: 5px;\n"
                "border-radius: 2px"))
        self.pushButton_direct = QtGui.QPushButton(self.centralwidget)
        self.pushButton_direct.setObjectName(_fromUtf8("pushButton_direct"))
        self.gridLayout.addWidget(self.pushButton_direct, 7, 1, 1, 4)
        self.pushButton_direct.setStyleSheet(
            _fromUtf8(
                "background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 186, 86, 255), stop:0.465909 rgba(235, 112, 61, 255), stop:1 rgba(167, 28, 0, 255));\n"
                "color: rgb(255, 255, 255);\n"
                "font: 25 10pt \"Roboto bold\";\n"
                "padding: 5px;\n"
                "border-radius: 2px"))
        self.pushButton_exit = QtGui.QPushButton(self.centralwidget)
        self.pushButton_exit.setObjectName(_fromUtf8("pushButton_exit"))
        self.gridLayout.addWidget(self.pushButton_exit, 8, 1, 1, 4)
        self.pushButton_exit.setStyleSheet(
            _fromUtf8(
                "background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 186, 86, 255), stop:0.465909 rgba(235, 112, 61, 255), stop:1 rgba(167, 28, 0, 255));\n"
                "color: rgb(255, 255, 255);\n"
                "font: 25 10pt \"Roboto bold\";\n"
                "padding: 5px;\n"
                "border-radius: 2px"))
        self.label = QtGui.QLabel(self.centralwidget)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 1, 1, 1, 2)
        self.label.setStyleSheet(
            _fromUtf8("color: rgb(255, 255, 255);\n"
                      "font: 25 10pt \"Roboto Bold\";\n"))
        self.label_2 = QtGui.QLabel(self.centralwidget)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 3, 1, 1, 2)
        self.label_2.setStyleSheet(
            _fromUtf8("color: rgb(255, 255, 255);\n"
                      "font: 25 10pt \"Roboto Bold\";\n"))
        self.label_title = QtGui.QLabel(self.centralwidget)
        self.label_title.setObjectName(_fromUtf8("label_title"))
        self.gridLayout.addWidget(self.label_title, 5, 1, 1, 4)
        self.gridLayout_2.addLayout(self.gridLayout, 0, 1, 1, 1)
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
        QtCore.QObject.connect(self.pushButton_browse,
                               QtCore.SIGNAL(_fromUtf8("clicked()")),
                               self.run_browse)
        QtCore.QObject.connect(self.pushButton_direct,
                               QtCore.SIGNAL(_fromUtf8("clicked()")),
                               self.run_speakr)
        QtCore.QObject.connect(self.pushButton_sns,
                               QtCore.SIGNAL(_fromUtf8("clicked()")),
                               self.run_saveAndStart)
        QtCore.QObject.connect(self.pushButton_exit,
                               QtCore.SIGNAL(_fromUtf8("clicked()")),
                               self.run_exit)
        QtCore.QObject.connect(self.pushButton_about,
                               QtCore.SIGNAL(_fromUtf8("clicked()")),
                               self.run_about)
        ##
        QtCore.QObject.connect(self.lineEdit,
                               QtCore.SIGNAL(_fromUtf8("selectionChanged()")),
                               self.run_switch)
        QtCore.QObject.connect(self.pushButton_browse,
                               QtCore.SIGNAL(_fromUtf8("clicked()")),
                               self.run_switch)
        ##
        QtCore.QObject.connect(self.comboBox,
                               QtCore.SIGNAL(_fromUtf8("activated(QString)")),
                               self.run_switch2)
예제 #23
0
파일: ghost.py 프로젝트: vmlellis/Ghost.py
 def show(self):
     """Show current page inside a QWebView.
     """
     self.webview = QtWebKit.QWebView()
     self.webview.setPage(self.page)
     self.webview.show()
예제 #24
0
    def setup(self, xce_object):
        ################################################################################################################
        #                                                                                                              #
        #                                                   PANDDA TAB                                                 #
        #                                                                                                              #
        ################################################################################################################
        # list of subtabs in PanDDA tab
        pandda_tab_list = [
            'pandda.analyse', 'Dataset Summary', 'Processing Output',
            'pandda.inspect', 'Statistical Map Summaries'
        ]

        # setup tab widget, set up tab dict, and make tab dict
        xce_object.pandda_tab_widget = QtGui.QTabWidget()
        xce_object.pandda_tab_dict = {}
        self.layout_funcs.make_tab_dict(pandda_tab_list,
                                        xce_object.pandda_tab_widget,
                                        xce_object.pandda_tab_dict)

        # pandda analyse subtab
        # setup a grid to hold everything
        grid_pandda = QtGui.QGridLayout()
        grid_pandda.setColumnStretch(0, 20)
        grid_pandda.setRowStretch(0, 20)

        # table - left
        xce_object.pandda_analyse_data_table = QtGui.QTableWidget()
        self.layout_funcs.table_setup(xce_object.pandda_analyse_data_table,
                                      xce_object.pandda_table_columns)

        # add table to grid
        frame_pandda = QtGui.QFrame()
        grid_pandda.addWidget(xce_object.pandda_analyse_data_table, 0, 0)

        # status of pandda job - under table
        xce_object.pandda_status = 'UNKNOWN'
        xce_object.pandda_status_label = QtGui.QLabel()

        # status options [filename, test to output, colour of text]
        pandda_status_options = [
            ['/pandda.done', 'Finished!', 'color: green'],
            ['/pandda.running', 'Running...', 'color: orange'],
            [
                '/pandda.errored',
                'Error encountered... please check the log files for pandda!',
                'color: red'
            ]
        ]

        # enumerate text options and set text under table
        for option in pandda_status_options:
            if os.path.exists(str(xce_object.panddas_directory + option[0])):
                xce_object.pandda_status = option[1]
                xce_object.pandda_status_label.setStyleSheet(option[2])

        xce_object.pandda_status_label.setText(
            str('STATUS: ' + xce_object.pandda_status))
        xce_object.pandda_status_label.setFont(
            QtGui.QFont("Arial", 25, QtGui.QFont.Bold))
        grid_pandda.addWidget(xce_object.pandda_status_label, 3, 0)

        header_font = QtGui.QFont()
        header_font.setBold(True)

        # input parameters for PANDDAs run - right
        frame_right = QtGui.QFrame()

        xce_object.pandda_analyse_input_params_vbox = QtGui.QVBoxLayout()

        # data directory section
        pandda_input_dir_hbox = QtGui.QHBoxLayout()
        label = QtGui.QLabel('Input data directory:')
        label.setFont(header_font)
        xce_object.pandda_analyse_input_params_vbox.addWidget(label)
        xce_object.pandda_input_data_dir_entry = QtGui.QLineEdit()
        xce_object.pandda_input_data_dir_entry.setText(
            os.path.join(xce_object.initial_model_directory, '*'))
        pandda_input_dir_hbox.addWidget(xce_object.pandda_input_data_dir_entry)
        xce_object.select_pandda_input_dir_button = QtGui.QPushButton(
            "Select Input Template")
        xce_object.select_pandda_input_dir_button.clicked.connect(
            xce_object.select_pandda_input_template)
        pandda_input_dir_hbox.addWidget(
            xce_object.select_pandda_input_dir_button)
        xce_object.pandda_analyse_input_params_vbox.addLayout(
            pandda_input_dir_hbox)

        # pdb style section
        pandda_pdb_style_hbox = QtGui.QHBoxLayout()
        label = QtGui.QLabel('pdb style')
        pandda_pdb_style_hbox.addWidget(label)
        xce_object.pandda_pdb_style_entry = QtGui.QLineEdit()
        xce_object.pandda_pdb_style_entry.setText('dimple.pdb')
        pandda_pdb_style_hbox.addWidget(xce_object.pandda_pdb_style_entry)
        xce_object.pandda_analyse_input_params_vbox.addLayout(
            pandda_pdb_style_hbox)

        # mtz style section
        pandda_mtz_style_hbox = QtGui.QHBoxLayout()
        label = QtGui.QLabel('mtz style')
        pandda_mtz_style_hbox.addWidget(label)
        xce_object.pandda_mtz_style_entry = QtGui.QLineEdit()
        xce_object.pandda_mtz_style_entry.setText('dimple.mtz')
        pandda_mtz_style_hbox.addWidget(xce_object.pandda_mtz_style_entry)
        xce_object.pandda_analyse_input_params_vbox.addLayout(
            pandda_mtz_style_hbox)

        print(xce_object.initial_model_directory)
        data_dir_string = xce_object.initial_model_directory.replace('/*', '')

        def copy_ligands(obj):
            os.system(
                str('find ' + data_dir_string +
                    '/*/compound -name "*.cif" | while read line; do  echo ${line//"'
                    + data_dir_string + '"/"' + xce_object.panddas_directory +
                    '/processed_datasets/"}| while read line2; do cp $line ${line2//compound/ligand_files} > /dev/null 2>&1; '
                    'done; done;'))

            os.system(
                str('find ' + data_dir_string +
                    '/*/compound -name "*.pdb" | while read line; do  echo ${line//"'
                    + data_dir_string + '"/"' + xce_object.panddas_directory +
                    '/processed_datasets/"}| while read line2; do cp $line ${line2//compound/ligand_files} > /dev/null 2>&1; '
                    'done; done;'))

            print('==> XCE: Copied ligand restraints over')

        # output directory section
        pandda_output_dir_hbox = QtGui.QHBoxLayout()
        label = QtGui.QLabel('Output directory:')
        label.setFont(header_font)
        xce_object.pandda_analyse_input_params_vbox.addWidget(label)
        xce_object.pandda_output_data_dir_entry = QtGui.QLineEdit()
        xce_object.pandda_output_data_dir_entry.setText(
            xce_object.panddas_directory)
        pandda_output_dir_hbox.addWidget(
            xce_object.pandda_output_data_dir_entry)
        xce_object.select_pandda_output_dir_button = QtGui.QPushButton(
            "Select PanDDA Directory")
        xce_object.select_pandda_output_dir_button.clicked.connect(
            xce_object.settings_button_clicked)
        pandda_output_dir_hbox.addWidget(
            xce_object.select_pandda_output_dir_button)
        xce_object.pandda_analyse_input_params_vbox.addLayout(
            pandda_output_dir_hbox)

        pandda_add_ligands_button = QtGui.QPushButton(
            'Copy Ligand restraints for PanDDA')
        pandda_add_ligands_button.clicked.connect(
            lambda: copy_ligands(xce_object))
        xce_object.pandda_analyse_input_params_vbox.addWidget(
            pandda_add_ligands_button)

        # spacer to separate out sections
        spacer = QtGui.QLabel(' ')
        xce_object.pandda_analyse_input_params_vbox.addWidget(spacer)

        label = QtGui.QLabel('Submission parameters')
        label.setFont(header_font)
        xce_object.pandda_analyse_input_params_vbox.addWidget(label)

        # qstat or local machine
        label = QtGui.QLabel('Submit via:')
        xce_object.pandda_analyse_input_params_vbox.addWidget(label)
        xce_object.pandda_submission_mode_selection_combobox = QtGui.QComboBox(
        )
        if xce_object.external_software['qsub']:
            xce_object.pandda_submission_mode_selection_combobox.addItem(
                'qsub')
        xce_object.pandda_submission_mode_selection_combobox.addItem(
            'local machine')
        xce_object.pandda_analyse_input_params_vbox.addWidget(
            xce_object.pandda_submission_mode_selection_combobox)

        # number of processors section
        label = QtGui.QLabel('Number of processors:')
        xce_object.pandda_analyse_input_params_vbox.addWidget(label)
        xce_object.pandda_nproc = multiprocessing.cpu_count() - 1
        xce_object.pandda_nproc_entry = QtGui.QLineEdit()
        xce_object.pandda_nproc_entry.setText(
            str(xce_object.pandda_nproc).replace(' ', ''))
        xce_object.pandda_analyse_input_params_vbox.addWidget(
            xce_object.pandda_nproc_entry)

        xce_object.pandda_analyse_input_params_vbox.addWidget(spacer)

        params_hbox = QtGui.QHBoxLayout()
        label = QtGui.QLabel('PanDDA parameters')
        label.setFont(header_font)
        params_hbox.addWidget(label)

        url_html = "<a href=\"https://pandda.bitbucket.io/manual.html\">For docs: click here</a>"
        label = QtGui.QLabel()
        label.setText(url_html)
        label.setOpenExternalLinks(True)
        label.setAlignment(QtCore.Qt.AlignRight)
        params_hbox.addWidget(label)

        xce_object.pandda_analyse_input_params_vbox.addLayout(params_hbox)

        # checkbox for wilson scaling
        xce_object.wilson_checkbox = QtGui.QCheckBox('Wilson B-factor Scaling')
        self.layout_funcs.add_checkbox(xce_object, xce_object.wilson_checkbox,
                                       'xce_object.set_run_dimple_flag')
        xce_object.pandda_analyse_input_params_vbox.addWidget(
            xce_object.wilson_checkbox)

        # crystal form option
        label = QtGui.QLabel('Use space group of reference file as filter:')
        xce_object.pandda_analyse_input_params_vbox.addWidget(label)
        # reference file combobox, label with spg display
        hbox = QtGui.QHBoxLayout()
        # xce_object.reference_file_list = xce_object.get_reference_file_list('')
        xce_object.pandda_reference_file_selection_combobox = QtGui.QComboBox()
        xce_object.populate_reference_combobox(
            xce_object.pandda_reference_file_selection_combobox)
        xce_object.pandda_reference_file_selection_combobox.activated[
            str].connect(xce_object.change_pandda_spg_label)
        hbox.addWidget(xce_object.pandda_reference_file_selection_combobox)
        xce_object.pandda_reference_file_spg_label = QtGui.QLabel()
        hbox.addWidget(xce_object.pandda_reference_file_spg_label)
        xce_object.pandda_analyse_input_params_vbox.addLayout(hbox)

        # how to order events
        label = QtGui.QLabel('Order events by:')
        xce_object.pandda_analyse_input_params_vbox.addWidget(label)
        xce_object.pandda_sort_event_combobox = QtGui.QComboBox()
        pandda_events = ['cluster_size', 'z_peak']
        self.layout_funcs.populate_combobox(
            pandda_events, xce_object.pandda_sort_event_combobox)
        xce_object.pandda_analyse_input_params_vbox.addWidget(
            xce_object.pandda_sort_event_combobox)

        # how calculate mean map
        label = QtGui.QLabel('Calculate average map by:')
        xce_object.pandda_analyse_input_params_vbox.addWidget(label)
        xce_object.pandda_calc_map_combobox = QtGui.QComboBox()
        average_map = ['mean_map', 'medn_map']
        self.layout_funcs.populate_combobox(
            average_map, xce_object.pandda_calc_map_combobox)
        xce_object.pandda_analyse_input_params_vbox.addWidget(
            xce_object.pandda_calc_map_combobox)

        # minimum number of datasets
        label = QtGui.QLabel('min_build_datasets')
        xce_object.pandda_analyse_input_params_vbox.addWidget(label)
        xce_object.pandda_min_build_dataset_entry = QtGui.QLineEdit()
        xce_object.pandda_min_build_dataset_entry.setText('40')
        xce_object.pandda_analyse_input_params_vbox.addWidget(
            xce_object.pandda_min_build_dataset_entry)

        # maximum number of datasets
        label = QtGui.QLabel('max_new_datasets')
        xce_object.pandda_analyse_input_params_vbox.addWidget(label)
        xce_object.pandda_max_new_datasets_entry = QtGui.QLineEdit()
        xce_object.pandda_max_new_datasets_entry.setText('300')
        xce_object.pandda_analyse_input_params_vbox.addWidget(
            xce_object.pandda_max_new_datasets_entry)

        # grid spacing
        label = QtGui.QLabel(
            'grid_spacing (default=0.5)\nNote: higher values speed up calculations, but maps might be less pretty)'
        )
        xce_object.pandda_analyse_input_params_vbox.addWidget(label)
        xce_object.pandda_grid_spacing_entry = QtGui.QLineEdit()
        xce_object.pandda_grid_spacing_entry.setText('0.5')
        xce_object.pandda_analyse_input_params_vbox.addWidget(
            xce_object.pandda_grid_spacing_entry)
        frame_right.setLayout(xce_object.pandda_analyse_input_params_vbox)

        grid_pandda.addWidget(frame_right, 0, 1, 5, 5)
        frame_pandda.setLayout(grid_pandda)

        # these are still currently populated in XCE.py - change
        xce_object.pandda_map_list = QtGui.QComboBox()
        xce_object.pandda_maps_html = QtWebKit.QWebView()

        # statistical map summaries vbox, add to vbox and add to layout
        xce_object.pandda_map_layout = QtGui.QVBoxLayout()
        pandda_map_layout_widgets = [
            xce_object.pandda_map_list, xce_object.pandda_maps_html
        ]
        self.layout_funcs.add_to_box(xce_object.pandda_map_layout,
                                     pandda_map_layout_widgets)
        xce_object.pandda_maps_html.show()

        xce_object.pandda_analyse_hbox = QtGui.QHBoxLayout()
        xce_object.pandda_analyse_hbox.addWidget(frame_pandda)

        ## change to do select options

        # create context menu... no idea where this lives again.
        xce_object.popMenu_for_pandda_table = QtGui.QMenu()
        ignore = QtGui.QAction("ignore selected", xce_object.window)
        exclude_characterisation = QtGui.QAction(
            "exclude selected from characterisation", xce_object.window)
        exclude_zmap = QtGui.QAction("exclude selected from z-map analysis",
                                     xce_object.window)
        deselect = QtGui.QAction("deselect highlighted", xce_object.window)
        ignore.triggered.connect(
            lambda: xce_object.select_sample_for_pandda(option='ignore'))
        exclude_characterisation.triggered.connect(
            lambda: xce_object.select_sample_for_pandda(option='char'))
        exclude_zmap.triggered.connect(
            lambda: xce_object.select_sample_for_pandda(option='zmap'))
        deselect.triggered.connect(
            lambda: xce_object.select_sample_for_pandda(option='deselect'))
        xce_object.popMenu_for_pandda_table.addAction(ignore)
        xce_object.popMenu_for_pandda_table.addAction(exclude_characterisation)
        xce_object.popMenu_for_pandda_table.addAction(exclude_zmap)
        xce_object.popMenu_for_pandda_table.addAction(deselect)
        xce_object.pandda_analyse_data_table.setContextMenuPolicy(
            QtCore.Qt.CustomContextMenu)
        xce_object.pandda_analyse_data_table.customContextMenuRequested.connect(
            xce_object.on_context_menu_pandda)

        # next three blocks display html documents created by pandda.analyse
        self.layout_funcs.pandda_html(xce_object)

        xce_object.pandda_initial_html = QtWebKit.QWebView()
        xce_object.pandda_initial_html.load(
            QtCore.QUrl(xce_object.pandda_initial_html_file))
        xce_object.pandda_initial_html.show()

        xce_object.pandda_analyse_html = QtWebKit.QWebView()
        xce_object.pandda_analyse_html.load(
            QtCore.QUrl(xce_object.pandda_analyse_html_file))
        xce_object.pandda_analyse_html.show()

        xce_object.pandda_inspect_html = QtWebKit.QWebView()
        xce_object.pandda_analyse_html.load(
            QtCore.QUrl(xce_object.pandda_inspect_html_file))
        xce_object.pandda_analyse_html.show()

        xce_object.panddas_results_vbox = QtGui.QVBoxLayout()
        xce_object.panddas_results_vbox.addWidget(xce_object.pandda_tab_widget)
        xce_object.show_pandda_html_summary()
예제 #25
0
    def __init__(self, parent = None):
        super(Main_widget, self).__init__(parent)
        self.sdsready = False
        self.ecunamemap = {}
        self.plugins = {}
        self.setWindowTitle(_("DDT4All"))
        self.ecu_scan = ecu.Ecu_scanner()
        self.ecu_scan.qapp = app
        options.ecu_scanner = self.ecu_scan
        print ("%i " + _("loaded ECUs in database.")) % self.ecu_scan.getNumEcuDb()
        if self.ecu_scan.getNumEcuDb() == 0:
            msgbox = gui.QMessageBox()
            msgbox.setIcon(gui.QMessageBox.Warning)
            msgbox.setText("No database found")
            msgbox.setInformativeText("Check documentation")
            msgbox.exec_()

        self.paramview = None
        self.docview = webkit.QWebView()
        self.docview.load(core.QUrl("https://github.com/cedricp/ddt4all/wiki"))
        self.docview.settings().setAttribute(webkit.QWebSettings.JavascriptEnabled, True)
        self.docview.settings().setAttribute(webkit.QWebSettings.PluginsEnabled, True)
        self.docview.settings().setAttribute(webkit.QWebSettings.AutoLoadImages, True)
        self.screennames = []

        self.statusBar = gui.QStatusBar()
        self.setStatusBar(self.statusBar)

        self.connectedstatus = gui.QLabel()
        self.connectedstatus.setAlignment(core.Qt.AlignHCenter | core.Qt.AlignVCenter)
        self.protocolstatus = gui.QLabel()
        self.progressstatus = gui.QProgressBar()
        self.infostatus = gui.QLabel()

        self.connectedstatus.setFixedWidth(100)
        self.protocolstatus.setFixedWidth(200)
        self.progressstatus.setFixedWidth(150)
        self.infostatus.setFixedWidth(200)

        self.refreshtimebox = gui.QSpinBox()
        self.refreshtimebox.setRange(100, 2000)
        self.refreshtimebox.setSingleStep(100)
        self.refreshtimebox.valueChanged.connect(self.changeRefreshTime)
        refrestimelabel = gui.QLabel(_("Refresh rate (ms):"))

        self.cantimeout = gui.QSpinBox()
        self.cantimeout.setRange(0, 1000)
        self.cantimeout.setSingleStep(200)
        self.cantimeout.setValue(options.cantimeout)
        self.cantimeout.valueChanged.connect(self.changeCanTimeout)
        cantimeoutlabel = gui.QLabel(_("Can timeout (ms) [0:AUTO] :"))

        self.statusBar.addWidget(self.connectedstatus)
        self.statusBar.addWidget(self.protocolstatus)
        self.statusBar.addWidget(self.progressstatus)
        self.statusBar.addWidget(refrestimelabel)
        self.statusBar.addWidget(self.refreshtimebox)
        self.statusBar.addWidget(cantimeoutlabel)
        self.statusBar.addWidget(self.cantimeout)
        self.statusBar.addWidget(self.infostatus)

        self.tabbedview = gui.QTabWidget()
        self.setCentralWidget(self.tabbedview)

        self.scrollview = gui.QScrollArea()
        self.scrollview.setWidgetResizable(False)

        self.snifferview = sniffer.sniffer()

        self.tabbedview.addTab(self.docview, _("Documentation"))
        self.tabbedview.addTab(self.scrollview, _("Screen"))
        self.tabbedview.addTab(self.snifferview, _("CAN Sniffer"))

        if options.simulation_mode:
            self.buttonEditor = dataeditor.buttonEditor()
            self.requesteditor = dataeditor.requestEditor()
            self.dataitemeditor = dataeditor.dataEditor()
            self.ecuparameditor = dataeditor.ecuParamEditor()
            self.tabbedview.addTab(self.requesteditor, _("Requests"))
            self.tabbedview.addTab(self.dataitemeditor, _("Data"))
            self.tabbedview.addTab(self.buttonEditor, _("Buttons"))
            self.tabbedview.addTab(self.ecuparameditor, _("Ecu parameters"))

        screen_widget = gui.QWidget()
        self.treedock_widget = gui.QDockWidget(self)
        self.treedock_widget.setWidget(screen_widget)
        self.treeview_params = gui.QTreeWidget()
        self.treeview_params.setSortingEnabled(True)
        self.treeview_params.sortByColumn(0, core.Qt.AscendingOrder)
        self.screenmenu = gui.QMenuBar()
        treedock_layout = gui.QVBoxLayout()
        treedock_layout.addWidget(self.screenmenu)
        treedock_layout.addWidget(self.treeview_params)
        screen_widget.setLayout(treedock_layout)
        self.treeview_params.setHeaderLabels([_("Screens")])
        self.treeview_params.clicked.connect(self.changeScreen)

        actionmenu = self.screenmenu.addMenu(_("Action"))
        cat_action = gui.QAction(_("New Category"), actionmenu)
        screen_action = gui.QAction(_("New Screen"), actionmenu)
        rename_action = gui.QAction(_("Rename"), actionmenu)
        actionmenu.addAction(cat_action)
        actionmenu.addAction(screen_action)
        actionmenu.addAction(rename_action)
        cat_action.triggered.connect(self.newCategory)
        screen_action.triggered.connect(self.newScreen)
        rename_action.triggered.connect(self.screenRename)

        self.treedock_logs = gui.QDockWidget(self)
        self.logview = gui.QTextEdit()
        self.logview.setReadOnly(True)
        self.treedock_logs.setWidget(self.logview)

        self.treedock_ecu = gui.QDockWidget(self)
        self.treeview_ecu = gui.QListWidget(self.treedock_ecu)
        self.treedock_ecu.setWidget(self.treeview_ecu)
        self.treeview_ecu.clicked.connect(self.changeECU)

        self.eculistwidget = Ecu_list(self.ecu_scan, self.treeview_ecu)
        self.treeview_eculist = gui.QDockWidget(self)
        self.treeview_eculist.setWidget(self.eculistwidget)

        self.addDockWidget(core.Qt.LeftDockWidgetArea, self.treeview_eculist)
        self.addDockWidget(core.Qt.LeftDockWidgetArea, self.treedock_ecu)
        self.addDockWidget(core.Qt.LeftDockWidgetArea, self.treedock_widget)
        self.addDockWidget(core.Qt.BottomDockWidgetArea, self.treedock_logs)

        self.toolbar = self.addToolBar(_("File"))

        self.diagaction = gui.QAction(gui.QIcon("icons/dtc.png"), _("Read DTC"), self)
        self.diagaction.triggered.connect(self.readDtc)
        self.diagaction.setEnabled(False)

        self.log = gui.QAction(gui.QIcon("icons/log.png"), _("Full log"), self)
        self.log.setCheckable(True)
        self.log.setChecked(options.log_all)
        self.log.triggered.connect(self.changeLogMode)

        self.expert = gui.QAction(gui.QIcon("icons/expert.png"), _("Expert mode (enable writing)"), self)
        self.expert.setCheckable(True)
        self.expert.setChecked(options.promode)
        self.expert.triggered.connect(self.changeUserMode)

        self.autorefresh = gui.QAction(gui.QIcon("icons/autorefresh.png"), _("Auto refresh"), self)
        self.autorefresh.setCheckable(True)
        self.autorefresh.setChecked(options.auto_refresh)
        self.autorefresh.triggered.connect(self.changeAutorefresh)

        self.refresh = gui.QAction(gui.QIcon("icons/refresh.png"), _("Refresh (one shot)"), self)
        self.refresh.triggered.connect(self.refreshParams)
        self.refresh.setEnabled(not options.auto_refresh)

        self.hexinput = gui.QAction(gui.QIcon("icons/hex.png"), _("Manual command"), self)
        self.hexinput.triggered.connect(self.hexeditor)
        self.hexinput.setEnabled(False)

        self.sdscombo = gui.QComboBox()
        self.sdscombo.setFixedWidth(300)
        self.sdscombo.currentIndexChanged.connect(self.changeSds)
        self.sdscombo.setEnabled(False)

        self.zoominbutton = gui.QPushButton("Zoom In")
        self.zoomoutbutton = gui.QPushButton("Zoom Out")
        self.zoominbutton.clicked.connect(self.zoomin)
        self.zoomoutbutton.clicked.connect(self.zoomout)

        self.toolbar.addSeparator()
        self.toolbar.addAction(self.log)
        self.toolbar.addAction(self.expert)
        self.toolbar.addSeparator()
        self.toolbar.addAction(self.autorefresh)
        self.toolbar.addAction(self.refresh)
        self.toolbar.addSeparator()
        self.toolbar.addAction(self.diagaction)
        self.toolbar.addSeparator()
        self.toolbar.addAction(self.hexinput)
        self.toolbar.addSeparator()
        self.toolbar.addWidget(self.sdscombo)
        self.toolbar.addSeparator()
        self.toolbar.addWidget(self.zoominbutton)
        self.toolbar.addWidget(self.zoomoutbutton)

        if options.simulation_mode:
            self.toolbar.addSeparator()
            self.ui_edit_button = gui.QPushButton("UI Edit")
            self.ui_edit_button.setCheckable(True)
            self.toolbar.addSeparator()
            self.toolbar.addWidget(self.ui_edit_button)
            self.ui_edit_button.clicked.connect(self.toggle_edit)

        vehicle_dir = "vehicles"
        if not os.path.exists(vehicle_dir):
            os.mkdir(vehicle_dir)

        ecu_files = []
        for filename in os.listdir(vehicle_dir):
            basename, ext = os.path.splitext(filename)
            if ext == '.ecu':
                ecu_files.append(basename)

        menu = self.menuBar()

        diagmenu = menu.addMenu(_("File"))
        xmlopenaction = diagmenu.addAction("Open XML")
        newecuction = diagmenu.addAction(_("Create New ECU"))
        saveecuaction = diagmenu.addAction(_("Save current ECU"))
        diagmenu.addSeparator()
        savevehicleaction = diagmenu.addAction(_("Save ECU list"))
        savevehicleaction.triggered.connect(self.saveEcus)
        saveecuaction.triggered.connect(self.saveEcu)
        newecuction.triggered.connect(self.newEcu)
        xmlopenaction.triggered.connect(self.openxml)
        diagmenu.addSeparator()
        zipdbaction = diagmenu.addAction(_("Zip database"))
        zipdbaction.triggered.connect(self.zipdb)
        diagmenu.addSeparator()

        for ecuf in ecu_files:
            ecuaction = diagmenu.addAction(ecuf)
            ecuaction.triggered.connect(lambda state, a=ecuf: self.loadEcu(a))

        plugins_menu = menu.addMenu(_("Plugins"))
        category_menus = {}
        plugins = glob.glob("./ddtplugins/*.py")
        for plugin in plugins:
            try:
                modulename = os.path.basename(plugin).replace(".py", "")
                plug = imp.load_source(modulename, plugin)

                category = plug.category
                name = plug.plugin_name
                need_hw = plug.need_hw

                #if options.simulation_mode and need_hw:
                #    continue

                if not category in category_menus:
                    category_menus[category] = plugins_menu.addMenu(category)

                plug_action = category_menus[category].addAction(name)
                plug_action.triggered.connect(lambda state, a=plug.plugin_entry: self.launchPlugin(a))

                self.plugins[modulename] = plug
            except Exception as e:
                print _("Cannot load plugin %s, %s") % (plugin, traceback.format_exc())

        self.setConnected(True)
예제 #26
0
	def __init__(self, pixmap=None, gocrParams=None, gocrParamsDefault=None):
		QtGui.QDialog.__init__(self)

		self.setWindowTitle(Tc2Config.dialogTitle('Edit char recognition'))

		self.gocrParamsDefault = gocrParamsDefault

		self.toolBar = QtGui.QToolBar(self)

		self.actionScanImage = QtGui.QAction(self)
		self.actionScanImage.setText('Scan image')
		self.actionScanImage.setShortcut(QtGui.QKeySequence('Alt-N') )
		self.actionScanImage.setToolTip('Scan Image (Alt+N)')
		self.actionScanImage.triggered.connect(self.onActionScanImageTriggered)
		self.toolBar.addAction(self.actionScanImage)

		self.actionOpenImage = QtGui.QAction(self)
		self.actionOpenImage.setText('Open image..')
		self.actionOpenImage.setShortcut(QtGui.QKeySequence('Alt+O') )
		self.actionOpenImage.setToolTip('Open Image (Alt+O)')
		self.actionOpenImage.triggered.connect(self.onActionOpenImageTriggered)
		self.toolBar.addAction(self.actionOpenImage)

		self.actionSaveImage = QtGui.QAction(self)
		self.actionSaveImage.setText('Save image..')
		self.actionSaveImage.setShortcut(QtGui.QKeySequence('Alt+S') )
		self.actionSaveImage.setToolTip('Save Image (Alt+S)')
		self.actionSaveImage.triggered.connect(self.onActionSaveImageTriggered)
		self.toolBar.addAction(self.actionSaveImage)

		self.actionOpenSettings = QtGui.QAction(self)
		self.actionOpenSettings.setText('Open settings..')
		self.actionOpenSettings.setShortcut(QtGui.QKeySequence('Atlt+P') )
		self.actionOpenSettings.setToolTip('Open Settings (Alt+P)')
		self.actionOpenSettings.triggered.connect(self.onActionOpenSettingsTriggered)
		self.toolBar.addAction(self.actionOpenSettings)

		self.actionSaveSettings = QtGui.QAction(self)
		self.actionSaveSettings.setText('Save settings..')
		self.actionSaveSettings.setShortcut(QtGui.QKeySequence('Atlt+A') )
		self.actionSaveSettings.setToolTip('Open Settings (Alt+A)')
		self.actionSaveSettings.triggered.connect(self.onActionSaveSettingsTriggered)
		self.toolBar.addAction(self.actionSaveSettings)


		self.actionHelp = QtGui.QAction(self)
		self.actionHelp.setText('Help')
		self.actionHelp.setShortcut(QtGui.QKeySequence('F1') )
		self.actionHelp.setToolTip('Help (F1)')
		self.actionHelp.triggered.connect(self.onActionHelpTriggered)
		self.toolBar.addAction(self.actionHelp)

		self.buttonBox = QtGui.QDialogButtonBox(QtCore.Qt.Horizontal, self)
		self.buttonBox.addButton(self.buttonBox.Ok).clicked.connect(self.accept)
		self.buttonBox.addButton(self.buttonBox.Cancel).clicked.connect(self.reject)
		self.buttonBox.addButton(self.buttonBox.RestoreDefaults).setEnabled(self.gocrParamsDefault is not None)

		self.splitterSettings = QtGui.QSplitter(QtCore.Qt.Horizontal, self)

		# setup settings pane
		self.frameSettings = QtGui.QFrame(self.splitterSettings)
		self.splitterSettings.addWidget(self.frameSettings)

		self.checkBoxChars = QtGui.QCheckBox('Chars', self.frameSettings)
		self.checkBoxChars.stateChanged.connect(self.onCheckBoxCharsStateChanged)
		self.editChars = QtGui.QLineEdit(self.frameSettings)

		self.checkBoxGraylevel = QtGui.QCheckBox('Gray level', self.frameSettings)
		self.checkBoxGraylevel.stateChanged.connect(self.onCheckBoxGraylevelStateChanged)
		self.spinGrayLevel = QtGui.QSpinBox(self.frameSettings)
		self.spinGrayLevel.setRange(gocr.GrayLevelMin, gocr.GrayLevelMax)

		self.checkBoxDustSize = QtGui.QCheckBox('Dust size', self.frameSettings)
		self.checkBoxDustSize.stateChanged.connect(self.onCheckBoxDustSizeStateChanged)
		self.spinDustSize = QtGui.QSpinBox(self.frameSettings)
		self.spinDustSize.setRange(gocr.DustSizeMin, gocr.DustSizeMax)

		self.checkBoxWordSpacing = QtGui.QCheckBox('Word spacing', self.frameSettings)
		self.checkBoxWordSpacing.stateChanged.connect(self.onCheckBoxWordSpacingStateChanged)
		self.spinWordSpacing = QtGui.QSpinBox(self.frameSettings)
		self.spinWordSpacing.setRange(gocr.WordSpacingMin, gocr.WordSpacingMax)

		self.checkBoxCertainty = QtGui.QCheckBox('Certainty', self.frameSettings)
		self.checkBoxCertainty.stateChanged.connect(self.onCheckBoxCertaintyStateChanged)
		self.spinCertainty = QtGui.QSpinBox(self.frameSettings)
		self.spinCertainty.setRange(gocr.CertaintyMin, gocr.CertaintyMax)

		self.checkBoxInvertImage = QtGui.QCheckBox('Invert image', self.frameSettings)
		self.checkBoxAnalyzeLayout = QtGui.QCheckBox('Analyze layout', self.frameSettings)
		self.checkBoxContextCorrection = QtGui.QCheckBox('Context correction', self.frameSettings)
		self.checkBoxCompareUnknownChars = QtGui.QCheckBox('Compare unknown chars', self.frameSettings)
		self.checkBoxDivideOverlappingChars = QtGui.QCheckBox('Divide overlapping chars', self.frameSettings)
		self.checkBoxPackChars = QtGui.QCheckBox('Pack chars', self.frameSettings)

		self.checkBoxOutputType = QtGui.QCheckBox('Output type', self.frameSettings)
		self.checkBoxOutputType.stateChanged.connect(self.onCheckBoxOutputTypeStateChanged)
		self.comboOutputType = QtGui.QComboBox(self.frameSettings)
		self.comboOutputType.addItems(gocr.OutputTypes)

		self.checkBoxOutputPattern = QtGui.QCheckBox('Output pattern', self.frameSettings)
		self.checkBoxOutputPattern.stateChanged.connect(self.onCheckBoxOutputPatternStateChanged)
		self.editOutputPattern = QtGui.QPlainTextEdit(self.frameSettings)

		#
		self.splitterImage = QtGui.QSplitter(QtCore.Qt.Vertical, self.splitterSettings)
		self.splitterSettings.addWidget(self.splitterImage)

		self.scrollAreaInputImage = QtGui.QScrollArea( self.splitterImage)
		self.splitterImage.addWidget(self.scrollAreaInputImage)
		self.scrollAreaInputImage.setBackgroundRole(QtGui.QPalette.Dark)
		self.scrollAreaInputImage.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)

		self.labelInputImage = QtGui.QLabel(self.scrollAreaInputImage)
		self.scrollAreaInputImage.setWidget(self.labelInputImage)

		self.splitterOutput = QtGui.QSplitter(QtCore.Qt.Horizontal, self.splitterImage)
		self.splitterImage.addWidget(self.splitterOutput)

		self.webViewOutput = QtWebKit.QWebView(self.splitterOutput)
		self.splitterOutput.addWidget(self.webViewOutput)

		self.webViewError = QtWebKit.QWebView(self.splitterOutput)
		self.splitterOutput.addWidget(self.webViewError)

		self.setPixmap(pixmap=pixmap)
		self.setGocrParams(params=gocrParams)
		self.setOutput(string='')
		self.setError(string='')
		self.layout()
예제 #27
0
    def setupUi(self):
        self.labels = {}
        self.widgets = {}
        self.checkBoxes = {}
        self.showAdvanced = False
        self.valueItems = {}
        self.dependentItems = {}
        self.resize(650, 450)
        self.buttonBox = QtGui.QDialogButtonBox()
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel
                                          | QtGui.QDialogButtonBox.Ok)
        tooltips = self.alg.getParameterDescriptions()
        self.setSizePolicy(QtGui.QSizePolicy.Expanding,
                           QtGui.QSizePolicy.Expanding)
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setSpacing(5)
        self.verticalLayout.setMargin(20)
        for param in self.alg.parameters:
            if param.isAdvanced:
                self.advancedButton = QtGui.QPushButton()
                self.advancedButton.setText('Show advanced parameters')
                self.advancedButton.setMaximumWidth(150)
                QtCore.QObject.connect(self.advancedButton,
                                       QtCore.SIGNAL('clicked()'),
                                       self.showAdvancedParametersClicked)
                self.verticalLayout.addWidget(self.advancedButton)
                break
        for param in self.alg.parameters:
            if param.hidden:
                continue
            desc = param.description
            if isinstance(param, ParameterExtent):
                desc += '(xmin, xmax, ymin, ymax)'
            label = QtGui.QLabel(desc)
            self.labels[param.name] = label
            widget = self.getWidgetFromParameter(param)
            self.valueItems[param.name] = widget
            if param.name in tooltips.keys():
                tooltip = tooltips[param.name]
            else:
                tooltip = param.description
            label.setToolTip(tooltip)
            widget.setToolTip(tooltip)
            if param.isAdvanced:
                label.setVisible(self.showAdvanced)
                widget.setVisible(self.showAdvanced)
                self.widgets[param.name] = widget
            self.verticalLayout.addWidget(label)
            self.verticalLayout.addWidget(widget)

        for output in self.alg.outputs:
            if output.hidden:
                continue
            if isinstance(output, (OutputRaster, OutputVector, OutputTable,
                                   OutputHTML, OutputFile, OutputDirectory)):
                label = QtGui.QLabel(output.description + '<' +
                                     output.__module__.split('.')[-1] + '>')
                item = QLineEdit()
                if hasattr(item, 'setPlaceholderText'):
                    item.setPlaceholderText(ModelerParametersDialog.ENTER_NAME)
                self.verticalLayout.addWidget(label)
                self.verticalLayout.addWidget(item)
                self.valueItems[output.name] = item

        label = QtGui.QLabel(' ')
        self.verticalLayout.addWidget(label)
        label = QtGui.QLabel('Parent algorithms')
        self.dependenciesPanel = self.getDependenciesPanel()
        self.verticalLayout.addWidget(label)
        self.verticalLayout.addWidget(self.dependenciesPanel)

        self.verticalLayout.addStretch(1000)
        self.setLayout(self.verticalLayout)

        self.setPreviousValues()
        self.setWindowTitle(self.alg.name)
        self.verticalLayout2 = QtGui.QVBoxLayout()
        self.verticalLayout2.setSpacing(2)
        self.verticalLayout2.setMargin(0)
        self.tabWidget = QtGui.QTabWidget()
        self.tabWidget.setMinimumWidth(300)
        self.paramPanel = QtGui.QWidget()
        self.paramPanel.setLayout(self.verticalLayout)
        self.scrollArea = QtGui.QScrollArea()
        self.scrollArea.setWidget(self.paramPanel)
        self.scrollArea.setWidgetResizable(True)
        self.tabWidget.addTab(self.scrollArea, 'Parameters')
        self.webView = QtWebKit.QWebView()

        html = None
        url = None
        try:
            isText, help = self.alg.help()
            if help is not None:
                if isText:
                    html = help
                else:
                    url = QtCore.QUrl(help)
            else:
                html = '<h2>Sorry, no help is available for this \
                        algorithm.</h2>'

        except WrongHelpFileException, e:
            html = e.args[0]
예제 #28
0
    def initUI(self):
        ####################################################  QTextEdit #####################################################

        self.editor = QtGui.QTextEdit(self)
        self.editor.move(8, 50)
        self.editor.resize(650, 690)
        self.editor.setStyleSheet(
            "background-color: #ffffff; border-radius: 10px; border: 3px solid #808080"
        )
        QtCore.QObject.connect(self.editor, QtCore.SIGNAL('textChanged()'),
                               self.onTextChanged)
        self.editor.changesSaved = True

        ####################################################  QWebView ######################################################

        self.visorWeb = QtWebKit.QWebView(self)
        self.visorWeb.move(665, 50)
        self.visorWeb.resize(650, 690)
        self.visorWeb.load(QtCore.QUrl('htmlArchivos/frontV2.html'))
        self.visorWeb.setStyleSheet(
            "background-color: #ffffff; border-radius: 80px; border: 10px solid #909090"
        )

        ####################################################  QMenuBar ######################################################

        self.menu = QtGui.QMenuBar(self)
        archivoMenu = self.menu.addMenu('Archivo')
        herramietasMenu = self.menu.addMenu('Herramientas')
        ayudaMenu = self.menu.addMenu('Ayuda')

        nuevoArchivo = QtGui.QAction(QtGui.QIcon("iconos/nuevo.png"), "Nuevo",
                                     self)
        nuevoArchivo.setShortcut('Ctrl+N')
        nuevoArchivo.setStatusTip('Nuevo')
        nuevoArchivo.triggered.connect(self.nuevoArchivoF)

        abrirArchivo = QtGui.QAction(QtGui.QIcon("iconos/abrir.png"), "Abrir",
                                     self)
        abrirArchivo.setShortcut('Ctrl+O')
        abrirArchivo.setStatusTip('Abrir')
        abrirArchivo.triggered.connect(self.abrirArchivo)

        guardarArchivo = QtGui.QAction(QtGui.QIcon("iconos/guardar.png"),
                                       "Guardar", self)
        guardarArchivo.setShortcut('Ctrl+S')
        guardarArchivo.setStatusTip('Guardar')
        guardarArchivo.triggered.connect(self.guardarArchivo)

        exportarPDF = QtGui.QAction(QtGui.QIcon("iconos/pdf.png"),
                                    'Exportar PDF', self)
        exportarPDF.triggered.connect(self.exportarPDF)

        salir = QtGui.QAction(QtGui.QIcon('iconos/salir.png'), 'Salir', self)
        salir.setShortcut('Ctrl+Q')
        salir.triggered.connect(self.closeEvent)

        orientacion = QtGui.QAction('Orientacion ', self)
        orientacion.triggered.connect(self.paintEvent)

        ayuda = QtGui.QAction(QtGui.QIcon("iconos/ayuda.png"), 'Ayuda', self)
        ayuda.setShortcut('F1')
        ayuda.setStatusTip('Ayuda ')
        ayuda.triggered.connect(self.ayudaFuncion)

        acerca = QtGui.QAction(QtGui.QIcon("iconos/acerca.png"),
                               'Acerca de...', self)
        acerca.triggered.connect(self.acercaFuncion)

        temas = herramietasMenu.addMenu(QtGui.QIcon('iconos/estilos.png'),
                                        'Estilos')
        estilo0 = QtGui.QAction(QtGui.QIcon('iconos/estilos.png'),
                                'Estilo negro', self)
        estilo0.setShortcut('Ctrl+X')
        estilo0.setStatusTip('Estilo negro')
        estilo0.triggered.connect(self.estilo0Funcion)
        temas.addAction(estilo0)

        estilo1 = QtGui.QAction(QtGui.QIcon('iconos/estilos.png'),
                                'Estilo gray', self)
        estilo1.setShortcut('Ctrl+X')
        estilo1.setStatusTip('Buscar')
        estilo1.triggered.connect(self.estilo1Funcion)
        temas.addAction(estilo1)

        estilo2 = QtGui.QAction(QtGui.QIcon('iconos/estilos.png'),
                                'Estilo azul', self)
        estilo2.setShortcut('Ctrl+X')
        estilo2.setStatusTip('Estilo azul')
        estilo2.triggered.connect(self.estilo2Funcion)
        temas.addAction(estilo2)

        estilo3 = QtGui.QAction(QtGui.QIcon('iconos/estilos.png'),
                                'Theme green', self)
        estilo3.setShortcut('Ctrl+X')
        estilo3.setStatusTip('Estilo azul')
        estilo3.triggered.connect(self.estilo3Funcion)
        temas.addAction(estilo3)

        archivoMenu.addAction(nuevoArchivo)
        archivoMenu.addAction(abrirArchivo)
        archivoMenu.addAction(guardarArchivo)
        archivoMenu.addAction(exportarPDF)
        archivoMenu.addAction(salir)
        ayudaMenu.addAction(ayuda)
        ayudaMenu.addAction(acerca)

        ####################################################  QPushButtons ##################################################

        ###############################  Buton Nuevo #####################################

        self.botonNuevo = QtGui.QPushButton('', self)
        self.botonNuevo.setIcon(QtGui.QIcon(QtGui.QPixmap('iconos/nuevo.png')))
        self.botonNuevo.setIconSize(QtCore.QSize(25, 25))
        self.botonNuevo.clicked.connect(self.nuevoArchivoF)
        self.botonNuevo.move(5, 10)
        self.botonNuevo.setStyleSheet("border-radius: 10px; border-width:0px")

        ###############################  Button Abrir #####################################

        self.botonAbrir = QtGui.QPushButton('', self)
        self.botonAbrir.setIcon(QtGui.QIcon(QtGui.QPixmap('iconos/abrir.png')))
        self.botonAbrir.setIconSize(QtCore.QSize(25, 25))
        self.botonAbrir.clicked.connect(self.abrirArchivo)
        self.botonAbrir.move(36, 10)
        self.botonAbrir.setStyleSheet("border-radius: 10px; border-width:0px")

        ###############################  Buton Guardar #####################################

        self.botonGuardar = QtGui.QPushButton('', self)
        self.botonGuardar.setIcon(
            QtGui.QIcon(QtGui.QPixmap('iconos/guardar.png')))
        self.botonGuardar.setIconSize(QtCore.QSize(23, 23))
        self.botonGuardar.clicked.connect(self.guardar)
        self.botonGuardar.move(67, 10)
        self.botonGuardar.setStyleSheet(
            "border-radius: 10px; border-width:0px")

        ###############################  Button imagen ###################################

        self.botonImagen = QtGui.QPushButton('', self)
        self.botonImagen.setIcon(
            QtGui.QIcon(QtGui.QPixmap('iconos/imagen.png')))
        self.botonImagen.setIconSize(QtCore.QSize(22, 22))
        self.botonImagen.clicked.connect(self.insertarImagen)
        self.botonImagen.move(210, 10)
        self.botonImagen.setStyleSheet("border-radius: 10px; border-width:0px")

        ###############################  Button Ecuacion #################################

        self.botonEcuacion = QtGui.QPushButton('', self)
        self.botonEcuacion.setIcon(
            QtGui.QIcon(QtGui.QPixmap('iconos/ecuacion.png')))
        self.botonEcuacion.setIconSize(QtCore.QSize(22, 22))
        self.botonEcuacion.clicked.connect(self.ecuacion)
        self.botonEcuacion.move(240, 10)
        self.botonEcuacion.setStyleSheet(
            "border-radius: 10px; border-width:0px")

        ###############################  Button Lista ####################################

        self.botonLista = QtGui.QPushButton('', self)
        self.botonLista.setIcon(QtGui.QIcon(QtGui.QPixmap('iconos/lista.png')))
        self.botonLista.setIconSize(QtCore.QSize(23, 23))
        self.botonLista.clicked.connect(self.lista)
        self.botonLista.move(275, 10)
        self.botonLista.setStyleSheet("border-radius: 10px; border-width:0px")

        ###############################  Button Lista no numerada ########################

        self.botonListaN = QtGui.QPushButton('', self)
        self.botonListaN.setIcon(
            QtGui.QIcon(QtGui.QPixmap('iconos/listaN.png')))
        self.botonListaN.setIconSize(QtCore.QSize(23, 23))
        self.botonListaN.clicked.connect(self.listaN)
        self.botonListaN.move(310, 10)
        self.botonListaN.setStyleSheet("border-radius: 10px; border-width:0px")

        ###############################  Button Buscar ##################################

        self.botonBuscar = QtGui.QPushButton('', self)
        self.botonBuscar.setIcon(
            QtGui.QIcon(QtGui.QPixmap('iconos/buscar.png')))
        self.botonBuscar.setIconSize(QtCore.QSize(23, 23))
        self.botonBuscar.clicked.connect(find.Find(self).show)
        self.botonBuscar.move(440, 10)
        self.botonBuscar.setStyleSheet('border-radius: 10px; border-width:0px')

        self.botonBuscar = QtGui.QPushButton('', self)
        self.botonBuscar.setIcon(QtGui.QIcon(QtGui.QPixmap('casosdeuso.jpg')))
        self.botonBuscar.setIconSize(QtCore.QSize(23, 23))
        self.botonBuscar.clicked.connect(find.Find(self).show)
        self.botonBuscar.move(440, 10)
        self.botonBuscar.setStyleSheet('border-radius: 10px; border-width:0px')

        ###############################  Button Preview ##################################

        self.buttonPreview = QtGui.QPushButton('', self)
        self.buttonPreview.setIcon(
            QtGui.QIcon(QtGui.QPixmap('iconos/preview.png')))
        self.buttonPreview.setIconSize(QtCore.QSize(23, 23))
        self.buttonPreview.clicked.connect(self.preview)
        self.buttonPreview.move(470, 10)
        self.buttonPreview.setStyleSheet(
            "border-radius: 10px; border-width:0px")

        ###############################  Button Copiar #####################################

        self.botonCopiar = QtGui.QPushButton('', self)
        self.botonCopiar.setIcon(
            QtGui.QIcon(QtGui.QPixmap('iconos/copiar.png')))
        self.botonCopiar.setIconSize(QtCore.QSize(23, 23))
        self.botonCopiar.clicked.connect(self.editor.copy)
        self.botonCopiar.move(500, 10)
        self.botonCopiar.setStyleSheet("border-radius: 10px; border-width:0px")

        ###############################  Buttonar Pegar ####################################

        self.botonPegar = QtGui.QPushButton('', self)
        self.botonPegar.setIcon(QtGui.QIcon(QtGui.QPixmap('iconos/pegar.png')))
        self.botonPegar.setIconSize(QtCore.QSize(23, 23))
        self.botonPegar.clicked.connect(self.editor.paste)
        self.botonPegar.move(530, 10)
        self.botonPegar.setStyleSheet("border-radius: 10px; border-width:0px")

        ###############################  Button Deshacer #####################################

        self.botonDeshacer = QtGui.QPushButton('', self)
        self.botonDeshacer.setIcon(
            QtGui.QIcon(QtGui.QPixmap('iconos/deshacer.png')))
        self.botonDeshacer.setIconSize(QtCore.QSize(20, 20))
        self.botonDeshacer.clicked.connect(self.editor.undo)
        self.botonDeshacer.move(560, 10)
        self.botonDeshacer.setStyleSheet(
            "border-radius: 10px; border-width:0px")

        ###############################  Button Hacer #####################################

        self.botonHacer = QtGui.QPushButton('', self)
        self.botonHacer.setIcon(QtGui.QIcon(QtGui.QPixmap('iconos/hacer.png')))
        self.botonHacer.setIconSize(QtCore.QSize(20, 20))
        self.botonHacer.clicked.connect(self.editor.redo)
        self.botonHacer.move(590, 10)
        self.botonHacer.setStyleSheet("border-radius: 10px; border-width:0px")

        ###############################  Button Cortar  ##################################

        self.butonCortar = QtGui.QPushButton('', self)
        self.butonCortar.setIcon(
            QtGui.QIcon(QtGui.QPixmap('iconos/cortar.png')))
        self.butonCortar.setIconSize(QtCore.QSize(23, 23))
        self.butonCortar.clicked.connect(self.editor.cut)
        self.butonCortar.move(620, 10)
        self.butonCortar.setStyleSheet("border-radius: 10px; border-width:0px")

        ##########################  Button Configuracion #################################

        #~ self.buttonConf  = QtGui.QPushButton('', self)
        #~ self.buttonConf.setIcon(QtGui.QIcon(QtGui.QPixmap('iconos/confiV2.png')))
        #~ self.buttonConf.setIconSize(QtCore.QSize(27,27))
        #~ self.buttonConf.move(665, 10)
        #~ self.buttonConf.setStyleSheet("border-radius: 10px; border-width:0px")

        ###############################  Button Ayuda ####################################

        self.butonAyuda = QtGui.QPushButton('', self)
        self.butonAyuda.setIcon(
            QtGui.QIcon(QtGui.QPixmap('iconos/ayudaV2.png')))
        self.butonAyuda.setIconSize(QtCore.QSize(30, 27))
        self.butonAyuda.clicked.connect(self.ayudaFuncion)
        self.butonAyuda.move(665, 10)
        self.butonAyuda.setStyleSheet("border-radius: 10px; border-width:0px")

        ###############################  Button PDF ####################################

        self.buttonPDF = QtGui.QPushButton('', self)
        self.buttonPDF.setIcon(QtGui.QIcon(QtGui.QPixmap('iconos/pdfV2.png')))
        self.buttonPDF.setIconSize(QtCore.QSize(25, 25))
        self.buttonPDF.clicked.connect(self.exportarPDF)
        self.buttonPDF.move(1225, 10)
        self.buttonPDF.setStyleSheet("border-radius: 10px; border-width:0px")

        #############################  Button Recargar ###################################

        self.botonRecargar = QtGui.QPushButton('', self)
        self.botonRecargar.setIcon(
            QtGui.QIcon(QtGui.QPixmap('iconos/recargarV2.png')))
        self.botonRecargar.setIconSize(QtCore.QSize(25, 25))
        self.botonRecargar.clicked.connect(self.onTextChanged)
        self.botonRecargar.move(1255, 10)
        self.botonRecargar.setStyleSheet(
            "border-radius: 10px; border-width:0px")

        ############################  Button Salir #######################################

        self.botonSalir = QtGui.QPushButton('', self)
        self.botonSalir.setIcon(QtGui.QIcon(
            QtGui.QPixmap('iconos/quitv2.png')))
        self.botonSalir.setIconSize(QtCore.QSize(25, 25))
        self.botonSalir.clicked.connect(self.cerrarEvento)
        self.botonSalir.move(1285, 10)
        self.botonSalir.setStyleSheet("border-radius: 10px; border-width:0px")

        ####################################################   Ventana  ######################################################

        self.setWindowTitle('Escribano%s' % VERSION)
        self.setWindowIcon(QtGui.QIcon('iconos/icon_pen.png'))
        self.setGeometry(0, 0, 1500, 900)
        self.show()
예제 #29
0
    def __init__(self):
        super(StageWebView, self).__init__()

        self.__isAddedToParentWidget = False

        self.webView = QtWebKit.QWebView()
예제 #30
0
    # Force Qt to update outside of any event loop to display the splash
    # screen.
    env.qApp.processEvents()

    # Init the main application window.
    window = QtGui.QMainWindow()

    # Init Tabbed Interface.
    tab = TabWidget()

    # Init the main tab and add it to the tabs-manager.
    main_window = MainWindow(env=env)
    tab.addTab(main_window, 'Main View')

    # Create the map tab that just displays a web page.
    env.web = QtWebKit.QWebView()
    env.web.show()
    tab.addTab(env.web, 'Map')

    # Add the station browser tab.
    env.station_browser = QtWebKit.QWebView()
    env.station_browser.show()
    tab.addTab(env.station_browser, 'Station Browser')

    # Init Status bar.
    st = QtGui.QStatusBar()
    env.st = st

    # Label to display the server status in the status bar. Need to init with
    # rich text if rich text should be used later on.
    env.server_status = QtGui.QLabel('<font color="#FF0000"></font>')