예제 #1
0
void PlaylistWindow::self_visibilityChanged()
{
    // When the window was (re)created/destroyed for whatever reason by
    // the toolkit/wm/etc, reveal the search widget if it was active last.
    if (showSearch)
        revealSearch();
    else
        finishSearch();
}
예제 #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);


    // Brush
    QBrush backgroundBrush(Qt::cyan, Qt::Dense6Pattern);


    // Scene and View
    scene = new QGraphicsScene(this);

    view = new myView(scene);
    view->setParent(this);
    view->setBackgroundBrush(backgroundBrush);

    view->display = new GUI;
    view->display->scene = scene;
    view->display->setPos(view->gameManager.board.currentPos);

    ui->layout->addWidget(view);
    view->show();


    // Label Font
    QFont f( "Helvetica Neue", 16);
    ui->strengthLabel->setFont(f);
    ui->toPlayLabel->setFont(f);
    updateToPlayLabel();


    // Search Thread
    search = new searchThread();
    search->view = view;
    connect(view, SIGNAL(moveSearch()), this, SLOT(moveSearch()));
    connect(view, SIGNAL(updateToPlayLabel()), this, SLOT(updateToPlayLabel()));
    connect(search, SIGNAL(finished()), this, SLOT(finishSearch()));

    searchLeftTimer = new QTimer(this);
    searchLeftTimer->setInterval(1000);
    connect(searchLeftTimer, SIGNAL(timeout()), this, SLOT(updateSearchLeft()) );

    // New Game Pop Up
    newGamePU = new newGamePopUp(this);
    connect(newGamePU, SIGNAL(colorChosen(int)), this, SLOT(getColorChoice(int)));


    view->ready = 1;

}
예제 #3
0
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();
}
예제 #4
0
void SearchPkcs11::on_search_clicked()
{
	if (searching) {
		return;
	}
	searching = new searchThread(filename->text(),
		getLibExtensions(),
		subdirs->isChecked());

	liblist->clear();
	connect(searching, SIGNAL(updateLibs(QString)),
		this, SLOT(updateLibs(QString)));
	connect(searching, SIGNAL(updateCurrFile(QString)),
		this, SLOT(updateCurrFile(QString)));
	connect(searching, SIGNAL(finished()),
		this, SLOT(finishSearch()));

	connect(search, SIGNAL(clicked()),
		searching, SLOT(cancelSearch()));

	search->setText("Cancel");
	searching->start();
}