Skip to content

Commit

Permalink
Merge pull request #8 from kyngchaos/release-1_7_0
Browse files Browse the repository at this point in the history
finish fix for #3497
  • Loading branch information
timlinux committed May 8, 2011
2 parents aadfa8c + 7e9b541 commit 934466b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 11 deletions.
14 changes: 14 additions & 0 deletions src/gui/symbology-ng/qgssymbollayerv2widget.cpp
Expand Up @@ -86,6 +86,8 @@ void QgsSimpleLineSymbolLayerV2Widget::colorChanged()
{
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889
// FIXME need to also check max QT_VERSION when Qt bug fixed
QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog );
#else
QColor color = QColorDialog::getColor( mLayer->color(), this );
Expand Down Expand Up @@ -233,6 +235,8 @@ void QgsSimpleMarkerSymbolLayerV2Widget::setColorBorder()
{
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889
// FIXME need to also check max QT_VERSION when Qt bug fixed
QColor borderColor = QColorDialog::getColor( mLayer->borderColor(), this, "", QColorDialog::DontUseNativeDialog );
#else
QColor borderColor = QColorDialog::getColor( mLayer->borderColor(), this );
Expand All @@ -248,6 +252,8 @@ void QgsSimpleMarkerSymbolLayerV2Widget::setColorFill()
{
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889
// FIXME need to also check max QT_VERSION when Qt bug fixed
QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog );
#else
QColor color = QColorDialog::getColor( mLayer->color(), this );
Expand Down Expand Up @@ -327,6 +333,8 @@ void QgsSimpleFillSymbolLayerV2Widget::setColor()
{
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889
// FIXME need to also check max QT_VERSION when Qt bug fixed
QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog );
#else
QColor color = QColorDialog::getColor( mLayer->color(), this );
Expand All @@ -342,6 +350,8 @@ void QgsSimpleFillSymbolLayerV2Widget::setBorderColor()
{
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889
// FIXME need to also check max QT_VERSION when Qt bug fixed
QColor color = QColorDialog::getColor( mLayer->borderColor(), this, "", QColorDialog::DontUseNativeDialog );
#else
QColor color = QColorDialog::getColor( mLayer->borderColor(), this );
Expand Down Expand Up @@ -665,6 +675,8 @@ void QgsLineDecorationSymbolLayerV2Widget::colorChanged()
{
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889
// FIXME need to also check max QT_VERSION when Qt bug fixed
QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog );
#else
QColor color = QColorDialog::getColor( mLayer->color(), this );
Expand Down Expand Up @@ -861,6 +873,8 @@ void QgsFontMarkerSymbolLayerV2Widget::setColor()
{
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889
// FIXME need to also check max QT_VERSION when Qt bug fixed
QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog );
#else
QColor color = QColorDialog::getColor( mLayer->color(), this );
Expand Down
2 changes: 2 additions & 0 deletions src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
Expand Up @@ -176,6 +176,8 @@ void QgsSymbolV2SelectorDialog::setSymbolColor()
{
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889
// FIXME need to also check max QT_VERSION when Qt bug fixed
QColor color = QColorDialog::getColor( mSymbol->color(), this, "", QColorDialog::DontUseNativeDialog );
#else
QColor color = QColorDialog::getColor( mSymbol->color(), this );
Expand Down
42 changes: 31 additions & 11 deletions src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp
Expand Up @@ -73,7 +73,14 @@ void QgsVectorGradientColorRampV2Dialog::updatePreview()

void QgsVectorGradientColorRampV2Dialog::setColor1()
{
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889
// FIXME need to also check max QT_VERSION when Qt bug fixed
QColor color = QColorDialog::getColor( mRamp->color1(), this, "", QColorDialog::DontUseNativeDialog );
#else
QColor color = QColorDialog::getColor( mRamp->color1(), this );
#endif
if ( !color.isValid() )
return;
mRamp->setColor1( color );
Expand All @@ -82,7 +89,14 @@ void QgsVectorGradientColorRampV2Dialog::setColor1()

void QgsVectorGradientColorRampV2Dialog::setColor2()
{
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889
// FIXME need to also check max QT_VERSION when Qt bug fixed
QColor color = QColorDialog::getColor( mRamp->color2(), this, "", QColorDialog::DontUseNativeDialog );
#else
QColor color = QColorDialog::getColor( mRamp->color2(), this );
#endif
if ( !color.isValid() )
return;
mRamp->setColor2( color );
Expand Down Expand Up @@ -114,7 +128,14 @@ void QgsVectorGradientColorRampV2Dialog::stopDoubleClicked( QTreeWidgetItem* ite
{
if ( column == 0 )
{
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889
// FIXME need to also check max QT_VERSION when Qt bug fixed
QColor color = QColorDialog::getColor( item->data( 0, StopColorRole ).value<QColor>(), this, "", QColorDialog::DontUseNativeDialog );
#else
QColor color = QColorDialog::getColor( item->data( 0, StopColorRole ).value<QColor>(), this );
#endif
if ( !color.isValid() )
return;
setStopColor( item, color );
Expand Down Expand Up @@ -153,13 +174,19 @@ void QgsVectorGradientColorRampV2Dialog::stopDoubleClicked( QTreeWidgetItem* ite

void QgsVectorGradientColorRampV2Dialog::addStop()
{
// Qt 4.7 Mac Cocoa bug: calling QInputDialog::getInt after QColorDialog::getColor will freeze app
// workaround: call QColorDialog::getColor below instead of here
#ifndef QT_MAC_USE_COCOA
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889
// also Qt 4.7 Mac Cocoa bug: calling QInputDialog::getInt after QColorDialog::getColor will freeze app
// workaround: call QColorDialog::getColor below instead of here,
// but not needed at this time because of the other Qt bug
// FIXME need to also check max QT_VERSION when Qt bug(s) fixed
QColor color = QColorDialog::getColor( QColor(), this, "", QColorDialog::DontUseNativeDialog );
#else
QColor color = QColorDialog::getColor( QColor(), this );
#endif
if ( !color.isValid() )
return;
#endif

bool ok;
int val = 50;
Expand All @@ -179,13 +206,6 @@ void QgsVectorGradientColorRampV2Dialog::addStop()
if ( !ok )
return;

// Qt 4.7 Mac Cocoa bug workaround: call QColorDialog::getColor here instead of above
#ifdef QT_MAC_USE_COCOA
QColor color = QColorDialog::getColor( QColor(), this );
if ( !color.isValid() )
return;
#endif

double key = val / 100.0;
QStringList lst;
lst << "." << QString::number( val, 'f', 0 );
Expand Down

0 comments on commit 934466b

Please sign in to comment.