Ejemplo n.º 1
0
    def __init__(self, parent=None):
        QDialog.__init__(self, parent)
        layout = QVBoxLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        self._iconView = QdThumbnailView(self)
        self._progress = QProgressBar(self)
        self._progress.setFormat("Generating thumbnails: %v of %m")
        self._progress.hide()

        layout.addWidget(self._iconView)
        layout.addWidget(self._progress)

        self._iconView.doubleClicked.connect(self._itemDoubleClicked)
        self._iconView.loading.connect(self.updateProgress)

        self.setWindowTitle("Apis Thumb Viewer")
        self.setModal(True)
        # Initial window size/pos last saved. Use default values for first time
        if GetWindowSize("thumb_viewer"):
            self.resize(GetWindowSize("thumb_viewer"))
        else:
            self.resize(1000, 600)
        if GetWindowPos("thumb_viewer"):
            self.move(GetWindowPos("thumb_viewer"))

        self.rejected.connect(self.onClose)
Ejemplo n.º 2
0
    def __init__(self, iface, model, dbm, imageRegistry, parent=None):
        """Constructor."""
        super(APISFilmSelectionList, self).__init__(parent)

        self.iface = iface
        # self.model = model
        self.dbm = dbm
        self.imageRegistry = imageRegistry

        self.setupUi(self)

        # Initial window size/pos last saved. Use default values for first time
        if GetWindowSize("film_selection_list"):
            self.resize(GetWindowSize("film_selection_list"))
        if GetWindowPos("film_selection_list"):
            self.move(GetWindowPos("film_selection_list"))

        self.settings = QSettings(QSettings().value("APIS/config_ini"),
                                  QSettings.IniFormat)

        self.printingOptionsDlg = None

        self.uiDisplayFlightPathBtn.clicked.connect(
            lambda: parent.openFlightPathDialog(self.getFilmList(), self))

        self.uiResetSelectionBtn.clicked.connect(
            self.uiFilmListTableV.clearSelection)

        mPdfExport = QMenu()
        aPdfExportFilmList = mPdfExport.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'pdf_export.png')), "Filmliste")
        aPdfExportFilmList.triggered.connect(
            lambda: self.exportAsPdf(tab_list=True))
        aPdfExportFilm = mPdfExport.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'pdf_export.png')), "Film")
        aPdfExportFilm.triggered.connect(lambda: self.exportAsPdf(detail=True))
        self.uiPdfExportTBtn.setMenu(mPdfExport)
        self.uiPdfExportTBtn.clicked.connect(self.uiPdfExportTBtn.showMenu)

        self.accepted.connect(self.onAccepted)
        self.rejected.connect(self.onRejected)
Ejemplo n.º 3
0
    def __init__(self, country, parent=None):
        """Constructor."""
        super(APISChronology, self).__init__(parent)
        self.candidateCountry = country
        self.setupUi(self)

        # Initial window size/pos last saved. Use default values for first time
        if GetWindowSize("chronology"):
            self.resize(GetWindowSize("chronology"))
        if GetWindowPos("chronology"):
            self.move(GetWindowPos("chronology"))

        self.settings = QSettings(QSettings().value("APIS/config_ini"),
                                  QSettings.IniFormat)

        self.currentChronology = None
        self.chronologiesDir = None
        self.isSetup = False
        self.uiChronologyCombo.currentIndexChanged.connect(
            self.updateChronology)
        self.accepted.connect(self.onAccepted)
        self.rejected.connect(self.onRejected)

        self.loadAvailableChronologies()
    def __init__(self, iface, dbm, imageRegistry, apisLayer, parent=None):
        """Constructor."""
        super(APISFindspotSelectionList, self).__init__(parent)
        self.iface = iface
        self.dbm = dbm
        self.imageRegistry = imageRegistry
        self.apisLayer = apisLayer
        self.settings = QSettings(QSettings().value("APIS/config_ini"),
                                  QSettings.IniFormat)
        self.setupUi(self)

        # Initial window size/pos last saved. Use default values for first time
        if GetWindowSize("findspot_selection_list"):
            self.resize(GetWindowSize("findspot_selection_list"))
        if GetWindowPos("findspot_selection_list"):
            self.move(GetWindowPos("findspot_selection_list"))

        self.query = None

        self.accepted.connect(self.onClose)
        self.rejected.connect(self.onClose)

        self.uiFindspotListTableV.doubleClicked.connect(
            self.openFindspotDialog)

        self.uiResetSelectionBtn.clicked.connect(
            self.uiFindspotListTableV.clearSelection)

        mLayer = QMenu()
        mLayer.addSection("In QGIS laden")
        aLayerLoadFindspot = mLayer.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'layer.png')), "Fundstelle(n)")
        aLayerLoadFindspot.triggered.connect(self.loadFindspotInQgis)
        mLayer.addSection("SHP Export")
        aLayerExportFindspot = mLayer.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'shp_export.png')), "Fundstelle(n)")
        aLayerExportFindspot.triggered.connect(self.exportFindspotAsShp)
        mLayer.addSection("In QGIS anzeigen")
        aLayerShowFindspot = mLayer.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'layer.png')), "Zu Fundstelle(n) zoomen")
        aLayerShowFindspot.triggered.connect(
            lambda: self.showFindspotInQgis(zoomTo=True, select=False))
        aLayerSelectFindspot = mLayer.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'layer.png')),
            "Fundstelle(n) selektieren")
        aLayerSelectFindspot.triggered.connect(
            lambda: self.showFindspotInQgis(zoomTo=False, select=True))
        aLayerShowAndSelectFindspot = mLayer.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'layer.png')),
            "Zu Fundstelle(n) zoomen und selektieren")
        aLayerShowAndSelectFindspot.triggered.connect(
            lambda: self.showFindspotInQgis(zoomTo=True, select=True))
        self.uiLayerTBtn.setMenu(mLayer)
        self.uiLayerTBtn.clicked.connect(self.uiLayerTBtn.showMenu)

        mPdfExport = QMenu()
        aPdfExportFindspotList = mPdfExport.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'pdf_export.png')), "Fundstellenliste")
        aPdfExportFindspotList.triggered.connect(
            lambda: self.exportAsPdf(tab_list=True))
        aPdfExportFindspot = mPdfExport.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'pdf_export.png')), "Fundstelle")
        aPdfExportFindspot.triggered.connect(
            lambda: self.exportAsPdf(detail=True))
        aPdfExportFindspotAndSite = mPdfExport.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'pdf_export.png')),
            "Fundstelle und Fundort")
        aPdfExportFindspotAndSite.triggered.connect(
            lambda: self.exportAsPdf(detail=True, parentDetail=True))
        self.uiPdfExportTBtn.setMenu(mPdfExport)
        self.uiPdfExportTBtn.clicked.connect(self.uiPdfExportTBtn.showMenu)

        self.findspotDlg = None
        self.printingOptionsDlg = None
