def __init__(self, parent=None): super(TP_Launcher_GUI, self).__init__(parent) self._icons = QtWidgets.QFileIconProvider() self._my_path = os.path.dirname(os.path.realpath(__file__)) images_path = os.path.join(self._my_path, 'images') full_path = os.path.join(images_path, 'TPayne_Launcher.png') self._tpl_icon = QtGui.QIcon(full_path) self._tp_launcher = tp_launcher_model.TP_Launcher_Model() self._edit_op = {True: self._edit_on, False: self._edit_off} self._app_instruction = True self._file_dialogs = defaultdict(lambda: self._file_dialog) self._file_dialogs['PyQt4'] = self._file_dialog_pyqt4 self._dragging = None self._delete_op = { 'workspace': self._delete_workspace, 'application': self._delete_app } txt = 'TPayne_Experience' + QT_VER self._settings = QtCore.QSettings(txt, 'TPayne\'s_Launcher') name = '{}_{}_data.json'.format(PY_VER, QT_VER) path = os.path.join(self._my_path, 'data') self._json_file = os.path.join(path, name) d = defaultdict(lambda: self._get_settings) self._settings_op = defaultdict(lambda: d) self._settings_op['2.7']['PyQt4'] = self._get_settings_27_pyqt4 self._setup() self._load_settings() self._edit_toggle()
def __init__(self, parent=None): super(TP_Launcher_GUI, self).__init__(parent) self._icons = QtWidgets.QFileIconProvider() self._my_path = os.path.dirname(os.path.realpath(__file__)) images_path = os.path.join(self._my_path, 'images') full_path = os.path.join(images_path, 'TPayne_Launcher.png') self._tpl_icon = QtGui.QIcon(full_path) self._tp_launcher = tp_launcher_model.TP_Launcher_Model() self._setup() self._testing()
def __init__(self, parent=None): super(TP_Launcher_GUI, self).__init__(parent) self._icons = QtWidgets.QFileIconProvider() self._my_path = os.path.dirname(os.path.realpath(__file__)) images_path = os.path.join(self._my_path, 'images') full_path = os.path.join(images_path, 'TPayne_Launcher.png') self._tpl_icon = QtGui.QIcon(full_path) self._tp_launcher = tp_launcher_model.TP_Launcher_Model() self._edit_op = {True: self._edit_on, False: self._edit_off} self._app_instruction = True self._file_dialogs = defaultdict(lambda: self._file_dialog) self._file_dialogs['PyQt4'] = self._file_dialog_pyqt4 self._setup() self._testing() self._edit_toggle()
def __init__(self, parent=None): super(TP_Launcher_GUI, self).__init__(parent) # System and tool icons self._icons = QtWidgets.QFileIconProvider() self._my_path = os.path.dirname(os.path.realpath(__file__)) images_path = os.path.join(self._my_path, 'images') full_path = os.path.join(images_path, 'TPayne_Launcher.png') self._tpl_icon = QtGui.QIcon(full_path) # Data holding instance self._tp_launcher = tp_launcher_model.TP_Launcher_Model() # Toggle dictionary to replace 'if/else' statements self._edit_op = {True: self._edit_on, False: self._edit_off} self._app_instruction = True # Handle version specific file dialog box issues self._file_dialogs = defaultdict(lambda: self._file_dialog) self._file_dialogs['PyQt4'] = self._file_dialog_pyqt4 self._dragging = None self._delete_op = { 'workspace': self._delete_workspace, 'application': self._delete_app } # Settings and json file read/write stuff txt = 'TPayne_Experience' + QT_VER self._settings = QtCore.QSettings(txt, 'TPayne\'s_Launcher') name = '{}_{}_data.json'.format(PY_VER, QT_VER) path = os.path.join(self._my_path, 'data') self._json_file = os.path.join(path, name) # Handle version specific reading/writing settings d = defaultdict(lambda: self._get_settings) self._settings_op = defaultdict(lambda: d) self._settings_op['2.7']['PyQt4'] = self._get_settings_27_pyqt4 # Setup GUI, then load settings, then display editmode properly self._setup() self._load_settings() self._edit_toggle()