void PhotoPluginItem::addDownloadedFile( const QString& url, const QString& type ) { if( type == "thumbnail" ) { if ( !m_image ) { m_image = new LabelGraphicsItem( this ); m_image->setFrame( FrameGraphicsItem::RectFrame ); MarbleGraphicsGridLayout *layout = new MarbleGraphicsGridLayout( 1, 1 ); layout->addItem( m_image, 0, 0 ); setLayout( layout ); } m_smallImage.load( url ); m_image->setImage( m_smallImage ); } else if ( type == "info" ) { QFile file( url ); if( !file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { return; } GeoDataCoordinates coordinates; CoordinatesParser parser( &coordinates ); if( parser.read( &file ) ) { setCoordinate( coordinates ); m_hasCoordinates = true; } } if ( initialized() ) { emit updated(); } }
void RoutingPlugin::initialize() { QWidget *widget = new QWidget; d->m_widget.setupUi( widget ); d->m_widgetItem = new WidgetGraphicsItem( this ); d->m_widgetItem->setWidget( widget ); PositionProviderPlugin* activePlugin = marbleModel()->positionTracking()->positionProviderPlugin(); d->updateGpsButton( activePlugin ); connect( marbleModel()->positionTracking(), SIGNAL(positionProviderPluginChanged(PositionProviderPlugin*)), this, SLOT(updateGpsButton(PositionProviderPlugin*)) ); d->m_widget.routingButton->setEnabled( false ); connect( d->m_widget.instructionLabel, SIGNAL(linkActivated(QString)), this, SLOT(reverseRoute()) ); #if QT_VERSION < 0x050000 bool const smallScreen = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen; if ( smallScreen ) { /** @todo: The maemo styling of the progressbar adds a black background and some frame * which are even painted when no background painting is requested like WidgetItem does. * This looks really bad on a float item. Using a different style here, but that is only * a workaround. */ d->m_widget.progressBar->setStyle( new QPlastiqueStyle ); } #endif MarbleGraphicsGridLayout *layout = new MarbleGraphicsGridLayout( 1, 1 ); layout->addItem( d->m_widgetItem, 0, 0 ); setLayout( layout ); d->updateButtonVisibility(); }
void License::initialize () { delete m_widgetItem; m_widgetItem = new WidgetGraphicsItem( this ); m_label = new QLabel; m_label->setStyle( new OutlinedStyle ); m_label->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ); m_widgetItem->setWidget( m_label ); MarbleGraphicsGridLayout *layout = new MarbleGraphicsGridLayout( 1, 1 ); layout->addItem( m_widgetItem, 0, 0 ); setLayout( layout ); setPadding( 0 ); updateLicenseText(); connect( marbleModel(), SIGNAL(themeChanged(QString)), this, SLOT(updateLicenseText()) ); }
void Speedometer::initialize () { if ( !m_widgetItem ) { QWidget *widget = new QWidget; m_widget.setupUi( widget ); m_widgetItem = new WidgetGraphicsItem( this ); m_widgetItem->setWidget( widget ); MarbleGraphicsGridLayout *layout = new MarbleGraphicsGridLayout( 1, 1 ); layout->addItem( m_widgetItem, 0, 0 ); setLayout( layout ); setPadding( 0 ); m_locale = MarbleGlobal::getInstance()->locale(); connect( marbleModel()->positionTracking(), SIGNAL(gpsLocation(GeoDataCoordinates,qreal)), this, SLOT(updateLocation(GeoDataCoordinates,qreal)) ); } }
PhotoPluginItem::PhotoPluginItem( MarbleWidget *widget, QObject *parent ) : AbstractDataPluginItem( parent ), m_marbleWidget( widget ), m_image( this ), m_browser( 0 ) { m_action = new QAction( this ); connect( m_action, SIGNAL(triggered()), this, SLOT(openBrowser()) ); setCacheMode( ItemCoordinateCache ); m_image.setFrame( FrameGraphicsItem::ShadowFrame ); m_image.setBorderBrush( QBrush( QColor( Qt::white ) ) ); m_image.setBorderWidth( 2.0 ); m_image.setMargin( 5 ); MarbleGraphicsGridLayout *layout = new MarbleGraphicsGridLayout( 1, 1 ); layout->addItem( &m_image, 0, 0 ); setLayout( layout ); }
void RoutingPlugin::initialize() { QWidget *widget = new QWidget; d->m_widget.setupUi( widget ); d->m_widgetItem = new WidgetGraphicsItem( this ); d->m_widgetItem->setWidget( widget ); PositionProviderPlugin* activePlugin = marbleModel()->positionTracking()->positionProviderPlugin(); d->updateGpsButton( activePlugin ); connect( marbleModel()->positionTracking(), SIGNAL(positionProviderPluginChanged(PositionProviderPlugin*)), this, SLOT(updateGpsButton(PositionProviderPlugin*)) ); d->m_widget.routingButton->setEnabled( false ); connect( d->m_widget.instructionLabel, SIGNAL(linkActivated(QString)), this, SLOT(reverseRoute()) ); MarbleGraphicsGridLayout *layout = new MarbleGraphicsGridLayout( 1, 1 ); layout->addItem( d->m_widgetItem, 0, 0 ); setLayout( layout ); d->updateButtonVisibility(); }
void NavigationFloatItem::initialize() { QWidget *navigationParent = new QWidget( 0 ); navigationParent->setAttribute( Qt::WA_NoSystemBackground, true ); m_navigationWidget = new Ui::Navigation; m_navigationWidget->setupUi( navigationParent ); m_widgetItem = new WidgetGraphicsItem( this ); m_widgetItem->setWidget( navigationParent ); MarbleGraphicsGridLayout *layout = new MarbleGraphicsGridLayout( 1, 1 ); layout->addItem( m_widgetItem, 0, 0 ); setLayout( layout ); if ( m_showHomeButton ) { activateHomeButton(); } else { activateCurrentPositionButton(); } }