Esempio n. 1
0
void bg_nle_project_outstream_make_current(bg_nle_project_t * p,
                                           bg_nle_track_type_t type,
                                           bg_nle_outstream_t * new_outstream)
  {
  bg_nle_op_outstream_make_current_t * d;
  bg_nle_outstream_t * old_outstream = NULL;

  switch(type)
    {
    case BG_NLE_TRACK_AUDIO:
      old_outstream = p->current_audio_outstream;
      break;
    case BG_NLE_TRACK_VIDEO:
      old_outstream = p->current_video_outstream;
      break;
    case BG_NLE_TRACK_NONE:
      break;
    }
  
  if(old_outstream == new_outstream)
    return;

  d = calloc(1, sizeof(*d));
  d->old_outstream = old_outstream;
  d->new_outstream = new_outstream;
  d->type = type;
  edited(p, BG_NLE_EDIT_OUTSTREAM_MAKE_CURRENT, d, NULL);
  }
Esempio n. 2
0
void EditPanel::onImagePathButtonClicked(bool /*checked*/)
{
	QList<QByteArray> formats = QImageReader::supportedImageFormats();

	QString filter;
	for(QList<QByteArray>::const_iterator i=formats.begin(); i!=formats.end(); i++)
	{
		QString ext(*i);
		if( !ext.isEmpty() )
		{
			if( !filter.isEmpty() )
				filter.append(' ');
			filter.append( QString("*.%1").arg(ext) );
		}
	}

	if( !filter.isEmpty() )
	{
		filter.prepend( tr("Image Files (") );
		filter.append(")");
	}

	QString imagePath = QFileDialog::getOpenFileName(this,
		tr("Select Icon"),
		QDesktopServices::storageLocation(QDesktopServices::PicturesLocation),
		filter);

	SetImagePath(imagePath);

	emit edited();
}
Esempio n. 3
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)

{

    Settings settings;
    settings.s_plot.Xfrom = 0;
    settings.s_plot.Xto = 500;
    settings.s_plot.Yfrom = 0;
    settings.s_plot.Yto = 500;
    settings.s_plot.x_name = "X";
    settings.s_plot.y_name = "Y";


    d_panel = new Panel();
    d_panel->setSettings(settings);

    QWidget *w = new QWidget( this );

    graf = new Graf();

    QHBoxLayout *hLayout = new QHBoxLayout( w );
    hLayout->addWidget( d_panel );
    hLayout->addWidget( graf, 10 );

    setCentralWidget( w );

    updatePlot();

    connect( d_panel, SIGNAL( edited() ), SLOT( updatePlot() ) );

    createAction();
    createToolBar();

}
Esempio n. 4
0
void SettingsEditor::edited()
{
    updateEditor();

    const PlotSettings s = settings();
    Q_EMIT edited( s );
}
Esempio n. 5
0
void bg_nle_project_delete_track(bg_nle_project_t * p, bg_nle_track_t * t)
  {
  int num_outstreams, i;
  bg_nle_op_track_t * d;
  
  d = calloc(1, sizeof(*d));
  d->index = bg_nle_project_track_index(p, t);
  d->track = t;

  /* Check to which outstreams this track was attached */
  num_outstreams = 0;

  for(i = 0; i < p->num_outstreams; i++)
    {
    if(bg_nle_outstream_has_track(p->outstreams[i], t))
      num_outstreams++;
    }

  if(!num_outstreams)
    d->num_outstreams = -1;
  else
    {
    d->outstreams = calloc(num_outstreams, sizeof(*d->outstreams));
    for(i = 0; i < p->num_outstreams; i++)
      {
      if(bg_nle_outstream_has_track(p->outstreams[i], t))
        {
        d->outstreams[d->num_outstreams] = p->outstreams[i];
        d->num_outstreams++;
        }
      }
    }
    
  edited(p, BG_NLE_EDIT_DELETE_TRACK, d, NULL);
  }
