even more font propagation

This commit is contained in:
Juergen E. Fischer 2012-01-26 00:54:56 +01:00
parent 747e497e0b
commit c25ae5635c
45 changed files with 71 additions and 70 deletions

View File

@ -96,8 +96,7 @@ class GdalTools:
if rasterMenu == None: if rasterMenu == None:
# no Raster menu, create and insert it before the Help menu # no Raster menu, create and insert it before the Help menu
self.menu = QMenu() self.menu = QMenu( rasterText, self.iface.mainWindow() )
self.menu.setTitle( rasterText )
lastAction = actions[ len( actions ) - 1 ] lastAction = actions[ len( actions ) - 1 ]
menu_bar.insertMenu( lastAction, self.menu ) menu_bar.insertMenu( lastAction, self.menu )
else: else:
@ -105,7 +104,7 @@ class GdalTools:
self.menu.addSeparator() self.menu.addSeparator()
# projections menu (Warp (Reproject), Assign projection) # projections menu (Warp (Reproject), Assign projection)
self.projectionsMenu = QMenu( QCoreApplication.translate( "GdalTools", "Projections" ) ) self.projectionsMenu = QMenu( QCoreApplication.translate( "GdalTools", "Projections" ), self.iface.mainWindow() )
self.warp = QAction( QIcon(":/icons/warp.png"), QCoreApplication.translate( "GdalTools", "Warp (Reproject)" ), self.iface.mainWindow() ) self.warp = QAction( QIcon(":/icons/warp.png"), QCoreApplication.translate( "GdalTools", "Warp (Reproject)" ), self.iface.mainWindow() )
self.warp.setStatusTip( QCoreApplication.translate( "GdalTools", "Warp an image into a new coordinate system") ) self.warp.setStatusTip( QCoreApplication.translate( "GdalTools", "Warp an image into a new coordinate system") )
@ -122,7 +121,7 @@ class GdalTools:
self.projectionsMenu.addActions( [ self.warp, self.projection, self.extractProj ] ) self.projectionsMenu.addActions( [ self.warp, self.projection, self.extractProj ] )
# conversion menu (Rasterize (Vector to raster), Polygonize (Raster to vector), Translate, RGB to PCT, PCT to RGB) # conversion menu (Rasterize (Vector to raster), Polygonize (Raster to vector), Translate, RGB to PCT, PCT to RGB)
self.conversionMenu = QMenu( QCoreApplication.translate( "GdalTools", "Conversion" ) ) self.conversionMenu = QMenu( QCoreApplication.translate( "GdalTools", "Conversion" ), self.iface.mainWindow() )
if self.GdalVersion >= "1.3": if self.GdalVersion >= "1.3":
self.rasterize = QAction( QIcon(":/icons/rasterize.png"), QCoreApplication.translate( "GdalTools", "Rasterize (Vector to raster)" ), self.iface.mainWindow() ) self.rasterize = QAction( QIcon(":/icons/rasterize.png"), QCoreApplication.translate( "GdalTools", "Rasterize (Vector to raster)" ), self.iface.mainWindow() )
@ -151,7 +150,7 @@ class GdalTools:
self.conversionMenu.addActions( [ self.translate, self.paletted, self.rgb ] ) self.conversionMenu.addActions( [ self.translate, self.paletted, self.rgb ] )
# extraction menu (Clipper, Contour) # extraction menu (Clipper, Contour)
self.extractionMenu = QMenu( QCoreApplication.translate( "GdalTools", "Extraction" ) ) self.extractionMenu = QMenu( QCoreApplication.translate( "GdalTools", "Extraction" ), self.iface.mainWindow() )
if self.GdalVersion >= "1.6": if self.GdalVersion >= "1.6":
self.contour = QAction( QIcon(":/icons/contour.png"), QCoreApplication.translate( "GdalTools", "Contour" ), self.iface.mainWindow() ) self.contour = QAction( QIcon(":/icons/contour.png"), QCoreApplication.translate( "GdalTools", "Contour" ), self.iface.mainWindow() )
@ -166,7 +165,7 @@ class GdalTools:
self.extractionMenu.addActions( [ self.clipper ] ) self.extractionMenu.addActions( [ self.clipper ] )
# analysis menu (DEM (Terrain model), Grid (Interpolation), Near black, Proximity (Raster distance), Sieve) # analysis menu (DEM (Terrain model), Grid (Interpolation), Near black, Proximity (Raster distance), Sieve)
self.analysisMenu = QMenu( QCoreApplication.translate( "GdalTools", "Analysis" ) ) self.analysisMenu = QMenu( QCoreApplication.translate( "GdalTools", "Analysis" ), self.iface.mainWindow() )
if self.GdalVersion >= "1.6": if self.GdalVersion >= "1.6":
self.sieve = QAction( QIcon(":/icons/sieve.png"), QCoreApplication.translate( "GdalTools", "Sieve" ), self.iface.mainWindow() ) self.sieve = QAction( QIcon(":/icons/sieve.png"), QCoreApplication.translate( "GdalTools", "Sieve" ), self.iface.mainWindow() )
@ -207,7 +206,7 @@ class GdalTools:
#self.analysisMenu.addActions( [ ] ) #self.analysisMenu.addActions( [ ] )
# miscellaneous menu (Build overviews (Pyramids), Tile index, Information, Merge, Build Virtual Raster (Catalog)) # miscellaneous menu (Build overviews (Pyramids), Tile index, Information, Merge, Build Virtual Raster (Catalog))
self.miscellaneousMenu = QMenu( QCoreApplication.translate( "GdalTools", "Miscellaneous" ) ) self.miscellaneousMenu = QMenu( QCoreApplication.translate( "GdalTools", "Miscellaneous" ), self.iface.mainWindow() )
if self.GdalVersion >= "1.6": if self.GdalVersion >= "1.6":
self.buildVRT = QAction( QIcon(":/icons/vrt.png"), QCoreApplication.translate( "GdalTools", "Build Virtual Raster (Catalog)" ), self.iface.mainWindow() ) self.buildVRT = QAction( QIcon(":/icons/vrt.png"), QCoreApplication.translate( "GdalTools", "Build Virtual Raster (Catalog)" ), self.iface.mainWindow() )

