示例#1
0
void PlayerWidget::mouseReleaseEvent(QMouseEvent *e) {
	if (_down == OverVolume) {
		mouseMoveEvent(e);
		Local::writeUserSettings();
	} else if (_down == OverPlayback) {
		mouseMoveEvent(e);
		SongMsgId playing;
		AudioPlayerState playingState = AudioPlayerStopped;
		int64 playingPosition = 0, playingDuration = 0;
		int32 playingFrequency = 0;
		audioPlayer()->currentState(&playing, &playingState, &playingPosition, &playingDuration, &playingFrequency);
		if (playing == _song && playingDuration) {
			_downDuration = playingDuration;
			audioPlayer()->seek(qRound(_downProgress * _downDuration));

			_showPause = true;

			a_progress = anim::fvalue(_downProgress, _downProgress);
			_a_progress.stop();
		}
		update();
	} else if (_down == OverClose && _over == OverClose) {
		stopPressed();
	}
	_down = OverNone;
}
示例#2
0
void TimeLapseWidget::setupConnections()
{
    connect(startButton, SIGNAL(clicked()), this, SLOT(startShooting()));
    connect(stopButton, SIGNAL(clicked()), this, SLOT(stopPressed()));
    connect(directoryButton, SIGNAL(clicked()), this, SLOT(setDirectory()));
    connect(saveDirectory, SIGNAL(textChanged(QString)), this, SLOT(saveDirectoryUpdated()));
    connect(attachedCameras, SIGNAL(currentIndexChanged(QString)), this, SLOT(attachedCameraSelectionChanged()));
}
示例#3
0
FaToDFA::FaToDFA(modes _mode, AlgorithmWidget* _algorithm_widget, FA_widget* _not_dfa_widget, FA_widget* _dfa_widget, QLabel* _var_widget, QObject* parrent)
 : Algorithm(parrent),  mode(_mode),  algorithm_widget(_algorithm_widget), not_dfa_widget(_not_dfa_widget), dfa_widget(_dfa_widget), var_widget(_var_widget)
{
    actInstruction = HEADER;
    prewInstruction = HEADER;
    instruction_count = WHILE_NEW+1;
    initInstructions();
    initBreakpoints(instruction_count);

    this->setColumnCount(1);
    this->setRowCount(instructions.count());

    var_widget->setText("");

    for(int i = 0; i < instructions.count();i++)
    {
        QModelIndex index = this->index(i,0,QModelIndex());
        setData(index,instructions[i],Qt::EditRole);
        setData(index,true,Algorithm::HasBreakpoint_Role);
        setData(index,false,Algorithm::Breakpoint_Role);
        switch(i)
        {
            case HEADER:
                setData(index,false,Algorithm::HasBreakpoint_Role);
                break;
        }
    }


    //
    // Connect algorithm buttons.
    //
    connect(this->algorithm_widget,SIGNAL(playPressed(int)),this,SLOT(runAlgorithm(int)));
    connect(this->algorithm_widget,SIGNAL(stopPressed()),this,SLOT(stop()));
    connect(this->algorithm_widget,SIGNAL(prewPressed()),this,SLOT(prevStep()));
    connect(this->algorithm_widget,SIGNAL(nextPressed()),this,SLOT(nextStep()));
    connect(this->algorithm_widget, SIGNAL(checkSolutionPressed()), this, SLOT(checkSolution()));
    connect(this->algorithm_widget, SIGNAL(showCorrectSolutionPressed()), this, SLOT(showCorrectSolution()));
    connect(this->algorithm_widget, SIGNAL(showUserSolutionPressed()), this, SLOT(showUserSolution()));
    connect(this->algorithm_widget, SIGNAL(beginPressed()), this, SLOT(toBegin()));
    connect(this->algorithm_widget, SIGNAL(endPressed()), this, SLOT(toEnd()));

    //
    // Connect timers.
    //
    connect(play_timer, SIGNAL(timeout()), this, SLOT(nextStep()));
    connect(check_step_timer, SIGNAL(timeout()), this, SLOT(checkSolution()));

    // Connect Finite Automata widgets
    connect(not_dfa_widget,SIGNAL(FA_changed(FiniteAutomata*)),this,SLOT(setFA(FiniteAutomata*)));
    connect(dfa_widget,SIGNAL(FA_changed(FiniteAutomata*)),this,SLOT(setDFA(FiniteAutomata*)));

    not_dfa_widget->setFA(new FiniteAutomata());

    algorithm_widget->enableShowButton();
}
CAlgorithmWidget::CAlgorithmWidget(QWidget *parent) : QWidget(parent), m_mode(AlgorithmModes::NONE),
    ui(new Ui::AlgorithmWidget)
{
    ui->setupUi(this);

    showSolution = true;

    connect(this->ui->nextButton,SIGNAL(clicked()),this,SIGNAL(nextPressed()));
    connect(this->ui->prewButton,SIGNAL(clicked()),this,SIGNAL(prewPressed()));
    connect(this->ui->playButton,SIGNAL(clicked()),this,SLOT(emitPlay()));
    connect(this->ui->stopButton,SIGNAL(clicked()),this,SIGNAL(stopPressed()));
    connect(this->ui->checkButton,SIGNAL(clicked()),this,SIGNAL(checkSolutionPressed()));
    connect(this->ui->beginButton,SIGNAL(clicked()), this, SIGNAL(beginPressed()));
    connect(this->ui->endButton,SIGNAL(clicked()),this, SIGNAL(endPressed()));
    SetMode(m_mode);
    ui->Formal->removeTab(1);
}
/*
 * Description : constructor
 */