Esempio n. 6
0
void KeySequenceEdit::processEvent(QEvent *e) {
    mSequence = ShortcutBuilder::fromEvent(e);
    if(!mSequence.isEmpty()) {
        this->setText(mSequence);
        emit edited();
    }
}
Esempio n. 7
0
QString ApiTrace::fileName() const
{
    if (edited()) {
        return m_tempFileName;
    }

    return m_fileName;
}
Esempio n. 8
0
void bg_nle_project_move_outstream(bg_nle_project_t * p, int old_pos, int new_pos)
  {
  bg_nle_op_move_outstream_t * d;
  d = calloc(1, sizeof(*d));
  d->old_index = old_pos;
  d->new_index = new_pos;
  edited(p, BG_NLE_EDIT_MOVE_OUTSTREAM, d, NULL);
  }
Esempio n. 9
0
void bg_nle_project_delete_outstream(bg_nle_project_t * p, bg_nle_outstream_t * t)
  {
  bg_nle_op_outstream_t * d;
  d = calloc(1, sizeof(*d));
  d->index = bg_nle_project_outstream_index(p, t);
  d->outstream = t;
  edited(p, BG_NLE_EDIT_DELETE_OUTSTREAM, d, NULL);
  }
Esempio n. 10
0
void EditPanel::onTextColorClicked(bool /*checked*/)
{
	QColor color;
	GetTextColor(color);
	color = QColorDialog::getColor(color, this, tr("Text Color"));
	SetTextColor(color);
	emit edited();
}
Esempio n. 11
0
void CtimerProperty::disconnectSignal()
{
    disconnect(simpleTextEdit, SIGNAL(edited()), this, SLOT(edited()));
    //connect(dstDateTimeEdit, SIGNAL(edited()), this, SLOT(edited()));
    disconnect(smLineEdit, SIGNAL(edited()), this, SLOT(edited()));

    disconnect(dstDateTimeEdit, SIGNAL(dateTimeChanged(const QDateTime &)), this, SLOT(edited()));
    disconnect(colorCombo, SIGNAL(indexChangeSignal()), this, SLOT(edited()));
    disconnect(styleCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(edited()));
    disconnect(fontSizeCombo, SIGNAL(indexChangeSignal()), this, SLOT(edited()));

    disconnect(showModeEdit, SIGNAL(edited()), this, SLOT(edited()));
    disconnect(borderEdit, SIGNAL(editSignal()), this, SLOT(edited()));
}
Esempio n. 12
0
void bg_nle_project_move_track(bg_nle_project_t * p, int old_pos, int new_pos)
  {
  bg_nle_op_move_track_t * d;
  
  d = calloc(1, sizeof(*d));
  d->old_index = old_pos;
  d->new_index = new_pos;
  edited(p, BG_NLE_EDIT_MOVE_TRACK, d, NULL);
  }
Esempio n. 13
0
void TupTextItem::focusOutEvent(QFocusEvent * event)
{
    QGraphicsTextItem::focusOutEvent(event);

    if (textInteractionFlags() & Qt::TextEditorInteraction && m_isEditable) {
        QTimer::singleShot(0, this, SLOT(toggleEditable()));
        emit edited();
    }
}
Esempio n. 14
0
void bg_nle_project_delete_file(bg_nle_project_t * p,
                                int index)
  {
  bg_nle_op_file_t * d;
  d = calloc(1, sizeof(*d));
  d->index = index;
  d->file = p->media_list->files[index];
  edited(p, BG_NLE_EDIT_DELETE_FILE, d, NULL);
  }
Esempio n. 15
0
void bg_nle_project_set_cursor_pos(bg_nle_project_t * p, int64_t cursor_pos)
  {
  bg_nle_op_cursor_pos_t * d;
  d = calloc(1, sizeof(*d));
  d->old_pos = p->cursor_pos;
  d->new_pos = cursor_pos;
  
  edited(p, BG_NLE_EDIT_SET_CURSOR_POS, d, NULL);
  
  }
