Ejemplo n.º 1
0
    def __init__(self, dialog):  # Initialization function
        # Set up the GUI
        Ui_Dialog.__init__(self)
        self.setupUi(dialog)

        # Create then display the image
        self.clear_image()
        self.disp_image(self.workingImage)

        self.bStart.clicked.connect(self.connect_serial)

        self.bGo.clicked.connect(self.run_calculations)
        self.bE.clicked.connect(self.serial_transmit)
Ejemplo n.º 2
0
class MyDialog(QtGui.QWidget):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_Dialog()
        self.ui.setupUi(self)
        self.ui.pushButton.clicked.connect(self.NEXT)
        self.ui.pushButton_2.clicked.connect(self.CANCEL)

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(
            QtGui.QApplication.translate("Dialog", "Dialog", None,
                                         QtGui.QApplication))
        self.pushButton.setText(
            QtGui.QApplication.translate("Dialog", "OKAY", None,
                                         QtGui.QApplication))
        self.label.setText(
            QtGui.QApplication.translate("Dialog", "WRONG DETAILS GIVEN", None,
                                         QtGui.QApplication))

    def NEXT(self):
        # text = self.ui.textEdit.toPlainText()
        database_name = self.ui.lineEdit.text()
        user_name = self.ui.lineEdit_2.text()
        password = self.ui.lineEdit_3.text()
        ip_address = self.ui.lineEdit_4.text()
        port_number = self.ui.lineEdit_5.text()
        var = create_connection(ip_address, user_name, password, database_name,
                                port_number)
        global var
        if (var != -1):
            myapp2 = Ui_Dialog2()
            myapp2.setupUi(self)
            myapp2.pushButton_5.clicked.connect(self.BACK)
        elif (var == -1):
            myapp3.show()
            myapp.hide()

    def BACK(self):
        self.close()

    def CANCEL(self):
        self.close()
Ejemplo n.º 3
0
 def __init__(self, parent=None):
     QtGui.QWidget.__init__(self, parent)
     self.ui = Ui_Dialog()
     self.ui.setupUi(self)
     self.ui.pushButton.clicked.connect(self.NEXT)
     self.ui.pushButton_2.clicked.connect(self.CANCEL)
Ejemplo n.º 4
0
from PyQt5 import QtCore, QtGui, QtWidgets
from functools import partial
from GUI import Ui_Dialog
import sys
from math import sqrt

app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.setFixedSize(239, 351)
Dialog.show()



class ex():
    def __init__(self, value, act, curr_dig):
        self.value = value
        self.act = act
        self.curr_dig = curr_dig
        self.sqrt_flag = 0
        self.evaluted_flag = 0



    def add_dig(self, dig):
        if dig == ".":
            for i in self.curr_dig:
                if i == ".":
                    return
Ejemplo n.º 5
0
import sys
sys.setrecursionlimit(10000000)
import struct
from GUI import Ui_Dialog
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import os
from Methods import *
from makeTabs import *
from userassist import *
from RecentDocsRegistry import *
import shellbags

app = QApplication(sys.argv)
window = QDialog()
ui = Ui_Dialog()
ui.setupUi(window)



def StartExam():  # Order:(db, cursor, hive, TableName, Source,  Key, Category, single or subdir, text):
    filename = QFileDialog.getExistingDirectory()

    db = sqlite3.connect(":memory:")
    db.text_factory = str
    cursor = db.cursor()
    ui.msgLabel.setText("Processing.....  ")
    app.processEvents()
    cursor.execute(    '''CREATE TABLE Info(Id INTEGER PRIMARY KEY, Name TEXT, Value TEXT,Category TEXT, State TEXT, Keystr TEXT, RecString TEXT, KeyParent TEXT, KeyTimeStamp TEXT, MRUOrder INTEGER, MFT INTEGER, Source TEXT)''')
    db.commit()
    cursor.execute(
Ejemplo n.º 6
0
from PyQt5 import QtWidgets
from GUI import Ui_Dialog
from sys import exit, argv
import sqlite3
import datetime

app = QtWidgets.QApplication(argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_Dialog()
ui.setupUi(MainWindow)
MainWindow.show()


class Project:
    def add_project(self):
        db = sqlite3.connect('database.db')
        cursor = db.cursor()
        new_project = ui.project_add_input.text()
        if new_project is not '':
            base_name = "insert into PROJECTS (name, total_time, total_price) values ('{project}', 0, 0)"
            cursor.execute(base_name.format(project=new_project))
            ui.project_add_input.clear()
            db.commit()
            db.close()
            ui.projects_list.addItem(new_project)
            ui.projects_list.update()

    def create_base(self):
        hour_cost = 340
        sql_create_projects = """CREATE TABLE if not exists 
                projects (name TEXT, total_time INT, total_price INT)"""