Esempio n. 1
0
 def __init__(self):
     super().__init__()
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self)
     self.ui.TryPromodoro.triggered.connect(self.call_Promodoro)
     self.ui.actionChoose_Epub_File.triggered.connect(self.call_epub_converter)
     self.ui.actionChoose_Epub_File.triggered.connect(self.call_epub_converter)
     self.ui.actionHelp_Book.triggered.connect(self.call_qtAbout)
Esempio n. 2
0
 def __init__(self):
     super(mywindow, self).__init__()
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self)
     self.ui.D0_text.setText('0')
     self.ui.D90_text.setText('0')
     self.ui.D180_text.setText('0')
     self.ui.D270_text.setText('0')
     self.ui.operation.clicked.connect(self.operation)
Esempio n. 3
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.lineEdit_roy1.setValidator(QtGui.QDoubleValidator())
        self.ui.lineEdit_roy2.setValidator(QtGui.QDoubleValidator())
        self.ui.lineEdit_roy3.setValidator(QtGui.QDoubleValidator())

        self.ui.lineEdit_bookname.editingFinished.connect(
            lambda: contract.setbookname(self.ui.lineEdit_bookname.text()))
        self.ui.lineEdit_unit.editingFinished.connect(
            lambda: contract.setunit(self.ui.lineEdit_unit.text()))
        self.ui.lineEdit_area.editingFinished.connect(
            lambda: contract.setauthorizedarea(self.ui.lineEdit_area.text()))
        self.ui.lineEdit_agent.editingFinished.connect(
            lambda: contract.setagent(self.ui.lineEdit_agent.text()))
        self.ui.lineEdit_author.editingFinished.connect(
            lambda: contract.setauthor(self.ui.lineEdit_author.text()))
        self.ui.comboBox_interval.activated.connect(
            lambda: contract.setclacinterval(self.ui.comboBox_interval.
                                             currentIndex()))
        self.ui.dateEdit_startdate.dateChanged.connect(
            lambda: contract.setstartdate(self.ui.dateEdit_startdate.date().
                                          toString("yyyy-MM-dd")))
        self.ui.dateEdit_enddate.dateChanged.connect(
            lambda: contract.setenddate(self.ui.dateEdit_enddate.date().
                                        toString("yyyy-MM-dd")))
        self.ui.lineEdit_roy1.editingFinished.connect(
            lambda: contract.setroalty1(float(self.ui.lineEdit_roy1.text())))
        self.ui.lineEdit_roy2.editingFinished.connect(
            lambda: contract.setroalty2(float(self.ui.lineEdit_roy2.text())))
        self.ui.lineEdit_roy3.editingFinished.connect(
            lambda: contract.setroalty3(float(self.ui.lineEdit_roy3.text())))
        self.ui.lineEdit_roy4.editingFinished.connect(
            lambda: contract.setroalty4(self.ui.lineEdit_roy4.text()))

        self.ui.pushButton_insert.clicked.connect(
            lambda: contract.sql_insert())
        self.ui.pushButton_search.clicked.connect(self.loadData)
