How to use the photini.pyqt.QtWidgets.QApplication.instance function in Photini

To help you get started, we’ve selected a few Photini examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jim-easterbrook / Photini / src / photini / loggerwindow.py View on Github external
def __init__(self, verbose, *arg, **kw):
        super(LoggerWindow, self).__init__(*arg, **kw)
        QtWidgets.QApplication.instance().aboutToQuit.connect(self.shutdown)
        self.setWindowTitle(self.tr("Photini error logging"))
        self.setLayout(QtWidgets.QVBoxLayout())
        # main dialog area
        self.text = QtWidgets.QTextEdit()
        self.text.setReadOnly(True)
        self.text.setMinimumWidth(width_for_text(self.text, 'x' * 70))
        self.layout().addWidget(self.text)
        # buttons
        button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Save | QtWidgets.QDialogButtonBox.Close)
        button_box.button(
            QtWidgets.QDialogButtonBox.Save).clicked.connect(self.save)
        button_box.button(
            QtWidgets.QDialogButtonBox.Close).clicked.connect(self.hide)
        self.layout().addWidget(button_box)
        # Python logger
github jim-easterbrook / Photini / src / photini / editsettings.py View on Github external
def __init__(self, *arg, **kw):
        super(EditSettings, self).__init__(*arg, **kw)
        self.config_store = QtWidgets.QApplication.instance().config_store
        self.setWindowTitle(self.tr('Photini: settings'))
        self.setLayout(QtWidgets.QVBoxLayout())
        # main dialog area
        scroll_area = QtWidgets.QScrollArea()
        self.layout().addWidget(scroll_area)
        panel = QtWidgets.QWidget()
        panel.setLayout(QtWidgets.QFormLayout())
        panel.layout().setRowWrapPolicy(max(QtWidgets.QFormLayout.WrapLongRows,
                                            panel.layout().rowWrapPolicy()))
        # apply & cancel buttons
        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Apply | QtWidgets.QDialogButtonBox.Cancel)
        self.button_box.clicked.connect(self.button_clicked)
        self.layout().addWidget(self.button_box)
        # copyright holder name
        self.copyright_name = SingleLineEdit(spell_check=True)
github jim-easterbrook / Photini / src / photini / technical.py View on Github external
def __init__(self, image_list, *arg, **kw):
        super(TabWidget, self).__init__(*arg, **kw)
        self.config_store = QtWidgets.QApplication.instance().config_store
        self.image_list = image_list
        self.setLayout(QtWidgets.QHBoxLayout())
        self.widgets = {}
        self.date_widget = {}
        self.link_widget = {}
        # store lens data in another object
        self.lens_data = LensData()
        # date and time
        date_group = QtWidgets.QGroupBox(
            translate('TechnicalTab', 'Date and time'))
        date_group.setLayout(QtWidgets.QFormLayout())
        # create date and link widgets
        for master in self._master_slave:
            self.date_widget[master] = DateAndTimeWidget(master)
            self.date_widget[master].new_value.connect(self.new_date_value)
            slave = self._master_slave[master]
github jim-easterbrook / Photini / src / photini / picasa.py View on Github external
def __init__(self, *arg, **kw):
        self.upload_config = PicasaUploadConfig()
        super(PicasaUploader, self).__init__(self.upload_config, *arg, **kw)
##        self.upload_config.delete_album.connect(self.delete_album)
##        self.upload_config.new_album.connect(self.new_album)
        self.upload_config.select_album.connect(self.select_album)
##        self.upload_config.update_album.connect(self.update_album)
        QtWidgets.QApplication.instance().aboutToQuit.connect(self.save_changes)
        self.service_name = self.tr('Google Photos')
        self.image_types = {
            'accepted': ('image/bmp', 'image/gif', 'image/jpeg', 'image/png'),
            'rejected': '*',
            }
        # timer to store album data after it's edited
        self.album_changed = False
        self.timer = QtCore.QTimer(self)
        self.timer.setSingleShot(True)
        self.timer.setInterval(5000)
        self.timer.timeout.connect(self.save_changes)
github jim-easterbrook / Photini / src / photini / gpximporter.py View on Github external
self.tr("GPX files (*.gpx *.GPX *.Gpx);;All files (*)")
            ]
        if eval(parent.app.config_store.get('pyqt', 'native_dialog', 'True')):
            pass
        elif qt_version_info >= (5, 0):
            args += [None, QtWidgets.QFileDialog.DontUseNativeDialog]
        else:
            args += [QtWidgets.QFileDialog.DontUseNativeDialog]
        path = QtWidgets.QFileDialog.getOpenFileName(*args)
        if qt_version_info >= (5, 0):
            path = path[0]
        if not path:
            return
        parent.app.config_store.set('paths', 'gpx', os.path.dirname(path))
        # get user options
        config_store = QtWidgets.QApplication.instance().config_store
        dialog = QtWidgets.QDialog(parent=parent)
        dialog.setWindowTitle(self.tr('GPX options'))
        dialog.setLayout(QtWidgets.QFormLayout())
        max_interval = QtWidgets.QSpinBox()
        max_interval.setRange(60, 300)
        max_interval.setValue(
            int(config_store.get('gpx_importer', 'interval', '120')))
        max_interval.setSuffix(self.tr(' secs'))
        dialog.layout().addRow(self.tr('Max time between points'), max_interval)
        max_dilution = QtWidgets.QDoubleSpinBox()
        max_dilution.setRange(1.0, 100.0)
        max_dilution.setValue(
            float(config_store.get('gpx_importer', 'dilution', '2.5')))
        max_dilution.setSingleStep(0.1)
        dialog.layout().addRow(
            self.tr('Max dilution of precision'), max_dilution)
github jim-easterbrook / Photini / src / photini / photinimap.py View on Github external
def __init__(self, *args, **kwds):
        super(GeocoderBase, self).__init__(*args, **kwds)
        self.app = QtWidgets.QApplication.instance()
        self.block_timer = QtCore.QTimer(self)
        self.block_timer.setInterval(self.interval)
        self.block_timer.setSingleShot(True)