예제 #1
0
void SharpnessFilter::updateSharpType(int type){

    switch (type) {
    case 0:
        noneType = true;
        somethingChanged();
    case 1:                     //Very fine
        noneType = false;
        kernal = (cv::Mat_<char>(4,4) <<   0.272, 0.534, 0.131, 0,
                     0.349, 0.686, 0.168, 0,
                     0.393, 0.769, 0.189, 0,
                     0, 0, 0, 1);
        cv::filter2D(originalImg, tempImage, originalImg.depth(), kernal);
        somethingChanged();
        break;
    case 2:                     // Fine
        noneType = false;
        medianBlur(originalImg, tempImage, 3);
        somethingChanged();
        break;
    case 3:                     // Coarse
        noneType = false;
        GaussianBlur(originalImg, tempImage, cv::Size(0, 0), 3);
        somethingChanged();
        break;
    default:
        noneType = true;
        break;
    }
}
예제 #2
0
void MainWidget::mouseReleaseEvent(QMouseEvent *event) {
    int i = event->pos().x() / xsize;
    int j = event->pos().y() / ysize;
    if (j >= yasc || j < 0 || i >= xasc || i < 0) {
        if (current_brush->second->onMouseRelease(event, i, j, false))
            emit somethingChanged(true);
        return;
    }
    lastx = i;
    lasty = j;
    update(pixelRect(i,j));
    if (current_brush->second->onMouseRelease(event, i, j, true))
        emit somethingChanged(true);
}
예제 #3
0
void OptionsDetailed::encoderChanged( const QString& encoder )
{
    CodecPlugin *plugin = qobject_cast<CodecPlugin*>(config->pluginLoader()->backendPluginByName( encoder ));
    if( !plugin )
    {
//         TODO leads to crashes
//         KMessageBox::error( this, i18n("Sorry, this shouldn't happen.\n\nPlease report this bug and attach the following error message:\n\nOptionsDetailed::encoderChanged; PluginLoader::codecPluginByName returned 0 for encoder: '%1'").arg(encoder), i18n("Internal error") );
        return;
    }
    if( wPlugin )
    {
        grid->removeWidget( wPlugin );
        disconnect( wPlugin, SIGNAL(optionsChanged()), 0, 0 );
        wPlugin = currentPlugin->deleteCodecWidget( wPlugin );
    }
    currentPlugin = plugin;
    wPlugin = plugin->newCodecWidget();
    if( wPlugin )
    {
        connect( wPlugin, SIGNAL(optionsChanged()), this, SLOT(somethingChanged()) );
        qobject_cast<CodecWidget*>(wPlugin)->setCurrentFormat( cFormat->currentText() );
        if( plugin->lastConversionOptions() )
        {
            wPlugin->setCurrentConversionOptions( plugin->lastConversionOptions() );
        }
        grid->addWidget( wPlugin, 2, 0 );
    }

    pConfigurePlugin->setEnabled( plugin->isConfigSupported(BackendPlugin::Encoder,"") );

    if( pConfigurePlugin->isEnabled() )
        pConfigurePlugin->setToolTip( i18n("Configure %1 ...",encoder) );
    else
        pConfigurePlugin->setToolTip( "" );
}
예제 #4
0
void Spreadsheet::sort(const SpreadsheetCompare &compare)
{
    QList<QStringList> rows;
    QTableWidgetSelectionRange range = selectedRange();
    int i;

    for(i = 0; i < range.rowCount(); ++i)
    {
        QStringList row;
        for(int j = 0; j < range.columnCount(); ++j)
            row.append(formula(range.topRow() + i, range.leftColumn() + j));

        rows.append(row);
    }


    qStableSort(rows.begin(), rows.end(), compare);

    for(i = 0; i < range.rowCount(); ++i)
    {
        for(int j = 0; j < range.columnCount(); ++j)
            setFormula(range.topRow() + i, range.leftColumn() + j, rows[i][j]);
    }

    clearSelection();
    somethingChanged();
}
예제 #5
0
void FaceDetector::updateFilterProperties(int i){
    //filterPropBox = new QVBoxLayout();
//    if(currentFilter!=NULL)
//        filterPropWidget=currentFilter->getWidget();
    stackedLayout->setCurrentIndex(i);
    somethingChanged();
}
예제 #6
0
void Spreadsheet::paste()
{
    QString str = QApplication::clipboard()->text();
    QStringList rows = str.split('\n');

    int numRows = rows.count();
    int numCols = rows.first().count('\t') + 1;

    QTableWidgetSelectionRange selection = selectedRange();
    if(selection.rowCount() * selection.columnCount() != 1 &&
            (numRows != selection.rowCount() || numCols != selection.columnCount())){
        QMessageBox::information(this, tr("Spreadsheet"),
                                 tr("The information cannot be paseted"
                                    "because the copy and the paste areas aren't the same size"));
        return;
    }

    int destRow = selection.topRow();
    int destCol = selection.leftColumn();

    for(int i=0; i<numRows; i++){
        QStringList columns = rows[i].split('\t');
        for(int j=0; j<numCols; j++){
            if(i+destRow < RowCount && j+destCol < ColumnCount)
                setFormula(i+destRow, j+destCol, columns[j]);
        }
    }

    somethingChanged();
}
예제 #7
0
void Spreadsheet::paste()
{
    QTableWidgetSelectionRange range = selectedRange();
    QString str = QApplication::clipboard()->text();
    QStringList rows = str.split('\n');
    int numRows = rows.count();
    int numColumns = rows.first().count('\t') + 1;

    if(     range.rowCount() * range.columnCount() != 1
        &&  (   range.rowCount() !=  numRows
             || range.columnCount() !=  numColumns)
      )
    {
        QMessageBox::information(this, tr("Spreadsheet")
                                 , tr("The information cannot be pasted because the copy"
                                      "and paste areas aren't the same size."));
        return;
    }

    for(int i = 0; i < numRows; ++i)
    {
        QStringList columns = rows[i].split('\t');
        for(int j = 0; j < numColumns; ++j)
        {
            int row = range.topRow() + i;
            int column = range.leftColumn() + j;
            if(row < RowCount && column < ColumnCount)
                setFormula(row, column, columns[j]);
        }
    }

    somethingChanged();
}
int Spreadsheet::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QTableWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: modified(); break;
        case 1: cut(); break;
        case 2: copy(); break;
        case 3: paste(); break;
        case 4: del(); break;
        case 5: selectCurrentRow(); break;
        case 6: selectCurrentColumn(); break;
        case 7: recalculate(); break;
        case 8: setAutoRecalculate((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 9: findNext((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< Qt::CaseSensitivity(*)>(_a[2]))); break;
        case 10: findPrevious((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< Qt::CaseSensitivity(*)>(_a[2]))); break;
        case 11: somethingChanged(); break;
        default: ;
        }
        _id -= 12;
    }
    return _id;
}
/**
 * @brief ChordTableWidget::itemChanged_slot
 * @param qitem Case dont on a changé le texte
 *
 * Méthode qui met la case dans un état bon ou mauvais.
 */
