Skip to content

Commit

Permalink
Merge pull request #15 from Samweli/plugin_dock
Browse files Browse the repository at this point in the history
Implementation for the main plugin dock
  • Loading branch information
Samweli authored Jun 27, 2024
2 parents 071e81e + e10b7e7 commit a2ae6b9
Show file tree
Hide file tree
Showing 17 changed files with 364 additions and 95 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Continuous Integration
on:
push:
branches:
- master
- main
pull_request:
types:
- edited
- opened
- reopened
- synchronize
branches:
- master
- main

env:
# Global environment variable
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# QGIS GEA Afforestation tool


![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/kartoza/qgis-gea-plugin/ci.yml?branch=master)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/kartoza/qgis-gea-plugin/ci.yml?branch=main)
![GitHub](https://img.shields.io/github/license/kartoza/qgis-gea-plugin)

QGIS plugin description.
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"about": "Adds functionality inside QGIS to enable GEA afforestation visualization and analysis.",
"author": "Kartoza",
"email": "[email protected]",
"description": "QGIS plugin for the GEA afforestation",
"description": "View, browse and navigate through imagery.",
"version": "0.0.1",
"changelog": ""
}
Expand Down
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '2.1'
services:
qgis-testing-environment:
image: ${IMAGE}:${QGIS_VERSION_TAG}
volumes:
- ./build/qgis_gea_plugin:/tests_directory:rw
environment:
QGIS_VERSION_TAG: "${QGIS_VERSION_TAG}"
WITH_PYTHON_PEP: "${WITH_PYTHON_PEP}"
ON_TRAVIS: "${ON_TRAVIS}"
MUTE_LOGS: "${MUTE_LOGS}"
DISPLAY: ":99"
working_dir: /tests_directory
entrypoint: /tests_directory/scripts/docker/qgis-testing-entrypoint.sh
# Enable "command:" line below to immediately run unittests upon docker-compose up
# command: qgis_testrunner.sh test_suite.test_package
# Default behaviour of the container is to standby
command: tail -f /dev/null
# qgis_testrunner.sh needs tty for tee
tty: true
Empty file added docs/plugin/changelog.txt
Empty file.
2 changes: 1 addition & 1 deletion docs/src/about/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ through these `document`, `good first issue` and `help wanted` issues:

#### Checkout a branch

* **master**: PR Base branch.
* **main**: PR Base branch.
* **production**: lastest release branch with distribution files. Never make a PR on this.
* **gh-pages**: API docs, examples and demo

Expand Down
Binary file added resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icon_terra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions resources/resources.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/plugins/qgis_gea_plugin">
<file>icon.png</file>
</qresource>
</RCC>
8 changes: 8 additions & 0 deletions scripts/docker/qgis-gea-plugin-test-pre-scripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

qgis_setup.sh

# FIX default installation because the sources must be in "qgis-gea-plugin" parent folder
rm -rf /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis-gea-plugin
ln -sf /tests_directory /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis-gea-plugin
ln -sf /tests_directory /usr/share/qgis/python/plugins/qgis-gea-plugin
8 changes: 0 additions & 8 deletions scripts/docker/qgis-plugin-template-test-pre-scripts.sh

This file was deleted.

33 changes: 33 additions & 0 deletions src/qgis_gea_plugin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QgisGea
A QGIS plugin that enables usage of the GEA afforestation data visualization.
-------------------
begin : 2024-06-27
copyright : (C) 2024 by Kartoza
email : [email protected]
git sha : $Format:%H$
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
This script initializes the plugin, making it known to QGIS.
"""

# noinspection PyPep8Naming
def classFactory(iface): # pylint: disable=invalid-name
"""Load QgisCplus class
:param iface: A QGIS interface instance.
:type iface: QgsInterface
"""
#
from .main import QgisGea

return QgisGea(iface)
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,12 @@
QtNetwork,
)
from qgis.PyQt.uic import loadUiType
from qgis.core import (
Qgis,
QgsCoordinateReferenceSystem,
QgsGeometry,
QgsRectangle,
QgsWkbTypes,
)

from qgis.gui import (
QgsMessageBar,
QgsMapCanvas,
QgsRubberBand,
)

from qgis.utils import iface

from ..resources import *


WidgetUi, _ = loadUiType(
os.path.join(os.path.dirname(__file__), "../ui/qgis_gea_plugin.ui")
os.path.join(os.path.dirname(__file__), "../ui/main_dockwidget.ui")
)


Expand All @@ -48,3 +33,11 @@ def __init__(
super().__init__(parent)
self.setupUi(self)
self.iface = iface

icon_pixmap = QtGui.QPixmap(":/plugins/qgis_gea_plugin/icon.png")
self.icon_la.setPixmap(icon_pixmap)

self.play_btn.setIcon(
QtGui.QIcon(":/images/themes/default/mActionPlay.svg")
)

1 change: 1 addition & 0 deletions src/qgis_gea_plugin/icons/mActionPlay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/qgis_gea_plugin/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from .gui.qgis_gea_plugin import QgisGeaPlugin


class QgisPlugin:
class QgisGea:
"""QGIS GEA Plugin Implementation."""

def __init__(self, iface):
Expand Down Expand Up @@ -141,7 +141,7 @@ def add_action(

def initGui(self):
"""Create the menu entries and toolbar icons inside the QGIS GUI."""
icon_path = ":/plugins/qgis_gea_plugin/icon.svg"
icon_path = ":/plugins/qgis_gea_plugin/icon.png"
self.add_action(
icon_path,
text=self.tr("Open Plugin"),
Expand Down
Loading

0 comments on commit a2ae6b9

Please sign in to comment.