View File

@ -5,8 +5,8 @@ from qgis.core import *
from qgis.gui import * from qgis.gui import *
class GdalToolsSRSDialog(QDialog): class GdalToolsSRSDialog(QDialog):
def __init__(self, title): def __init__(self, title, parent):
QDialog.__init__(self) QDialog.__init__(self, parent)
self.setWindowTitle( title ) self.setWindowTitle( title )
layout = QVBoxLayout() layout = QVBoxLayout()

View File

@ -16,7 +16,7 @@ class GdalToolsDialog(QWidget, Ui_Widget, BasePluginWidget):
self.canvas = self.iface.mapCanvas() self.canvas = self.iface.mapCanvas()
self.setupUi(self) self.setupUi(self)
BasePluginWidget.__init__(self, self.iface, "gdal_translate", self.iface.mainWindow()) BasePluginWidget.__init__(self, self.iface, "gdal_translate")
self.outSelector.setType( self.outSelector.FILE ) self.outSelector.setType( self.outSelector.FILE )
self.extentSelector.setCanvas(self.canvas) self.extentSelector.setCanvas(self.canvas)

View File

@ -21,7 +21,7 @@ except ImportError, e:
class GdalToolsDialog( QDialog, Ui_Dialog ): class GdalToolsDialog( QDialog, Ui_Dialog ):
def __init__( self, iface ): def __init__( self, iface ):
QDialog.__init__( self ) QDialog.__init__( self, iface.mainWindow() )
self.setupUi( self ) self.setupUi( self )
self.iface = iface self.iface = iface

View File

@ -9,8 +9,8 @@ import GdalTools_utils as Utils
class GdalToolsBaseBatchWidget(BasePluginWidget): class GdalToolsBaseBatchWidget(BasePluginWidget):
def __init__(self, iface, commandName, helpFileBaseName = None): def __init__(self, iface, commandName):
BasePluginWidget.__init__(self, iface, commandName, helpFileBaseName) BasePluginWidget.__init__(self, iface, commandName)
def getBatchArguments(self, inFile, outFile = None): def getBatchArguments(self, inFile, outFile = None):
arguments = QStringList() arguments = QStringList()

View File

