Exemple #1
0
def get_wizard_step_ui_class(py_file_name):
    """Get ui class based on python filename.

    Load a Qt Designer .ui file and return the generated form class and the Qt
    base class.
    .ui file is based on py filename.

    :param py_file_name: Filename of the widget
    :type py_file_name: str

    :return: Loaded .ui file
    :rtype: loaded ui
    """
    return get_ui_class(os.path.join(
        'wizard', re.sub(r"pyc?$", "ui", os.path.basename(py_file_name))))
Exemple #2
0
import logging
from PyQt4.QtGui import (
    QDialog,
    QPixmap
)

from cadasta.common.setting import logo_element
from cadasta.utilities.resources import get_ui_class
from cadasta.utilities.i18n import tr

__copyright__ = "Copyright 2016, Cadasta"
__license__ = "GPL version 3"
__email__ = "*****@*****.**"
__revision__ = '$Format:%H$'

FORM_CLASS = get_ui_class('dialog_base.ui')

LOGGER = logging.getLogger('CadastaQGISPlugin')


class CadastaDialog(QDialog, FORM_CLASS):
    """Dialog base class for cadasta."""

    def __init__(self, parent=None, iface=None,
                 title='Cadasta', subtitle='', widget=None):
        """Constructor for the dialog.

        .. note:: In QtDesigner the advanced editor's predefined keywords
           list should be shown in english always, so when adding entries to
           cboKeyword, be sure to choose :safe_qgis:`Properties<<` and untick
           the :safe_qgis:`translatable` property.
from cadasta.gui.tools.wizard.step_project_download01 import (
    StepProjectDownload01)
from cadasta.gui.tools.wizard.step_project_download02 import (
    StepProjectDownload02)

from cadasta.utilities.resources import get_ui_class
from cadasta.utilities.i18n import tr
from cadasta.gui.tools.wizard.wizard_dialog import WizardDialog

__copyright__ = "Copyright 2016, Cadasta"
__license__ = "GPL version 3"
__email__ = "*****@*****.**"
__revision__ = '$Format:%H$'

FORM_CLASS = get_ui_class('wizard/wizard_dialog_base.ui')

LOGGER = logging.getLogger('CadastaQGISPlugin')


class ProjectDownloadWizard(WizardDialog):
    """Dialog implementation class for Project Download Wizard"""

    step_project_download01 = None
    step_project_download02 = None
    downloaded = pyqtSignal()

    def __init__(self, parent=None, iface=None):
        """Constructor for the dialog.

        .. note:: In QtDesigner the advanced editor's predefined keywords
Exemple #4
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 qgis.PyQt import QtGui
from qgis.gui import QgsMessageBar
from cadasta.utilities.resources import get_ui_class

from cadasta.api.login import Login

FORM_CLASS = get_ui_class('cadasta_login_base.ui')


class CadastaLogin(QtGui.QDialog, FORM_CLASS):
    def __init__(self, parent=None):
        """Constructor."""
        super(CadastaLogin, self).__init__(parent)
        self.setupUi(self)
        self.login_button.clicked.connect(self.login)
        self.msg_bar = None

    def login(self):
        """Login function when tools button clicked"""
        username = self.username_input.displayText()
        password = self.password_input.displayText()
# from cadasta.gui.tools.helper.content.options_help import options_help
# from cadasta.gui.tools.helper.content.download_project_help import (
#     download_project_help
# )
# from cadasta.gui.tools.helper.content.create_project_help import (
#     create_project_help
# )
from cadasta.utilities.resources import html_header, html_footer, get_ui_class
from extras import messaging as m

__copyright__ = "Copyright 2016, Cadasta"
__license__ = "GPL version 3"
__email__ = "*****@*****.**"
__revision__ = '$Format:%H$'

FORM_CLASS = get_ui_class('helper_dialog.ui')

LOGGER = logging.getLogger('CadastaQGISPlugin')


class HelperDialog(QDialog, FORM_CLASS):
    """Helper dialog for cadasta."""
    def __init__(self, parent=None, iface=None):
        """Constructor for the dialog.

        .. note:: In QtDesigner the advanced editor's predefined keywords
           list should be shown in english always, so when adding entries to
           cboKeyword, be sure to choose :safe_qgis:`Properties<<` and untick
           the :safe_qgis:`translatable` property.

        :param parent: Parent widget of this dialog.