void ChordTableWidget::itemChanged_slot(QTableWidgetItem *qitem)
{
	CaseItem* item = (CaseItem*) qitem;
	if((m_savedItem != 0 && item->text() != m_savedItem->text()) || (m_savedItem == 0))
	{
		emit somethingChanged();
		currentItemChanged_slot(item, 0); //on met à jour m_savedItem avec le texte nouvellement entré
	}

	if(item->column() < columnCount() -1)
	{
		if(!BasicChord::isValidForPlayer(item->getChord()))
		{
			item->setBadChordColor();
		}
		else if (item->isBeingPlayed())
		{
			item->setPlayColor();
		}
		else
		{
			item->restoreColor();
		}
	}
}
void Spreadsheet::del()
{
    QList<QTableWidgetItem *> items = selectedItems();
    if (!items.isEmpty()) {
        foreach (QTableWidgetItem *item, items)
            delete item;
        somethingChanged();
    }
}
// =============================================================================
void TimeTrackingWindow::stopTT() {
    try {
        mTableModel->stopTT();
        somethingChanged();
    } catch (std::exception& e) {
        QMessageBox::warning(this, tr("Could not end tracking time"),
                             e.what());

    }
}
예제 #12
0
void FaceDetector::updateMedianBlurSizeSlider(int val)
{
    //appendLog(QString::number(medianBlurSize)+QString(" to ")+QString::number(val));
    if(val%2==0){
        val++;
        medianBlurSizeSlider->setValue(val);
    }
    medianBlurSize = val;
    somethingChanged();
}
예제 #13
0
void OptionsDetailed::formatChanged( const QString& format )
{
    const QString oldEncoder = cPlugin->currentText();

    cPlugin->clear();
    //if( format != "wav" ) // TODO make it nicer if wav is selected
    for( int i=0; i<config->data.backends.codecs.count(); i++ )
    {
        if( config->data.backends.codecs.at(i).codecName == format )
        {
            cPlugin->addItems( config->data.backends.codecs.at(i).encoders );
        }
    }
    cPlugin->setCurrentIndex( 0 );

    if( cPlugin->currentText() != oldEncoder )
    {
        encoderChanged( cPlugin->currentText() );
    }
    else if( wPlugin )
    {
        wPlugin->setCurrentFormat( cFormat->currentText() );
    }

    lPlugin->setShown( format != "wav" );
    cPlugin->setShown( format != "wav" );
    pConfigurePlugin->setShown( format != "wav" );
    if( wPlugin )
        wPlugin->setShown( format != "wav" );

    QStringList errorList;
    cReplayGain->setEnabled( config->pluginLoader()->canReplayGain(cFormat->currentText(),currentPlugin,&errorList) );
    if( !cReplayGain->isEnabled() )
    {
        QPalette notificationPalette = cReplayGain->palette();
        notificationPalette.setColor( QPalette::Disabled, QPalette::WindowText, QColor(174,127,130) );
        cReplayGain->setPalette( notificationPalette );

        if( !errorList.isEmpty() )
        {
            errorList.prepend( i18n("Replay Gain is not supported for the %1 file format.\nPossible solutions are listed below.",cFormat->currentText()) );
        }
        else
        {
            errorList += i18n("Replay Gain is not supported for the %1 file format.\nPlease check your distribution's package manager in order to install an additional Replay Gain plugin.",cFormat->currentText());
        }
        cReplayGain->setToolTip( errorList.join("\n\n") );
    }
    else
    {
        cReplayGain->setToolTip( i18n("Replay Gain tags can tell your music player how loud a track is\nso it can adjust the volume to play all tracks with equal loudness.") );
    }

    somethingChanged();
}
/**
 * @brief ChordTableWidget::insert_column
 *
 * Insère une nouvelle colonne dans la grille.
 * @todo insérer la colonne APRES la case sélectionnée, si une seule case sélectionnée
 */