Esempio n. 4
0
    def __init__(self):
        QtGui.QMainWindow.__init__(self)

        self.doctree=None
        self.lineMarks={}

        # We put things we want rendered here
        self.render_queue = Queue()
        # We get things rendered back
        self.pdf_queue = Queue()
        # We get doctrees for the outline viewer
        self.doctree_queue = Queue()

        print('Starting background renderer...', end=' ')
        self.renderProcess=Process(target = renderQueue,
            args=(self.render_queue, self.pdf_queue, self.doctree_queue))
        self.renderProcess.daemon=True
        self.renderProcess.start()
        print('DONE')

        # This is always the same
        self.ui=Ui_MainWindow()
        self.ui.setupUi(self)

        # Adjust column widths in the structure tree
        self.ui.tree.header().setStretchLastSection(False)
        self.ui.tree.header().setResizeMode(0, QtGui.QHeaderView.Stretch)
        self.ui.tree.header().setResizeMode(1, QtGui.QHeaderView.ResizeToContents)

        self.pdf=PDFWidget()

        self.ui.pageNum = QtGui.QSpinBox()
        self.ui.pageNum.setMinimum(1)
        self.ui.pageNum.setValue(1)
        self.connect(self.pdf,QtCore.SIGNAL('pageCount'),
            self.ui.pageNum.setMaximum)
        self.connect(self.pdf,QtCore.SIGNAL('pageChanged'),
            self.ui.pageNum.setValue)
        self.connect(self.ui.pageNum,QtCore.SIGNAL('valueChanged(int)'),
            self.pdf.gotoPage)

        self.ui.actionShow_ToolBar=self.ui.toolBar.toggleViewAction()
        self.ui.actionShow_ToolBar.setText("Show Main Toolbar")
        self.ui.menuView.addAction(self.ui.actionShow_ToolBar)

        self.ui.pdfbar.addAction(self.pdf.ui.previous)
        self.ui.pdfbar.addWidget(self.ui.pageNum)
        self.ui.pdfbar.addAction(self.pdf.ui.__next__)
        self.ui.pdfbar.addSeparator()
        self.ui.pdfbar.addAction(self.pdf.ui.zoomin)
        self.ui.pdfbar.addAction(self.pdf.ui.zoomout)
        self.ui.actionShow_PDFBar=self.ui.pdfbar.toggleViewAction()
        self.ui.actionShow_PDFBar.setText("Show PDF Toolbar")
        self.ui.menuView.addAction(self.ui.actionShow_PDFBar)

        self.ui.dockLayout.addWidget(self.ui.pdfbar)
        self.ui.dockLayout.addWidget(self.pdf)
        self.ui.dock.hide()
        self.ui.actionShow_PDF=self.ui.dock.toggleViewAction()
        self.ui.actionShow_PDF.setText('Show Preview')
        self.ui.menuView.addAction(self.ui.actionShow_PDF)
        self.ui.actionShow_Structure=self.ui.structure.toggleViewAction()
        self.ui.actionShow_Structure.setText('Show Document Outline')
        self.ui.menuView.addAction(self.ui.actionShow_Structure)

        self.text_md5=''
        self.style_md5=''

        self.hl1 = Highlighter(self.ui.text.document(),'rest')
        self.hl2 = Highlighter(self.ui.style.document(),'javascript')

        self.editorPos=QtGui.QLabel()
        self.ui.statusBar.addWidget(self.editorPos)
        self.editorPos.show()

        self.statusMessage=QtGui.QLabel()
        self.ui.statusBar.addWidget(self.statusMessage)
        self.statusMessage.show()

        self.on_text_cursorPositionChanged()
        self.on_actionRender_triggered()

        # Connect editing actions to the editors
        self.ui.text.undoAvailable.connect(self.ui.actionUndo1.setEnabled)
        self.ui.actionUndo1.triggered.connect(self.ui.text.undo)
        self.ui.text.redoAvailable.connect(self.ui.actionRedo1.setEnabled)
        self.ui.actionRedo1.triggered.connect(self.ui.text.redo)

        self.ui.text.copyAvailable.connect(self.ui.actionCopy1.setEnabled)
        self.ui.actionCopy1.triggered.connect(self.ui.text.copy)
        self.ui.text.copyAvailable.connect(self.ui.actionCut1.setEnabled)
        self.ui.actionCut1.triggered.connect(self.ui.text.cut)
        self.ui.actionPaste1.triggered.connect(self.ui.text.paste)


        self.ui.style.undoAvailable.connect(self.ui.actionUndo2.setEnabled)
        self.ui.actionUndo2.triggered.connect(self.ui.style.undo)
        self.ui.style.redoAvailable.connect(self.ui.actionRedo2.setEnabled)
        self.ui.actionRedo2.triggered.connect(self.ui.style.redo)

        self.ui.style.copyAvailable.connect(self.ui.actionCopy2.setEnabled)
        self.ui.actionCopy2.triggered.connect(self.ui.style.copy)
        self.ui.style.copyAvailable.connect(self.ui.actionCut2.setEnabled)
        self.ui.actionCut2.triggered.connect(self.ui.style.cut)
        self.ui.actionPaste2.triggered.connect(self.ui.style.paste)

        self.clipBoard=QtGui.QApplication.clipboard()
        self.clipBoard.changed.connect(self.clipChanged)

        self.hookEditToolbar(self.ui.text)
        self.clipChanged(QtGui.QClipboard.Clipboard)

        self.text_fname=None
        self.style_fname=None
        self.pdf_fname=None

        self.ui.searchbar.setVisible(False)
        self.ui.searchWidget=SearchWidget()
        self.ui.searchbar.addWidget(self.ui.searchWidget)
        self.ui.actionFind.triggered.connect(self.ui.searchbar.show)
        self.ui.actionFind.triggered.connect(self.ui.searchWidget.ui.text.setFocus)
        self.ui.searchWidget.ui.close.clicked.connect(self.ui.searchbar.hide)
        self.ui.searchWidget.ui.close.clicked.connect(self.returnFocus)
        self.ui.searchWidget.ui.next.clicked.connect(self.doFind)
        self.ui.searchWidget.ui.previous.clicked.connect(self.doFindBackwards)

        self.updatePdf()

        self.renderTimer=QtCore.QTimer()
        self.renderTimer.timeout.connect(self.on_actionRender_triggered)
        self.renderTimer.start(5000)
Esempio n. 5
0
 def abrir_main(self):
     self.MainWindow = QtWidgets.QMainWindow()
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self.MainWindow)
     self.MainWindow.show()