Exemplo n.º 1
0
        void kClipHolder::btnClicked(widgetEvent & _event ){
            int index = btnView->value;

            string command = btnView->labels[index];

            if( command == "select" )
               notify("select");

            if( command == "connect" )
                notify("connect");

            if( command == "related" ) {
                addView();
                showView(btnView->widgets[ index ]->x,btnView->widgets[ index ]->y);
            }

            if( command == "scenes" ) {
                addView();
                showView(btnView->widgets[ index ]->x,btnView->widgets[ index ]->y);
            }

            if( command == "tags" ) {
                addView();
                showView(btnView->widgets[ index ]->x,btnView->widgets[ index ]->y);
            }

        }
Exemplo n.º 2
0
void StandardPLPanel::cycleViews()
{
    if( currentView == iconView )
        showView( TREE_VIEW );
    else if( currentView == treeView )
        showView( LIST_VIEW );
    else if( currentView == listView )
        showView( ICON_VIEW );
    else
        assert( 0 );
}
void StandardPLPanel::cycleViews()
{
    if( currentView == iconView )
        showView( TREE_VIEW );
    else if( currentView == treeView )
        showView( LIST_VIEW );
    else if( currentView == listView )
#ifndef NDEBUG
        showView( PICTUREFLOW_VIEW  );
    else if( currentView == picFlowView )
#endif
        showView( ICON_VIEW );
    else
        assert( 0 );
}
Exemplo n.º 4
0
PgConsole::PgConsole()
{
    this->setCaption("SQL console");
    this->setGeometry(100,100,640,480);
    this->setFontPointSize(12);
    QObject::connect(this, SIGNAL(sqlcmd(QString)), this, SLOT(showView(QString)));
}
TEST(chatpresenter, test_incomingMessages)
{
    Poco::SharedPtr<MockChatService> m(new MockChatService);

    Mvp::Presenter::TextChatPresenter presenter(m.get());
    Poco::SharedPtr<MockChatView> v(new MockChatView());
    EXPECT_CALL(*v, initialize());

    ON_CALL(*m, getParticipants())
        .WillByDefault(Return(contacts));
    ON_CALL(*m, messageHistory(_))
        .WillByDefault(Return(messages));

    EXPECT_CALL(*m, chatName());
    EXPECT_CALL(*v, setChatTitle(_));
    EXPECT_CALL(*m, messageHistory(_));
    EXPECT_CALL(*m, isConsumer());
    EXPECT_CALL(*v, enableControls(_));
    EXPECT_CALL(*v, showLeaveAction(_));
    EXPECT_CALL(*m, getParticipants());
    EXPECT_CALL(*v, setParticipants(_));
    presenter.setView(v.get());

    EXPECT_CALL(*v, showView());
    presenter.showView();

    EXPECT_CALL(*v, addMessage(_));
    m->triggerIncomingMessage();
}
Exemplo n.º 6
0
void Browser::showSongs(const QVariant &containerId, const QString &title)
{
#ifdef Q_WS_MAEMO_5
    SongView *songView = new SongView(gallery);
#endif

    showView(songView, containerId, title);
}
Exemplo n.º 7
0
void Browser::showPhotos(const QVariant &containerId, const QString &title)
{
#ifdef Q_WS_MAEMO_5
    PhotoView *photoView = new PhotoView(gallery);
#endif

    showView(photoView, containerId, title);
}
Exemplo n.º 8
0
void KOViewManager::showListView()
{
    if(!mListView)
    {
        mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView");
        addView(mListView);
    }
    showView(mListView);
}
Exemplo n.º 9
0
GameWindow::GameWindow(QWidget *parent) :
    QStackedWidget(parent)
{
    menu = new GameMenu;
    view = new GameView;
    this->addWidget(view);
    this->addWidget(menu);
    connect(menu, SIGNAL(startClicked()), this, SLOT(showView()));
}
Exemplo n.º 10
0
void KOViewManager::showTimeSpentView()
{
    if ( !mTimeSpentView ) {
        mTimeSpentView = new KOTimeSpentView( mMainView->calendar(), mMainView->viewStack() );
        mTimeSpentView->setObjectName( "KOViewManager::TimeSpentView" );
        addView( mTimeSpentView );
    }
    goMenu( true );
    showView( mTimeSpentView );
}
Exemplo n.º 11
0
void KOViewManager::showMonthView()
{
    if ( !mMonthView ) {
        mMonthView = new KOrg::MonthView( mMainView->calendar(), mMainView->viewStack() );
        mMonthView->setObjectName( "KOViewManager::MonthView" );
        addView( mMonthView );
    }
    goMenu( true );
    showView( mMonthView );
}
Exemplo n.º 12
0
void KOViewManager::showWhatsNextView()
{
    if ( !mWhatsNextView ) {
        mWhatsNextView = new KOWhatsNextView( mMainView->calendar(), mMainView->viewStack() );
        mWhatsNextView->setObjectName( "KOViewManager::WhatsNextView" );
        addView( mWhatsNextView );
    }
    goMenu( true );
    showView( mWhatsNextView );
}
Exemplo n.º 13
0
void Browser::showAlbums(const QVariant &containerId, const QString &title)
{
#ifdef Q_WS_MAEMO_5
    AlbumView *albumView = new AlbumView(gallery);
    connect(albumView, SIGNAL(showSongs(QVariant,QString)),
            this, SLOT(showSongs(QVariant,QString)));
#endif

    showView(albumView, containerId, title);
}
Exemplo n.º 14
0
void KOViewManager::showWhatsNextView()
{
    if(!mWhatsNextView)
    {
        mWhatsNextView = new KOWhatsNextView(mMainView->calendar(), mMainView->viewStack(),
                                             "KOViewManager::WhatsNextView");
        addView(mWhatsNextView);
    }
    showView(mWhatsNextView);
}
Exemplo n.º 15
0
void KOViewManager::showListView()
{
    if ( !mListView ) {
        mListView = new KOListView( mMainView->calendar(), mMainView->viewStack() );
        mListView->setObjectName( "KOViewManager::ListView" );
        addView( mListView );
    }
    goMenu( true );
    showView( mListView );
}
Exemplo n.º 16
0
bool CharmWindow::showHideView( QWidget* w )
{
    // hide or restore the view
    if ( w->isVisible() ) {
        w->hide();
        return false;
    } else {
        showView( w );
        return true;
    }
}
Exemplo n.º 17
0
void Dialog::showData(string const & data)
{
	if (isBufferDependent() && !isBufferAvailable())
		return;

	if (!initialiseParams(data)) {
		LYXERR0("Dialog \"" << name()
			<< "\" failed to translate the data string passed to show()");
		return;
	}

	showView();
}
Exemplo n.º 18
0
void CharmWindow::setWindowNumber( int number )
{
    m_windowNumber = number;
    delete m_shortcut;
    m_shortcut = new QShortcut( this );
    QKeySequence sequence( tr( "Ctrl+%1" ).arg( number ) );
#ifdef Q_OS_OSX
    m_shortcut->setKey( sequence );
#endif
    m_shortcut->setContext( Qt::ApplicationShortcut );
    m_showHideAction->setShortcut( sequence );
    m_showAction->setShortcut( sequence );
    connect( m_shortcut, SIGNAL(activated()), SLOT(showHideView()) );
    connect( m_shortcut, SIGNAL(activated()), SLOT(showView()) );
}
Exemplo n.º 19
0
StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
                                  intf_thread_t *_p_intf,
                                  playlist_item_t *p_root,
                                  PLSelector *_p_selector,
                                  VLCModel *_p_model )
                : QWidget( _parent ),
                  model( _p_model ),
                  p_intf( _p_intf ),
                  p_selector( _p_selector )
{
    viewStack = new QStackedLayout( this );
    viewStack->setSpacing( 0 ); viewStack->setMargin( 0 );
    setMinimumWidth( 300 );

    iconView    = NULL;
    treeView    = NULL;
    listView    = NULL;
    picFlowView = NULL;

    currentRootIndexPLId  = -1;
    lastActivatedPLItemId     = -1;

    QList<QString> frames;
    frames << ":/util/wait1";
    frames << ":/util/wait2";
    frames << ":/util/wait3";
    frames << ":/util/wait4";
    spinnerAnimation = new PixmapAnimator( this, frames );
    CONNECT( spinnerAnimation, pixmapReady( const QPixmap & ), this, updateViewport() );

    /* Saved Settings */
    int i_savedViewMode = getSettings()->value( "Playlist/view-mode", TREE_VIEW ).toInt();

    QFont font = QApplication::font();
    font.setPointSize( font.pointSize() + getSettings()->value( "Playlist/zoom", 0 ).toInt() );
    model->setData( QModelIndex(), font, Qt::FontRole );

    showView( i_savedViewMode );

    DCONNECT( THEMIM, leafBecameParent( int ),
              this, browseInto( int ) );

    CONNECT( model, currentIndexChanged( const QModelIndex& ),
             this, handleExpansion( const QModelIndex& ) );
    CONNECT( model, rootIndexChanged(), this, browseInto() );

    setRootItem( p_root, false );
}
Exemplo n.º 20
0
ComponentViewItem::ComponentViewItem(AbstractComponentView* p_item, QWidget* p_parent /*= 0*/ ) : QWidget(p_parent), m_item(p_item)
{
	m_header = new ComponentViewHeader(p_item->GetComponentName(), this);
	m_layout = new QVBoxLayout(this);
	m_layout->setContentsMargins(0, 0, 0, 0);
	m_layout->addWidget(m_header);
	m_layout->addWidget(p_item);
	m_layout->setSizeConstraint(QLayout::SetNoConstraint);
	setLayout(m_layout);

	m_header->SetArrowShape(p_item->m_shown ? Qt::ArrowType::DownArrow : Qt::ArrowType::RightArrow);

	connect(m_header, SIGNAL(showView()),	this, SLOT(ShowComponentView()));
	connect(m_header, SIGNAL(hideView()),	this, SLOT(HideComponentView()));
	connect(m_header, SIGNAL(remove()),		this, SLOT(RemoveComponent()));
}
Exemplo n.º 21
0
WinAlarmSummary::WinAlarmSummary(QWidget *parent) :
    QWidget(parent)
{   
    btnPress = -1;
    btnStatus = false;

    dataName = "alarm";
    detailTime = true;
    currentRow = 0;

    initAlarmSummaryUI();

    initAlarmSummaryModel();

    showView();
    signalAndSlotConnect();

}
Exemplo n.º 22
0
void PgxConsole::pasteFromClipboard()
{
    if(!textCursor().atEnd()) {
        if(textCursor().block().next().isValid()) {
            QTextCursor cursor = textCursor();
            cursor.movePosition(QTextCursor::End);
            setTextCursor(cursor);
        }
    }
    QClipboard *clipboard = QApplication::clipboard();
    QString clipboard_text = clipboard->text();
    QStringList clipboard_text_list = clipboard_text.trimmed().split("\n", QString::SkipEmptyParts);
    int clipboard_text_list_size = clipboard_text_list.size();
    for(int i = 0; i < clipboard_text_list_size; i++) {
        insertPlainText(clipboard_text_list.at(i));
        if(i != clipboard_text_list_size-1)
            showView(clipboard_text_list.at(i));
    }
}
Exemplo n.º 23
0
TEST(chatpresenter, test_postingsms)
{
    Poco::SharedPtr<MockChatService> m(new MockChatService);

    Mvp::Presenter::TextChatPresenter presenter(m.get());
    Poco::SharedPtr<MockChatView> v(new MockChatView());
    EXPECT_CALL(*v, initialize());

    ON_CALL(*m, getParticipants())
        .WillByDefault(Return(contacts));
    ON_CALL(*m, messageHistory(_))
        .WillByDefault(Return(messages));

    EXPECT_CALL(*m, chatName());
    EXPECT_CALL(*v, setChatTitle(_));
    EXPECT_CALL(*m, messageHistory(_));
    EXPECT_CALL(*m, isConsumer());
    EXPECT_CALL(*v, enableControls(_));
    EXPECT_CALL(*v, showLeaveAction(_));
    EXPECT_CALL(*m, getParticipants());
    EXPECT_CALL(*v, setParticipants(_));
    presenter.setView(v.get());

    EXPECT_CALL(*v, showView());
    presenter.showView();

    EXPECT_CALL(*v, setSmsMode(true));
    v->triggerToggleMode();

    EXPECT_CALL(*m, postSMS(_));
    v->triggerPostMessage();

    EXPECT_CALL(*v, reportMessageStatus(
        Mvp::View::AbstractChatView::SmsDelivered, _));
    m->triggerSmsDelivered();

    EXPECT_CALL(*v, reportMessageStatus(
        Mvp::View::AbstractChatView::MiscError, _));
    m->triggerSmsError();
}
Exemplo n.º 24
0
KTextEditor::View *KateViewSpace::createView(KTextEditor::Document *doc)
{
    // should only be called if a view does not yet exist
    Q_ASSERT(! m_docToView.contains(doc));

    /**
     * Create a fresh view
     */
    KTextEditor::View *v = doc->createView(stack, m_viewManager->mainWindow()->wrapper());

    // set status bar to right state
    v->setStatusBarEnabled(m_viewManager->mainWindow()->showStatusBar());

    // restore the config of this view if possible
    if (!m_group.isEmpty()) {
        QString fn = v->document()->url().toString();
        if (! fn.isEmpty()) {
            QString vgroup = QString::fromLatin1("%1 %2").arg(m_group).arg(fn);

            KateSession::Ptr as = KateApp::self()->sessionManager()->activeSession();
            if (as->config() && as->config()->hasGroup(vgroup)) {
                KConfigGroup cg(as->config(), vgroup);
                v->readSessionConfig(cg);
            }
        }
    }

    // register document, it is shown below through showView() then
    if (! m_lruDocList.contains(doc)) {
        registerDocument(doc);
        Q_ASSERT(m_lruDocList.contains(doc));
    }

    // insert View into stack
    stack->addWidget(v);
    m_docToView[doc] = v;
    showView(v);

    return v;
}
Exemplo n.º 25
0
StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
                                  intf_thread_t *_p_intf,
                                  playlist_item_t *p_root,
                                  PLSelector *_p_selector,
                                  PLModel *_p_model,
                                  MLModel *_p_plmodel)
                : QWidget( _parent ),
                  model( _p_model ),
                  mlmodel( _p_plmodel),
                  p_intf( _p_intf ),
                  p_selector( _p_selector )
{
    viewStack = new QStackedLayout( this );
    viewStack->setSpacing( 0 ); viewStack->setMargin( 0 );
    setMinimumWidth( 300 );

    iconView    = NULL;
    treeView    = NULL;
    listView    = NULL;
    picFlowView = NULL;

    currentRootIndexId  = -1;
    lastActivatedId     = -1;

    /* Saved Settings */
    int i_savedViewMode = getSettings()->value( "Playlist/view-mode", TREE_VIEW ).toInt();
    i_zoom = getSettings()->value( "Playlist/zoom", 0 ).toInt();

    showView( i_savedViewMode );

    DCONNECT( THEMIM, leafBecameParent( int ),
              this, browseInto( int ) );

    CONNECT( model, currentIndexChanged( const QModelIndex& ),
             this, handleExpansion( const QModelIndex& ) );
    CONNECT( model, rootIndexChanged(), this, browseInto() );

    setRootItem( p_root, false );
}
Exemplo n.º 26
0
void TestDbView::openExistedTest()
{
    QString filename("");
    if (m_testBox->count() > 0) {
        QListWidgetItem *item = m_testBox->currentItem();
        if (item) {
            filename = testFolderPath() + item->text();
            QFile file(filename);

            if (file.exists()) {
                QFileInfo fileExt(filename);
                QString ext = fileExt.suffix();

                if (ext == ".doc" || ext == ".docx") {
                    emit docFileName(filename);
                } else if (SqlliteDbManager::checkIfTestDb(filename)) {
                    emit bdFileName(filename);
                }
            }
        }
    }
    emit showView(CreatorView);
}
Exemplo n.º 27
0
void AkuViewOptionWidget::loadSettings()
{
    KConfigGroup viewOptionConfig = KGlobal::config()->group("Views Option");

    if (!viewOptionConfig.exists()) {
        viewOptionConfig.writeEntry("Active View", "TreeView");
        viewOptionConfig.writeEntry("IconView item size", 
                                    KIconLoader::global()->currentSize(KIconLoader::Desktop));
    }

    // here we load the active view
    int view = 0;
    if (viewOptionConfig.readEntry("Active View", "TreeView") == "IconView") {
        view = 1;
    }
    showView(view);

    // icon settings
    m_iconWidget->view()->setIconSize(viewOptionConfig.readEntry("IconView item size",
                                      KIconLoader::global()->currentSize(KIconLoader::Desktop) ));
    ui.iconSizeSlider->setValue(m_iconWidget->view()->iconSize());


}
void SavingSettingsTabView::back()
{
    emit showView(TestStartView);
}
Exemplo n.º 29
0
    /**
     * Verarbeitet das Touch-Event.
     */
    void handleTouchEvent() {
        // Prüfung, ob ein Tipp auf den Touchscreen erkannt und dieser noch nicht verarbeitet wurde
        if (touchEvent.isTap && touchEvent.startTime > lastTapTime) {
            // Es wurde auf den Touchscreen getippt. Es wird versucht, an der Stelle ein Feld zu
            // erzeugen.

            QCAR::Vec3F intersection;
            // Projektion der Koordinaten, auf die getippt wurde, auf die Ebene des getrackten
            // Objektes
            projectScreenPointToPlane(screenWidth, screenHeight,
                    QCAR::Vec2F(touchEvent.tapPosition.data[0], touchEvent.tapPosition.data[1]),
                    inverseProjectionMatrix, modelViewMatrix, QCAR::Vec3F(0, 0, 0),
                    QCAR::Vec3F(0, 0, 1), intersection);
            // Prüfung, ob sich an den projezierten Koordinaten bereits ein Feld befindet
            Space* space = selectSpace(QCAR::Vec2F(intersection.data[0], intersection.data[1]));
            if (space != NULL) {
                // Feld gefunden

                // normales Feld in Sonderfeld umwandeln und umgekehrt
                if (space->type == SPACE) {
                    space->type = SPECIAL_SPACE;
                } else if (space->type == SPECIAL_SPACE) {
                    space->type = SPACE;
                }
            } else if (canCreateSpace(QCAR::Vec2F(intersection.data[0], intersection.data[1]))) {
                // kein Feld gefunden, es kann ein neues erstellt werden

                // Feld erzeugen
                createSpace(QCAR::Vec2F(intersection.data[0], intersection.data[1]));
                // Weiter-Button beim Erreichen einer bestimmten Anzahl von Feldern anzeigen
                if (field.length == SPACE_COUNT_TO_SHOW_NEXT_BUTTON) {
                    showView("nextButton");
                }
                // Neustart-Button beim Erreichen einer bestimmten Anzahl von Feldern anzeigen
                if (field.length == SPACE_COUNT_TO_SHOW_RESTART_BUTTON) {
                    showView("restartButton");
                }
            }
            // Zeit des Verarbeitung manipulieren, damit dieser Tipp nicht mehr verarbeitet wird
            lastTapTime = touchEvent.startTime;
        } else if (touchEvent.isActive) {
            // Der User hat den Finger immer noch auf dem Touchscreen. Wenn der Finger über den
            // Bildschrim gezogen wird, dann wird versucht auf diesem Zieh-Pfad nacheinander Felder
            // zu erzeugen.

            // Touch-Ereignis ignorieren, wenn daraus noch ein Tipp werden könnte
            if (touchEvent.lifeTime > MAX_TAP_TIME
                    || touchEvent.startPositionLastPositionDistance > MAX_TAP_SQUARED_DISTANCE) {
                QCAR::Vec3F intersection;
                // Projektion der Koordinaten, auf denen sich der Finger befindet, auf die Ebene des
                // getrackten Objektes
                projectScreenPointToPlane(
                        screenWidth,
                        screenHeight,
                        QCAR::Vec2F(touchEvent.currentPosition.data[0],
                                touchEvent.currentPosition.data[1]), inverseProjectionMatrix,
                        modelViewMatrix, QCAR::Vec3F(0, 0, 0), QCAR::Vec3F(0, 0, 1), intersection);
                // Prüfung, ob an den projezierten Koordinaten ein Feld erzeugt werden kann
                if (canCreateSpace(QCAR::Vec2F(intersection.data[0], intersection.data[1]))) {
                    // Feld erzeugen
                    createSpace(QCAR::Vec2F(intersection.data[0], intersection.data[1]));
                    // Weiter-Button beim Erreichen einer bestimmten Anzahl von Feldern anzeigen
                    if (field.length == SPACE_COUNT_TO_SHOW_NEXT_BUTTON) {
                        showView("nextButton");
                    }
                    // Neustart-Button beim Erreichen einer bestimmten Anzahl von Feldern anzeigen
                    if (field.length == SPACE_COUNT_TO_SHOW_RESTART_BUTTON) {
                        showView("restartButton");
                    }
                }
            }
        }
    }
Exemplo n.º 30
0
void ContactsTable::addNewContact(ContactView& view) const
  {
  addContactView(view);
  showView(view);
  view.addNewContact ();
  }