Skip to content

Commit

Permalink
Dodanie narzedzi giap pod logiem, usuniecie wstegi narzedzia giap
Browse files Browse the repository at this point in the history
  • Loading branch information
pmilosz99 authored and gorzelakp committed Jun 23, 2021
1 parent 84f2cbd commit b792991
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 52 deletions.
2 changes: 1 addition & 1 deletion OrtoTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from qgis.utils import iface
from .utils import WMS_SERVERS, WMS_SERVERS_GROUPS
from .CustomMessageBox import CustomMessageBox
from .giap_layout import tr
from .utils import tr


class OrtoAddingTool(object):
Expand Down
2 changes: 0 additions & 2 deletions Searcher/searchTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ def __init__(self, dock, iface):
self.dock = dock

def run(self):
self.dock.toolButton_address.clicked.connect(
self.search_address)
self.dock.lineEdit_address.returnPressed.connect(
self.search_address)
self.dock.comboBox_woj.currentIndexChanged.connect(
Expand Down
2 changes: 1 addition & 1 deletion config.json

Large diffs are not rendered by default.

67 changes: 51 additions & 16 deletions giap_dynamic_layout.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
<property name="minimumSize">
<size>
<width>1291</width>
<height>167</height>
<height>150</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1291000</width>
<height>178</height>
<height>179</height>
</size>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -49,12 +49,6 @@
</property>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
Expand Down Expand Up @@ -200,6 +194,9 @@
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Enter the data according to the scheme: TERYT: 146513_8.1016.17/2 or fill in the previous fields and indicate the parcel number, e.g. 17/2</string>
</property>
<property name="statusTip">
<string extracomment="wpisz numer działki"/>
</property>
Expand Down Expand Up @@ -236,18 +233,14 @@
<height>26</height>
</size>
</property>
<property name="toolTip">
<string>Enter the data according to the scheme: for the address point: Warszawa, Pasaż Ursynowski 1, for the street: Warszawa, Pasaż Ursynowsk</string>
</property>
<property name="text">
<string/>
</property>
<property name="placeholderText">
<string>address</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_address">
<property name="text">
<string>Search</string>
<string>Search address point</string>
</property>
</widget>
</item>
Expand All @@ -264,6 +257,48 @@
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="labelGiapTools">
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
font: 87 10pt &quot;Arial Black&quot;;</string>
</property>
<property name="text">
<string>Narzędzia GIAP </string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="runQuickPrintButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="runCompositionButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="runOrtoTool">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="offOnSearchButton">
<property name="toolTip">
<string>Turn off or turn on search tool</string>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down
32 changes: 30 additions & 2 deletions giap_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

# Initialize Qt resources from file resources.py
from qgis._core import QgsProject, Qgis

from .OrtoTools import OrtoAddingTool
from .QuickPrint import PrintMapTool

from .Kompozycje.Kompozycje import CompositionsTool
Expand All @@ -23,7 +25,7 @@
from .StyleManager.stylemanager import StyleManagerDialog
from .Searcher.searchTool import SearcherTool

from .giap_dynamic_layout import Widget
from .giap_dynamic_layout import Widget, CustomToolButton
from .ribbon_config import RIBBON_DEFAULT

project = QgsProject.instance()
Expand Down Expand Up @@ -58,6 +60,7 @@ def __init__(self, iface):

# initialize StyleManager for styling handling
self.style_manager = StyleManager(self)
self.print_map_tool = PrintMapTool(self.iface)

self.iface.projectRead.connect(self.projekt_wczytany)
self.iface.newProjectCreated.connect(self.projekt_wczytany)
Expand Down Expand Up @@ -122,6 +125,23 @@ def initGui(self):
os.path.abspath(project.fileName()))
self.toolbar.show()

#tools under GIAP logo
self.main_widget.runQuickPrintButton.clicked.connect(self.print_map_tool.run)
self.main_widget.runQuickPrintButton.setToolTip(tr("Map fast print"))
self.main_widget.runQuickPrintButton.setIcon(QIcon(f'{self.plugin_dir}/icons/quick_print.png'))

self.main_widget.runCompositionButton.clicked.connect(self.kompozycje.config)
self.main_widget.runCompositionButton.setIcon(QIcon(f'{self.plugin_dir}/icons/compositions_giap.png'))
self.main_widget.runCompositionButton.setToolTip(tr("Composition settings"))

orto_button = self.main_widget.runOrtoTool
orto_button.setIcon(QIcon(f'{self.plugin_dir}/icons/orto_icon2.png'))
self.orto = OrtoAddingTool(self.main_widget, orto_button)