@ -9,10 +9,10 @@ import GdalTools_utils as Utils
class GdalToolsBasePluginWidget: class GdalToolsBasePluginWidget:
def __init__(self, iface, commandName, parent = None): def __init__(self, iface, commandName):
self.iface = iface self.iface = iface
self.initialized = False self.initialized = False
self.base = BaseDialog(parent, iface, self, self.windowTitle(), commandName) self.base = BaseDialog( iface.mainWindow(), iface, self, self.windowTitle(), commandName)
self.connect(self.base, SIGNAL("processError(QProcess::ProcessError)"), self.onError) self.connect(self.base, SIGNAL("processError(QProcess::ProcessError)"), self.onError)
self.connect(self.base, SIGNAL("processFinished(int, QProcess::ExitStatus)"), self.onFinished) self.connect(self.base, SIGNAL("processFinished(int, QProcess::ExitStatus)"), self.onFinished)

View File

@ -38,7 +38,7 @@ from ui_frmReProject import Ui_Dialog
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
self.setupUi(self) self.setupUi(self)
self.toolOut.setEnabled(False) self.toolOut.setEnabled(False)

View File

@ -41,7 +41,7 @@ from sets import Set
class GeometryDialog(QDialog, Ui_Dialog): class GeometryDialog(QDialog, Ui_Dialog):
def __init__(self, iface, function): def __init__(self, iface, function):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
self.setupUi(self) self.setupUi(self)
self.myFunction = function self.myFunction = function

View File

@ -40,7 +40,7 @@ import sys
class GeoprocessingDialog( QDialog, Ui_Dialog ): class GeoprocessingDialog( QDialog, Ui_Dialog ):
def __init__( self, iface, function ): def __init__( self, iface, function ):
QDialog.__init__( self ) QDialog.__init__( self, iface.mainWindow() )
self.iface = iface self.iface = iface
self.setupUi( self ) self.setupUi( self )
self.param.setValidator(QDoubleValidator(self.param)) self.param.setValidator(QDoubleValidator(self.param))

View File

@ -37,7 +37,7 @@ from ui_frmIntersectLines import Ui_Dialog
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
# Set up the user interface from Designer. # Set up the user interface from Designer.
self.setupUi(self) self.setupUi(self)

View File

@ -37,7 +37,7 @@ from ui_frmMeanCoords import Ui_Dialog
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface, function): def __init__(self, iface, function):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
self.function = function self.function = function
self.setupUi(self) self.setupUi(self)

View File

@ -12,7 +12,7 @@ from ui_frmMergeShapes import Ui_Dialog
class Dialog( QDialog, Ui_Dialog ): class Dialog( QDialog, Ui_Dialog ):
def __init__( self, iface ): def __init__( self, iface ):
QDialog.__init__( self ) QDialog.__init__( self, iface.mainWindow() )
self.setupUi( self ) self.setupUi( self )
self.iface = iface self.iface = iface

View File

@ -73,7 +73,7 @@ class UnicodeWriter:
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
# Set up the user interface from Designer. # Set up the user interface from Designer.
self.setupUi(self) self.setupUi(self)

View File

@ -37,7 +37,7 @@ from ui_frmPointsInPolygon import Ui_Dialog
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
# Set up the user interface from Designer. # Set up the user interface from Designer.
self.setupUi(self) self.setupUi(self)

View File

@ -38,7 +38,7 @@ from ui_frmRandPoints import Ui_Dialog
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
self.setupUi(self) self.setupUi(self)
QObject.connect(self.toolOut, SIGNAL("clicked()"), self.outFile) QObject.connect(self.toolOut, SIGNAL("clicked()"), self.outFile)

View File

@ -37,7 +37,7 @@ from ui_frmRandom import Ui_Dialog
import random import random
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
# Set up the user interface from Designer. # Set up the user interface from Designer.
self.setupUi(self) self.setupUi(self)

View File

@ -38,7 +38,7 @@ from ui_frmRegPoints import Ui_Dialog
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
self.setupUi(self) self.setupUi(self)
self.xMin.setValidator(QDoubleValidator(self.xMin)) self.xMin.setValidator(QDoubleValidator(self.xMin))

View File

@ -37,7 +37,7 @@ from ui_frmPointsInPolygon import Ui_Dialog
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
# Set up the user interface from Designer. # Set up the user interface from Designer.
self.setupUi(self) self.setupUi(self)