Esempio n. 16
0
static void add_file(bg_nle_project_t * p,
                     bg_nle_file_t * file, int * id)
  {
  bg_nle_op_file_t * d;

  d = calloc(1, sizeof(*d));
  d->index = p->media_list->num_files;
  d->file  = file;
  edited(p, BG_NLE_EDIT_ADD_FILE, d, id);
  }
Esempio n. 17
0
 /**
 Create a standard edit box for each component.
 */
 QLineEdit* ParameterisedLatticeView::createEditBox(double value)
 {
   QLineEdit* box = new QLineEdit();
   box->setFixedWidth(50);
   box->setText(QString::number(value));
   QDoubleValidator* validator = new QDoubleValidator(0,100,4, box); //TODO 0 - 100 4dp. is this OK?
   box->setValidator(validator);
   connect(box, SIGNAL(editingFinished()), this, SLOT(edited()));
   return box;
 }
Esempio n. 18
0
static void delete_segment(bg_nle_project_t * p,
                           bg_nle_track_t * t, int index, int * id)
  {
  bg_nle_op_segment_t * d;
  d = calloc(1, sizeof(*d));
  d->t = t;
  d->index = index;
  memcpy(&d->seg, t->segments + index, sizeof(d->seg));
  edited(p, BG_NLE_EDIT_DELETE_SEGMENT, d, id);
  }