self.visibility_search_tool = False
self.main_widget.offOnSearchButton.clicked.connect(lambda: self.off_on_search_tool(self.visibility_search_tool))
self.main_widget.offOnSearchButton.setIcon(QIcon(f'{self.plugin_dir}/styles/giap/icons/close.png'))

self.searcher.run()
# set strong focus to get keypressevent
self.main_widget.setFocusPolicy(Qt.StrongFocus)
Expand Down Expand Up @@ -153,10 +173,18 @@ def load_ribbons(self):
# turn off ribbon editing
self.main_widget.edit_session_toggle()

def off_on_search_tool(self, visibility):
elements = ['comboBox_woj', 'comboBox_pow', 'comboBox_gmina', 'comboBox_obr',
'lineEdit_parcel', 'toolButton_parcel', 'lineEdit_address',
'line', 'line_2']

for elem in elements:
getattr(self.main_widget, elem).setVisible(visibility)
self.visibility_search_tool = not visibility

def custom_prints(self):
"""Load custom tools to qgis"""
self.quick_print = PrintMapTool(self.iface, self.main_widget)

b_qprints = self.main_widget.findChildren(
QToolButton, 'giapQuickPrint')
for b_qprint in b_qprints:
Expand Down
Binary file modified i18n/giap_pl.qm
Binary file not shown.
20 changes: 20 additions & 0 deletions i18n/giap_pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,21 @@ Porszę czekać...</translation>
<source>parcel number or TERYT</source>
<translation>nr działki lub TERYT</translation>
</message>
<message>
<location filename="../giap_dynamic_layout.ui" line="198"/>
<source>Enter the data according to the scheme: TERYT: 146513_8.1016.17/2 or fill in the previous fields and indicate the parcel number, e.g. 17/2</source>
<translation>Wpisz dane według schematu: TERYT: 146513_8.1016.17/2 lub uzupełnij wcześniejsze pola i wskaż numer działki np. 17/2</translation>
</message>
<message>
<location filename="../giap_dynamic_layout.ui" line="237"/>
<source>Enter the data according to the scheme: for the address point: Warszawa, Pasaż Ursynowski 1, for the street: Warszawa, Pasaż Ursynowsk</source>
<translation>Wpisz dane według schematu: dla punktu adresowego: Warszawa, Pasaż Ursynowski 1, dla ulicy: Warszawa, Pasaż Ursynowski</translation>
</message>
<message>
<location filename="../giap_dynamic_layout.ui" line="243"/>
<source>Search address point</source>
<translation>Wyszukaj punkt adresowy</translation>
</message>
<message>
<location filename="../giap_dynamic_layout.ui" line="244"/>
<source>Search</source>
Expand All @@ -598,6 +613,11 @@ Porszę czekać...</translation>
<source>address</source>
<translation>adres</translation>
</message>
<message>
<location filename="../giap_dynamic_layout.ui" line="295"/>
<source>Turn off or turn on search tool</source>
<translation>Wyłącz lub włącz wyszukiwarke</translation>
</message>
</context>
<context>
<name>KompozycjeDialog</name>
Expand Down
40 changes: 11 additions & 29 deletions ribbon_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@
],
},

{
'label': tr('Prints'),
'id': 'Prints',
'btn_size': 30,
'btns': [
['mActionNewPrintLayout', 0, 0],
['giapMyPrints', 0, 1],
['mActionShowLayoutManager', 1, 0],
]
},

]
},

Expand Down Expand Up @@ -163,35 +174,6 @@
]
},

{
"tab_name": tr("GIAP Tools"),
"tab_id": "GIAP Tools",
"sections": [
{
'label': tr('Prints'),
'id': 'Prints',
'btn_size': 30,
'btns': [
['mActionNewPrintLayout', 0, 0],
['giapMyPrints', 0, 1],
['mActionShowLayoutManager', 1, 0],
['giapQuickPrint', 1, 1],
]
},

{
'label': tr('GIAP Tools'),
'id': 'GIAP Tools',
'btn_size': 60,
'btns': [
['giapCompositions', 0, 0],
['giapWMS', 0, 1],
]
},

]
},

{
"tab_name": tr("Vector"),
"tab_id": "Vector",
Expand Down
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,4 +481,4 @@ def get_project_config(parameter, key, default=''):

]

DEFAULT_TABS = ['Main', 'Tools', 'GIAP Tools', 'Vector', 'Raster']
DEFAULT_TABS = ['Main', 'Tools', 'Vector', 'Raster']

0 comments on commit b792991

Please sign in to comment.