Beispiel #1
0
void UIPageText::append( const QString & data, bool update )
{
        QTextView::append( data );

        if ( update == true )
                updateContents();
}
Beispiel #2
0
void toResultLong::query(const QString &sql, const toQueryParams &param)
{
    setSqlAndParams(sql, param);
    slotStop();
    Query = NULL;
    LastItem = NULL;
    RowNumber = 0;
    First = true;

    clear();

    setSorting( -1);

    if (NumberColumn)
    {
        addColumn(QString::fromLatin1("#"));
        setColumnAlignment(0, Qt::AlignRight);
    }

    if (Filter)
        Filter->startingQuery();

    try
    {
        Query = new toEventQuery(this
                                 , connection()
                                 , sql
                                 , param
                                 //, Statistics
                                 , toEventQuery::READ_ALL
                                );
        connect(Query, SIGNAL(dataAvailable(toEventQuery*)), this, SLOT(slotAddItem()));
        connect(Query, SIGNAL(done(toEventQuery*)), this, SLOT(slotQueryDone()));
        if (ReadAll)
        {
            MaxNumber = -1;
            //// Query->slotReadAll(); // indicate that all records should be fetched
        }
        else
            MaxNumber = toConfigurationNewSingle::Instance().option(ToConfiguration::Database::InitialFetchInt).toInt();
        Query->start();
    }
    catch (const toConnection::exception &str)
    {
        First = false;
        emit firstResult(toResult::sql(), str, true);
        emit done();
        //// if (Mode != toQuery::Long)
        Utils::toStatusMessage(str);
    }
    catch (const QString &str)
    {
        First = false;
        emit firstResult(toResult::sql(), str, true);
        emit done();
        //// if (Mode != toQuery::Long)
        Utils::toStatusMessage(str);
    }
    updateContents();
}
Beispiel #3
0
    void selectRow (const int row, const int rowHeight, const bool dontScroll,
                    const int lastRowSelected, const int totalItems, const bool isMouseClick)
    {
        hasUpdated = false;

        if (row < firstWholeIndex && ! dontScroll)
        {
            setViewPosition (getViewPositionX(), row * rowHeight);
        }
        else if (row >= lastWholeIndex && ! dontScroll)
        {
            const int rowsOnScreen = lastWholeIndex - firstWholeIndex;

            if (row >= lastRowSelected + rowsOnScreen
                 && rowsOnScreen < totalItems - 1
                 && ! isMouseClick)
            {
                setViewPosition (getViewPositionX(),
                                 jlimit (0, jmax (0, totalItems - rowsOnScreen), row) * rowHeight);
            }
            else
            {
                setViewPosition (getViewPositionX(),
                                 jmax (0, (row  + 1) * rowHeight - getMaximumVisibleHeight()));
            }
        }

        if (! hasUpdated)
            updateContents();
    }