void ChordTableWidget::insertChordColumn() {

	insertColumn(columnCount()-1);

	for (int c = 0 ; c < this->rowCount(); c ++) {
		this->setItem(c, columnCount()-2, new CaseItem());
		this->setColumnWidth(c, 60);
	}

	emit somethingChanged();
}
예제 #15
0
void MainWidget::mouseMoveEvent(QMouseEvent *event) {
    int i = event->pos().x() / xsize;
    int j = event->pos().y() / ysize;
    if (j >= yasc || j < 0 || i >= xasc || i < 0) {
        if (current_brush->second->onMouseMove(event, i, j, false))
            emit somethingChanged(true);
        return;
    }
    int oldx = lastx;
    int oldy = lasty;
    lastx = i;
    lasty = j;
    update(pixelRect(oldx,oldy));
    if (event->buttons() & Qt::LeftButton || event->buttons() & Qt::RightButton) {
        if (current_brush->second->onMouseMove(event, i, j, true))
            emit somethingChanged(true);
    } else {
        QWidget::mouseMoveEvent(event);
    }
}
예제 #16
0
void OptionsSimple::profileChanged()
{
    const QString profile = cProfile->currentText();
    const QString lastFormat = cFormat->currentText();
    cFormat->clear();

    pProfileRemove->hide();
    pProfileInfo->show();

    if( profile == i18n("Very low") || profile == i18n("Low") || profile == i18n("Medium") || profile == i18n("High") || profile == i18n("Very high") )
    {
        cFormat->addItems( config->pluginLoader()->formatList(PluginLoader::Encode,PluginLoader::Lossy) );
    }
    else if( profile == i18n("Lossless") )
    {
        cFormat->addItems( config->pluginLoader()->formatList(PluginLoader::Encode,PluginLoader::Lossless) );
    }
    else if( profile == i18n("Hybrid") )
    {
        cFormat->addItems( config->pluginLoader()->formatList(PluginLoader::Encode,PluginLoader::Hybrid) );
    }
    else if( profile == i18n("User defined") )
    {
        cFormat->addItems( config->pluginLoader()->formatList(PluginLoader::Encode,PluginLoader::CompressionType(PluginLoader::InferiorQuality|PluginLoader::Lossy|PluginLoader::Lossless|PluginLoader::Hybrid)) );
    }
    else
    {
        foreach( const QString profileName, config->data.profiles.keys() )
        {
            if( profileName == profile )
            {
                ConversionOptions *conversionOptions = config->data.profiles.value( profileName );
                if( conversionOptions )
                {
                    cFormat->addItem( conversionOptions->codecName );
                    outputDirectory->setMode( (OutputDirectory::Mode)conversionOptions->outputDirectoryMode );
                    outputDirectory->setDirectory( conversionOptions->outputDirectory );
                    cReplayGain->setChecked( conversionOptions->replaygain );
                    pProfileRemove->show();
                    pProfileInfo->hide();
                }
                break;
            }
        }
    }

    if( cFormat->findText(lastFormat) != -1 )
    {
        cFormat->setCurrentIndex( cFormat->findText(lastFormat) );
    }

    somethingChanged();
}
/**
 * @brief ChordTableWidget::insertChordRow
 *
 * Insère une nouvelle ligne dans la grille.
 * @todo insérer SOIT après la case sélectionnée (si une seule case sélectionnée), SOIT à la fin du fichier
 */
