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 Diff line number Diff line change
Expand Up @@ -1052,9 +1052,9 @@ void QgisApp::createMenus()
*/

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

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

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

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

void QgisApp::showRasterCalculator()
{
QgsRasterCalcDialog d;
QgsRasterCalcDialog d( this );
if ( d.exec() == QDialog::Accepted )
{
//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->dataProvider()->capabilities() & QgsVectorDataProvider::EditingCapabilities ) )
if ( !( vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::EditingCapabilities ) )
{
QMessageBox::information( 0, tr( "Start editing failed" ), tr( "Provider cannot be opened for editing" ) );
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();

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

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 Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
#include <QMetaObject>

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

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

void QgsCustomization::openDialog()
void QgsCustomization::openDialog( QWidget *parent )
{
QgsDebugMsg( "Entered" );
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
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgscustomization.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class QgsCustomizationDialog : public QMainWindow, private Ui::QgsCustomizationD
{
Q_OBJECT
public:
QgsCustomizationDialog();
QgsCustomizationDialog( QWidget *parent );
~QgsCustomizationDialog();

// 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
static QgsCustomization* instance();

void openDialog();
void openDialog( QWidget *parent );
static void customizeWidget( QWidget * widget, QEvent * event );
static void customizeWidget( QString path, 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 Diff line number Diff line change
Expand Up @@ -358,11 +358,11 @@ void QgsInterpolationDialog::on_mInterpolationMethodComboBox_currentIndexChanged
delete mInterpolatorDialog;
if ( text == tr( "Inverse Distance Weighting (IDW)" ) )
{
mInterpolatorDialog = new QgsIDWInterpolatorDialog( 0, mIface );
mInterpolatorDialog = new QgsIDWInterpolatorDialog( this, mIface );
}
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 Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void QgsInterpolationPlugin::unload()

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

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

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

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

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

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

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

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

0 comments on commit ac44ace

Please sign in to comment.