Skip to content

Commit

Permalink
Merge pull request #274 from m-kuhn/refactorname
Browse files Browse the repository at this point in the history
Rename Projectgenerator to QGIS Model Baker
  • Loading branch information
m-kuhn authored Dec 25, 2018
2 parents 08fb044 + e7a97a2 commit 6cdaff8
Show file tree
Hide file tree
Showing 96 changed files with 245 additions and 237 deletions.
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.gitignore export-ignore
.travis.yml export-ignore
.idea export-ignore
projectgenerator.zip export-ignore
QgisModelBaker.zip export-ignore
*.sh export-ignore
*/__pycache__ export-ignore
projectgenerator/tests export-ignore
projectgenerator/metadata.txt eol=lf
QgisModelBaker/tests export-ignore
QgisModelBaker/metadata.txt eol=lf
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.idea
__pycache__
/projectgenerator/libili2db/bin
/QgisModelBaker/libili2db/bin
*.orig
i18n
.DS_Store
Expand Down
6 changes: 3 additions & 3 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[main]
host = https://www.transifex.com

[projectgenerator.projectgenerator]
source_file = i18n/projectgenerator_en.ts
[QgisModelBaker.QgisModelBaker]
source_file = i18n/QgisModelBaker_en.ts
source_lang = en
file_filter = i18n/projectgenerator_<lang>.ts
file_filter = i18n/QgisModelBaker_<lang>.ts
type = QT
4 changes: 2 additions & 2 deletions projectgenerator/__init__.py → QgisModelBaker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@