View File

@ -40,7 +40,7 @@ from ui_frmSimplify import Ui_Dialog
class Dialog( QDialog, Ui_Dialog ): class Dialog( QDialog, Ui_Dialog ):
def __init__( self, iface, function ): def __init__( self, iface, function ):
QDialog.__init__( self ) QDialog.__init__( self, iface.mainWindow() )
self.setupUi( self ) self.setupUi( self )
self.iface = iface self.iface = iface
self.myFunction = function self.myFunction = function

View File

@ -29,7 +29,7 @@ from ui_frmSpatialIndex import Ui_Dialog
class Dialog( QDialog, Ui_Dialog ): class Dialog( QDialog, Ui_Dialog ):
def __init__( self, iface ): def __init__( self, iface ):
QDialog.__init__( self ) QDialog.__init__( self, iface.mainWindow() )
self.setupUi( self ) self.setupUi( self )
self.iface = iface self.iface = iface

View File

@ -54,7 +54,7 @@ def myself(L):
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
# Set up the user interface from Designer. # Set up the user interface from Designer.
self.setupUi(self) self.setupUi(self)

View File

@ -37,7 +37,7 @@ from ui_frmSubsetSelect import Ui_Dialog
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
# Set up the user interface from Designer. # Set up the user interface from Designer.
self.setupUi(self) self.setupUi(self)

View File

@ -37,7 +37,7 @@ from ui_frmSumLines import Ui_Dialog
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
# Set up the user interface from Designer. # Set up the user interface from Designer.
self.setupUi(self) self.setupUi(self)

View File

@ -67,11 +67,11 @@ class MarkerErrorGeometry():
class ValidateDialog( QDialog, Ui_Dialog ): class ValidateDialog( QDialog, Ui_Dialog ):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
self.setupUi(self) self.setupUi(self)
self.setModal(False) # we want to be able to interact with the featuresmc.extent().width() # self.setModal(False) # we want to be able to interact with the featuresmc.extent().width()
self.setWindowFlags( Qt.SubWindow ) # self.setWindowFlags( Qt.SubWindow )
# adjust user interface # adjust user interface
self.setWindowTitle( self.tr( "Check geometry validity" ) ) self.setWindowTitle( self.tr( "Check geometry validity" ) )
self.cmbField.setVisible( False ) self.cmbField.setVisible( False )

View File

@ -36,7 +36,7 @@ from ui_frmVectorGrid import Ui_Dialog
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
self.setupUi(self) self.setupUi(self)
QObject.connect(self.toolOut, SIGNAL("clicked()"), self.outFile) QObject.connect(self.toolOut, SIGNAL("clicked()"), self.outFile)

View File

@ -36,7 +36,7 @@ from ui_frmVectorSplit import Ui_Dialog
class Dialog(QDialog, Ui_Dialog): class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface): def __init__(self, iface):
QDialog.__init__(self) QDialog.__init__(self, iface.mainWindow())
self.iface = iface self.iface = iface
self.setupUi(self) self.setupUi(self)

View File

@ -37,7 +37,7 @@ import math
class VisualDialog( QDialog, Ui_Dialog ): class VisualDialog( QDialog, Ui_Dialog ):
def __init__( self, iface, function ): def __init__( self, iface, function ):
QDialog.__init__( self ) QDialog.__init__( self, iface.mainWindow() )
self.iface = iface self.iface = iface
self.setupUi( self ) self.setupUi( self )
self.myFunction = function self.myFunction = function

View File

@ -73,7 +73,7 @@ class MapServerExport:
# run method that performs all the real work # run method that performs all the real work
def run(self): def run(self):
# create and show the MapServerExport dialog # create and show the MapServerExport dialog
self.dlg = MapServerExportDialog() self.dlg = MapServerExportDialog(self.iface.mainWindow())
# attach events to inputs and buttons # attach events to inputs and buttons
QObject.connect(self.dlg.ui.btnChooseFile, SIGNAL("clicked()"), self.setMapFile) QObject.connect(self.dlg.ui.btnChooseFile, SIGNAL("clicked()"), self.setMapFile)
QObject.connect(self.dlg.ui.txtMapFilePath, SIGNAL("textChanged(QString)"), self.mapfileChanged) QObject.connect(self.dlg.ui.txtMapFilePath, SIGNAL("textChanged(QString)"), self.mapfileChanged)

