BookMarks::BookMarks(QWidget *parent) : QTreeWidget(parent) { setAcceptDrops(true); setDragEnabled(false); setDragDropMode(QAbstractItemView::DropOnly); connect(this, SIGNAL(expanded( const QModelIndex &)), this, SLOT(resizeTreeColumn( const QModelIndex &))); connect(this, SIGNAL(collapsed( const QModelIndex &)), this, SLOT(resizeTreeColumn( const QModelIndex &))); setColumnCount(1); setHeaderHidden(true); reloadBookmarks(); }
RoutingInputWidget::RoutingInputWidget( MarbleModel* model, int index, QWidget *parent ) : QWidget( parent ), d( new RoutingInputWidgetPrivate( model, index, this ) ) { QHBoxLayout *layout = new QHBoxLayout( this ); layout->setSizeConstraint( QLayout::SetMinimumSize ); layout->setSpacing( 0 ); layout->setMargin( 0 ); layout->addWidget( d->m_lineEdit ); layout->addWidget( d->m_removeButton ); bool const smallScreen = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen; if ( smallScreen ) { connect( d->m_lineEdit, SIGNAL(decoratorButtonClicked()), this, SLOT(openTargetSelectionDialog()) ); } else { d->createMenu( this ); connect(d->m_lineEdit, SIGNAL(decoratorButtonClicked()), this, SLOT(showMenu())); } connect( d->m_removeButton, SIGNAL(clicked()), this, SLOT(requestRemoval()) ); connect( d->m_marbleModel->bookmarkManager(), SIGNAL(bookmarksChanged()), this, SLOT(reloadBookmarks()) ); connect( d->m_marbleModel->positionTracking(), SIGNAL(statusChanged(PositionProviderStatus)), this, SLOT(updateCurrentLocationButton(PositionProviderStatus)) ); connect( &d->m_placemarkRunnerManager, SIGNAL(searchResultChanged(QAbstractItemModel*)), this, SLOT(setPlacemarkModel(QAbstractItemModel*)) ); connect( &d->m_reverseGeocodingRunnerManager, SIGNAL(reverseGeocodingFinished(GeoDataCoordinates,GeoDataPlacemark)), this, SLOT(retrieveReverseGeocodingResult(GeoDataCoordinates,GeoDataPlacemark)) ); connect( d->m_lineEdit, SIGNAL(returnPressed()), this, SLOT(findPlacemarks()) ); connect( d->m_lineEdit, SIGNAL(textEdited(QString)), this, SLOT(setInvalid()) ); connect( &d->m_placemarkRunnerManager, SIGNAL(searchFinished(QString)), this, SLOT(finishSearch()) ); connect( d->m_marbleModel->routingManager()->routeRequest(), SIGNAL(positionChanged(int,GeoDataCoordinates)), this, SLOT(updatePosition(int,GeoDataCoordinates)) ); connect( &d->m_nominatimTimer, SIGNAL(timeout()), this, SLOT(reverseGeocoding()) ); connect( this, SIGNAL(targetValidityChanged(bool)), this, SLOT(updateCenterButton(bool)) ); updateCenterButton( hasTargetPosition() ); d->adjustText(); }
void BookMarks::removeBookmark() { if (selectedItems().size() == 1) { Settings::bookmarkPaths.remove(selectedItems().at(0)->toolTip(0)); reloadBookmarks(); } }