def classFactory(iface):
from .qgs_project_generator import QgsProjectGeneratorPlugin
return QgsProjectGeneratorPlugin(iface)
from .qgismodelbaker import QgisModelBakerPlugin
return QgisModelBakerPlugin(iface)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
***************************************************************************/
"""

from projectgenerator.utils import get_ui_class
from projectgenerator.utils.qt_utils import selectFolder
from QgisModelBaker.utils import get_ui_class
from QgisModelBaker.utils.qt_utils import selectFolder

from qgis.PyQt.QtCore import QCoreApplication, Qt
from qgis.PyQt.QtWidgets import QDialog, QListWidgetItem
Expand Down Expand Up @@ -73,7 +73,7 @@ def accepted(self):

def browse_dir(self):
selectFolder(self.model_dir_list.currentItem(), title=QCoreApplication.translate(
'projectgenerator', 'Open Folder with ili Models'), parent=None)
'QgisModelBaker', 'Open Folder with ili Models'), parent=None)

def set_flags(self, item):
item.setFlags(Qt.ItemIsSelectable |
Expand Down
54 changes: 27 additions & 27 deletions projectgenerator/gui/export.py → QgisModelBaker/gui/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import os.path
import re

from projectgenerator.gui.options import OptionsDialog, ModelListView
from projectgenerator.gui.multiple_models import MultipleModelsDialog
from projectgenerator.libili2db.iliexporter import JavaNotFoundError
from projectgenerator.libili2db.ilicache import IliCache, ModelCompleterDelegate
from projectgenerator.libili2db.ili2dbutils import color_log_text
from projectgenerator.utils.qt_utils import (
from QgisModelBaker.gui.options import OptionsDialog, ModelListView
from QgisModelBaker.gui.multiple_models import MultipleModelsDialog
from QgisModelBaker.libili2db.iliexporter import JavaNotFoundError
from QgisModelBaker.libili2db.ilicache import IliCache, ModelCompleterDelegate
from QgisModelBaker.libili2db.ili2dbutils import color_log_text
from QgisModelBaker.utils.qt_utils import (
make_save_file_selector,
Validators,
make_file_selector,
Expand Down Expand Up @@ -375,49 +375,49 @@ def updated_configuration(self):
def save_configuration(self, configuration):
settings = QSettings()
settings.setValue(
'QgsProjectGenerator/ili2pg/xtffile_export', configuration.xtffile)
settings.setValue('QgsProjectGenerator/importtype',
'QgisModelBaker/ili2pg/xtffile_export', configuration.xtffile)
settings.setValue('QgisModelBaker/importtype',
self.type_combo_box.currentData())

if self.type_combo_box.currentData() in ['ili2pg', 'pg']:
# PostgreSQL specific options
settings.setValue(
'QgsProjectGenerator/ili2pg/host', configuration.dbhost)
'QgisModelBaker/ili2pg/host', configuration.dbhost)
settings.setValue(
'QgsProjectGenerator/ili2pg/port', configuration.dbport)
'QgisModelBaker/ili2pg/port', configuration.dbport)
settings.setValue(
'QgsProjectGenerator/ili2pg/user', configuration.dbusr)
'QgisModelBaker/ili2pg/user', configuration.dbusr)
settings.setValue(
'QgsProjectGenerator/ili2pg/database', configuration.database)
'QgisModelBaker/ili2pg/database', configuration.database)
settings.setValue(
'QgsProjectGenerator/ili2pg/schema', configuration.dbschema)
'QgisModelBaker/ili2pg/schema', configuration.dbschema)
settings.setValue(
'QgsProjectGenerator/ili2pg/password', configuration.dbpwd)
'QgisModelBaker/ili2pg/password', configuration.dbpwd)
elif self.type_combo_box.currentData() in ['ili2gpkg', 'gpkg']:
settings.setValue(
'QgsProjectGenerator/ili2gpkg/dbfile', configuration.dbfile)
'QgisModelBaker/ili2gpkg/dbfile', configuration.dbfile)

def restore_configuration(self):
settings = QSettings()

self.xtf_file_line_edit.setText(settings.value(
'QgsProjectGenerator/ili2pg/xtffile_export'))
'QgisModelBaker/ili2pg/xtffile_export'))
self.pg_host_line_edit.setText(settings.value(
'QgsProjectGenerator/ili2pg/host', 'localhost'))
'QgisModelBaker/ili2pg/host', 'localhost'))
self.pg_port_line_edit.setText(
settings.value('QgsProjectGenerator/ili2pg/port'))
settings.value('QgisModelBaker/ili2pg/port'))
self.pg_user_line_edit.setText(
settings.value('QgsProjectGenerator/ili2pg/user'))
settings.value('QgisModelBaker/ili2pg/user'))
self.pg_database_line_edit.setText(
settings.value('QgsProjectGenerator/ili2pg/database'))
settings.value('QgisModelBaker/ili2pg/database'))
self.pg_schema_line_edit.setText(
settings.value('QgsProjectGenerator/ili2pg/schema'))
settings.value('QgisModelBaker/ili2pg/schema'))
self.pg_password_line_edit.setText(
settings.value('QgsProjectGenerator/ili2pg/password'))
settings.value('QgisModelBaker/ili2pg/password'))
self.gpkg_file_line_edit.setText(
settings.value('QgsProjectGenerator/ili2gpkg/dbfile'))
settings.value('QgisModelBaker/ili2gpkg/dbfile'))

mode = settings.value('QgsProjectGenerator/importtype', 'pg')
mode = settings.value('QgisModelBaker/importtype', 'pg')
mode = 'pg' if mode == 'ili2pg' else mode
mode = 'gpkg' if mode == 'ili2gpkg' else mode
self.type_combo_box.setCurrentIndex(self.type_combo_box.findData(mode))
Expand Down Expand Up @@ -447,7 +447,7 @@ def link_activated(self, link):
cfg = OptionsDialog(self.base_configuration)
if cfg.exec_():
settings = QSettings()
settings.beginGroup('QgsProjectGenerator/ili2db')
settings.beginGroup('QgisModelBaker/ili2db')
self.base_configuration.save(settings)
else:
QDesktopServices.openUrl(link)
Expand All @@ -457,10 +457,10 @@ def help_requested(self):
'locale/userLocale')).name()[:2]
if os_language in ['es', 'de']:
webbrowser.open(
"https://opengisch.github.io/projectgenerator/docs/{}/user-guide.html#export-an-interlis-transfer-file-xtf".format(os_language))
"https://opengisch.github.io/QgisModelBaker/docs/{}/user-guide.html#export-an-interlis-transfer-file-xtf".format(os_language))
else:
webbrowser.open(
"https://opengisch.github.io/projectgenerator/docs/user-guide.html#export-an-interlis-transfer-file-xtf")
"https://opengisch.github.io/QgisModelBaker/docs/user-guide.html#export-an-interlis-transfer-file-xtf")

def xtf_browser_opened_to_true(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
import re
from psycopg2 import OperationalError

from projectgenerator.gui.options import OptionsDialog, CompletionLineEdit
from projectgenerator.gui.ili2db_options import Ili2dbOptionsDialog
from projectgenerator.gui.multiple_models import MultipleModelsDialog
from projectgenerator.libili2db.globals import CRS_PATTERNS
from projectgenerator.libili2db.ili2dbconfig import SchemaImportConfiguration
from projectgenerator.libili2db.ilicache import IliCache, ModelCompleterDelegate
from projectgenerator.libili2db.iliimporter import JavaNotFoundError
from projectgenerator.libili2db.ili2dbutils import color_log_text
from projectgenerator.utils.qt_utils import (
from QgisModelBaker.gui.options import OptionsDialog, CompletionLineEdit
from QgisModelBaker.gui.ili2db_options import Ili2dbOptionsDialog
from QgisModelBaker.gui.multiple_models import MultipleModelsDialog
from QgisModelBaker.libili2db.globals import CRS_PATTERNS
from QgisModelBaker.libili2db.ili2dbconfig import SchemaImportConfiguration
from QgisModelBaker.libili2db.ilicache import IliCache, ModelCompleterDelegate
from QgisModelBaker.libili2db.iliimporter import JavaNotFoundError
from QgisModelBaker.libili2db.ili2dbutils import color_log_text
from QgisModelBaker.utils.qt_utils import (
make_file_selector,
make_save_file_selector,
Validators,
Expand Down Expand Up @@ -398,60 +398,60 @@ def updated_configuration(self):

def save_configuration(self, configuration):
settings = QSettings()
settings.setValue('QgsProjectGenerator/ili2db/ilifile',
settings.setValue('QgisModelBaker/ili2db/ilifile',
configuration.ilifile)
settings.setValue('QgsProjectGenerator/ili2db/epsg', self.epsg)
settings.setValue('QgsProjectGenerator/importtype',
settings.setValue('QgisModelBaker/ili2db/epsg', self.epsg)
settings.setValue('QgisModelBaker/importtype',
self.type_combo_box.currentData())
if self.type_combo_box.currentData() in ['ili2pg', 'pg']:
# PostgreSQL specific options
settings.setValue(
'QgsProjectGenerator/ili2pg/host', configuration.dbhost)
'QgisModelBaker/ili2pg/host', configuration.dbhost)
settings.setValue(
'QgsProjectGenerator/ili2pg/port', configuration.dbport)
'QgisModelBaker/ili2pg/port', configuration.dbport)
settings.setValue(
'QgsProjectGenerator/ili2pg/user', configuration.dbusr)
'QgisModelBaker/ili2pg/user', configuration.dbusr)
settings.setValue(
'QgsProjectGenerator/ili2pg/database', configuration.database.strip("'"))
'QgisModelBaker/ili2pg/database', configuration.database.strip("'"))
settings.setValue(
'QgsProjectGenerator/ili2pg/schema', configuration.dbschema)
'QgisModelBaker/ili2pg/schema', configuration.dbschema)
settings.setValue(
'QgsProjectGenerator/ili2pg/password', configuration.dbpwd)
'QgisModelBaker/ili2pg/password', configuration.dbpwd)
settings.setValue(
'QgsProjectGenerator/ili2pg/usesuperlogin', configuration.db_use_super_login)
'QgisModelBaker/ili2pg/usesuperlogin', configuration.db_use_super_login)
elif self.type_combo_box.currentData() in ['ili2gpkg', 'gpkg']:
settings.setValue(
'QgsProjectGenerator/ili2gpkg/dbfile', configuration.dbfile)
'QgisModelBaker/ili2gpkg/dbfile', configuration.dbfile)

def restore_configuration(self):
settings = QSettings()

self.ili_file_line_edit.setText(
settings.value('QgsProjectGenerator/ili2db/ilifile'))
settings.value('QgisModelBaker/ili2db/ilifile'))
self.crs = QgsCoordinateReferenceSystem(
settings.value('QgsProjectGenerator/ili2db/epsg', 21781, int))
settings.value('QgisModelBaker/ili2db/epsg', 21781, int))
self.fill_toml_file_info_label()
self.update_crs_info()

self.pg_host_line_edit.setText(
settings.value('QgsProjectGenerator/ili2pg/host', 'localhost'))
settings.value('QgisModelBaker/ili2pg/host', 'localhost'))
self.pg_port_line_edit.setText(
settings.value('QgsProjectGenerator/ili2pg/port'))
settings.value('QgisModelBaker/ili2pg/port'))
self.pg_user_line_edit.setText(
settings.value('QgsProjectGenerator/ili2pg/user'))
settings.value('QgisModelBaker/ili2pg/user'))
self.pg_database_line_edit.setText(
settings.value('QgsProjectGenerator/ili2pg/database'))
settings.value('QgisModelBaker/ili2pg/database'))
self.pg_schema_line_edit.setText(
settings.value('QgsProjectGenerator/ili2pg/schema'))
settings.value('QgisModelBaker/ili2pg/schema'))
self.pg_password_line_edit.setText(
settings.value('QgsProjectGenerator/ili2pg/password'))
settings.value('QgisModelBaker/ili2pg/password'))
self.pg_use_super_login.setChecked(
settings.value('QgsProjectGenerator/ili2pg/usesuperlogin', defaultValue=False, type=bool))
settings.value('QgisModelBaker/ili2pg/usesuperlogin', defaultValue=False, type=bool))
self.gpkg_file_line_edit.setText(
settings.value('QgsProjectGenerator/ili2gpkg/dbfile'))
settings.value('QgisModelBaker/ili2gpkg/dbfile'))

self.type_combo_box.setCurrentIndex(
self.type_combo_box.findData(settings.value('QgsProjectGenerator/importtype', 'pg')))
self.type_combo_box.findData(settings.value('QgisModelBaker/importtype', 'pg')))
self.type_changed()
self.crs_changed()

Expand Down Expand Up @@ -524,7 +524,7 @@ def link_activated(self, link):
cfg = OptionsDialog(self.base_configuration)
if cfg.exec_():
settings = QSettings()
settings.beginGroup('QgsProjectGenerator/ili2db')
settings.beginGroup('QgisModelBaker/ili2db')
self.base_configuration.save(settings)
else:
QDesktopServices.openUrl(link)
Expand Down Expand Up @@ -612,10 +612,10 @@ def help_requested(self):
'locale/userLocale')).name()[:2]
if os_language in ['es', 'de']:
webbrowser.open(
"https://opengisch.github.io/projectgenerator/docs/{}/user-guide.html#generate-project".format(os_language))
"https://opengisch.github.io/QgisModelBaker/docs/{}/user-guide.html#generate-project".format(os_language))
else:
webbrowser.open(
"https://opengisch.github.io/projectgenerator/docs/user-guide.html#generate-project")
"https://opengisch.github.io/QgisModelBaker/docs/user-guide.html#generate-project")

def advance_progress_bar_by_text(self, text):
if text.strip() == 'Info: compile models…':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
***************************************************************************/
"""

