示例#1
0
 def __init__(self):
     QObject.__init__(self)
     self.mPlugins = {}  # the dict of plugins (dicts)
     self.repoCache = {}  # the dict of lists of plugins (dicts)
     self.localCache = {}  # the dict of plugins (dicts)
     self.obsoletePlugins = [
     ]  # the list of outdated 'user' plugins masking newer 'system' ones
示例#2
0
文件: db_model.py 项目: lidi100/QGIS
 def __init__(self, data, parent=None):
     QObject.__init__(self, parent)
     self.populated = False
     self.itemData = data
     self.childItems = []
     if parent:
         parent.appendChild(self)
示例#3
0
    def __init__(self):
        QObject.__init__(self)
        if LayerRegistry._instance is not None:
            return

        LayerRegistry.layers = self.getAllLayers()
        LayerRegistry._instance = self
        QgsMapLayerRegistry.instance().removeAll.connect(self.removeAllLayers)
        QgsMapLayerRegistry.instance().layerWasAdded.connect(self.layerAdded)
        QgsMapLayerRegistry.instance().layerWillBeRemoved.connect(self.removeLayer)
示例#4
0
    def __init__(self):
        QObject.__init__(self)
        if LayerRegistry._instance is not None:
            return

        LayerRegistry.layers = self.getAllLayers()
        LayerRegistry._instance = self
        QgsMapLayerRegistry.instance().removeAll.connect(self.removeAllLayers)
        QgsMapLayerRegistry.instance().layerWasAdded.connect(self.layerAdded)
        QgsMapLayerRegistry.instance().layerWillBeRemoved.connect(
            self.removeLayer)
示例#5
0
    def __init__(self):
        """ Initialize data objects, starts fetching if appropriate, and warn about/removes obsolete plugins """

        QObject.__init__(self)  # initialize QObject in order to to use self.tr()
        repositories.load()
        plugins.getAllInstalled()

        if repositories.checkingOnStart() and repositories.timeForChecking() and repositories.allEnabled():
            # start fetching repositories
            self.statusLabel = QLabel(self.tr("Looking for new plugins...") + " ", iface.mainWindow().statusBar())
            iface.mainWindow().statusBar().insertPermanentWidget(0, self.statusLabel)
            self.statusLabel.linkActivated.connect(self.showPluginManagerWhenReady)
            repositories.checkingDone.connect(self.checkingDone)
            for key in repositories.allEnabled():
                repositories.requestFetching(key)
        else:
            # no fetching at start, so mark all enabled repositories as requesting to be fetched.
            for key in repositories.allEnabled():
                repositories.setRepositoryData(key, "state", 3)

        # look for obsolete plugins (the user-installed one is newer than core one)
        for key in plugins.obsoletePlugins:
            plugin = plugins.localCache[key]
            msg = QMessageBox()
            msg.setIcon(QMessageBox.Warning)
            msg.setWindowTitle(self.tr("QGIS Python Plugin Installer"))
            msg.addButton(self.tr("Uninstall (recommended)"), QMessageBox.AcceptRole)
            msg.addButton(self.tr("I will uninstall it later"), QMessageBox.RejectRole)
            msg.setText("%s <b>%s</b><br/><br/>%s" % (self.tr("Obsolete plugin:"), plugin["name"], self.tr("QGIS has detected an obsolete plugin that masks its more recent version shipped with this copy of QGIS. This is likely due to files associated with a previous installation of QGIS. Do you want to remove the old plugin right now and unmask the more recent version?")))
            msg.exec_()
            if not msg.result():
                # uninstall, update utils and reload if enabled
                self.uninstallPlugin(key, quiet=True)
                updateAvailablePlugins()
                settings = QSettings()
                if settings.value("/PythonPlugins/" + key, False, type=bool):
                    settings.setValue("/PythonPlugins/watchDog/" + key, True)
                    loadPlugin(key)
                    startPlugin(key)
                    settings.remove("/PythonPlugins/watchDog/" + key)
示例#6
0
 def __init__(self, tag=None):
     QObject.__init__(self)
     self.log = []
     self.tag = tag
示例#7
0
文件: plugin.py 项目: dwadler/QGIS
 def __init__(self, conn_name, parent=None):
     QObject.__init__(self, parent)
     self.connName = conn_name
     self.db = None
示例#8
0
文件: plugin.py 项目: dwadler/QGIS
 def __init__(self, parent=None):
     QObject.__init__(self, parent)
示例#9
0
文件: plugin.py 项目: dwadler/QGIS
 def __init__(self, table):
     QObject.__init__(self, table)
示例#10
0
 def __init__(self, canvas):
     """Constructor"""
     QObject.__init__(self)
     self.canvas = canvas
示例#11
0
 def __init__(self):
     QObject.__init__(self)
     self.mRepositories = {}
     self.httpId = {}   # {httpId : repoName}
     self.mInspectionFilter = None
示例#12
0
 def eventFilter(self, obj, event):
     if event.type() == QEvent.FocusIn:
         self.focus = obj.objectName()
     return QObject.eventFilter(self, obj, event)
示例#13
0
 def __init__(self, key):
     QObject.__init__(self)
     self.key = key
示例#14
0
 def __init__(self):
     QObject.__init__(self)
     self.mRepositories = {}
     self.httpId = {}  # {httpId : repoName}
     self.mInspectionFilter = None
 def __init__(self, tag=None):
     QObject.__init__(self)
     self.log = []
     self.tag = tag