View File

@ -22,8 +22,8 @@ from ms_export import defaults
from ui_qgsmapserverexportbase import Ui_QgsMapserverExportBase from ui_qgsmapserverexportbase import Ui_QgsMapserverExportBase
# create the dialog for mapserver export # create the dialog for mapserver export
class MapServerExportDialog(QtGui.QDialog): class MapServerExportDialog(QtGui.QDialog):
def __init__(self): def __init__(self, parent):
QtGui.QDialog.__init__(self) QtGui.QDialog.__init__(self, parent)
# Set up the user interface from Designer. # Set up the user interface from Designer.
self.ui = Ui_QgsMapserverExportBase() self.ui = Ui_QgsMapserverExportBase()
self.ui.setupUi(self) self.ui.setupUi(self)

View File

@ -37,7 +37,7 @@ class OsmAddRelationDlg(QDialog, Ui_OsmAddRelationDlg):
@param relationToEdit if relation is given, this dialog is for editing of existing relation, not for creation a new one @param relationToEdit if relation is given, this dialog is for editing of existing relation, not for creation a new one
""" """
QDialog.__init__(self,None) QDialog.__init__(self, plugin.iface.mainWindow())
self.setupUi(self) self.setupUi(self)
self.dockWidget=plugin.dockWidget self.dockWidget=plugin.dockWidget
self.plugin=plugin self.plugin=plugin

View File

@ -46,7 +46,7 @@ class OsmDownloadDlg(QDialog, Ui_OsmDownloadDlg):
@param plugin is pointer to instance of OSM Plugin. @param plugin is pointer to instance of OSM Plugin.
""" """
QDialog.__init__(self, None) QDialog.__init__(self, plugin.iface.mainWindow())
self.setupUi(self) self.setupUi(self)
self.dbm=plugin.dbm self.dbm=plugin.dbm

View File

@ -53,7 +53,7 @@ class OsmImportDlg(QDialog, Ui_OsmImportDlg):
@param plugin is pointer to instance of OSM Plugin @param plugin is pointer to instance of OSM Plugin
""" """
QDialog.__init__(self, None) QDialog.__init__(self, plugin.iface.mainWindow())
self.setupUi(self) self.setupUi(self)
self.plugin=plugin self.plugin=plugin

View File

@ -40,7 +40,7 @@ class OsmLoadDlg(QDialog, Ui_OsmLoadDlg):
@param plugin is pointer to instance of OSM Plugin @param plugin is pointer to instance of OSM Plugin
""" """
QDialog.__init__(self, None) QDialog.__init__(self, plugin.iface.mainWindow())
self.setupUi(self) self.setupUi(self)
self.canvas=plugin.canvas self.canvas=plugin.canvas

View File

@ -31,7 +31,7 @@ class OsmSaveDlg(QDialog, Ui_OsmSaveDlg):
@param plugin is pointer to instance of OSM Plugin @param plugin is pointer to instance of OSM Plugin
""" """
QDialog.__init__(self, None) QDialog.__init__(self, plugin.iface.mainWindow())
self.setupUi(self) self.setupUi(self)
self.plugin=plugin self.plugin=plugin

View File

@ -47,7 +47,7 @@ class OsmUploadDlg(QDialog, Ui_OsmUploadDlg):
@param plugin is pointer to instance of OSM Plugin. @param plugin is pointer to instance of OSM Plugin.
""" """
QDialog.__init__(self,None) QDialog.__init__(self, plugin.iface.mainWindow())
self.setupUi(self) self.setupUi(self)
self.dockWidget=plugin.dockWidget self.dockWidget=plugin.dockWidget

View File