from projectgenerator.utils.qt_utils import (
from QgisModelBaker.utils.qt_utils import (
make_file_selector,
Validators,
FileValidator
Expand Down Expand Up @@ -80,7 +80,7 @@ def inheritance_type(self):

def set_toml_file_key(self, key_postfix):
if key_postfix:
self.toml_file_key = 'QgsProjectGenerator/ili2db/tomlfile/' + key_postfix
self.toml_file_key = 'QgisModelBaker/ili2db/tomlfile/' + key_postfix
else:
self.toml_file_key = None
self.restore_configuration()
Expand All @@ -94,24 +94,24 @@ def stroke_arcs(self):
def save_configuration(self):
settings = QSettings()
settings.setValue(
'QgsProjectGenerator/ili2db/inheritance', self.inheritance_type())
'QgisModelBaker/ili2db/inheritance', self.inheritance_type())
settings.setValue(
self.toml_file_key, self.toml_file())
settings.setValue('QgsProjectGenerator/ili2db/create_basket_col', self.create_basket_col())
settings.setValue('QgsProjectGenerator/ili2db/create_import_tid', self.create_import_tid())
settings.setValue('QgsProjectGenerator/ili2db/stroke_arcs', self.stroke_arcs())
settings.setValue('QgisModelBaker/ili2db/create_basket_col', self.create_basket_col())
settings.setValue('QgisModelBaker/ili2db/create_import_tid', self.create_import_tid())
settings.setValue('QgisModelBaker/ili2db/stroke_arcs', self.stroke_arcs())

def restore_configuration(self):
settings = QSettings()
inheritance = settings.value(
'QgsProjectGenerator/ili2db/inheritance', 'smart2')
'QgisModelBaker/ili2db/inheritance', 'smart2')
if inheritance == 'smart1':
self.smart1_radio_button.setChecked(True)
else:
self.smart2_radio_button.setChecked(True)
create_basket_col = settings.value('QgsProjectGenerator/ili2db/create_basket_col', defaultValue=False, type=bool)
create_import_tid = settings.value('QgsProjectGenerator/ili2db/create_import_tid', defaultValue=True, type=bool)
stroke_arcs = settings.value('QgsProjectGenerator/ili2db/stroke_arcs', defaultValue=True, type=bool)
create_basket_col = settings.value('QgisModelBaker/ili2db/create_basket_col', defaultValue=False, type=bool)
create_import_tid = settings.value('QgisModelBaker/ili2db/create_import_tid', defaultValue=True, type=bool)
stroke_arcs = settings.value('QgisModelBaker/ili2db/stroke_arcs', defaultValue=True, type=bool)

self.create_basket_col_checkbox.setChecked(create_basket_col)
self.create_import_tid_checkbox.setChecked(create_import_tid)
Expand Down
Loading

0 comments on commit 6cdaff8

Please sign in to comment.