Beispiel #4
0
void TestComponent::setFilename (const String& newName)
{
    File newFile;

    if (newName.isNotEmpty())
    {
        if (ownerDocument != nullptr)
            newFile = ownerDocument->getCppFile().getSiblingFile (newName);
        else
            newFile = File::getCurrentWorkingDirectory().getChildFile (newName);
    }

    if (! recursiveFiles.contains (newFile.getFullPathName()))
    {
        recursiveFiles.add (newFile.getFullPathName());

        loadedDocument = nullptr;

        filename = newName;
        lastModificationTime = findFile().getLastModificationTime();

        loadedDocument = JucerDocument::createForCppFile (nullptr, findFile());

        updateContents();
        repaint();

        recursiveFiles.remove (recursiveFiles.size() - 1);
    }
}
Beispiel #5
0
void EvaChatView::showInfomation( const TQString & info )
{
    TQString picPath = "<img src = \"" + EvaMain::images->getIconFullPath("MSG_INFO") + "\">";
    TQString msg = wrapFontAttributes(TQt::gray, 9, false, false, false, info);
    updateContents("&nbsp;" + picPath + "&nbsp;" + msg );
    showContents();
}
Beispiel #6
0
void EffectRack::songChanged(int typ)
{
    if (typ & (SC_ROUTE | SC_RACK) || typ == -1)
    {
        updateContents();
    }
}
Beispiel #7
0
void EvaChatView::showFileNotification( const TQString & who, const TQString & filename,
                                        const int size, const unsigned int session, const bool isSend )
{
    TQString strSession = TQString::number(session);
    TQString picPath = "<img src = \"" + EvaMain::images->getIconFullPath("MSG_INFO") + "\">";
    TQString acceptLink = "<a href=\""+ protocolAccept + "_" + strSession + "\">" + i18n("Accept") + "</a>";
    TQString saveAsLink = "<a href=\""+ protocolSaveAs + "_" + strSession + "\">" + i18n("Save As") + "</a>";
    TQString rejectLink = "<a href=\""+ protocolCancel + "_" + strSession + "\">" + i18n("Reject") + "</a>";
    TQString cancelLink = "<a href=\""+ protocolCancel + "_" + strSession + "\">" + i18n("Cancel") + "</a>";
    TQString fileSize = (size<0x400)?(TQString::number(size) + "B"):
                        ((size<0x100000)?(TQString::number(size/0x400) + "KB") :
                         ((size<0x40000000)?(TQString::number(size/0x100000) + "MB"):
                          (TQString::number(size/0x40000000) + "GB") ) );
    TQString fileInfo = filename + "(" + fileSize + ")";
    TQString txt;
    if(isSend) {
        txt = i18n("Waiting for %1 accepting file \"%2\". Please wait or %3.")
              .arg(who).arg(fileInfo).arg(cancelLink);
    } else {
        txt = i18n("%1 wants to send you a file \"%2\", you can %3, %4 or %5.")
              .arg(who).arg(fileInfo).arg(acceptLink).arg(saveAsLink).arg(rejectLink);
    }
    TQString msg = wrapFontAttributes(TQt::gray, 9, false, false, false, txt);
    updateContents("&nbsp;" + picPath + "&nbsp;" + msg );
    showContents();
}
// this is called from the clicked PatternWidget when in signal mode //
void 
PolicyViewClass::endAddTransition(PatternWidgetClass* patternWidget)
{
  // if addTransition mode is on, finish it and add the signal //
  if (isAddTransitionMode()) {
    viewport()->setMouseTracking(false);
    addTransitionMode = false;

    bool ok = false;
    QString message = QInputDialog::getText(tr( "Add Transition" ),
					    tr( "Transition name:" ),
					    QLineEdit::Normal, QString::null, &ok, this );
    if ( ok && !message.isEmpty() ) {
      QString target  = patternWidget->getPatternName();
      if (document.addTransition(pickedPattern, message, target))
	updateContents(contentsX(), contentsY(),
		       contentsWidth(), contentsHeight());
      else
	QMessageBox::warning(this, 
			     "Add Transition", 
			     "Transition " + message + " allready exists.\n" + 
			     "No transition added.");

    }
  }
}
void TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded(TextureMapper* textureMapper)
{
    if (!m_image)
        return;

    updateContents(textureMapper, m_image.get());
    m_image.clear();
}
Beispiel #10
0
void EvaChatView::append( TQString & nick, TQDateTime time, TQColor nameColor, bool isNormal,
                          TQColor msgColor, TQ_UINT8 size,
                          bool underline, bool italic, bool bold, TQString contents )
{
    TQString msg = wrapNickName(nick, time, nameColor, isNormal) +
                   wrapFontAttributes(msgColor, size, underline, italic, bold, contents);
    updateContents(msg);
}
void ContourLinesEditor::setSpectrogram(Spectrogram *sp)
{
	if (!sp || d_spectrogram == sp)
		return;

	d_spectrogram = sp;
	updateContents();
}
void CombinedSymbolSettings::reset(Symbol* symbol)
{
	Q_ASSERT(symbol->getType() == Symbol::Combined);
	
	SymbolPropertiesWidget::reset(symbol);
	
	this->symbol = symbol->asCombined();
	updateContents();
}
Beispiel #13
0
RTLEditor::RTLEditor(Decompiler *_decompiler, const QString &_name)
    : decompiler(_decompiler)
    , name(_name)
{
    setMouseTracking(true);
    setReadOnly(true);

    updateContents();
}
Beispiel #14
0
void CardView::setItemWidth( int w )
{
  if ( w == d->mItemWidth )
    return;
  if ( w < MIN_ITEM_WIDTH )
    w = MIN_ITEM_WIDTH;
  d->mItemWidth = w;
  setLayoutDirty( true );
  updateContents();
}
Beispiel #15
0
RegisterMemoryView::RegisterMemoryView(QWidget *binEditor, quint64 addr,
                                       const QString &regName,
                                       RegisterHandler *handler, QWidget *parent) :
    MemoryView(binEditor, parent),
    m_registerName(regName), m_registerAddress(addr)
{
    connect(handler, &QAbstractItemModel::modelReset, this, &QWidget::close);
    connect(handler, &RegisterHandler::registerChanged, this, &RegisterMemoryView::onRegisterChanged);
    updateContents();
}
Beispiel #16
0
void NotePadPlugin::remNote(){
  //Clear the current note
  settings->remove("Note-"+QString::number(cnote));
  //If the last note, also decrease the max number
  if(cnote==maxnote && maxnote>1){ maxnote--; }
  //Now go to the previous note
  cnote--;
  if(cnote<1){ cnote = maxnote; }
  updateContents();
}
void QPWMTreeItemEditor::onSliderValueChanged( int value ) 
{
	unsigned int v = static_cast<unsigned int>(value);
	unsigned int pulseWidth = PWM::getMinPulseWidthInUs() + v;
	bool ret = mPWM->setPulseWidthInUs( pulseWidth );
	
	// If changing the pulse width failed, we need to put the slider 
	// back to the width of the PWM component 
	if ( !ret )		
		updateContents();
}
Beispiel #18
0
void RegisterMemoryView::setRegisterAddress(quint64 v)
{
    if (v == m_registerAddress) {
        updateContents();
        return;
    }
    m_registerAddress = v;
    setAddress(v);
    setWindowTitle(title(m_registerName, v));
    if (v)
        setMarkup(registerMarkup(v, m_registerName));
}
Beispiel #19
0
//==============================================================================
TestComponent::TestComponent (JucerDocument* const doc,
                              JucerDocument* const loaded,
                              const bool alwaysFill)
    : ownerDocument (doc),
      loadedDocument (loaded),
      alwaysFillBackground (alwaysFill)
{
    setToInitialSize();
    updateContents();
    testComponents.add (this);

    setLookAndFeel (&lookAndFeel);
}
bool KlustersView::qt_emit( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: updatedDimensions((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 1: singleColorUpdated((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 2: clusterRemovedFromView((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 3: clusterAddedToView((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 4: newClusterAddedToView((QValueList<int>&)*((QValueList<int>*)static_QUType_ptr.get(_o+1)),(int)static_QUType_int.get(_o+2),(bool)static_QUType_bool.get(_o+3)); break;
    case 5: newClusterAddedToView((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 6: spikesRemovedFromClusters((QValueList<int>&)*((QValueList<int>*)static_QUType_ptr.get(_o+1)),(bool)static_QUType_bool.get(_o+2)); break;
    case 7: modeToSet((BaseFrame::Mode)(*((BaseFrame::Mode*)static_QUType_ptr.get(_o+1)))); break;
    case 8: spikesAddedToCluster((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 9: updateContents(); break;
    case 10: emptySelection(); break;
    case 11: modifiedClusters((QValueList<int>&)*((QValueList<int>*)static_QUType_ptr.get(_o+1)),(bool)static_QUType_bool.get(_o+2),(bool)static_QUType_bool.get(_o+3)); break;
    case 12: modifiedClustersUndo((QValueList<int>&)*((QValueList<int>*)static_QUType_ptr.get(_o+1)),(bool)static_QUType_bool.get(_o+2)); break;
    case 13: updatedTimeFrame((long)(*((long*)static_QUType_ptr.get(_o+1))),(long)(*((long*)static_QUType_ptr.get(_o+2)))); break;
    case 14: sampleMode(); break;
    case 15: timeFrameMode(); break;
    case 16: meanPresentation(); break;
    case 17: allWaveformsPresentation(); break;
    case 18: overLayPresentation(); break;
    case 19: sideBySidePresentation(); break;
    case 20: increaseAmplitude(); break;
    case 21: decreaseAmplitude(); break;
    case 22: updateDisplayNbSpikes((long)(*((long*)static_QUType_ptr.get(_o+1)))); break;
    case 23: increaseAmplitudeofCorrelograms(); break;
    case 24: decreaseAmplitudeofCorrelograms(); break;
    case 25: noScale(); break;
    case 26: maxScale(); break;
    case 27: shoulderScale(); break;
    case 28: updatedBinSizeAndTimeFrame((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 29: setShoulderLine((bool)static_QUType_bool.get(_o+1)); break;
    case 30: updateDrawing(); break;
    case 31: changeGain((int)static_QUType_int.get(_o+1)); break;
    case 32: changeTimeInterval((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 33: changeChannelPositions((QValueList<int>&)*((QValueList<int>*)static_QUType_ptr.get(_o+1))); break;
    case 34: computeProbabilities(); break;
    case 35: changeBackgroundColor((QColor)(*((QColor*)static_QUType_ptr.get(_o+1)))); break;
    case 36: clustersRenumbered((bool)static_QUType_bool.get(_o+1)); break;
    case 37: updateClusters((QString)static_QUType_QString.get(_o+1),(QValueList<int>&)*((QValueList<int>*)static_QUType_ptr.get(_o+2)),(ItemColors*)static_QUType_ptr.get(_o+3),(bool)static_QUType_bool.get(_o+4)); break;
    case 38: increaseAllAmplitude(); break;
    case 39: decreaseAllAmplitude(); break;
    case 40: showLabels((bool)static_QUType_bool.get(_o+1)); break;
    case 41: nextCluster(); break;
    case 42: previousCluster(); break;
    default:
	return KDockArea::qt_emit(_id,_o);
    }
    return TRUE;
}
Beispiel #21
0
void EvaChatView::askResumeMode( const TQString filename, const unsigned int session )
{
    TQString strSession = TQString::number(session);
    TQString picPath = "<img src = \"" + EvaMain::images->getIconFullPath("MSG_INFO") + "\">";
    TQString resumeLink = "<a href=\""+ protocolResume + "_" + strSession + "\">" +
                          i18n("resume") + "</a>";
    TQString restartLink = "<a href=\""+ protocolNewOne + "_" + strSession + "\">" +
                           i18n("start") + "</a>";
    TQString txt = i18n("Cached information of \"%1\" has been found, you can %2 the last download or ignore the last cached download information and %3 a new download.").arg(filename).arg(resumeLink).arg(restartLink);

    TQString msg = wrapFontAttributes(TQt::gray, 9, false, false, false, txt);
    updateContents("&nbsp;" + picPath + "&nbsp;" + msg );
    showContents();
}
void TLFrameSequenceLayout::updateContentSize()
{
    if ( contentsHeight() < number_of_frame_sequences * 24 )
    {
    	resizeContents( contentsWidth(), number_of_frame_sequences * 24 );
    }
    else if ( contentsHeight() > number_of_frame_sequences * 24 && contentsHeight() > 90 )
    {
        resizeContents( contentsWidth(), contentsHeight() - 24 );
    }
    updateContents();
    updateScrollBars();
    parent_widget -> update();
}
Beispiel #23
0
void GuiDialog::updateView()
{
	setUpdatesEnabled(false);

	bc().setReadOnly(isBufferReadonly());
	// protect the BC from unwarranted state transitions
	updating_ = true;
	updateContents();
	updating_ = false;
	// The widgets may not be valid, so refresh the button controller
	bc().refresh();

	setUpdatesEnabled(true);
}
DesktopViewPlugin::DesktopViewPlugin(QWidget* parent, QString ID) : LDPlugin(parent, ID){
  this->setLayout( new QVBoxLayout());
    this->layout()->setContentsMargins(0,0,0,0);
  list = new QListWidget(this);
    list->setUniformItemSizes(true);
    list->setViewMode(QListView::IconMode);
    list->setLayoutMode(QListView::Batched);
    list->setBatchSize(10); //keep it snappy
    list->setSpacing(2);
    list->setSelectionBehavior(QAbstractItemView::SelectItems);
    list->setSelectionMode(QAbstractItemView::NoSelection);
    list->setStyleSheet( "QListWidget{ background: transparent; }" );
    list->setIconSize(QSize(64,64));
    list->setGridSize(QSize(80,80));
  this->layout()->addWidget(list);
  this->setInitialSize(200,300);
  watcher = new QFileSystemWatcher(this);
    watcher->addPath(QDir::homePath()+"/Desktop");
    connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(updateContents()) );
	
  connect(list, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(runItem(QListWidgetItem*)) );
  QTimer::singleShot(0,this, SLOT(updateContents()) );
}
Beispiel #25
0
NotePadPlugin::NotePadPlugin(QWidget* parent, QString ID) : LDPlugin(parent, ID){
  QVBoxLayout *vlay = new QVBoxLayout();
  this->setLayout( new QVBoxLayout() );
    this->layout()->setContentsMargins(0,0,0,0);
    vlay->setContentsMargins(3,3,3,3);
    frame = new QFrame(this);
      frame->setObjectName("notepadbase");
      frame->setStyleSheet("QFrame#notepadbase{border-size: 1px; background: rgba(255,255,255,50); color: black;} QFrame{ border: none; border-radius: 3px; background: rgba(255,255,255,100); color: black;}");
    this->layout()->addWidget(frame);
    frame->setLayout(vlay);
   
  //Setup the title bar header buttons
  QHBoxLayout *hlay = new QHBoxLayout();
  next = new QToolButton(this);
    next->setAutoRaise(true);
  prev = new QToolButton(this);
    prev->setAutoRaise(true);
  add = new QToolButton(this);
    add->setAutoRaise(true);
  rem = new QToolButton(this);
    rem->setAutoRaise(true);
  label = new QLabel(this);
    label->setAlignment(Qt::AlignCenter);
    hlay->addWidget(prev);
    hlay->addWidget(next);
    hlay->addWidget(label);
    hlay->addWidget(add);
    hlay->addWidget(rem);
    vlay->addLayout(hlay);
	
  //Setup the main text widget
  edit = new QPlainTextEdit(this);
    edit->setReadOnly(false);
    vlay->addWidget(edit);
	
  //Now setup the initial values
  cnote = this->settings->value("currentNote", 1).toInt();
  maxnote = this->settings->value("availableNotes",1).toInt();
  this->setInitialSize(200,300);
  //Setup the button connections
  connect(next, SIGNAL(clicked()), this, SLOT(nextNote()) );
  connect(prev, SIGNAL(clicked()), this, SLOT(prevNote()) );
  connect(add, SIGNAL(clicked()), this, SLOT(newNote()) );
  connect(rem, SIGNAL(clicked()), this, SLOT(remNote()) );
  connect(edit, SIGNAL(textChanged()), this, SLOT(noteChanged()) );
  QTimer::singleShot(0,this, SLOT(loadIcons()) );
  QTimer::singleShot(0,this, SLOT(updateContents()) );
  
}
Beispiel #26
0
// Resize event handler.
void qtractorMidiEditView::resizeEvent ( QResizeEvent *pResizeEvent )
{
	qtractorScrollView::resizeEvent(pResizeEvent);

	// Scrollbar/tools layout management.
	const QSize& size = qtractorScrollView::size();
	QScrollBar *pVScrollBar = qtractorScrollView::verticalScrollBar();
	const int w = pVScrollBar->width();

	updateContents();

	m_pEditor->editEventScale()->setFixedWidth(
		m_pEditor->width() - size.width());
	m_pEditor->editEventFrame()->setFixedWidth(w);
}
Beispiel #27
0
void BitmapTexture::updateContents(TextureMapper* textureMapper, GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag updateContentsFlag)
{
    std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(targetRect.size());
    GraphicsContext* context = imageBuffer->context();
    context->setImageInterpolationQuality(textureMapper->imageInterpolationQuality());
    context->setTextDrawingMode(textureMapper->textDrawingMode());

    IntRect sourceRect(targetRect);
    sourceRect.setLocation(offset);
    context->translate(-offset.x(), -offset.y());
    sourceLayer->paintGraphicsLayerContents(*context, sourceRect);

    RefPtr<Image> image = imageBuffer->copyImage(DontCopyBackingStore);

    updateContents(image.get(), targetRect, IntPoint(), updateContentsFlag);
}
Beispiel #28
0
void DigitView::slotZoomChange(const QString &zoom)
{
  QString stripped(zoom);

  if (stripped.right(1) == QString("%"))
    stripped.remove(stripped.length() - 1, 1);

  m_zoom = stripped.toInt();

  double scale = (double) m_zoom / 100.0;
  QMatrix ms;
  ms.scale(scale, scale);
  setWorldMatrix(ms);

  updateContents();
}
Beispiel #29
0
    void updateVisibleArea (const bool makeSureItUpdatesContent)
    {
        hasUpdated = false;

        const int newX = getViewedComponent()->getX();
        int newY = getViewedComponent()->getY();
        const int newW = jmax (owner.minimumRowWidth, getMaximumVisibleWidth());
        const int newH = owner.totalItems * owner.getRowHeight();

        if (newY + newH < getMaximumVisibleHeight() && newH > getMaximumVisibleHeight())
            newY = getMaximumVisibleHeight() - newH;

        getViewedComponent()->setBounds (newX, newY, newW, newH);

        if (makeSureItUpdatesContent && ! hasUpdated)
            updateContents();
    }
Beispiel #30
0
void EffectRack::choosePlugin(QListWidgetItem* it, bool replace)/*{{{*/
{
    PluginI* plugi = PluginDialog::getPlugin(track->type(), this);
    if (plugi)
    {
        BasePlugin* nplug = 0;

        if (plugi->type() == PLUGIN_LADSPA)
            nplug = new LadspaPlugin();
        else if (plugi->type() == PLUGIN_LV2)
            nplug = new Lv2Plugin();
        else if (plugi->type() == PLUGIN_VST)
            nplug = new VstPlugin();

        if (nplug)
        {
            if (nplug->init(plugi->filename(), plugi->label()))
            {
                // just in case is needed later
                //if (!audioDevice || audioDevice->deviceType() != AudioDevice::JACK_AUDIO)
                //    nplug->aboutToRemove();

                int idx = row(it);
                if (replace)
                {
                    audio->msgAddPlugin(track, idx, 0);
                    //Do this part from the GUI context so user interfaces can be properly deleted
                    // track->efxPipe()->insert(0, idx); was set on lv2 only
                }
                audio->msgAddPlugin(track, idx, nplug);
                nplug->setChannels(track->channels());
                nplug->setActive(true);
                song->dirty = true;
            }
            else
            {
                QMessageBox::warning(this, tr("Failed to load plugin"), tr("Plugin '%1'' failed to initialize properly, error was:\n%2").arg(plugi->name()).arg(get_last_error()));
                nplug->deleteMe();
                return;
            }
        }

        updateContents();
    }
}/*}}}*/