From kde-commits Thu Nov 13 22:31:18 2008 From: Inge Wallin Date: Thu, 13 Nov 2008 22:31:18 +0000 To: kde-commits Subject: KDE/kdeedu/marble/src Message-Id: <1226615478.601267.16264.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=122661549022409 SVN commit 883967 by ingwa: Make the Sun Shadow control work. There are still a couple of glitches that I will fix in the next commit, once I have identified them all. At least it can be turned off and on now and you can also choose between different modes. M +4 -2 lib/SunControlWidget.cpp M +5 -3 lib/SunControlWidget.h M +1 -1 lib/SunControlWidget.ui M +19 -11 marble_part.cpp M +7 -5 marble_part.h M +1 -1 marble_part.rc M +1 -1 marbleui.rc --- trunk/KDE/kdeedu/marble/src/lib/SunControlWidget.cpp #883966:883967 @@ -5,7 +5,8 @@ // find a copy of this license in LICENSE.txt in the top directory of // the source code. // -// Copyright 2008 David Roberts +// Copyright 2008 David Roberts +// Copyright 2008 Inge Wallin // @@ -53,12 +54,13 @@ else m_uiWidget.showToolButton->setText( tr("Sh&ow") ); - emit showSun(checked); + emit showSun( checked ); } void SunControlWidget::nowClicked(bool checked) { Q_UNUSED( checked ) + m_sunLocator->datetime()->setNow(); m_sunLocator->update(); updateDateTime(); --- trunk/KDE/kdeedu/marble/src/lib/SunControlWidget.h #883966:883967 @@ -5,7 +5,8 @@ // find a copy of this license in LICENSE.txt in the top directory of // the source code. // -// Copyright 2008 David Roberts +// Copyright 2008 David Roberts +// Copyright 2008 Inge Wallin // @@ -53,8 +54,9 @@ protected: Q_DISABLE_COPY( SunControlWidget ) - Ui::SunControlWidget m_uiWidget; - SunLocator* m_sunLocator; + + Ui::SunControlWidget m_uiWidget; + SunLocator *m_sunLocator; }; } --- trunk/KDE/kdeedu/marble/src/lib/SunControlWidget.ui #883966:883967 @@ -185,7 +185,7 @@ - false + true <html><head><meta name="qrichtext" content="1" /><style type="text/css"> --- trunk/KDE/kdeedu/marble/src/marble_part.cpp #883966:883967 @@ -5,7 +5,8 @@ // find a copy of this license in LICENSE.txt in the top directory of // the source code. // -// Copyright 2007 Tobias Koenig " +// Copyright 2007 Tobias Koenig +// Copyright 2008 Inge Wallin // @@ -83,8 +84,8 @@ m_distanceLabel( 0 ) { // only set marble data path when a path was given - if(arguments.count() != 0 && !arguments.first().isEmpty()) - MarbleDirs::setMarbleDataPath(arguments.first()); + if ( arguments.count() != 0 && !arguments.first().isEmpty() ) + MarbleDirs::setMarbleDataPath( arguments.first() ); setComponentData( MarblePartFactory::componentData() ); @@ -259,18 +260,25 @@ m_statusBarExtension->statusBar()->setVisible( isChecked ); } -void MarblePart::showSun() +void MarblePart::controlSun() { - if (!m_sunControlDialog) + if ( !m_sunControlDialog ) { m_sunControlDialog = new SunControlWidget( NULL, m_controlView->sunLocator() ); + connect( m_sunControlDialog, SIGNAL( showSun( bool ) ), + this, SLOT ( showSun( bool ) ) ); + } - m_sunControlDialog->show(); m_sunControlDialog->raise(); m_sunControlDialog->activateWindow(); } +void MarblePart::showSun( bool active ) +{ + m_controlView->marbleWidget()->sunLocator()->setShow( active ); +} + void MarblePart::copyMap() { QPixmap mapPixmap = m_controlView->mapScreenShot(); @@ -508,11 +516,11 @@ this, SLOT( setShowClouds( bool ) ) ); // Action: Show Sunshade options - m_showSunAct = new KAction( this ); - actionCollection()->addAction( "show_sun", m_showSunAct ); - m_showSunAct->setText( i18n( "S&un Control" ) ); - connect( m_showSunAct, SIGNAL( triggered( bool ) ), - this, SLOT( showSun() ) ); + m_controlSunAction = new KAction( this ); + actionCollection()->addAction( "control_sun", m_controlSunAction ); + m_controlSunAction->setText( i18n( "S&un Control..." ) ); + connect( m_controlSunAction, SIGNAL( triggered( bool ) ), + this, SLOT( controlSun() ) ); // Action: Lock float items m_lockFloatItemsAct = new KAction ( this ); --- trunk/KDE/kdeedu/marble/src/marble_part.h #883966:883967 @@ -5,7 +5,8 @@ // find a copy of this license in LICENSE.txt in the top directory of // the source code. // -// Copyright 2007 Tobias Koenig " +// Copyright 2007 Tobias Koenig +// Copyright 2008 Inge Wallin // #ifndef MARBLE_PART_H @@ -62,7 +63,8 @@ void showSideBar( bool ); void showStatusBar( bool ); void lockFloatItemPosition( bool ); - void showSun(); + void controlSun(); + void showSun( bool ); void setupStatusBar(); void showNewStuffDialog(); @@ -82,8 +84,8 @@ private: // All the functionality is provided by this widget. - ControlView *m_controlView; - SunControlWidget* m_sunControlDialog; + ControlView *m_controlView; // MarbleControlBox and MarbleWidget + SunControlWidget *m_sunControlDialog; // Actions for the GUI. KAction *m_exportMapAction; @@ -97,7 +99,7 @@ KAction *m_fullScreenAct; KAction *m_openAct; KAction *m_newStuffAction; - KAction *m_showSunAct; + KAction *m_controlSunAction; KAction *m_lockFloatItemsAct; QStandardItemModel* m_pluginModel; --- trunk/KDE/kdeedu/marble/src/marble_part.rc #883966:883967 @@ -29,7 +29,7 @@ - + &Settings --- trunk/KDE/kdeedu/marble/src/marbleui.rc #883966:883967 @@ -22,7 +22,7 @@ - + &Settings