IRNowPlayingView::IRNowPlayingView(IRApplication* aApplication, TIRViewId aViewId) :
    IRBaseView(aApplication, aViewId),
    iStatisticsReporter(NULL),
    iStationShare(NULL),
    iPlayStopAction(NULL),
    iLogoDownloadState(EIdle),    
    iSongNameLabel(NULL),
    iSongNameMarquee(NULL),
    iArtistName(NULL),
    iStationName(NULL),
    iStationLogo(NULL),
    iLogoNeedUpdate(true),    
    iFindinNmsAllowed(false),
    iSongNameAvailable(false)
#ifdef ADV_ENABLED
    ,iAdvImage(NULL)
    ,iAdvImageNeedUpdate(true)
    ,iAdvUrl(KDefaultAdvLink)    
#endif
{
    LOG_METHOD;
    
    iLaunchActionNeeded = (0 == getViewManager()->views().count()); // this is the starting view
        
    initialize();
    
    iStatisticsReporter = IRQStatisticsReporter::openInstance();
        
    connect(iPlayController, SIGNAL(metaDataAvailable(IRQMetaData*)), this, SLOT(updateMetaData(IRQMetaData*)));
    connect(iPlayController, SIGNAL(playingStarted()), this, SLOT(handlePlayStarted()));
    connect(iPlayController, SIGNAL(playingStopped()), this, SLOT(handlePlayStopped()));

    connect(iNetworkController, SIGNAL(networkRequestNotified(IRQNetworkEvent)),
            this, SLOT(handleNetworkEvent(IRQNetworkEvent)));
    connect(iApplication->getMediaKeyObserver(), SIGNAL(playPausePressed()), 
            this, SLOT(handlePlayPauseMediaKey()));
    connect(iApplication->getMediaKeyObserver(), SIGNAL(stopPressed()), 
            this, SLOT(handleStopMediaKey()));
    connect( getViewManager(), SIGNAL( orientationChanged(Qt::Orientation) ),
             this, SLOT( handleOrientationChanged(Qt::Orientation) ) );
    
    setFlag(EViewFlag_StickyViewEnabled);
}
示例#6
0
FeedView::FeedView(QObject *parent):
    QObject(parent),
    mView(NULL),
    iWriter(NULL),
    iReader(NULL),
    mManager(NULL),
    mUpdateTimer(NULL),
    mStarted(false)
{
    bool ok = false;
    mDocumentLoader.load(":/xml/feedview.docml", &ok);

    if (ok)
    {
        mView = static_cast<HbView*>(mDocumentLoader.findWidget(QString("view")));
    }
    else
    {
        qFatal("Unable to read :/xml/feedview.docml");
    }

    HbPushButton *create = static_cast<HbPushButton*>(mDocumentLoader.findObject("createContactsButton"));
    connect(create, SIGNAL(clicked()), this, SLOT(createPressed()));

    HbPushButton *start = static_cast<HbPushButton*>(mDocumentLoader.findObject("startButton"));
    connect(start, SIGNAL(clicked()), this, SLOT(startPressed()));

    HbPushButton *stop = static_cast<HbPushButton*>(mDocumentLoader.findObject("stopButton"));
    connect(stop, SIGNAL(clicked()), this, SLOT(stopPressed()));

    iWriter = PrcPresenceWriter::createWriter();
    iReader = PrcPresenceReader::createReader();

    mManager = new QContactManager("symbian");

    mUpdateTimer = new QTimer();
    mUpdateTimer->setInterval(2000);
    connect(mUpdateTimer, SIGNAL(timeout()), this, SLOT(updateRandomPresence()));
}
示例#7
0
DolphinStatusBar::DolphinStatusBar(QWidget* parent, DolphinView* view) :
    QWidget(parent),
    m_view(view),
    m_messageLabel(0),
    m_spaceInfo(0),
    m_zoomWidget(0),
    m_zoomOut(0),
    m_zoomSlider(0),
    m_zoomIn(0),
    m_progressBar(0),
    m_stopButton(0),
    m_progress(100),
    m_showProgressBarTimer(0),
    m_messageTimeStamp()
{
    connect(m_view, SIGNAL(urlChanged(const KUrl&)),
            this, SLOT(updateSpaceInfoContent(const KUrl&)));

    // Initialize message label
    m_messageLabel = new KonqStatusBarMessageLabel(this);

    // Initialize zoom slider
    m_zoomWidget = new QWidget(this);

    m_zoomOut = new QToolButton(m_zoomWidget);
    m_zoomOut->setIcon(KIcon("file-zoom-out"));
    m_zoomOut->setAutoRaise(true);

    m_zoomSlider = new QSlider(Qt::Horizontal, m_zoomWidget);
    m_zoomSlider->setPageStep(1);

    const int min = ZoomLevelInfo::minimumLevel();
    const int max = ZoomLevelInfo::maximumLevel();
    m_zoomSlider->setRange(min, max);
    m_zoomSlider->setValue(view->zoomLevel());
    updateZoomSliderToolTip(view->zoomLevel());

    m_zoomIn = new QToolButton(m_zoomWidget);
    m_zoomIn->setIcon(KIcon("file-zoom-in"));
    m_zoomIn->setAutoRaise(true);

    // Initialize zoom widget layout
    QHBoxLayout* zoomWidgetLayout = new QHBoxLayout(m_zoomWidget);
    zoomWidgetLayout->setSpacing(0);
    zoomWidgetLayout->setMargin(0);
    zoomWidgetLayout->addWidget(m_zoomOut);
    zoomWidgetLayout->addWidget(m_zoomSlider);
    zoomWidgetLayout->addWidget(m_zoomIn);

    connect(m_zoomSlider, SIGNAL(valueChanged(int)), this, SLOT(setZoomLevel(int)));
    connect(m_zoomSlider, SIGNAL(sliderMoved(int)), this, SLOT(showZoomSliderToolTip(int)));
    connect(m_view, SIGNAL(zoomLevelChanged(int)), m_zoomSlider, SLOT(setValue(int)));
    connect(m_zoomOut, SIGNAL(clicked()), this, SLOT(zoomOut()));
    connect(m_zoomIn, SIGNAL(clicked()), this, SLOT(zoomIn()));

    // Initialize space information
    m_spaceInfo = new StatusBarSpaceInfo(this);
    m_spaceInfo->setUrl(m_view->url());

    // Initialize progress information
    m_stopButton = new QToolButton(this);
    m_stopButton->setIcon(KIcon("process-stop"));
    // TODO: Add tooltip for KDE SC 4.7.0, if new strings are allowed again
    m_stopButton->setAutoRaise(true);
    m_stopButton->hide();
    connect(m_stopButton, SIGNAL(clicked()), this, SIGNAL(stopPressed()));

    m_progressText = new QLabel(this);
    m_progressText->hide();

    m_progressBar = new QProgressBar(this);
    m_progressBar->hide();

    m_showProgressBarTimer = new QTimer(this);
    m_showProgressBarTimer->setInterval(1000);
    m_showProgressBarTimer->setSingleShot(true);
    connect(m_showProgressBarTimer, SIGNAL(timeout()), this, SLOT(updateProgressInfo()));

    // Initialize top layout and size policies
    const int fontHeight = QFontMetrics(m_messageLabel->font()).height();
    const int zoomWidgetHeight = m_zoomWidget->minimumSizeHint().height();
    const int contentHeight = qMax(fontHeight, zoomWidgetHeight);

    m_messageLabel->setMinimumTextHeight(contentHeight);

    m_spaceInfo->setMaximumSize(200, contentHeight - 5);
    m_spaceInfo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    m_progressBar->setMaximumSize(200, contentHeight);
    m_zoomWidget->setMaximumSize(150, contentHeight);
    m_zoomSlider->setMinimumWidth(30);

    QHBoxLayout* topLayout = new QHBoxLayout(this);
    topLayout->setMargin(0);
    topLayout->setSpacing(4);
    topLayout->addWidget(m_messageLabel);
    topLayout->addWidget(m_zoomWidget);
    topLayout->addWidget(m_spaceInfo);
    topLayout->addWidget(m_stopButton);
    topLayout->addWidget(m_progressText);
    topLayout->addWidget(m_progressBar);

    setExtensionsVisible(true);
}
示例#8
0
void StageControl::stopClicked ()
{
    stopPressed (_number);
}
DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
    QWidget(parent),
    m_topLayout(0),
    m_urlNavigator(0),
    m_searchBox(0),
    m_view(0),
    m_filterBar(0),
    m_statusBar(0),
    m_statusBarTimer(0),
    m_statusBarTimestamp()
{
    hide();

    m_topLayout = new QVBoxLayout(this);
    m_topLayout->setSpacing(0);
    m_topLayout->setMargin(0);

    m_urlNavigator = new KUrlNavigator(DolphinSettings::instance().placesModel(), url, this);
    connect(m_urlNavigator, SIGNAL(urlsDropped(const KUrl&, QDropEvent*)),
            this, SLOT(dropUrls(const KUrl&, QDropEvent*)));
    connect(m_urlNavigator, SIGNAL(activated()),
            this, SLOT(activate()));
    connect(m_urlNavigator->editor(), SIGNAL(completionModeChanged(KGlobalSettings::Completion)),
            this, SLOT(saveUrlCompletionMode(KGlobalSettings::Completion)));

    const GeneralSettings* settings = DolphinSettings::instance().generalSettings();
    m_urlNavigator->setUrlEditable(settings->editableUrl());
    m_urlNavigator->setShowFullPath(settings->showFullPath());
    m_urlNavigator->setHomeUrl(KUrl(settings->homeUrl()));
    KUrlComboBox* editor = m_urlNavigator->editor();
    editor->setCompletionMode(KGlobalSettings::Completion(settings->urlCompletionMode()));

    m_searchBox = new DolphinSearchBox(this);
    m_searchBox->hide();
    connect(m_searchBox, SIGNAL(closeRequest()), this, SLOT(closeSearchBox()));
    connect(m_searchBox, SIGNAL(search(QString)), this, SLOT(startSearching(QString)));
    connect(m_searchBox, SIGNAL(returnPressed(QString)), this, SLOT(requestFocus()));

    m_view = new DolphinView(url, this);
    connect(m_view, SIGNAL(urlChanged(const KUrl&)),      m_urlNavigator, SLOT(setUrl(const KUrl&)));
    connect(m_view, SIGNAL(writeStateChanged(bool)),      this, SIGNAL(writeStateChanged(bool)));
    connect(m_view, SIGNAL(requestItemInfo(KFileItem)),   this, SLOT(showItemInfo(KFileItem)));
    connect(m_view, SIGNAL(errorMessage(const QString&)), this, SLOT(showErrorMessage(const QString&)));
    connect(m_view, SIGNAL(infoMessage(const QString&)),  this, SLOT(showInfoMessage(const QString&)));
    connect(m_view, SIGNAL(itemTriggered(KFileItem)),     this, SLOT(slotItemTriggered(KFileItem)));
    connect(m_view, SIGNAL(redirection(KUrl, KUrl)),      this, SLOT(redirect(KUrl, KUrl)));
    connect(m_view, SIGNAL(startedPathLoading(KUrl)),     this, SLOT(slotStartedPathLoading()));
    connect(m_view, SIGNAL(finishedPathLoading(KUrl)),    this, SLOT(slotFinishedPathLoading()));
    connect(m_view, SIGNAL(itemCountChanged()),           this, SLOT(delayedStatusBarUpdate()));
    connect(m_view, SIGNAL(pathLoadingProgress(int)),     this, SLOT(updateProgress(int)));
    connect(m_view, SIGNAL(infoMessage(const QString&)),  this, SLOT(showInfoMessage(const QString&)));
    connect(m_view, SIGNAL(errorMessage(const QString&)), this, SLOT(showErrorMessage(const QString&)));
    connect(m_view, SIGNAL(urlIsFileError(const KUrl&)),  this, SLOT(openFile(const KUrl&)));
    connect(m_view, SIGNAL(selectionChanged(const KFileItemList&)),    this, SLOT(delayedStatusBarUpdate()));
    connect(m_view, SIGNAL(operationCompletedMessage(const QString&)), this, SLOT(showOperationCompletedMessage(const QString&)));

    connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
            this, SLOT(slotUrlNavigatorLocationChanged(const KUrl&)));
    connect(m_urlNavigator, SIGNAL(urlAboutToBeChanged(const KUrl&)),
            this, SLOT(saveViewState()));
    connect(m_urlNavigator, SIGNAL(historyChanged()),
            this, SLOT(slotHistoryChanged()));

    // initialize status bar
    m_statusBar = new DolphinStatusBar(this, m_view);
    connect(m_statusBar, SIGNAL(stopPressed()), this, SLOT(stopLoading()));

    m_statusBarTimer = new QTimer(this);
    m_statusBarTimer->setSingleShot(true);
    m_statusBarTimer->setInterval(300);
    connect(m_statusBarTimer, SIGNAL(timeout()),
            this, SLOT(updateStatusBar()));

    KIO::FileUndoManager* undoManager = KIO::FileUndoManager::self();
    connect(undoManager, SIGNAL(jobRecordingFinished(CommandType)),
            this, SLOT(delayedStatusBarUpdate()));

    // initialize filter bar
    m_filterBar = new FilterBar(this);
    m_filterBar->setVisible(settings->filterBar());
    connect(m_filterBar, SIGNAL(filterChanged(const QString&)),
            this, SLOT(setNameFilter(const QString&)));
    connect(m_filterBar, SIGNAL(closeRequest()),
            this, SLOT(closeFilterBar()));
    connect(m_view, SIGNAL(urlChanged(const KUrl&)),
            m_filterBar, SLOT(clear()));

    m_topLayout->addWidget(m_urlNavigator);
    m_topLayout->addWidget(m_searchBox);
    m_topLayout->addWidget(m_view);
    m_topLayout->addWidget(m_filterBar);
    m_topLayout->addWidget(m_statusBar);

    setSearchModeEnabled(isSearchUrl(url));
}
示例#10
0
void PlayerWidget::closePressed() {
	stopPressed();
	if (App::main()) App::main()->closePlayer();
}