Skip to content

Commit

Permalink
Merge pull request #1 from jajberni/develop
Browse files Browse the repository at this point in the history
Major rewrite of the plugin
  • Loading branch information
jajberni authored Apr 5, 2022
2 parents b423f71 + 4dc427d commit 009533d
Show file tree
Hide file tree
Showing 31 changed files with 2,271 additions and 1,200 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@ ENV/

# mypy
.mypy_cache/

.idea
.vscode
41 changes: 27 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#
# Creates a field layout for a typical row-column breeder's trial
# -------------------
# begin : 2018-02-20
# begin : 2021-05-14
# git sha : $Format:%H$
# copyright : (C) 2018 by Jose A. Jimenez Berni
# email : jose.jimenez.[email protected]
# copyright : (C) 2021 by Jose A. _Jimenez-Berni
# email : berni@ias.csic.es
# ***************************************************************************/
#
#/***************************************************************************
Expand Down Expand Up @@ -38,17 +38,15 @@ LOCALES =
# translation
SOURCES = \
__init__.py \
breeder_map.py breeder_map_dialog.py \
about_dialog.py
breeder_map.py breeder_map_dockwidget.py

PLUGINNAME = BreederMap
PLUGINNAME = breeder_map

PY_FILES = \
__init__.py \
breeder_map.py breeder_map_dialog.py \
about_dialog.py
breeder_map.py breeder_map_dockwidget.py

UI_FILES = breeder_map_dialog_base.ui ui_about_dialog.ui
UI_FILES = breeder_map_dockwidget_base.ui

EXTRAS = metadata.txt icon.png

Expand All @@ -58,6 +56,16 @@ COMPILED_RESOURCE_FILES = resources.py

PEP8EXCLUDE=pydev,resources.py,conf.py,third_party,ui

# QGISDIR points to the location where your plugin should be installed.
# This varies by platform, relative to your HOME directory:
# * Linux:
# .local/share/QGIS/QGIS3/profiles/default/python/plugins/
# * Mac OS X:
# Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
# * Windows:
# AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins'

QGISDIR=C:\Users\berni\AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins

#################################################
# Normally you would not need to edit below here
Expand All @@ -69,14 +77,19 @@ PLUGIN_UPLOAD = $(c)/plugin_upload.py

RESOURCE_SRC=$(shell grep '^ *<file' resources.qrc | sed 's@</file>@@g;s/.*>//g' | tr '\n' ' ')

QGISDIR=.qgis2

default: compile
.PHONY: default
default:
@echo While you can use make to build and deploy your plugin, pb_tool
@echo is a much better solution.
@echo A Python script, pb_tool provides platform independent management of
@echo your plugins and runs anywhere.
@echo You can install pb_tool using: pip install pb_tool
@echo See https://g-sherman.github.io/plugin_build_tool/ for info.

compile: $(COMPILED_RESOURCE_FILES)

%.py : %.qrc $(RESOURCES_SRC)
pyrcc4 -o $*.py $<
pyrcc5 -o $*.py $<

%.qm : %.ts
$(LRELEASE) $<
Expand Down Expand Up @@ -115,7 +128,7 @@ deploy: compile doc transcompile
cp -vfr i18n $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
cp -vfr $(HELP) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/help
# Copy extra directories if any
# (temporarily removed)
(foreach EXTRA_DIR,(EXTRA_DIRS), cp -R (EXTRA_DIR) (HOME)/(QGISDIR)/python/plugins/(PLUGINNAME)/;)


# The dclean target removes compiled python files from plugin directory
Expand Down
14 changes: 7 additions & 7 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@ <h3>Plugin Builder Results</h3>

