Exemplo n.º 1
0
def allowed_to_continue(
                        filename,
                        gist_url,
                        dir_name,
                        n = 2,
                        ):
    from functions import check_legal
    check = check_legal.CheckLegalUse(
                                filename,
                                gist_url,
                                dir_name,
                                n = n,
    )
    allow, text = check.allowed_to_continue()
    if allow and not text:
        return True, check
    else:
        if text in ('INTERNET', 'SERIAL'):
            ui = SerialForm()
            ui.form.serial.setText(check.serial)
            Gui.Control.showDialog(ui)
            # if ui.setupUi():
            #     Gui.Control.closeDialog(ui)
            return False, check
        elif text == 'REGISTERED':
            msg = "Congrajulation! You are now registered, enjoy using this features!"
            QMessageBox.information(None, 'Registered', str(msg))
            return True, check
    return False, check
Exemplo n.º 2
0
 def allowed_to_continue(self,
                         filename,
                         gist_url,
                         dir_name,
                         n,
                         ):
     sys.path.insert(0, str(civiltools_path))
     from functions import check_legal
     check = check_legal.CheckLegalUse(
                                 filename,
                                 gist_url,
                                 dir_name,
                                 n,
     )
     allow, text = check.allowed_to_continue()
     if allow and not text:
         return True, check
     else:
         if text in ('INTERNET', 'SERIAL'):
             # msg = "You must register to continue, but you are not connected to the Internet, please check your internet connection."
             # QMessageBox.warning(None, 'Register!', str(msg))
             # return False
         # elif text == 'SERIAL':
             serial_win = SerialForm(self)
             serial_win.serial.setText(check.serial)
             serial_win.exec_()
             return False, check
         elif text == 'REGISTERED':
             msg = "Congrajulation! You are now registered, enjoy using this features!"
             QMessageBox.information(None, 'Registered', str(msg))
             return True, check
     return False, check
Exemplo n.º 3
0
def allowed_to_continue(
    filename,
    gist_url,
    dir_name,
    n=5,
):
    from functions import check_legal
    check = check_legal.CheckLegalUse(
        filename,
        gist_url,
        dir_name,
        n,
    )
    allow, text = check.allowed_to_continue()
    if allow and not text:
        return True, check
    else:
        if text in ('INTERNET', 'SERIAL'):
            serial_win = SerialForm()
            serial_win.serial.setText(check.serial)
            serial_win.exec_()
            return False, check
        elif text == 'REGISTERED':
            msg = "Congrajulation! You are now registered, enjoy using this features!"
            QMessageBox.information(None, 'Registered', str(msg))
            return True, check
    return False, check
Exemplo n.º 4
0
    def register(self):
        from functions import check_legal
        check = check_legal.CheckLegalUse(
            'civiltools5.bin',
            'https://gist.githubusercontent.com/ebrahimraeyat/b8cbd078eb7b211e3154804a8bb77633/raw',
            'cfactor',
            serial=self.form.serial.text())
        text = check.submit()

        if text == 'INTERNET':
            msg = 'Please connect to the internet!'
        elif text == 'SERIAL':
            msg = 'You are not registered, Please Contact author to buy the software.'
        elif text == 'REGISTERED':
            msg = "Congrajulation! You are now registered, enjoy using CivilTools."
        QMessageBox.information(None, 'Registeration', msg)