Esempio n. 19
0
SettingsEditor::SettingsEditor( QWidget *parent ):
    QFrame( parent )
{
    QGroupBox *axesBox = new QGroupBox( "Axes", this );
    QVBoxLayout* axesBoxLayout = new QVBoxLayout( axesBox );
    axesBoxLayout->setMargin( 20 );


    for ( int i = PlotSettings::AxisBegin;
        i <= PlotSettings::Logarithmic; i++ )
    {
        d_checkBox[i] = new QCheckBox( axesBox );
        axesBoxLayout->addWidget( d_checkBox[i] );
    }

    QGroupBox *gridBox = new QGroupBox( "Grids", this );
    QVBoxLayout* gridBoxLayout = new QVBoxLayout( gridBox );
    gridBoxLayout->setMargin( 20 );

    for ( int scaleId = 0; scaleId < QwtPolar::ScaleCount; scaleId++ )
    {
        int idx = PlotSettings::MajorGridBegin + scaleId;
        d_checkBox[idx] = new QCheckBox( gridBox );
        gridBoxLayout->addWidget( d_checkBox[idx] );

        idx = PlotSettings::MinorGridBegin + scaleId;
        d_checkBox[idx] = new QCheckBox( gridBox );
        gridBoxLayout->addWidget( d_checkBox[idx] );
    }
    gridBoxLayout->addStretch( 10 );

    QGroupBox *otherBox = new QGroupBox( "Other", this );
    QVBoxLayout* otherBoxLayout = new QVBoxLayout( otherBox );
    otherBoxLayout->setMargin( 20 );

    for ( int i = PlotSettings::Logarithmic + 1;
        i < PlotSettings::NumFlags; i++ )
    {
        d_checkBox[i] = new QCheckBox( otherBox );
        otherBoxLayout->addWidget( d_checkBox[i] );
    }
    otherBoxLayout->addStretch( 10 );

    QVBoxLayout *layout = new QVBoxLayout( this );
    layout->addWidget( axesBox );
    layout->addWidget( gridBox );
    layout->addWidget( otherBox );
    layout->addStretch( 10 );

    for ( int i = 0; i < PlotSettings::NumFlags; i++ )
    {
        d_checkBox[i]->setText( label( i ) );
        connect( d_checkBox[i], SIGNAL( clicked() ), this, SLOT( edited() ) );
    }
}
Esempio n. 20
0
HeliPanel::HeliPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
  ModelPanel(parent, model, generalSettings, firmware),
  ui(new Ui::Heli)
{
  ui->setupUi(this);

  connect(ui->swashType, SIGNAL(currentIndexChanged(int)), this, SLOT(edited()));
  connect(ui->swashRingVal, SIGNAL(editingFinished()), this, SLOT(edited()));
  connect(ui->swashCollectiveSource, SIGNAL(currentIndexChanged(int)), this, SLOT(edited()));
  if (firmware->getCapability(VirtualInputs)) {
    connect(ui->swashAileronSource, SIGNAL(currentIndexChanged(int)), this, SLOT(edited()));
    connect(ui->swashElevatorSource, SIGNAL(currentIndexChanged(int)), this, SLOT(edited()));
    connect(ui->swashAileronWeight, SIGNAL(editingFinished()), this, SLOT(edited()));
    connect(ui->swashElevatorWeight, SIGNAL(editingFinished()), this, SLOT(edited()));
    connect(ui->swashCollectiveWeight, SIGNAL(editingFinished()), this, SLOT(edited()));
    ui->invertLabel->hide();
    ui->swashElevatorInvert->hide();
    ui->swashAileronInvert->hide();
    ui->swashCollectiveInvert->hide();
  }
Esempio n. 21
0
void pPathListEditor::onEditItem()
{
    if ( QListWidgetItem* it = mList->selectedItems().value( 0 ) )
    {
        QString s= QFileDialog::getExistingDirectory( window(), tr( "Choose directory" ), mPath );
        if ( !s.isEmpty() )
        {
            it->setText( s );
            emit edited();
        }
    }
}
Esempio n. 22
0
static void move_segment(bg_nle_project_t * p,
                         bg_nle_track_t * t, int index,
                         int64_t new_dst_pos, int * id)
  {
  bg_nle_op_move_segment_t * d;
  
  d = calloc(1, sizeof(*d));
  d->t = t;
  d->old_dst_pos = t->segments[index].dst_pos;
  d->new_dst_pos = new_dst_pos;
  edited(p, BG_NLE_EDIT_MOVE_SEGMENT, d, id);
  }
Esempio n. 23
0
static void split_segment(bg_nle_project_t * p,
                          bg_nle_track_t * t, int index,
                          gavl_time_t time, int * id)
  {
  bg_nle_op_split_segment_t * d;
  
  d = calloc(1, sizeof(*d));
  d->t = t;
  d->index = index;
  d->time = time;
  edited(p, BG_NLE_EDIT_MOVE_SEGMENT, d, id);
  }
Esempio n. 24
0
void bg_nle_project_detach_track(bg_nle_project_t * p,
                                 bg_nle_outstream_t * outstream,
                                 bg_nle_track_t * track)
  {
  bg_nle_op_outstream_track_t * d;
  if(!bg_nle_outstream_has_track(outstream, track))
    return;
  d = calloc(1, sizeof(*d));
  d->track = track;
  d->outstream = outstream;
  edited(p, BG_NLE_EDIT_OUTSTREAM_DETACH_TRACK, d, NULL);
  }
Esempio n. 25
0
void bg_nle_project_set_zoom(bg_nle_project_t * p,
                             bg_nle_time_range_t * visible)
  {
  bg_nle_op_change_range_t * d;

  d = calloc(1, sizeof(*d));

  bg_nle_time_range_copy(&d->old_range, &p->visible);
  bg_nle_time_range_copy(&d->new_range, visible);
  
  edited(p, BG_NLE_EDIT_CHANGE_ZOOM, d, NULL);
  
  }
Esempio n. 26
0
void bg_nle_project_set_outstream_flags(bg_nle_project_t * p,
                                        bg_nle_outstream_t * t, int flags)
  {
  bg_nle_op_outstream_flags_t * d;
  if(t->flags == flags)
    return;
  d = calloc(1, sizeof(*d));
  d->old_flags = t->flags;
  d->new_flags = flags;
  d->outstream = t;
  edited(p, BG_NLE_EDIT_OUTSTREAM_FLAGS, d, NULL);
  
  }
Esempio n. 27
0
HeliPanel::HeliPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
  ModelPanel(parent, model, generalSettings, firmware),
  ui(new Ui::Heli)
{
  ui->setupUi(this);

  connect(ui->swashTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(edited()));
  connect(ui->swashCollectiveCB, SIGNAL(currentIndexChanged(int)), this, SLOT(edited()));
  connect(ui->swashRingValSB, SIGNAL(editingFinished()), this, SLOT(edited()));
  connect(ui->swashInvertELE, SIGNAL(stateChanged(int)), this, SLOT(edited()));
  connect(ui->swashInvertAIL, SIGNAL(stateChanged(int)), this, SLOT(edited()));
  connect(ui->swashInvertCOL, SIGNAL(stateChanged(int)), this, SLOT(edited()));
}
Esempio n. 28
0
void bg_nle_project_set_edit_mode(bg_nle_project_t * p, int mode)
  {
  bg_nle_op_edit_mode_t * d;

  if(p->edit_mode == mode)
    return;

  d = calloc(1, sizeof(*d));
  d->old_mode = p->edit_mode;
  d->new_mode = mode;
  edited(p, BG_NLE_EDIT_SET_EDIT_MODE, d, NULL);
  
  }
Esempio n. 29
0
MessageView::MessageView(ViewInfo::Type type, IrcConnection* connection, IrcChannelStackView* stackView) :
	QWidget(stackView)
{
	d.setupUi(this);
	d.viewType = type;
	d.sentId = 1;
#if QT_VERSION >= 0x040700
	d.awayReply.invalidate();
#else
	d.awayReply = QTime();
#endif
	d.playback = false;
	d.parser = stackView->parser();
	d.firstNames = true;
	d.messageTimer = new QTimer(this);
	connect(d.messageTimer, SIGNAL(timeout()), this, SLOT(sendMessageLine()));

	d.joined = 0;
	d.parted = 0;
	d.connected = 0;
	d.disconnected = 0;

	d.chatInput = new CWidgetChatInput(this, true);
	d.verticalLayoutInputWidget->addWidget(d.chatInput);
	d.widgetInput->setFixedHeight(130);
	d.chatInput->setFixedHeight(130);

	connect(d.splitter, SIGNAL(splitterMoved(int, int)), this, SLOT(onSplitterMoved()));

	setFocusProxy(d.chatInput->textEdit());
	d.textBrowser->setBuddy(d.chatInput->textEdit());
	d.textBrowser->viewport()->installEventFilter(this);
	connect(d.textBrowser, SIGNAL(anchorClicked(QUrl)), SLOT(onAnchorClicked(QUrl)));

	d.highlighter = new SyntaxHighlighter(d.textBrowser->document());

	d.connection = connection;
	connect(d.connection, SIGNAL(statusChanged(IrcConnection::Status)), this, SLOT(onConnectionStatusChanged()));

	if (type == ViewInfo::Server)
		connect(d.connection, SIGNAL(socketError(QAbstractSocket::SocketError)), this, SLOT(onSocketError()));

	d.topicLabel->setVisible(type == ViewInfo::Channel);
	d.listView->setVisible(type == ViewInfo::Channel);
	if (type == ViewInfo::Channel) {
		d.listView->setConnection(connection);
		connect(d.listView, SIGNAL(queried(QString)), this, SIGNAL(queried(QString)));
		connect(d.listView, SIGNAL(doubleClicked(QString)), this, SIGNAL(queried(QString)));
		connect(d.listView, SIGNAL(commandRequested(IrcCommand*)), d.connection, SLOT(sendCommand(IrcCommand*)));
		connect(d.topicLabel, SIGNAL(edited(QString)), this, SLOT(onTopicEdited(QString)));
	} else if (type == ViewInfo::Server) {
Esempio n. 30
0
void pPathListEditor::onAddItem()
{
    // get directory
    QString s = QFileDialog::getExistingDirectory( window(), tr( "Choose directory" ), mPath );
    
    if ( !s.isEmpty() )
    {
        QListWidgetItem* it = new QListWidgetItem( s, mList );
        it->setFlags( it->flags() | Qt::ItemIsEditable );
        mList->setCurrentItem( it );
        mList->scrollToItem( it );
        emit edited();
    }
}