void ChordTableWidget::insertChordRow() {
	if (isRowSelected())
	{
		QList<int> rows = expand_list(rowsSelected());
		for (QList<int>::Iterator it = rows.begin() ; it != rows.end() ; it ++)
			insertChordRow(*it);
	}
	else
	{
		insertChordRow(this->rowCount());
	}

	emit somethingChanged();
}
// =============================================================================
bool TimeTrackingWindow::openSpreadsheet(bool silent) {

//    SomethingChangedDisconnectTemporarily somethingChangedDisconnectTemporarily(mTableModel->getViewModel()->getTimeTrackingModel(), this);
    // TODO: Change this with a smart pointer
    /*disconnect(mTableModel->getViewModel()->getTimeTrackingModel(),
            0, this, 0);*/
    std::unique_ptr<DisconnectTemporarily> disconnectTemporarily(
                new DisconnectTemporarily(
                    mTableModel->getViewModel()->getTimeTrackingModel(), SIGNAL(somethingChanged()),
                    this, SLOT(informSomethingChanged())));
    bool returnValue = false;
    if(mIOFileAccesses->openSheetInformation(NULL, silent)) {

        updateMainFields();
        somethingChanged();
        returnValue = true;

    }
    /*connect(mTableModel->getViewModel()->getTimeTrackingModel(),
            SIGNAL(somethingChanged()), this, SLOT(informSomethingChanged()));*/

    return returnValue;

}
/**
 * @brief ChordTableWidget::delete_selected_column
 *
 * Supprime les colonnes dont les cases sélectionnées sont membres.
 */