@ -3062,7 +3062,7 @@ void QgisApp::newPrintComposer()
void QgisApp::showComposerManager() void QgisApp::showComposerManager()
{ {
QgsComposerManager m; QgsComposerManager m( this );
m.exec(); m.exec();
} }
@ -5149,7 +5149,7 @@ void QgisApp::addMapLayer( QgsMapLayer *theMapLayer )
void QgisApp::embedLayers() void QgisApp::embedLayers()
{ {
//dialog to select groups/layers from other project files //dialog to select groups/layers from other project files
QgsEmbedLayerDialog d; QgsEmbedLayerDialog d( this );
if ( d.exec() == QDialog::Accepted ) if ( d.exec() == QDialog::Accepted )
{ {
mMapCanvas->freeze( true ); mMapCanvas->freeze( true );

View File

@ -259,7 +259,7 @@ void QgsGrassBrowser::copyMap()
typeName = "region"; typeName = "region";
} }
QgsGrassElementDialog ed; QgsGrassElementDialog ed( this );
bool ok; bool ok;
QString source; QString source;
QString suggest; QString suggest;
@ -344,7 +344,7 @@ void QgsGrassBrowser::renameMap()
typeName = "region"; typeName = "region";
} }
QgsGrassElementDialog ed; QgsGrassElementDialog ed( this );
bool ok; bool ok;
QString newName = ed.getItem( element, tr( "New name" ), QString newName = ed.getItem( element, tr( "New name" ),
tr( "New name for layer \"%1\"" ).arg( map ), "", map, &ok ); tr( "New name for layer \"%1\"" ).arg( map ), "", map, &ok );

View File

