Example #1
0
    def _specify_hdd(self):
        """
        Specify which HDD to unmount.

        Arguments:
        None

        Return:
        HDD text
        """
        text, result = QInputDialog().getText(
            self,
            'Specify hdd',
            'choose hdd to unmount,\n"all" will unmount all mounted hdd\'s',
            QLineEdit.Normal,
            'all'
            )
        if result:
            text = text.lower()
            if text.startswith('hdd_'):
                return text
            elif text.startswith('hdd '):
                return text
            elif text == 'all':
                return text
            else:
                tu.message('Input needs to be "all" or "hdd_{number}" or "hdd {number}')
                return None
        else:
            tu.message('Input needs to be "all" or "hdd_{number} or "hdd {number}"')
            return None