Exemplo n.º 1
0
    def __init__(self, parent=None):
        self.parent = parent
        super(AboutWidget, self).__init__()
        self.setupUi(self)

        self.logo_geohealth.setPixmap(QPixmap(resource('icon-100.png')))
        self.logo_ird.setPixmap(QPixmap(resource('logo_ird.png')))
        self.logo_umr.setPixmap(QPixmap(resource('espace-dev.png')))
Exemplo n.º 2
0
    def initGui(self):

        self.plugin_menu = self.iface.pluginMenu()

        # Main window
        icon = QIcon(resource('icon-32.png'))
        self.main_action = QAction(icon, 'GeoHealth', self.iface.mainWindow())
        self.plugin_menu.addAction(self.main_action)
        # noinspection PyUnresolvedReferences
        self.main_action.triggered.connect(self.open_main_window)
Exemplo n.º 3
0
 def getIcon(self):
     return QIcon(resource('icon-32.png'))
Exemplo n.º 4
0
 def getIcon(self):
     return QIcon(resource("blur.png"))
Exemplo n.º 5
0
 def getIcon(self):
     return QIcon(resource('icon-32.png'))
Exemplo n.º 6
0
    def __init__(self, parent=None):
        """Constructor."""
        QDialog.__init__(self)
        self.parent = parent
        self.setupUi(self)

        # noinspection PyUnresolvedReferences
        self.menu.clicked.connect(self.expand)
        # noinspection PyUnresolvedReferences
        self.menu.clicked.connect(self.display_content)

        self.tree_menu = [{
            'label':
            'Import',
            'icon':
            resource('import.png'),
            'content': [{
                'label': 'Shapefile',
                'icon': resource('shp.png'),
                'content': {
                    'widget': OpenShapefileWidget(),
                    'help': help_open_shapefile()
                }
            }, {
                'label': 'Raster',
                'icon': resource('raster.png'),
                'content': {
                    'widget': OpenRasterWidget(),
                    'help': help_open_raster()
                }
            }, {
                'label': 'Table XLS/DBF',
                'icon': resource('xls.png'),
                'content': {
                    'widget': OpenXlsDbfFileWidget(),
                    'help': help_open_table()
                }
            }, {
                'label': 'Table CSV',
                'icon': resource('csv.png'),
                'content': {
                    'widget': OpenCsv(),
                    'help': help_open_csv()
                }
            }, {
                'label': 'XY to map',
                'icon': resource('xy.png'),
                'content': {
                    'widget': OpenCsv(),
                    'help': help_open_csv()
                }
            }]
        }, {
            'label':
            'Analyse',
            'icon':
            resource('gears.png'),
            'content': [{
                'label':
                'Blur',
                'icon':
                resource('blur.png'),
                'content': [{
                    'label': 'Blur',
                    'icon': resource('blur.png'),
                    'content': {
                        'widget': BlurWidget(),
                        'help': help_blur()
                    }
                }, {
                    'label': 'Stats',
                    'icon': resource('sigma.png'),
                    'content': {
                        'widget': StatsWidget(),
                        'help': help_stats_blurring()
                    }
                }]
            }, {
                'label':
                'Incidence',
                'icon':
                resource('incidence.png'),
                'content': [{
                    'label': 'Polygon layer only',
                    'icon': resource('incidence.png'),
                    'content': {
                        'widget': IncidenceDialog(),
                        'help': help_incidence()
                    }
                }, {
                    'label': 'Case and aggregation layers',
                    'icon': resource('incidence.png'),
                    'content': {
                        'widget': IncidencePointDialog(),
                        'help': help_incidence_point()
                    }
                }]
            }, {
                'label':
                'Density',
                'icon':
                resource('incidence.png'),
                'content': [{
                    'label': 'Polygon layer only',
                    'icon': resource('incidence.png'),
                    'content': {
                        'widget': DensityDialog(),
                        'help': help_density()
                    }
                }, {
                    'label': 'Case and aggregation layers',
                    'icon': resource('incidence.png'),
                    'content': {
                        'widget': DensityPointDialog(),
                        'help': help_density_point()
                    }
                }]
            }]
        }, {
            'label':
            'Export',
            'icon':
            resource('export.png'),
            'content': [{
                'label': 'Attribute table',
                'icon': resource('csv.png'),
                'content': {
                    'widget': CsvExport(),
                    'help': help_attribute_table()
                }
            }]
        }]

        self.stack.addWidget(AboutWidget())

        self.help_list = []

        # A category is import, process and export.
        for category_def in self.tree_menu:
            category_menu = QTreeWidgetItem(self.menu)
            category_menu.setIcon(0, QIcon(category_def['icon']))
            category_menu.setText(0, category_def['label'])

            # Sub item
            for sub_category_def in category_def['content']:
                menu_entry = QTreeWidgetItem(category_menu)
                menu_entry.setIcon(0, QIcon(sub_category_def['icon']))
                menu_entry.setText(0, sub_category_def['label'])

                # Add widget or add tab
                if isinstance(sub_category_def['content'], dict):
                    widget = sub_category_def['content']['widget']
                    self.stack.addWidget(widget)
                    self.help_list.append(sub_category_def['content']['help'])
                else:
                    tab = QTabWidget(self.stack)
                    tab.setIconSize(QSize(32, 32))
                    self.stack.addWidget(tab)

                    tab_help = []
                    tab_bar = sub_category_def['content']
                    for item in tab_bar:
                        label = item['label']
                        icon = QIcon(item['icon'])
                        widget = item['content']['widget']
                        help_widget = item['content']['help']
                        tab_help.append(help_widget)
                        tab.addTab(widget, icon, label)
                    self.help_list.append(tab_help)

        self.stack.setCurrentIndex(1)
Exemplo n.º 7
0
 def getIcon(self):
     return QIcon(resource('blur.png'))