@ -40,7 +40,7 @@ QgsGrassMapcalc::QgsGrassMapcalc(
QgsGrassTools *tools, QgsGrassModule *module, QgsGrassTools *tools, QgsGrassModule *module,
QgisInterface *iface, QgisInterface *iface,
QWidget * parent, Qt::WFlags f ) QWidget * parent, Qt::WFlags f )
: QMainWindow( 0, Qt::Dialog ) : QMainWindow( iface->mainWindow(), Qt::Dialog )
, QgsGrassMapcalcBase( ) , QgsGrassMapcalcBase( )
, QgsGrassModuleOptions( tools, module, iface ) , QgsGrassModuleOptions( tools, module, iface )
, mTool( -1 ) , mTool( -1 )
@ -1255,7 +1255,7 @@ void QgsGrassMapcalc::load()
{ {
QgsDebugMsg( "entered." ); QgsDebugMsg( "entered." );
QgsGrassSelect *sel = new QgsGrassSelect( QgsGrassSelect::MAPCALC ); QgsGrassSelect *sel = new QgsGrassSelect( this, QgsGrassSelect::MAPCALC );
if ( sel->exec() == QDialog::Rejected ) if ( sel->exec() == QDialog::Rejected )
return; return;

View File

@ -52,7 +52,7 @@ class QgsGrassModule: public QDialog, private Ui::QgsGrassModuleBase
public: public:
//! Constructor //! Constructor
QgsGrassModule( QgsGrassTools *tools, QString moduleName, QgisInterface *iface, QgsGrassModule( QgsGrassTools *tools, QString moduleName, QgisInterface *iface,
QString path, QWidget * parent = 0, Qt::WFlags f = 0 ); QString path, QWidget *parent, Qt::WFlags f = 0 );
//! Destructor //! Destructor
~QgsGrassModule(); ~QgsGrassModule();

View File

@ -292,7 +292,7 @@ void QgsGrassPlugin::addVector()
// QgsDebugMsg("entered."); // QgsDebugMsg("entered.");
QString uri; QString uri;
QgsGrassSelect *sel = new QgsGrassSelect( QgsGrassSelect::VECTOR ); QgsGrassSelect *sel = new QgsGrassSelect( qGisInterface->mainWindow(), QgsGrassSelect::VECTOR );
if ( sel->exec() ) if ( sel->exec() )
{ {
uri = sel->gisdbase + "/" + sel->location + "/" + sel->mapset + "/" + sel->map + "/" + sel->layer; uri = sel->gisdbase + "/" + sel->location + "/" + sel->mapset + "/" + sel->map + "/" + sel->layer;
@ -387,7 +387,7 @@ void QgsGrassPlugin::addRaster()
// QgsDebugMsg("entered."); // QgsDebugMsg("entered.");
QString uri; QString uri;
QgsGrassSelect *sel = new QgsGrassSelect( QgsGrassSelect::RASTER ); QgsGrassSelect *sel = new QgsGrassSelect( qGisInterface->mainWindow(), QgsGrassSelect::RASTER );
if ( sel->exec() ) if ( sel->exec() )
{ {
QString element; QString element;
@ -520,7 +520,7 @@ void QgsGrassPlugin::newVector()
bool ok; bool ok;
QString name; QString name;
QgsGrassElementDialog dialog; QgsGrassElementDialog dialog( qGisInterface->mainWindow() );
name = dialog.getItem( "vector", tr( "New vector name" ), name = dialog.getItem( "vector", tr( "New vector name" ),
tr( "New vector name" ), "", "", &ok ); tr( "New vector name" ), "", "", &ok );
@ -710,7 +710,7 @@ void QgsGrassPlugin::openMapset()
QString element; QString element;
QgsGrassSelect *sel = new QgsGrassSelect( QgsGrassSelect::MAPSET ); QgsGrassSelect *sel = new QgsGrassSelect( qGisInterface->mainWindow(), QgsGrassSelect::MAPSET );
if ( !sel->exec() ) if ( !sel->exec() )
return; return;

View File

@ -29,7 +29,7 @@ extern "C"
} }
QgsGrassSelect::QgsGrassSelect( int type ): QgsGrassSelectBase() QgsGrassSelect::QgsGrassSelect( QWidget *parent, int type ): QDialog( parent ), QgsGrassSelectBase()
{ {
QgsDebugMsg( QString( "QgsGrassSelect() type = %1" ).arg( type ) ); QgsDebugMsg( QString( "QgsGrassSelect() type = %1" ).arg( type ) );

View File

@ -28,7 +28,7 @@ class QgsGrassSelect: public QDialog, private Ui::QgsGrassSelectBase
public: public:
//! Constructor //! Constructor
//QgsGrassSelect(QWidget *parent = 0, int type = VECTOR ); //QgsGrassSelect(QWidget *parent = 0, int type = VECTOR );
QgsGrassSelect( int type = VECTOR ); QgsGrassSelect( QWidget *parent, int type = VECTOR );
//! Destructor //! Destructor
~QgsGrassSelect(); ~QgsGrassSelect();

View File

@ -65,7 +65,7 @@ bool QgsGrassUtils::itemExists( QString element, QString item )
return fi.exists(); return fi.exists();
} }
QgsGrassElementDialog::QgsGrassElementDialog() : QObject() QgsGrassElementDialog::QgsGrassElementDialog( QWidget *parent ) : QObject(), mParent( parent )
{ {
} }
@ -80,7 +80,7 @@ QString QgsGrassElementDialog::getItem( QString element,
*ok = false; *ok = false;
mElement = element; mElement = element;
mSource = source; mSource = source;
mDialog = new QDialog(); mDialog = new QDialog( mParent );
mDialog->setWindowTitle( title ); mDialog->setWindowTitle( title );
QVBoxLayout *layout = new QVBoxLayout( mDialog ); QVBoxLayout *layout = new QVBoxLayout( mDialog );
QHBoxLayout *buttonLayout = new QHBoxLayout( ); QHBoxLayout *buttonLayout = new QHBoxLayout( );

View File

@ -58,7 +58,7 @@ class QgsGrassElementDialog: public QObject
public: public:
//! Constructor //! Constructor
QgsGrassElementDialog(); QgsGrassElementDialog( QWidget *parent );
//! Destructor //! Destructor
~QgsGrassElementDialog(); ~QgsGrassElementDialog();
@ -83,6 +83,7 @@ class QgsGrassElementDialog: public QObject
QLabel *mErrorLabel; QLabel *mErrorLabel;
QPushButton *mOkButton; QPushButton *mOkButton;
QPushButton *mCancelButton; QPushButton *mCancelButton;
QWidget *mParent;
}; };
#endif // QGSGRASSUTILS_H #endif // QGSGRASSUTILS_H

View File

@ -20,10 +20,11 @@
#include "qgsrasterlayer.h" #include "qgsrasterlayer.h"
#include "qgsvectordataprovider.h" #include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h" #include "qgsvectorlayer.h"
#include "qgisinterface.h"
#include <QSettings> #include <QSettings>
QgsZonalStatisticsDialog::QgsZonalStatisticsDialog( QgisInterface* iface ): QDialog(), mIface( iface ) QgsZonalStatisticsDialog::QgsZonalStatisticsDialog( QgisInterface* iface ): QDialog( iface->mainWindow() ), mIface( iface )
{ {
setupUi( this ); setupUi( this );