示例#16
0
    def __init__(self, iface, db, parent=None, reset=False):
        QDialog.__init__(self, parent)
        self.iface = iface
        self.db = db
        self.query = ''
        self.ui = Ui_Dialog()
        self.ui.setupUi(self)
        self.ui.group.setMaximumHeight(self.ui.tab.sizeHint().height())
        self.ui.order.setMaximumHeight(self.ui.tab.sizeHint().height())

        self.evt = FocusEventFilter(self)
        self.ui.col.installEventFilter(self.evt)
        self.ui.where.installEventFilter(self.evt)
        self.ui.group.installEventFilter(self.evt)
        self.ui.order.installEventFilter(self.evt)

        d = self.db.connector.getQueryBuilderDictionary()
        #Application default parameters
        self.table = None
        self.col_col = []
        self.col_where = []
        self.coltables = []
        self.ui.extract.setChecked(True)
        #ComboBox default values
        self.ui.functions.insertItems(1, d['function'])
        self.ui.math.insertItems(1, d['math'])
        self.ui.aggregates.insertItems(1, d['aggregate'])
        self.ui.operators.insertItems(1, d['operator'])
        self.ui.stringfct.insertItems(1, d['string'])
        #self.ui.Rtree.insertItems(1,rtreecommand)

        # restore last query if needed
        if reset:
            QueryBuilderDlg.saveParameter = None
        if QueryBuilderDlg.saveParameter is not None:
            self.restoreLastQuery()

        #Show Tables
        self.show_tables()

        #Signal/slot
        QObject.connect(self.ui.aggregates, SIGNAL("currentIndexChanged(const QString&)"), self.add_aggregate)
        QObject.connect(self.ui.stringfct, SIGNAL("currentIndexChanged(const QString&)"), self.add_stringfct)
        QObject.connect(self.ui.operators, SIGNAL("currentIndexChanged(const QString&)"), self.add_operators)
        QObject.connect(self.ui.functions, SIGNAL("currentIndexChanged(const QString&)"), self.add_functions)
        QObject.connect(self.ui.math, SIGNAL("currentIndexChanged(const QString&)"), self.add_math)
        QObject.connect(self.ui.tables, SIGNAL("currentIndexChanged(const QString&)"), self.add_tables)
        QObject.connect(self.ui.tables, SIGNAL("currentIndexChanged(const QString&)"), self.list_cols)
        QObject.connect(self.ui.columns, SIGNAL("currentIndexChanged(const QString&)"), self.add_columns)
        QObject.connect(self.ui.columns_2, SIGNAL("currentIndexChanged(const QString&)"), self.list_values)
        QObject.connect(self.ui.reset, SIGNAL("clicked(bool)"), self.reset)
        QObject.connect(self.ui.extract, SIGNAL("stateChanged(int)"), self.list_values)
        QObject.connect(self.ui.values, SIGNAL("doubleClicked(const QModelIndex &)"), self.query_item)
        QObject.connect(self.ui.buttonBox, SIGNAL("accepted()"), self.validate)
        QObject.connect(self.ui.checkBox, SIGNAL("stateChanged(int)"), self.show_tables)

        if self.db.explicitSpatialIndex():
            self.tablesGeo = [table for table in self.tables if isinstance(table, VectorTable)]
            tablesGeo = ['"%s"."%s"' % (table.name, table.geomColumn) for table in self.tablesGeo]
            self.ui.table_target.insertItems(1, tablesGeo)
            self.idxTables = [table for table in self.tablesGeo if table.hasSpatialIndex()]
            idxTables = ['"%s"."%s"' % (table.name, table.geomColumn) for table in self.idxTables]
            self.ui.table_idx.insertItems(1, idxTables)

            QObject.connect(self.ui.usertree, SIGNAL("clicked(bool)"), self.use_rtree)
        else:
            self.ui.toolBox.setItemEnabled(2, False)
示例#17
0
 def __init__(self):
     QObject.__init__(self)
     self.mPlugins = {}         # the dict of plugins (dicts)
     self.repoCache = {}        # the dict of lists of plugins (dicts)
     self.localCache = {}       # the dict of plugins (dicts)
     self.obsoletePlugins = []  # the list of outdated 'user' plugins masking newer 'system' ones
示例#18
0
 def __init__(self, canvas):
     """Constructor"""
     QObject.__init__(self)
     self.canvas = canvas
示例#19
0
 def __init__(self, api_lexer, api_files, pap_file):
     QObject.__init__(self)
     self._api = None
     self._api_files = api_files
     self._api_lexer = api_lexer
     self._pap_file = pap_file
示例#20
0
 def __init__(self, parent):
     QObject.__init__(self, parent)
     self.focus = ''
示例#21
0
文件: plugin.py 项目: ravirbdgtc/QGIS
 def __init__(self, conn_name, parent=None):
     QObject.__init__(self, parent)
     self.connName = conn_name
     self.db = None
示例#22
0
文件: plugin.py 项目: ravirbdgtc/QGIS
 def __init__(self, table):
     QObject.__init__(self, table)
示例#23
0
 def __init__(self, key):
     QObject.__init__(self)
     self.key = key
示例#24
0
文件: plugin.py 项目: ravirbdgtc/QGIS
 def __init__(self, parent=None):
     QObject.__init__(self, parent)
示例#25
0
 def __init__(self, api_lexer, api_files, pap_file):
     QObject.__init__(self)
     self._api = None
     self._api_files = api_files
     self._api_lexer = api_lexer
     self._pap_file = pap_file