Skip to content

Commit

Permalink
set parents of various objects to propagate the font settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 25, 2012
1 parent 87ae8a3 commit ac44ace
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
18 changes: 9 additions & 9 deletions src/app/qgisapp.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1052,9 +1052,9 @@ void QgisApp::createMenus()
*/ */


// Panel and Toolbar Submenus // Panel and Toolbar Submenus
mPanelMenu = new QMenu( tr( "Panels" ) ); mPanelMenu = new QMenu( tr( "Panels" ), this );
mPanelMenu->setObjectName( "mPanelMenu" ); mPanelMenu->setObjectName( "mPanelMenu" );
mToolbarMenu = new QMenu( tr( "Toolbars" ) ); mToolbarMenu = new QMenu( tr( "Toolbars" ), this );
mToolbarMenu->setObjectName( "mToolbarMenu" ); mToolbarMenu->setObjectName( "mToolbarMenu" );


// Get platform for menu layout customization (Gnome, Kde, Mac, Win) // Get platform for menu layout customization (Gnome, Kde, Mac, Win)
Expand Down Expand Up @@ -1109,13 +1109,13 @@ void QgisApp::createMenus()


// Database Menu // Database Menu
// don't add it yet, wait for a plugin // don't add it yet, wait for a plugin
mDatabaseMenu = new QMenu( tr( "&Database" ) ); mDatabaseMenu = new QMenu( tr( "&Database" ), this );
// Vector Menu // Vector Menu
// don't add it yet, wait for a plugin // don't add it yet, wait for a plugin
mVectorMenu = new QMenu( tr( "Vect&or" ) ); mVectorMenu = new QMenu( tr( "Vect&or" ), this );
// Web Menu // Web Menu
// don't add it yet, wait for a plugin // don't add it yet, wait for a plugin
mWebMenu = new QMenu( tr( "&Web" ) ); mWebMenu = new QMenu( tr( "&Web" ), this );


// Help menu // Help menu
// add What's this button to it // add What's this button to it
Expand Down Expand Up @@ -2665,7 +2665,7 @@ void QgisApp::newSpatialiteLayer()


