Exemplo n.º 1
0
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
"""
import webbrowser

from projectgenerator.utils import get_ui_class
from projectgenerator.utils import qt_utils
from projectgenerator.gui.custom_model_dir import CustomModelDirDialog
from qgis.PyQt.QtWidgets import QDialog
from qgis.PyQt.QtCore import QLocale, QSettings

from projectgenerator.utils.qt_utils import FileValidator, Validators

DIALOG_UI = get_ui_class('options.ui')


class OptionsDialog(QDialog, DIALOG_UI):
    def __init__(self, configuration, parent=None):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        self.configuration = configuration
        self.custom_model_directories_line_edit.setText(
            configuration.custom_model_directories)
        self.custom_model_directories_box.setChecked(
            configuration.custom_model_directories_enabled)
        self.java_path_line_edit.setText(configuration.java_path)
        self.java_path_search_button.clicked.connect(
            qt_utils.make_file_selector(self.java_path_line_edit,
                                        self.tr('Select Java application'),
Exemplo n.º 2
0
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/
"""

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

from qgis.PyQt.QtCore import QCoreApplication, Qt
from qgis.PyQt.QtWidgets import QDialog, QListWidgetItem

from qgis.gui import QgsGui

DIALOG_UI = get_ui_class('custom_model_dir.ui')


class CustomModelDirDialog(QDialog, DIALOG_UI):
    def __init__(self, current_paths, parent=None):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        QgsGui.instance().enableAutoGeometryRestore(self)
        self.parent = parent

        paths = current_paths.split(";")
        self.model_dir_list.addItems([path for path in paths if path.strip()]
                                     or [''])
        for i in range(self.model_dir_list.count()):
            self.set_flags(self.model_dir_list.item(i))
Exemplo n.º 3
0
/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/
"""
from projectgenerator.utils import get_ui_class

from qgis.PyQt.QtCore import Qt
from qgis.PyQt.QtWidgets import QDialog, QListWidgetItem, QDialogButtonBox
from qgis.gui import QgsGui

DIALOG_UI = get_ui_class('multiple_models.ui')


class MultipleModelsDialog(QDialog, DIALOG_UI):
    def __init__(self, parent=None):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        QgsGui.instance().enableAutoGeometryRestore(self)
        self.parent = parent

        self.model_list.itemSelectionChanged.connect(self.on_selection_changed)
        self.on_selection_changed()

        self.add_button.clicked.connect(self.add_model)
        self.remove_button.clicked.connect(self.remove_model)
        self.buttonBox.accepted.connect(self.accepted)