示例#1
0
 def search_terms(self):
     widget = QtWidgets.QLabel(
         translate('MapTabGoogle', 'Search and altitude lookup') +
         '\npowered by Google')
     widget.setAlignment(Qt.AlignRight)
     scale_font(widget, 80)
     return [widget]
示例#2
0
 def search_terms(self):
     widget = QtWidgets.QLabel(
         translate('MapTabBing',
                   'Search and altitude lookup\nprovided by Bing'))
     widget.setAlignment(Qt.AlignRight)
     scale_font(widget, 80)
     return [widget]
示例#3
0
 def __init__(self, path, image_list, thumb_size=80, *arg, **kw):
     super(Image, self).__init__(*arg, **kw)
     self.path = path
     self.image_list = image_list
     self.name, ext = os.path.splitext(os.path.basename(self.path))
     self.selected = False
     self.thumb_size = thumb_size
     # read metadata
     self.metadata = Metadata(self.path)
     self.metadata.unsaved.connect(self.show_status)
     self.file_times = (os.path.getatime(self.path),
                        os.path.getmtime(self.path))
     # set file type
     self.file_type = self.metadata.get_mime_type()
     if not self.file_type:
         self.file_type = mimetypes.guess_type(self.path)[0]
     if not self.file_type:
         self.file_type = imghdr.what(self.path)
         if self.file_type:
             self.file_type = 'image/' + self.file_type
     # anything not recognised is assumed to be 'raw'
     if not self.file_type:
         self.file_type = 'image/raw'
     # sub widgets
     layout = QtWidgets.QGridLayout()
     layout.setSpacing(0)
     layout.setContentsMargins(3, 3, 3, 3)
     self.setLayout(layout)
     self.setToolTip(self.path)
     # label to display image
     self.image = QtWidgets.QLabel()
     self.image.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
     layout.addWidget(self.image, 0, 0, 1, 2)
     # label to display file name
     self.label = QtWidgets.QLabel()
     self.label.setAlignment(Qt.AlignRight)
     scale_font(self.label, 80)
     layout.addWidget(self.label, 1, 1)
     # label to display status
     self.status = QtWidgets.QLabel()
     self.status.setAlignment(Qt.AlignLeft)
     set_symbol_font(self.status)
     scale_font(self.status, 80)
     layout.addWidget(self.status, 1, 0)
     self.setFrameStyle(QtWidgets.QFrame.Panel | QtWidgets.QFrame.Plain)
     self.setObjectName("thumbnail")
     self.set_selected(False)
     self.show_status(False)
     self._set_thumb_size(self.thumb_size)
示例#4
0
 def __init__(self, *arg, **kw):
     super(OffsetWidget, self).__init__(*arg, **kw)
     self.config_store = QtWidgets.QApplication.instance().config_store
     self.setLayout(QtWidgets.QHBoxLayout())
     self.layout().setContentsMargins(0, 0, 0, 0)
     spacing = self.layout().spacing()
     self.layout().setSpacing(0)
     # offset value
     self.offset = QtWidgets.QTimeEdit()
     self.offset.setDisplayFormat("'h:'hh 'm:'mm 's:'ss")
     self.layout().addWidget(self.offset)
     self.layout().addSpacing(spacing)
     # time zone
     self.time_zone = TimeZoneWidget()
     self.time_zone.set_value(None)
     self.layout().addWidget(self.time_zone)
     self.layout().addSpacing(spacing)
     # add offset button
     add_button = QtWidgets.QPushButton(chr(0x002b))
     add_button.setStyleSheet('QPushButton {padding: 0px}')
     set_symbol_font(add_button)
     scale_font(add_button, 170)
     add_button.setFixedWidth(self.offset.sizeHint().height())
     add_button.setFixedHeight(self.offset.sizeHint().height())
     add_button.clicked.connect(self.add)
     self.layout().addWidget(add_button)
     # subtract offset button
     sub_button = QtWidgets.QPushButton(chr(0x2212))
     sub_button.setStyleSheet('QPushButton {padding: 0px}')
     set_symbol_font(sub_button)
     scale_font(sub_button, 170)
     sub_button.setFixedWidth(self.offset.sizeHint().height())
     sub_button.setFixedHeight(self.offset.sizeHint().height())
     sub_button.clicked.connect(self.sub)
     self.layout().addWidget(sub_button)
     self.layout().addStretch(1)
     # restore stored values
     value = self.config_store.get('technical', 'offset')
     if value:
         self.offset.setTime(QtCore.QTime(*value[0:3]))
         self.time_zone.set_value(value[3])
     # connections
     self.offset.editingFinished.connect(self.new_value)
     self.time_zone.editingFinished.connect(self.new_value)
示例#5
0
 def __init__(self, path, image_list, thumb_size=80, *arg, **kw):
     super(Image, self).__init__(*arg, **kw)
     self.app = QtWidgets.QApplication.instance()
     self.path = path
     self.image_list = image_list
     self.name, ext = os.path.splitext(os.path.basename(self.path))
     self.selected = False
     self.thumb_size = thumb_size
     # read metadata
     self.metadata = Metadata(self.path,
                              notify=self.show_status,
                              utf_safe=self.app.options.utf_safe)
     self.file_times = (os.path.getatime(self.path),
                        os.path.getmtime(self.path))
     # set file type
     self.file_type = self.metadata.mime_type
     # sub widgets
     layout = QtWidgets.QGridLayout()
     layout.setSpacing(0)
     layout.setContentsMargins(3, 3, 3, 3)
     self.setLayout(layout)
     self.setToolTip(self.path)
     # label to display image
     self.image = QtWidgets.QLabel()
     self.image.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
     layout.addWidget(self.image, 0, 0, 1, 2)
     # label to display file name
     self.label = QtWidgets.QLabel()
     self.label.setAlignment(Qt.AlignRight)
     scale_font(self.label, 80)
     layout.addWidget(self.label, 1, 1)
     # label to display status
     self.status = QtWidgets.QLabel()
     self.status.setAlignment(Qt.AlignLeft)
     set_symbol_font(self.status)
     scale_font(self.status, 80)
     layout.addWidget(self.status, 1, 0)
     self.setFrameStyle(QtWidgets.QFrame.Panel | QtWidgets.QFrame.Plain)
     self.setObjectName("thumbnail")
     self.set_selected(False)
     self.show_status(False)
     self._set_thumb_size(self.thumb_size)
示例#6
0
 def search_terms(self):
     widget = QtWidgets.QLabel(self.tr('Search powered by Google'))
     scale_font(widget, 80)
     return '', widget