<div id='help' style='font-size:.9em;'>
Your plugin <b>BreederMap</b> was created in:<br>
&nbsp;&nbsp;<b>/Users/berni/.qgis2/python/plugins/BreederMap</b>
&nbsp;&nbsp;<b>C:/Users/berni/Documents/development/github\breeder_map</b>
<p>
Your QGIS plugin directory is located at:<br>
&nbsp;&nbsp;<b>/Users/berni/.qgis2/python/plugins</b>
&nbsp;&nbsp;<b>C:/Users/berni/AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins</b>
<p>
<h3>What's Next</h3>
<ol>
<li>In your plugin directory, compile the resources file using pyrcc4 (simply run <b>make</b> if you have automake or use <b>pb_tool</b>)
<li>In your plugin directory, compile the resources file using pyrcc5 (simply run <b>make</b> if you have automake or use <b>pb_tool</b>)
<li>Test the generated sources using <b>make test</b> (or run tests from your IDE)
<li>Copy the entire directory containing your new plugin to the QGIS plugin directory (see Notes below)
<li>Test the plugin by enabling it in the QGIS plugin manager
<li>Customize it by editing the implementation file <b>breeder_map.py</b>
<li>Create your own custom icon, replacing the default <b>icon.png</b>
<li>Modify your user interface by opening <b>breeder_map_dialog_base.ui</b> in Qt Designer
<li>Modify your user interface by opening <b>breeder_map_dockwidget_base.ui</b> in Qt Designer
</ol>
Notes:
<ul>
<li>You can use the <b>Makefile</b> to compile and deploy when you
make changes. This requires GNU make (gmake). The Makefile is ready to use, however you
will have to edit it to add addional Python source files, dialogs, and translations.
<li>You can also use <b>pb_tool</b> to compile and deploy your plugin. Tweak the <i>pb_tool.cfg</i> file included with your plugin as you add files. Install <b>pb_tool</b> using
<i>pip</i> or <i>easy_install</i>. See <a href="http://loc8.cc/pb_tool">http://loc8.cc/pb_tool</a> for more information.
<i>pip</i> or <i>easy_install</i>. See <b>http://loc8.cc/pb_tool</b> for more information.
</ul>
</div>
<div style='font-size:.9em;'>
<p>
For information on writing PyQGIS code, see <a href="http://loc8.cc/pyqgis_resources">http://loc8.cc/pyqgis_resources</a> for a list of resources.
For information on writing PyQGIS code, see <b>http://loc8.cc/pyqgis_resources</b> for a list of resources.
</p>
</div>
<p>
&copy;2011-2016 GeoApt LLC - geoapt.com
&copy;2011-2018 GeoApt LLC - geoapt.com
</p>
</body>
</html>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# BreederMap
QGIS plug-in that creates a field layout for a typical row-column breeder's trial
# Breeder Map
Breeder Map is a QGIS plugin for assisting with the processing and extraction of field phenomics data.
11 changes: 5 additions & 6 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Plugin Builder Results

Your plugin BreederMap was created in:
/Users/berni/.qgis2/python/plugins/BreederMap
C:/Users/berni/Documents/development/github\breeder_map

Your QGIS plugin directory is located at:
/Users/berni/.qgis2/python/plugins
C:/Users/berni/AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins

What's Next:

* Copy the entire directory containing your new plugin to the QGIS plugin
directory

* Compile the resources file using pyrcc4
* Compile the resources file using pyrcc5

* Run the tests (``make test``)

Expand All @@ -21,13 +21,12 @@ What's Next:

* Create your own custom icon, replacing the default icon.png

* Modify your user interface by opening BreederMap.ui in Qt Designer
* Modify your user interface by opening BreederMap_dockwidget_base.ui in Qt Designer

* You can use the Makefile to compile your Ui and resource files when
you make changes. This requires GNU make (gmake)

For more information, see the PyQGIS Developer Cookbook at:
http://www.qgis.org/pyqgis-cookbook/index.html

(C) 2011-2014 GeoApt LLC - geoapt.com
Git revision : $Format:%H$
(C) 2011-2018 GeoApt LLC - geoapt.com
7 changes: 4 additions & 3 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
BreederMap
A QGIS plugin
Creates a field layout for a typical row-column breeder's trial
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
-------------------
begin : 2018-02-20
copyright : (C) 2018 by Jose A. Jimenez Berni
email : jose.jimenez.[email protected]
begin : 2021-05-14
copyright : (C) 2021 by Jose A. _Jimenez-Berni
email : berni@ias.csic.es
git sha : $Format:%H$
***************************************************************************/
Expand Down
15 changes: 10 additions & 5 deletions about_dialog.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import os

from PyQt4 import QtGui, uic
from qgis.PyQt import uic
from qgis.PyQt.QtWidgets import QDialog
import sys

sys.path.append(os.path.dirname(__file__))
FORM_CLASS, _ = uic.loadUiType(os.path.join(
os.path.dirname(__file__), 'ui_about_dialog.ui'))
os.path.dirname(__file__), 'ui_about_dialog.ui'), resource_suffix='')

class AboutDialog(QtGui.QDialog, FORM_CLASS):
def __init__(self):
QtGui.QDialog.__init__(self)

class AboutDialog(QDialog, FORM_CLASS):
def __init__(self, parent=None):
QDialog.__init__(self)
# Set up the user interface from Designer.
# After setupUI you can access any designer object by doing
# self.<objectname>, and you can use autoconnect slots - see
# http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html
# #widgets-and-dialogs-with-auto-connect

self.setupUi(self)
Loading

0 comments on commit 009533d

Please sign in to comment.