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(Workbench_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, 'Launcher.png') self._tpl_icon = QtGui.QIcon(full_path) self._workbench_launcher = workbench_model.Workbench_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 = f'Workbench Launcher {QT_VER}' self._settings = QtCore.QSettings(txt, 'Workbench_Launcher') name = f'{PY_VER}_{QT_VER}_data.json' 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._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._setup()
def __init__(self, parent=None): super(TP_Launcher_GUI, self).__init__(parent) self._icons = QtWidgets.QFileIconProvider( ) # The QFileIconProvider class provides file icons for the QDirModel and the QFileSystemModel classes. self._my_path = os.path.dirname( os.path.realpath(__file__)) # path to the file images_path = os.path.join(self._my_path, 'images') # path to the image full_path = os.path.join( images_path, 'TPayne_Launcher.png') # full path to the image self._tpl_icon = QtGui.QIcon( full_path ) # The PySide.QtGui.QIcon class provides scalable icons in different modes and states. # A PySide.QtGui.QIcon can generate smaller, # larger, active, and disabled pixmaps from the set of pixmaps it is given. # Such pixmaps are used by Qt widgets to show an icon representing a particular action. self._setup()
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()