Ejemplo n.º 5
0
    def __init__(self, iface, dbm, imageRegistry, apisLayer, parent=None):
        """Constructor."""
        super(APISFilm, self).__init__(parent)

        self.iface = iface
        self.dbm = dbm
        self.imageRegistry = imageRegistry
        self.apisLayer = apisLayer

        self.parent = parent

        self.setupUi(self)

        # Initial window size/pos last saved. Use default values for first time
        if GetWindowSize("film"):
            self.resize(GetWindowSize("film"))
        if GetWindowPos("film"):
            self.move(GetWindowPos("film"))

        self.printingOptionsDlg = None

        self.settings = QSettings(QSettings().value("APIS/config_ini"), QSettings.IniFormat)

        self.editMode = False
        self.addMode = False
        self.initalLoad = True

        #self.uiInitalEntryQgsDate.setCalendarPopup(False)
        #self.uiLastChangesQgsDate.setCalendarPopup(False)

        # Signals/Slot Connections
        self.rejected.connect(self.onReject)
        self.uiOkBtn.clicked.connect(self.onAccept)
        self.uiCancelBtn.clicked.connect(self.cancelEdit)
        self.uiSaveBtn.clicked.connect(self.saveEdits)

        self.uiFilmSelectionBtn.clicked.connect(self.openFilmSelectionDialog)

        self.uiNewFilmBtn.clicked.connect(self.openNewFilmDialog)
        self.uiSearchFilmBtn.clicked.connect(self.openSearchFilmDialog)
        self.uiEditWeatherBtn.clicked.connect(self.openEditWeatherDialog)

        self.uiExportPdfBtn.clicked.connect(self.exportDetailsPdf)

        self.uiShowFlightPathBtn.clicked.connect(lambda: self.openFlightPathDialog([self.uiCurrentFilmNumberEdit.text()]))

        # For LaLe Mode
        if self.settings.value("APIS/disable_site_and_findspot", "0") != "1":
            self.uiListSitesOfFilmBtn.setEnabled(True)
            self.uiListSitesOfFilmBtn.clicked.connect(self.openSiteSelectionListDialog)
        else:
            self.uiListSitesOfFilmBtn.setEnabled(False)

        self.uiListImagesOfFilmBtn.clicked.connect(self.openImageSelectionListDialog)
        self.uiExtractGpsFromImagesBtn.clicked.connect(self.extractGpsFromImages)

        self.uiWeatherCodeEdit.textChanged.connect(self.generateWeatherCode)
        self.uiFilmModeCombo.currentIndexChanged.connect(self.onFilmModeChanged)

        self.uiEditProjectTableBtn.clicked.connect(lambda: self.openSystemTableEditorDialog("projekt", self.uiProjectSelectionCombo))
        self.uiEditCopyrightTableBtn.clicked.connect(lambda: self.openSystemTableEditorDialog("copyright", self.uiCopyrightCombo))
        # self.uiEditProjectTableBtn.clicked.connect(lambda: VersionToCome())
        # self.uiEditCopyrightTableBtn.clicked.connect(lambda: VersionToCome())

        # init Project Btn
        self.uiAddProjectBtn.clicked.connect(self.addProject)
        self.uiRemoveProjectBtn.clicked.connect(self.removeProject)

        # Setup Sub-Dialogs
        self.filmSelectionDlg = APISFilmNumberSelection(self)
        self.newFilmDlg = APISFilmNew(parent=self)
        self.searchFilmDlg = APISFilmSearch(self.dbm, self)  # (self.iface, self.dbm)
        self.editWeatherDlg = APISWeather(self.iface, self.dbm, self)
        self.flightPathDlg = APISFlightPath(self.iface, self.dbm, self.apisLayer, self)
        self.siteSelectionListDlg = APISSiteSelectionList(self.iface, self.dbm, self.imageRegistry, self.apisLayer, self)
        self.imageSelectionListDlg = APISImageSelectionList(self.iface, self.dbm, self.imageRegistry,  self.apisLayer, parent=self)
        self.systemTableEditorDlg = None

        # Setup film model
        self.model = QSqlRelationalTableModel(self, self.dbm.db)
        self.model.setTable("film")
        self.model.select()

        while (self.model.canFetchMore()):
            self.model.fetchMore()

        self.setupMapper()
        self.setupComboBox(self.uiProjectSelectionCombo, "projekt", 0, None)

        self.setupComboBox(self.newFilmDlg.uiProducerCombo, "hersteller", 2, None)

        self.setupNavigation()

        self.mapper.toFirst()

        self.initalLoad = False
