https://github.com/minorua/Qgis2threejs
Revision abc0671259cbcdf2f16cd0b2d9a92bf01206cc02 authored by Minoru Akagi on 22 January 2015, 05:25:53 UTC, committed by Minoru Akagi on 22 January 2015, 05:32:17 UTC
which makes it possible to scale the objects that appears on the web browser
1 parent f854a93
Raw File
Tip revision: abc0671259cbcdf2f16cd0b2d9a92bf01206cc02 authored by Minoru Akagi on 22 January 2015, 05:25:53 UTC
add base size option to world page
Tip revision: abc0671
settingsdialog.py
# -*- coding: utf-8 -*-
"""
/***************************************************************************
 SettingsDialog
                             -------------------
        begin                : 2014-01-10
        copyright            : (C) 2014 Minoru Akagi
        email                : akaginch@gmail.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 PyQt4.QtCore import QSettings
from PyQt4.QtGui import QDialog, QFileDialog

from ui.ui_settingsdialog import Ui_SettingsDialog

class SettingsDialog(QDialog):
  def __init__(self, iface):
    QDialog.__init__(self, iface.mainWindow())
    self.iface = iface

    # Set up the user interface from Designer.
    self.ui = ui = Ui_SettingsDialog()
    ui.setupUi(self)
    ui.lineEdit_BrowserPath.setPlaceholderText("Leave this empty to use your default browser")
    ui.toolButton_Browse.clicked.connect(self.browseClicked)

    # load settings
    settings = QSettings()
    self.ui.lineEdit_BrowserPath.setText(settings.value("/Qgis2threejs/browser", "", type=unicode))

  def accept(self):
    # save settings
    settings = QSettings()
    settings.setValue("/Qgis2threejs/browser", self.ui.lineEdit_BrowserPath.text())
    QDialog.accept(self)

  def browseClicked(self):
    filename = QFileDialog.getOpenFileName(self, self.tr("Select browser"))
    if filename != "":
      self.ui.lineEdit_BrowserPath.setText(filename)
back to top