Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.widgets['album_choose'] = QtWidgets.QComboBox()
self.widgets['album_choose'].activated.connect(self.select_album)
album_form_left.addRow(self.tr('Title'), self.widgets['album_choose'])
# album description
self.widgets['album_description'] = QtWidgets.QPlainTextEdit()
self.widgets['album_description'].setReadOnly(True)
policy = self.widgets['album_description'].sizePolicy()
policy.setVerticalStretch(1)
self.widgets['album_description'].setSizePolicy(policy)
album_form_left.addRow(self.tr('Description'), self.widgets['album_description'])
# album location
self.widgets['album_location'] = QtWidgets.QLineEdit()
self.widgets['album_location'].setReadOnly(True)
album_form_left.addRow(self.tr('Location'), self.widgets['album_location'])
# right hand side
album_form_right = QtWidgets.QVBoxLayout()
album_group.layout().addLayout(album_form_right)
# album thumbnail
self.widgets['album_thumb'] = QtWidgets.QLabel()
self.widgets['album_thumb'].setFixedSize(150, 150)
self.widgets['album_thumb'].setAlignment(Qt.AlignHCenter | Qt.AlignTop)
album_form_right.addWidget(self.widgets['album_thumb'])
album_form_right.addStretch(1)
# new album
new_album_button = QtWidgets.QPushButton(self.tr('New album'))
new_album_button.clicked.connect(self.new_album)
album_form_right.addWidget(new_album_button)
self.layout().addWidget(album_group, stretch=1)
def __init__(self, images, *arg, **kw):
super(NewLensDialog, self).__init__(*arg, **kw)
self.setWindowTitle(translate('TechnicalTab', 'Photini: define lens'))
self.setLayout(QtWidgets.QVBoxLayout())
# main dialog area
scroll_area = QtWidgets.QScrollArea()
scroll_area.setWidgetResizable(True)
self.layout().addWidget(scroll_area)
panel = QtWidgets.QWidget()
panel.setLayout(QtWidgets.QFormLayout())
panel.layout().setFieldGrowthPolicy(
QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
# ok & cancel buttons
button_box = QtWidgets.QDialogButtonBox(
QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel)
button_box.accepted.connect(self.accept)
button_box.rejected.connect(self.reject)
self.layout().addWidget(button_box)
# model
self.lens_model = QtWidgets.QLineEdit()
self.setLayout(QtWidgets.QGridLayout())
self.layout().setContentsMargins(0, 0, 0, 0)
# create new set
new_set_button = QtWidgets.QPushButton(
translate('GooglePhotosTab', 'New album'))
new_set_button.clicked.connect(self.new_set)
self.layout().addWidget(new_set_button, 2, 1)
# list of sets widget
sets_group = QtWidgets.QGroupBox(
translate('GooglePhotosTab', 'Add to albums'))
sets_group.setLayout(QtWidgets.QVBoxLayout())
scrollarea = QtWidgets.QScrollArea()
scrollarea.setFrameStyle(QtWidgets.QFrame.NoFrame)
scrollarea.setStyleSheet("QScrollArea { background-color: transparent }")
self.sets_widget = QtWidgets.QWidget()
self.sets_widget.setLayout(QtWidgets.QVBoxLayout())
self.sets_widget.layout().setSpacing(0)
self.sets_widget.layout().setSizeConstraint(
QtWidgets.QLayout.SetMinAndMaxSize)
scrollarea.setWidget(self.sets_widget)
self.sets_widget.setAutoFillBackground(False)
sets_group.layout().addWidget(scrollarea)
self.layout().addWidget(sets_group, 0, 2, 3, 1)
self.layout().setColumnStretch(2, 1)
if name_pred == ID_TAG:
break
else:
# new upload
return {
'set_metadata' : True,
'set_visibility': True,
'set_type' : True,
'set_albums' : True,
'replace_image' : False,
'new_photo' : True,
}, None
# get user preferences
dialog = QtWidgets.QDialog(parent=self)
dialog.setWindowTitle(translate('FlickrTab', 'Replace photo'))
dialog.setLayout(QtWidgets.QVBoxLayout())
message = QtWidgets.QLabel(translate(
'FlickrTab', 'File {0} has already been uploaded to Flickr.'
' How would you like to update it?').format(
os.path.basename(image.path)))
message.setWordWrap(True)
dialog.layout().addWidget(message)
widget = {}
widget['set_metadata'] = QtWidgets.QCheckBox(
translate('FlickrTab', 'Replace metadata'))
widget['set_visibility'] = QtWidgets.QCheckBox(
translate('FlickrTab', 'Change who can see it'))
widget['set_type'] = QtWidgets.QCheckBox(
translate('FlickrTab', 'Change content type'))
widget['set_albums'] = QtWidgets.QCheckBox(
translate('FlickrTab', 'Change album membership'))
widget['replace_image'] = QtWidgets.QCheckBox(
def show_terms(self):
# return widget to display map terms and conditions
layout = QtWidgets.QVBoxLayout()
widget = QtWidgets.QLabel(self.tr('Search powered by Google'))
widget.setStyleSheet('QLabel { font-size: 10px }')
layout.addWidget(widget)
widget = QtWidgets.QPushButton(self.tr('Terms of Use'))
widget.clicked.connect(self.load_tou)
widget.setStyleSheet('QPushButton { font-size: 10px }')
layout.addWidget(widget)
return layout
def show_terms(self):
# return widget to display map terms and conditions
layout = QtWidgets.QVBoxLayout()
widget = QtWidgets.QPushButton(self.tr('Terms of Use'))
widget.clicked.connect(self.load_tou)
widget.setStyleSheet('QPushButton { font-size: 10px }')
layout.addWidget(widget)
return layout
def __init__(self, *arg, **kw):
super(FacebookLoginPopup, self).__init__(*arg, **kw)
self.setSizePolicy(
QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
self.setLayout(QtWidgets.QVBoxLayout())
self.browser = WebView()
self.browser.urlChanged.connect(self.auth_url_changed)
self.layout().addWidget(self.browser)
buttons = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Cancel)
buttons.rejected.connect(self.reject)
self.layout().addWidget(buttons)
def __init__(self, upload_config_widget, image_list, *arg, **kw):
super(PhotiniUploader, self).__init__(*arg, **kw)
self.app = QtWidgets.QApplication.instance()
self.app.aboutToQuit.connect(self.shutdown)
logger.debug('using %s', keyring.get_keyring().__module__)
self.image_list = image_list
self.setLayout(QtWidgets.QGridLayout())
self.session = self.session_factory()
self.session.connection_changed.connect(self.connection_changed)
self.upload_worker = None
# user details
self.user = {}
user_group = QtWidgets.QGroupBox(translate('UploaderTabsAll', 'User'))
user_group.setLayout(QtWidgets.QVBoxLayout())
self.user_photo = QtWidgets.QLabel()
self.user_photo.setAlignment(Qt.AlignHCenter | Qt.AlignTop)
user_group.layout().addWidget(self.user_photo)
self.user_name = QtWidgets.QLabel()
self.user_name.setWordWrap(True)
self.user_name.setFixedWidth(80)
user_group.layout().addWidget(self.user_name)
user_group.layout().addStretch(1)
self.layout().addWidget(user_group, 0, 0, 1, 2)
# connect / disconnect button
self.user_connect = StartStopButton(
translate('UploaderTabsAll', 'Log in'),
translate('UploaderTabsAll', 'Log out'))
self.user_connect.click_start.connect(self.log_in)
self.user_connect.click_stop.connect(self.session.log_out)
self.layout().addWidget(self.user_connect, 1, 0, 1, 2)
self.sync_button.clicked.connect(self.sync_metadata)
self.layout().addWidget(self.sync_button, 1, 1)
# create new set
new_set_button = QtWidgets.QPushButton(
translate('FlickrTab', 'New album'))
new_set_button.clicked.connect(self.new_set)
self.layout().addWidget(new_set_button, 2, 1)
# list of sets widget
sets_group = QtWidgets.QGroupBox(
translate('FlickrTab', 'Add to albums'))
sets_group.setLayout(QtWidgets.QVBoxLayout())
scrollarea = QtWidgets.QScrollArea()
scrollarea.setFrameStyle(QtWidgets.QFrame.NoFrame)
scrollarea.setStyleSheet("QScrollArea { background-color: transparent }")
self.sets_widget = QtWidgets.QWidget()
self.sets_widget.setLayout(QtWidgets.QVBoxLayout())
self.sets_widget.layout().setSpacing(0)
self.sets_widget.layout().setSizeConstraint(
QtWidgets.QLayout.SetMinAndMaxSize)
scrollarea.setWidget(self.sets_widget)
self.sets_widget.setAutoFillBackground(False)
sets_group.layout().addWidget(scrollarea)
self.layout().addWidget(sets_group, 0, 2, 3, 1)
self.layout().setColumnStretch(2, 1)