Ejemplo n.º 6
0
    def __init__(self, iface, dbm, apisLayer, parent=None):
        """Constructor."""
        super(APISFlightPath, self).__init__(parent)
        self.iface = iface
        self.dbm = dbm
        self.apisLayer = apisLayer
        self.setupUi(self)

        # Initial window size/pos last saved. Use default values for first time
        if GetWindowSize("flight_path"):
            self.resize(GetWindowSize("flight_path"))
        if GetWindowPos("flight_path"):
            self.move(GetWindowPos("flight_path"))

        self.filmsDict = {}
        self.settings = QSettings(QSettings().value("APIS/config_ini"),
                                  QSettings.IniFormat)

        self.uiLayerTBtn.setEnabled(False)

        self.shpDriver = ogr.GetDriverByName('ESRI Shapefile')

        self.rejected.connect(self.onClose)
        self.accepted.connect(self.onClose)

        mSelect = QMenu()
        mSelect.addSection("Linien")
        aSelectBestAvailableLine = mSelect.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'flightpath.png')),
            "Beste Verfügbarkeit")
        aSelectBestAvailableLine.triggered.connect(
            lambda: self.selectBestAvailable([2, 4, 6]))
        aSelectFlightGpsPoint = mSelect.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'flightpath.png')), "GPS Flug")
        aSelectFlightGpsPoint.triggered.connect(
            lambda: self.selectColumns([2]))
        aSelectCameraGpsPoint = mSelect.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'flightpath.png')), "GPS Kamera")
        aSelectCameraGpsPoint.triggered.connect(
            lambda: self.selectColumns([4]))
        aSelectImageMappingPoint = mSelect.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'flightpath.png')), "Bildkartierung")
        aSelectImageMappingPoint.triggered.connect(
            lambda: self.selectColumns([6]))
        mSelect.addSection("Punkte")
        aSelectBestAvailablePoint = mSelect.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'flightpath.png')),
            "Beste Verfügbarkeit")
        aSelectBestAvailablePoint.triggered.connect(
            lambda: self.selectBestAvailable([1, 3, 5]))
        aSelectFlightGpsPoint = mSelect.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'flightpath.png')), "GPS Flug")
        aSelectFlightGpsPoint.triggered.connect(
            lambda: self.selectColumns([1]))
        aSelectCameraGpsPoint = mSelect.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'flightpath.png')), "GPS Kamera")
        aSelectCameraGpsPoint.triggered.connect(
            lambda: self.selectColumns([3]))
        aSelectImageMappingPoint = mSelect.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'flightpath.png')), "Bildkartierung")
        aSelectImageMappingPoint.triggered.connect(
            lambda: self.selectColumns([5]))
        mSelect.addSeparator()
        aSelectDeselectAll = mSelect.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'flightpath.png')), "Alle auswählen")
        aSelectDeselectAll.triggered.connect(lambda: self.selectAll(True))
        aSelectAll = mSelect.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'flightpath.png')), "Alle zurücksetzen")
        aSelectAll.triggered.connect(lambda: self.selectAll(False))
        self.uiSelectionTBtn.setMenu(mSelect)
        self.uiSelectionTBtn.clicked.connect(self.uiSelectionTBtn.showMenu)

        mLayer = QMenu()
        aLoadLayerInQgis = mLayer.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'layer.png')), "In QGIS laden")
        aLoadLayerInQgis.triggered.connect(self.loadLayerInQgis)
        aExportLayerAsShp = mLayer.addAction(
            QIcon(
                os.path.join(QSettings().value("APIS/plugin_dir"), 'ui',
                             'icons', 'shp_export.png')),
            "Als SHP Datei exportieren")
        aExportLayerAsShp.triggered.connect(self.exportLayerAsShp)
        self.uiLayerTBtn.setMenu(mLayer)
        self.uiLayerTBtn.clicked.connect(self.uiLayerTBtn.showMenu)