Exemplo n.º 1
0
def popUpBoxTable(path):
    '''
    A pop-up window to confirm if one should save a table in ASCII

    path [string] is the displayed path to the new history file

    Will return buttonRole of pressed button
    '''

    msgBox = QMessageBox()

    msgBox.setText('Confirm the following action:')
    text = 'Save table in ASCII-format as:' + path
    msgBox.setInformativeText(text)

    msgBox.addButton(QMessageBox.Save)
    msgBox.addButton(QMessageBox.Cancel)

    msgBox.exec_()

    pressed_button = msgBox.clickedButton()
    return msgBox.buttonRole(pressed_button)
Exemplo n.º 2
0
def popUpBoxEdit(msg):
    '''
    A pop-up window to confirm if one should save tracked changes

    msg [string] is the displayed information in the window

    Will return buttonRole of pressed button

    '''

    msgBox = QMessageBox()

    msgBox.setText('Confirm saving your changes:')
    msgBox.setDetailedText(msg)

    save_button = msgBox.addButton(QMessageBox.Save)
    msgBox.addButton(QMessageBox.Cancel)
    msgBox.addButton(QMessageBox.Reset)

    msgBox.exec_()

    pressed_button = msgBox.clickedButton()
    return msgBox.buttonRole(pressed_button)