void QgisApp::showRasterCalculator() void QgisApp::showRasterCalculator()
{ {
QgsRasterCalcDialog d; QgsRasterCalcDialog d( this );
if ( d.exec() == QDialog::Accepted ) if ( d.exec() == QDialog::Accepted )
{ {
//invoke analysis library //invoke analysis library
Expand Down Expand Up @@ -4329,7 +4329,7 @@ bool QgisApp::toggleEditing( QgsMapLayer *layer, bool allowCancel )


if ( !vlayer->isEditable() && !vlayer->isReadOnly() ) if ( !vlayer->isEditable() && !vlayer->isReadOnly() )
{ {
if ( !(vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::EditingCapabilities ) ) if ( !( vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::EditingCapabilities ) )
{ {
QMessageBox::information( 0, tr( "Start editing failed" ), tr( "Provider cannot be opened for editing" ) ); QMessageBox::information( 0, tr( "Start editing failed" ), tr( "Provider cannot be opened for editing" ) );
return false; return false;
Expand All @@ -4342,7 +4342,7 @@ bool QgisApp::toggleEditing( QgsMapLayer *layer, bool allowCancel )
bool markSelectedOnly = settings.value( "/qgis/digitizing/marker_only_for_selected", false ).toBool(); bool markSelectedOnly = settings.value( "/qgis/digitizing/marker_only_for_selected", false ).toBool();


// redraw only if markers will be drawn // redraw only if markers will be drawn
if( ( !markSelectedOnly || vlayer->selectedFeatureCount() > 0 ) && if (( !markSelectedOnly || vlayer->selectedFeatureCount() > 0 ) &&
( markerType == "Cross" || markerType == "SemiTransparentCircle" ) ) ( markerType == "Cross" || markerType == "SemiTransparentCircle" ) )
{ {
vlayer->triggerRepaint(); vlayer->triggerRepaint();
Expand Down Expand Up @@ -4857,7 +4857,7 @@ void QgisApp::configureShortcuts()


void QgisApp::customize() void QgisApp::customize()
{ {
QgsCustomization::instance()->openDialog(); QgsCustomization::instance()->openDialog( this );
} }




Expand Down
22 changes: 11 additions & 11 deletions src/app/qgscustomization.cpp
100644 → 100755
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
#include <QMetaObject> #include <QMetaObject>


#ifdef Q_OS_MACX #ifdef Q_OS_MACX
QgsCustomizationDialog::QgsCustomizationDialog() QgsCustomizationDialog::QgsCustomizationDialog( QWidget *parent )
: QMainWindow( NULL, Qt::WindowSystemMenuHint ) // Modeless dialog with close button only : QMainWindow( parent, Qt::WindowSystemMenuHint ) // Modeless dialog with close button only
, mSettings( "QuantumGIS", "QGISCUSTOMIZATION" ) , mSettings( "QuantumGIS", "QGISCUSTOMIZATION" )
#else #else
QgsCustomizationDialog::QgsCustomizationDialog() QgsCustomizationDialog::QgsCustomizationDialog( QWidget *parent )
: QMainWindow( NULL ) : QMainWindow( parent )
, mSettings( "QuantumGIS", "QGISCUSTOMIZATION" ) , mSettings( "QuantumGIS", "QGISCUSTOMIZATION" )
#endif #endif
{ {
Expand Down Expand Up @@ -597,11 +597,11 @@ QgsCustomization *QgsCustomization::instance()
return pinstance; return pinstance;
} }


QgsCustomization::QgsCustomization( ) : QgsCustomization::QgsCustomization()
pDialog( 0 ), : pDialog( 0 )
mEnabled( true ), , mEnabled( true )
mStatusPath( "/Customization/status" ), , mStatusPath( "/Customization/status" )
mSettings( "QuantumGIS", "QGISCUSTOMIZATION" ) , mSettings( "QuantumGIS", "QGISCUSTOMIZATION" )
{ {
QgsDebugMsg( "Entered" ); QgsDebugMsg( "Entered" );
} }
Expand Down Expand Up @@ -756,12 +756,12 @@ void QgsCustomization::updateMenu( QMenu* menu, QSettings& settings )
settings.endGroup(); settings.endGroup();
} }


void QgsCustomization::openDialog() void QgsCustomization::openDialog( QWidget *parent )
{ {
QgsDebugMsg( "Entered" ); QgsDebugMsg( "Entered" );
if ( !pDialog ) if ( !pDialog )
{ {
pDialog = new QgsCustomizationDialog(); pDialog = new QgsCustomizationDialog( parent );
} }


// I am trying too enable switching widget status by clicking in main app, so I need non modal // I am trying too enable switching widget status by clicking in main app, so I need non modal
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgscustomization.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class QgsCustomizationDialog : public QMainWindow, private Ui::QgsCustomizationD
{ {
Q_OBJECT Q_OBJECT
public: public:
QgsCustomizationDialog(); QgsCustomizationDialog( QWidget *parent );
~QgsCustomizationDialog(); ~QgsCustomizationDialog();


// get item by path // get item by path
Expand Down Expand Up @@ -113,7 +113,7 @@ class QgsCustomization : public QObject
//! Returns the instance pointer, creating the object on the first call //! Returns the instance pointer, creating the object on the first call
static QgsCustomization* instance(); static QgsCustomization* instance();


void openDialog(); void openDialog( QWidget *parent );
static void customizeWidget( QWidget * widget, QEvent * event ); static void customizeWidget( QWidget * widget, QEvent * event );
static void customizeWidget( QString path, QWidget * widget ); static void customizeWidget( QString path, QWidget * widget );
static void removeFromLayout( QLayout *theLayout, QWidget * widget ); static void removeFromLayout( QLayout *theLayout, QWidget * widget );
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/interpolation/qgsinterpolationdialog.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -358,11 +358,11 @@ void QgsInterpolationDialog::on_mInterpolationMethodComboBox_currentIndexChanged
delete mInterpolatorDialog; delete mInterpolatorDialog;
if ( text == tr( "Inverse Distance Weighting (IDW)" ) ) if ( text == tr( "Inverse Distance Weighting (IDW)" ) )
{ {
mInterpolatorDialog = new QgsIDWInterpolatorDialog( 0, mIface ); mInterpolatorDialog = new QgsIDWInterpolatorDialog( this, mIface );
} }
else if ( text == tr( "Triangular interpolation (TIN)" ) ) else if ( text == tr( "Triangular interpolation (TIN)" ) )
{ {
mInterpolatorDialog = new QgsTINInterpolatorDialog( 0, mIface ); mInterpolatorDialog = new QgsTINInterpolatorDialog( this, mIface );
} }
} }


Expand Down
2 changes: 1 addition & 1 deletion src/plugins/interpolation/qgsinterpolationplugin.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void QgsInterpolationPlugin::unload()


void QgsInterpolationPlugin::showInterpolationDialog() void QgsInterpolationPlugin::showInterpolationDialog()
{ {
QgsInterpolationDialog dialog( 0, mIface ); QgsInterpolationDialog dialog( mIface->mainWindow(), mIface );
dialog.exec(); dialog.exec();
} }


Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void QgsRasterTerrainAnalysisPlugin::initGui()
return; return;
} }


mTerrainAnalysisMenu = new QMenu( tr( "Terrain analysis" ) ); mTerrainAnalysisMenu = new QMenu( tr( "Terrain analysis" ), rasterMenu );
mTerrainAnalysisMenu->addAction( tr( "Slope" ), this, SLOT( slope() ) ); mTerrainAnalysisMenu->addAction( tr( "Slope" ), this, SLOT( slope() ) );
mTerrainAnalysisMenu->addAction( tr( "Aspect" ), this, SLOT( aspect() ) ); mTerrainAnalysisMenu->addAction( tr( "Aspect" ), this, SLOT( aspect() ) );
mTerrainAnalysisMenu->addAction( tr( "Hillshade" ), this, SLOT( hillshade() ) ); mTerrainAnalysisMenu->addAction( tr( "Hillshade" ), this, SLOT( hillshade() ) );
Expand All @@ -107,7 +107,7 @@ void QgsRasterTerrainAnalysisPlugin::unload()


void QgsRasterTerrainAnalysisPlugin::hillshade() void QgsRasterTerrainAnalysisPlugin::hillshade()
{ {
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::HillshadeInput ); QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::HillshadeInput, mIface->mainWindow() );
d.setWindowTitle( tr( "Hillshade" ) ); d.setWindowTitle( tr( "Hillshade" ) );
if ( d.exec() == QDialog::Accepted ) if ( d.exec() == QDialog::Accepted )
{ {
Expand All @@ -126,7 +126,7 @@ void QgsRasterTerrainAnalysisPlugin::hillshade()


void QgsRasterTerrainAnalysisPlugin::relief() void QgsRasterTerrainAnalysisPlugin::relief()
{ {
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::ReliefInput ); QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::ReliefInput, mIface->mainWindow() );
d.setWindowTitle( tr( "Relief" ) ); d.setWindowTitle( tr( "Relief" ) );
if ( d.exec() == QDialog::Accepted ) if ( d.exec() == QDialog::Accepted )
{ {
Expand All @@ -146,7 +146,7 @@ void QgsRasterTerrainAnalysisPlugin::relief()


void QgsRasterTerrainAnalysisPlugin::slope() void QgsRasterTerrainAnalysisPlugin::slope()
{ {
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::NoParameter ); QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::NoParameter, mIface->mainWindow() );
d.setWindowTitle( tr( "Slope" ) ); d.setWindowTitle( tr( "Slope" ) );
if ( d.exec() == QDialog::Accepted ) if ( d.exec() == QDialog::Accepted )
{ {
Expand All @@ -165,7 +165,7 @@ void QgsRasterTerrainAnalysisPlugin::slope()


void QgsRasterTerrainAnalysisPlugin::aspect() void QgsRasterTerrainAnalysisPlugin::aspect()
{ {
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::NoParameter ); QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::NoParameter, mIface->mainWindow() );
d.setWindowTitle( tr( "Aspect" ) ); d.setWindowTitle( tr( "Aspect" ) );
if ( d.exec() == QDialog::Accepted ) if ( d.exec() == QDialog::Accepted )
{ {
Expand All @@ -184,7 +184,7 @@ void QgsRasterTerrainAnalysisPlugin::aspect()


void QgsRasterTerrainAnalysisPlugin::ruggedness() void QgsRasterTerrainAnalysisPlugin::ruggedness()
{ {
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::NoParameter ); QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::NoParameter, mIface->mainWindow() );
d.setWindowTitle( tr( "Ruggedness" ) ); d.setWindowTitle( tr( "Ruggedness" ) );
if ( d.exec() == QDialog::Accepted ) if ( d.exec() == QDialog::Accepted )
{ {
Expand Down

0 comments on commit ac44ace

Please sign in to comment.