void ChordTableWidget::deleteSelectedColumn() {

	QList<QTableWidgetItem*> listItems = selectedItems();
	//Suppression des doublons
	for(int i=0; i<listItems.size(); i++)
	{
		for(int j=i+1; j<listItems.size(); j++)
		{
			if(listItems.value(i)->column() == listItems.value(j)->column())
			{
				listItems.removeAt(j);
				j--;
			}
		}
	}

	if(listItems.count() == 1 && listItems.value(0)->column() != columnCount() - 1)
	{
		removeColumn(listItems.first()->column());
	}
	else if(listItems.count() > 1)
	{
		QString listColumn;
		listColumn.append(tr("Are you sure you want to delete columns "));

		for(QList<QTableWidgetItem*>::Iterator i = listItems.begin(); i != listItems.end() ; i++)
		{
			listColumn.append(QString::number((**i).column()+1));
			listColumn.append(", ");
		}
		listColumn.remove(listColumn.length()-2, 1);
		listColumn.append("?");

		int answer = QMessageBox::question(this, tr("Deleting columns"), listColumn, QMessageBox::Yes | QMessageBox::No);
		if(answer == QMessageBox::Yes)
		{
			for(QList<QTableWidgetItem*>::Iterator i = listItems.begin(); i != listItems.end() ; i++)
			{
				if(columnCount() > 1 && (**i).column() != columnCount() - 1)
				{
					removeColumn((**i).column());
				}
			}
		}
	}
	emit somethingChanged();
}
예제 #20
0
void UWatchMe::on__login_clicked()
{
    QSettings s;
    s.setValue("endpoint", ui->_endpoint->text());
    s.setValue("device", ui->_device_id->text());

    QVariantMap body;
    body["device"] = ui->_device_id->text();
    try {
        _tracker->apicall("devicelogin", body);
        s.setValue("loggedIn", true);
        hide();
        emit somethingChanged("Logged in", "WatchMe is logging your activity.");
    } catch (ApiCallError e) {
        QMessageBox::critical(this, "Unable to login", e.message);
    }
    reloadUi();
}
예제 #21
0
void MainWidget::addRows(int place, int n) {
    if (n <= 0)
        return;
    place = qBound(0, place, yasc);

    QList<QList<QRgb> > bg, fg;
    for (int j = 0; j < yasc; ++j) {
        QList<QRgb> a, b;
        for (int i = 0; i < xasc; ++i) {
            a << background.pixel(i,j);
            b << foreground.pixel(i,j);
        }
        bg << a;
        fg << b;
    }
    QList<QChar> textl;
    QList<QRgb> bgRow, fgRow;
    for (int i = 0; i < xasc; ++i) {
        textl << QChar();
        bgRow << bgColor.rgb();
        fgRow << fgColor.rgb();
    }
    for (int i = 0; i < n; ++i) {
        text.insert(place, textl);
        bg.insert(place, bgRow);
        fg.insert(place, fgRow);
    }
    QImage newbg(xasc, yasc+n, QImage::Format_RGB32);
    QImage newfg(xasc, yasc+n, QImage::Format_RGB32);
    for (int j = 0; j < yasc+n; ++j) {
        for (int i = 0; i < xasc; ++i) {
            newbg.setPixel(i, j, bg[j][i]);
            newfg.setPixel(i, j, fg[j][i]);
        }
    }
    background = newbg;
    foreground = newfg;
    yasc += n;
    update();
    updateGeometry();
    adjustSize();
    emit somethingChanged(true);
}
예제 #22
0
QLayout* EditSheet::createColumn(column c) {
    ColumnEditSheet* col = new ColumnEditSheet(c,ui->vboxLayout->count(),ui->vboxLayout->count()+1,C);

    connect(col,SIGNAL(somethingChanged()),SLOT(refreshDisplay()));
    connect(col,SIGNAL(moveMeUp(int)),SLOT(upCol(int)));
    connect(col,SIGNAL(moveMeDown(int)),SLOT(downCol(int)));
    connect(col,SIGNAL(removeMe(int)),SLOT(delCol(int)));
    connect(this,SIGNAL(switchPos(int,int,int)),col,SLOT(posSwitched(int,int,int)));
    connect(this,SIGNAL(deletePos(int,int)),col,SLOT(posRemoved(int,int)));
    connect(this,SIGNAL(newPos(int)),col,SLOT(posChanged(int)));
    connect(ui->checkBoxAdapt,SIGNAL(toggled(bool)),col->widthBox(),SLOT(setDisabled(bool)));

    col->widthBox()->setDisabled(ui->checkBoxAdapt->isChecked());

#if QT_VERSION >= 0x403000
    col->setContentsMargins(0,0,0,0);
#endif
    col->setSpacing(0);
    col->setMargin(0);

    return col;
}
예제 #23
0
void MainWidget::delColumns(int place, int n) {
    if (n <= 0)
        return;
    place = qBound(0, place, xasc);
    n = qMin(n, xasc);

    QList<QList<QRgb> > bg, fg;
    for (int j = 0; j < yasc; ++j) {
        QList<QRgb> a, b;
        for (int i = 0; i < xasc; ++i) {
            a << background.pixel(i,j);
            b << foreground.pixel(i,j);
        }
        bg << a;
        fg << b;
    }
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < yasc; ++j) {
            text[j].removeAt(place);
            bg[j].removeAt(place);
            fg[j].removeAt(place);
        }
    }
    QImage newbg(xasc-n, yasc, QImage::Format_RGB32);
    QImage newfg(xasc-n, yasc, QImage::Format_RGB32);
    for (int j = 0; j < yasc; ++j) {
        for (int i = 0; i < xasc-n; ++i) {
            newbg.setPixel(i, j, bg[j][i]);
            newfg.setPixel(i, j, fg[j][i]);
        }
    }
    background = newbg;
    foreground = newfg;
    xasc -= n;
    update();
    updateGeometry();
    adjustSize();
    emit somethingChanged(true);
}
예제 #24
0
//***************************************************************************
Kwave::SaveBlocksWidget::SaveBlocksWidget(QWidget *parent,
	QString filename_pattern,
	Kwave::SaveBlocksPlugin::numbering_mode_t numbering_mode,
	bool selection_only,
	bool have_selection)
    :QWidget(parent), Ui::SaveBlocksWidgetBase()
{
    setupUi(this);

    Kwave::FileInfo info;

    // the file name pattern combo box
    cbPattern->addItem(_("[%2nr]-[%title]"));
    cbPattern->addItem(_("[%filename] part [%nr] of [%total]"));
    cbPattern->addItem(
	_("[%fileinfo{") +
	info.name(Kwave::INF_NAME) +
	_("}] (part [%nr] of [%total])"));
    cbPattern->addItem(_("[%filename] - [%04nr]"));
    cbPattern->addItem(_("[%2nr] [%filename]"));
    cbPattern->addItem(_("[%2nr]-[%filename]"));
    cbPattern->addItem(_("[%02nr]-[%filename]"));
    cbPattern->addItem(_("[%04nr]-[%filename]"));
    cbPattern->addItem(_("[%02nr] of [%count] [%filename]"));
    cbPattern->addItem(_("[%02nr] of [%total] [%filename]"));
    if (filename_pattern.length())
	cbPattern->setEditText(filename_pattern);
    else
	cbPattern->setCurrentIndex(0);

    // the numbering mode combo box
    cbNumbering->setCurrentIndex(static_cast<int>(numbering_mode));

    // the "selection only" checkbox
    if (have_selection) {
	// we have a selection
	chkSelectionOnly->setEnabled(true);
	chkSelectionOnly->setChecked(selection_only);
    } else {
	// no selection -> force it to "off"
	chkSelectionOnly->setEnabled(false);
	chkSelectionOnly->setChecked(false);
    }

    // combo box with pattern
    connect(cbPattern, SIGNAL(editTextChanged(QString)),
            this, SIGNAL(somethingChanged()));
    connect(cbPattern, SIGNAL(highlighted(int)),
            this, SIGNAL(somethingChanged()));
    connect(cbPattern, SIGNAL(activated(int)),
            this, SIGNAL(somethingChanged()));

    // combo box with numbering
    connect(cbNumbering, SIGNAL(editTextChanged(QString)),
            this, SIGNAL(somethingChanged()));
    connect(cbNumbering, SIGNAL(highlighted(int)),
            this, SIGNAL(somethingChanged()));
    connect(cbNumbering, SIGNAL(activated(int)),
            this, SIGNAL(somethingChanged()));

    // selection only checkbox
    connect(chkSelectionOnly, SIGNAL(stateChanged(int)),
            this, SIGNAL(somethingChanged()));
}
예제 #25
0
void FaceDetector::updateRectThresholdSpinBox(int val)
{
    rectThreshold = val;
    somethingChanged();
}
예제 #26
0
void FaceDetector::handleImageChanged()
{
    cv::cvtColor(originalImg,grayImgMat,CV_BGR2GRAY);
    somethingChanged();
}
예제 #27
0
void TextFinder::on_caseSensitivity_stateChanged(int arg1)
{
    somethingChanged();
}
예제 #28
0
void TextFinder::on_textEdit_textChanged()
{
    somethingChanged();
}
예제 #29
0
void SharpnessFilter::handleImageChanged()
{
    somethingChanged();
    updateSharpType(sharpTypeComboBox->currentIndex());
}
예제 #30
0
void AstManager::processAstData(QString str) {
  //qDebug () << "AstData: " << str;

    QStringList lines = str.split("\n");
    //qDebug() << lines;

    QHash<QString, QString> strHash;
    QStringListIterator linesIterator(lines);
    while (linesIterator.hasNext()) {
       QStringList fields = linesIterator.next().split(": ");
       if (fields.size() == 2) {
	 strHash[fields.at(0).toLower()]= fields.at(1).toLower();
       }
    }
      
     qDebug() << "Hash: " << strHash;

    if (strHash.contains("event")) {
      if (strHash.value("event") == "newchannel") {
	Channel *channel = new Channel();
	channel->setName(strHash.value("channel"));
	channel->setUniqueID(strHash.value("uniqueid"));
	channel->setCallerID(strHash.value("callerid"));
	channel->setCallerIDName(strHash.value("calleridname"));
	channel->setState(convertToChannelState(strHash.value("state")));
	channelsHash.insert(strHash.value("uniqueid"), channel);
	emit somethingChanged();
      } else if (strHash.value("event") == "newstate") {
	Channel *channel = channelsHash.value(strHash.value("uniqueid"));
	if (channel != 0) {
	  channel->setState(convertToChannelState(strHash.value("state")));
	  emit somethingChanged();
	}	
      } else if (strHash.value("event") == "newcallerid") {
	Channel *channel = channelsHash.value(strHash.value("uniqueid"));
	if (channel != 0) {
	  channel->setCallerID(strHash.value("callerid"));
	  channel->setCallerIDName(strHash.value("calleridname"));
	  emit somethingChanged();
	}	
      } else if (strHash.value("event") == "newexten") {
	//emit newextension();
	qDebug() << "Newextension : " <<  strHash.value("newexten");
      } else if (strHash.value("event") == "dial") {
	// dest channel holds the connection
	Channel *destchannel = channelsHash.value(strHash.value("destuniqueid"));
	destchannel->newConnection(channelsHash.value(strHash.value("srcuniqueid")), ConnectionNsp::dail);
	emit somethingChanged();

      } else if (strHash.value("event") == "link") {
	// guess uniqueid2 is destuniqueid
	Channel *destchannel = channelsHash.value(strHash.value("uniqueid2"));
	if (destchannel != 0) {
	  Connection *connection = destchannel->getConnectionPtr();
	  
	  if (connection != 0) {
	    connection->setState(ConnectionNsp::link);
	    emit somethingChanged();
	  } else {
	    qWarning() << "Internal error ... conection == NULL";
	  }
	} else {
	  qWarning() << "Internal error ... destchannel == NULL";
	}

      } else if (strHash.value("event") == "hangup") {
	Channel *channel = channelsHash.value(strHash.value("uniqueid"));
	channel->setState(down);
	emit somethingChanged();
	channelsHash.remove(strHash.value("uniqueid"));
	delete channel;
	emit somethingChanged();
      }
    }
}