Example #1
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)
     # offset value
     self.offset = QtWidgets.QTimeEdit()
     self.offset.setDisplayFormat("'h:'hh 'm:'mm 's:'ss")
     self.layout().addWidget(self.offset)
     # time zone
     self.time_zone = TimeZoneWidget()
     self.time_zone.set_value(None)
     self.layout().addWidget(self.time_zone)
     # add offset button
     add_button = SquareButton('+')
     add_button.clicked.connect(self.add)
     self.layout().addWidget(add_button)
     # subtract offset button
     sub_button = SquareButton('-')
     sub_button.clicked.connect(self.sub)
     self.layout().addWidget(sub_button)
     self.layout().addStretch(1)
     # restore stored values
     value = eval(self.config_store.get('technical', 'offset', 'None'))
     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)
Example #2
0
 def __init__(self, *args, **kw):
     super(LocationInfo, self).__init__(*args, **kw)
     layout = QtWidgets.QGridLayout()
     self.setLayout(layout)
     layout.setContentsMargins(0, 0, 0, 0)
     self.members = {
         'taken': LocationWidgets(self),
         'shown': LocationWidgets(self)
     }
     self.swap = SquareButton(six.unichr(0x21c4))
     self.swap.setStyleSheet('QPushButton { font-size: 10px }')
     set_symbol_font(self.swap)
     layout.addWidget(self.swap, 0, 4)
     label = QtWidgets.QLabel(translate('PhotiniMap', 'camera'))
     layout.addWidget(label, 0, 1, 1, 2)
     label = QtWidgets.QLabel(translate('PhotiniMap', 'subject'))
     layout.addWidget(label, 0, 3)
     layout.addWidget(QtWidgets.QLabel(translate('PhotiniMap', 'Street:')),
                      1, 0)
     layout.addWidget(QtWidgets.QLabel(translate('PhotiniMap', 'City:')), 2,
                      0)
     layout.addWidget(
         QtWidgets.QLabel(translate('PhotiniMap', 'Province:')), 3, 0)
     layout.addWidget(QtWidgets.QLabel(translate('PhotiniMap', 'Country:')),
                      4, 0)
     layout.addWidget(QtWidgets.QLabel(translate('PhotiniMap', 'Region:')),
                      5, 0)
     for ts, col in (('taken', 1), ('shown', 3)):
         layout.addWidget(self.members[ts]['sublocation'], 1, col, 1, 2)
         layout.addWidget(self.members[ts]['city'], 2, col, 1, 2)
         layout.addWidget(self.members[ts]['province_state'], 3, col, 1, 2)
         layout.addWidget(self.members[ts]['country_name'], 4, col)
         layout.addWidget(self.members[ts]['country_code'], 4, col + 1)
         layout.addWidget(self.members[ts]['world_region'], 5, col, 1, 2)
Example #3
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 = SquareButton(six.unichr(0x002b))
     add_button.setStyleSheet('QPushButton {padding: 0px}')
     set_symbol_font(add_button)
     scale_font(add_button, 170)
     add_button.clicked.connect(self.add)
     self.layout().addWidget(add_button)
     # subtract offset button
     sub_button = SquareButton(six.unichr(0x2212))
     sub_button.setStyleSheet('QPushButton {padding: 0px}')
     set_symbol_font(sub_button)
     scale_font(sub_button, 170)
     sub_button.clicked.connect(self.sub)
     self.layout().addWidget(sub_button)
     self.layout().addStretch(1)
     # restore stored values
     value = eval(self.config_store.get('technical', 'offset', 'None'))
     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)
Example #4
0
class LocationInfo(QtWidgets.QWidget):
    def __init__(self, *args, **kw):
        super(LocationInfo, self).__init__(*args, **kw)
        layout = QtWidgets.QGridLayout()
        self.setLayout(layout)
        layout.setContentsMargins(0, 0, 0, 0)
        self.members = {
            'taken': LocationWidgets(self),
            'shown': LocationWidgets(self)
        }
        self.swap = SquareButton(six.chr(0x21c4))
        self.swap.setStyleSheet('QPushButton { font-size: 10px }')
        self.swap.setFont(QtGui.QFont("Dejavu Sans"))
        if not self.swap.fontInfo().exactMatch():
            # probably on Windows, try a different font
            self.swap.setFont(QtGui.QFont("Segoe UI Symbol"))
        layout.addWidget(self.swap, 0, 4)
        label = QtWidgets.QLabel(translate('PhotiniMap', 'camera'))
        layout.addWidget(label, 0, 1, 1, 2)
        label = QtWidgets.QLabel(translate('PhotiniMap', 'subject'))
        layout.addWidget(label, 0, 3)
        layout.addWidget(QtWidgets.QLabel(translate('PhotiniMap', 'Street:')),
                         1, 0)
        layout.addWidget(QtWidgets.QLabel(translate('PhotiniMap', 'City:')), 2,
                         0)
        layout.addWidget(
            QtWidgets.QLabel(translate('PhotiniMap', 'Province:')), 3, 0)
        layout.addWidget(QtWidgets.QLabel(translate('PhotiniMap', 'Country:')),
                         4, 0)
        layout.addWidget(QtWidgets.QLabel(translate('PhotiniMap', 'Region:')),
                         5, 0)
        for ts, col in (('taken', 1), ('shown', 3)):
            layout.addWidget(self.members[ts]['sublocation'], 1, col, 1, 2)
            layout.addWidget(self.members[ts]['city'], 2, col, 1, 2)
            layout.addWidget(self.members[ts]['province_state'], 3, col, 1, 2)
            layout.addWidget(self.members[ts]['country_name'], 4, col)
            layout.addWidget(self.members[ts]['country_code'], 4, col + 1)
            layout.addWidget(self.members[ts]['world_region'], 5, col, 1, 2)

    def __getitem__(self, key):
        return self.members[key]