void Delegate::indexChanged(int ind_newCB)
{
    if(ind_field.column() == 7)
        emit signal_changed(ind_field, QString::number(ind_newCB));
    else
    {
        disconnect(temp_editor, SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int)));
        QString new_val = temp_editor->itemData(ind_newCB, Qt::DisplayRole).toString();
        emit signal_changed(ind_field, new_val);
    }
}
ColorPickerProxy::ColorPickerProxy(QLineEdit* line_edit, QToolButton* picker_button)
  : m_line_edit(line_edit)
  , m_picker_button(picker_button)
{
    connect(m_line_edit, SIGNAL(returnPressed()), SIGNAL(signal_changed()));
    connect(m_line_edit, SIGNAL(textChanged(const QString&)), SLOT(slot_set(const QString&)));
}
Exemple #3
0
void ColorCurve::update_samples()
{
  if(!_invalidated||_dont_update>0)
    return;
  _invalidated = false;

  gsize n_samples = _samples.size();
  gdouble inv_n_samples = 1.f/gdouble(n_samples);

  for(gsize i=0; i<n_samples; ++i)
  {
    gdouble offset = gdouble(i)*inv_n_samples;

    gdouble r = value_curve->get_value(red_curve->get_value(offset));
    gdouble g = value_curve->get_value(green_curve->get_value(offset));
    gdouble b = value_curve->get_value(blue_curve->get_value(offset));
    gdouble a = alpha_curve->get_value(offset);

    if(get_hide_alpha())
      a = offset;

    _samples[i].set(r, g, b, a);
  }

  signal_changed().emit();
}
Exemple #4
0
void SettingsWindow::SaveValues()
{
	auto appSettings(GetAppSettings().lock());
	assert(appSettings);

	GetDieFace();

	appSettings->DeathThreshold      ( GetValue   ( f_table, DeathThreshold  ) );
	appSettings->CombatantListFont   ( GetFontName( f_table, CharListFont    ) );
	appSettings->AltCombatantListFont( GetFontName( f_table, AltCharListFont ) );

	Gtk::TreeModel::iterator	iter = f_model->children().begin();
	const Gtk::TreeModel::iterator	end  = f_model->children().end();
	//
	for( ; iter != end; ++iter )
	{
		Gtk::TreeModel::Row row = *iter;
		const mo_name_t	id     = row[f_columns.f_id];
		const bool		active = row[f_columns.f_active];

		if( id == (mo_name_t) moName(UltraInit)	) { appSettings->UltraInit( active );		}
		if( id == (mo_name_t) moName(BleedOut)	) { appSettings->BleedOutDying( active );	}
		if( id == (mo_name_t) moName(SkipDead)	) { appSettings->SkipDead( active );		}
		if( id == (mo_name_t) moName(AltDeathRule)) { appSettings->AlternateDeathRule( active );	}
		if( id == (mo_name_t) moName(NotifyExpiredEffects)) { appSettings->NotifyExpiredEffects( active );}
		if( id == (mo_name_t) moName(InitOnStart)		) { appSettings->InitOnStart( active );		}
		if( id == (mo_name_t) moName(ManualInit)			) { appSettings->ManualInit( active );		}
		if( id == (mo_name_t) moName(GetDC)			) { appSettings->GetDC( active );		}
	}

	appSettings->signal_changed().emit();
}
void DisneyMaterialLayerUI::create_input_widgets(const Dictionary& values)
{
    for (size_t i = 0, e = m_input_metadata.size(); i < e; ++i)
    {
        Dictionary im = m_input_metadata[i];
        const string input_name = im.get<string>("name");
        const string input_type = im.get<string>("type");

        im.insert("value",
            values.strings().exist(input_name) ? values.get<string>(input_name) :
            im.strings().exist("default") ? im.get<string>("default") :
            "");

        unique_ptr<IInputWidgetProxy> widget_proxy =
            input_type == "colormap" ?
                im.dictionaries().exist("entity_types") &&
                im.dictionaries().get("entity_types").strings().exist("color")
                    ? create_color_input_widgets(im)
                    : create_colormap_input_widgets(im) :
            input_type == "text" ? create_text_input_widgets(im) :
            unique_ptr<IInputWidgetProxy>(nullptr);

        assert(widget_proxy.get());
        connect(widget_proxy.get(), SIGNAL(signal_changed()), SIGNAL(signal_apply()));

        m_widget_proxies.insert(input_name, std::move(widget_proxy));
    }
}
ColorMapInputWidget::ColorMapInputWidget(QWidget* parent)
  : QStackedWidget(parent)
{
    m_line_edit = new QLineEdit(this);
    m_line_edit->setMaximumWidth(120);
    connect(m_line_edit, SIGNAL(returnPressed()), SIGNAL(signal_changed()));

    DoubleSlider* slider = new DoubleSlider(Qt::Horizontal, this);
    slider->setRange(0.0, 1.0);
    slider->setPageStep(0.1);
    new MouseWheelFocusEventFilter(slider);
    new LineEditDoubleSliderAdaptor(m_line_edit, slider);
    connect(slider, SIGNAL(valueChanged(int)), SIGNAL(signal_changed()));

    QWidget* bind_button = new QPushButton("Bind", this);
    bind_button->setObjectName("bind_entity_button");
    bind_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    connect(bind_button, SIGNAL(clicked()), SIGNAL(signal_bind_button_clicked()));

    QWidget* line_edit_button_group = new QWidget(this);
    QHBoxLayout* line_edit_button_group_layout = new QHBoxLayout();
    line_edit_button_group_layout->setMargin(0);
    line_edit_button_group_layout->setSpacing(6);
    line_edit_button_group_layout->addWidget(m_line_edit);
    line_edit_button_group_layout->addWidget(slider);
    line_edit_button_group_layout->addWidget(bind_button);
    line_edit_button_group->setLayout(line_edit_button_group_layout);

    m_entity_button = new QPushButton(this);

    QPushButton* unbind_button = new QPushButton("Unbind", this);
    unbind_button->setObjectName("unbind_entity_button");
    unbind_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    connect(unbind_button, SIGNAL(clicked()), SLOT(slot_unbind()));
    connect(unbind_button, SIGNAL(clicked()), SIGNAL(signal_changed()));

    QWidget* entity_button_group = new QWidget(this);
    QHBoxLayout* entity_button_group_layout = new QHBoxLayout();
    entity_button_group_layout->setMargin(0);
    entity_button_group_layout->setSpacing(6);
    entity_button_group_layout->addWidget(m_entity_button);
    entity_button_group_layout->addWidget(unbind_button);
    entity_button_group->setLayout(entity_button_group_layout);

    addWidget(line_edit_button_group);
    addWidget(entity_button_group);
}
Exemple #7
0
TimeEntry::TimeEntry ( Glib::ustring text ) :
	Gtk::Entry()
{
	set_max_length(4);
	set_width_chars(4);
	set_text(text);

	signal_changed().connect(sigc::mem_fun(*this, &TimeEntry::on_change));
	signal_focus_out_event().connect(sigc::mem_fun(*this, &TimeEntry::on_lose_focus));
}
Exemple #8
0
void KeysStoreDialog::onInputCommit(const Glib::ustring key) {
	// Add key to list store
	if(key == "")
		return;

	Glib::RefPtr<Gtk::TreeModel> model = treeView->get_model();
	Glib::RefPtr<Gtk::ListStore> listStore = Glib::RefPtr<Gtk::ListStore>::cast_static(model);

	Gtk::TreeModel::Row row = *(listStore->append());
	row.set_value<Glib::ustring>(0, key);

	signal_changed(prepareModel());
}
EntityInputWidget::EntityInputWidget(QWidget* parent)
  : QStackedWidget(parent)
{
    m_line_edit = new QLineEdit(this);
    connect(m_line_edit, SIGNAL(returnPressed()), SLOT(slot_set_value()));
    connect(m_line_edit, SIGNAL(returnPressed()), SIGNAL(signal_changed()));

    QWidget* bind_button = new QPushButton("Bind", this);
    bind_button->setObjectName("bind_entity_button");
    bind_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    connect(bind_button, SIGNAL(clicked()), SIGNAL(signal_bind_button_clicked()));

    QWidget* line_edit_button_group = new QWidget(this);
    QHBoxLayout* line_edit_button_group_layout = new QHBoxLayout();
    line_edit_button_group_layout->setMargin(0);
    line_edit_button_group_layout->setSpacing(6);
    line_edit_button_group_layout->addWidget(m_line_edit);
    line_edit_button_group_layout->addWidget(bind_button);
    line_edit_button_group->setLayout(line_edit_button_group_layout);

    m_entity_button = new QPushButton(this);

    QPushButton* unbind_button = new QPushButton("Unbind", this);
    unbind_button->setObjectName("unbind_entity_button");
    unbind_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    connect(unbind_button, SIGNAL(clicked()), SLOT(slot_unbind()));
    connect(unbind_button, SIGNAL(clicked()), SIGNAL(signal_changed()));

    QWidget* entity_button_group = new QWidget(this);
    QHBoxLayout* entity_button_group_layout = new QHBoxLayout();
    entity_button_group_layout->setMargin(0);
    entity_button_group_layout->setSpacing(6);
    entity_button_group_layout->addWidget(m_entity_button);
    entity_button_group_layout->addWidget(unbind_button);
    entity_button_group->setLayout(entity_button_group_layout);

    addWidget(line_edit_button_group);
    addWidget(entity_button_group);
}
Exemple #10
0
void HUDWindow::OnHUDChangeFont()
{
	auto appSettings(GetAppSettings().lock());
	assert(appSettings);

	Gtk::FontSelectionDialog dlg( "Select Player HUD Font" );
	dlg.set_font_name( appSettings->AltCombatantListFont().c_str() );
	if( dlg.run() == Gtk::RESPONSE_OK )
	{
		appSettings->AltCombatantListFont( dlg.get_font_name().c_str() );
		appSettings->signal_changed().emit();
	}
}
void ColorPickerProxy::set(const string& value)
{
    m_line_edit->setText(QString::fromStdString(value));

    const QColor color = color_to_qcolor(get_color_from_string(value));

    m_picker_button->setStyleSheet(
        QString("background-color: rgb(%1, %2, %3)")
            .arg(color.red())
            .arg(color.green())
            .arg(color.blue()));

    emit signal_changed();
}
Exemple #12
0
InfoBox::InfoBox()
{
    auto statMgr(GetStatMgr().lock());
    assert(statMgr);
    //f_stats = statMgr->GetStats();

    // Misc stuff about the label
    //
    set_wrap_mode( Gtk::WRAP_WORD );
    f_infoBuffer = Gtk::TextBuffer::create();
    set_buffer( f_infoBuffer );
    set_editable( false );

    // StatManager
    //
    statMgr->signal_changed().connect( sigc::mem_fun( *this, &InfoBox::OnReloadTables ) );
}
control::control(imodel* const Model, k3d::istate_recorder* const StateRecorder) :
	m_implementation(new implementation(Model, StateRecorder))
{
	if(Model)
	{
		Model->connect_changed(sigc::mem_fun(*this, &control::on_data_changed));
		Model->connect_enumeration_values_changed(sigc::mem_fun(*this, &control::on_enumeration_values_changed));
	}

	set_model(m_implementation->m_list_model);

	Gtk::CellRendererText* const cell_renderer = new Gtk::CellRendererText();
	pack_start(*manage(cell_renderer), true);
	add_attribute(cell_renderer->property_text(), m_implementation->m_columns.label);

	on_enumeration_values_changed();
	on_data_changed(0);

	signal_changed().connect(sigc::mem_fun(*this, &control::on_list_changed));
}
Exemple #14
0
void KeysStoreDialog::onBtnRemoveClick() {
	bool changed = false;

	Glib::RefPtr<Gtk::TreeModel> model = treeView->get_model();
	Glib::RefPtr<Gtk::ListStore> listStore = Glib::RefPtr<Gtk::ListStore>::cast_static(model);

	Glib::RefPtr<Gtk::TreeSelection> sel = treeView->get_selection();
	std::vector<Gtk::TreeModel::Path> pathlist = sel->get_selected_rows();

	for(int i = pathlist.size() - 1; i >= 0 ; i--) {
		Gtk::TreeModel::iterator iter = treeView->get_model()->get_iter(pathlist[i]);
		Gtk::TreeModel::Row row = *iter;

		listStore->erase(iter);
		changed = true;
	}

	// Emit signal if any change appear
	if(changed)
		signal_changed(prepareModel());
}
Exemple #15
0
void TableofcontentsNoteAddin::on_note_opened ()
{
  m_toc_menu = manage(new Gtk::Menu);
  m_toc_menu->signal_hide().connect(
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_menu_hidden));

  register_main_window_action_callback("tableofcontents-heading1",
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_level_1_action));
  register_main_window_action_callback("tableofcontents-heading2",
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_level_2_action));
  register_main_window_action_callback("tableofcontents-help",
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_toc_help_action));
  register_main_window_action_callback("tableofcontents-goto-heading",
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_goto_heading));

  auto win = get_window();
  win->signal_foregrounded.connect(sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_foregrounded));

  auto buffer = get_note()->get_buffer();
  if(buffer) {
    buffer->signal_changed().connect(sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_note_changed));
  }

  // Reacts to key press events
  win->signal_key_press_event().connect(
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_key_pressed));

  // TOC can show up also in the contextual menu
  win->editor()->signal_populate_popup().connect(
    sigc::mem_fun(*this, &TableofcontentsNoteAddin::on_populate_popup));

  // Heading tags
  m_tag_bold  = get_note()->get_tag_table()->lookup ("bold");
  m_tag_large = get_note()->get_tag_table()->lookup ("size:large");
  m_tag_huge  = get_note()->get_tag_table()->lookup ("size:huge");
}
void Delegate::editTextChangedSlot(QString new_val)
{
    disconnect(temp_editor, SIGNAL(editTextChanged(QString)), this, SLOT(editTextChangedSlot(QString)));
    emit signal_changed(ind_field, new_val);
}
LineEditProxy::LineEditProxy(QLineEdit* line_edit)
  : m_line_edit(line_edit)
{
    connect(m_line_edit, SIGNAL(returnPressed()), SIGNAL(signal_changed()));
}
void IInputWidgetProxy::emit_signal_changed()
{
    emit signal_changed();
}
ColorExpressionProxy::ColorExpressionProxy(QLineEdit* line_edit, QToolButton* picker_button)
  : m_line_edit(line_edit)
  , m_picker_button(picker_button)
{
    connect(m_line_edit, SIGNAL(returnPressed()), SIGNAL(signal_changed()));
}
Exemple #20
0
SudokuEntry::SudokuEntry()
{
	// Connect the editing of each entry to the method to check if it is a valid value
	signal_changed().connect(sigc::mem_fun(*this,
			&SudokuEntry::on_cell_edited) );
}
Exemple #21
0
int main(int argc, char **argv) {
#if HAVE_DVB_API_VERSION >= 3
  struct dvb_frontend_parameters feparams;
  int tune = 0;
#endif
  int lcd_fd;
  int fe_fd,dmx_fd;
  int lcd_mode;
  fd_set rfds;
  int result;
  screen_t screen;
  struct timeval tv;
  struct signal signal_quality,old_signal;
  struct dmx_sct_filter_params flt;
  unsigned char buf[1024];
  char network_name[31],old_name[31];
  int lcd;

#if HAVE_DVB_API_VERSION >= 3
   if (argc == 2) {
   	if (!strncmp(argv[1], "--tune", 6)) { 
		tune  = 1; 
	}
	else {
		printf("Usage: satfind [--tune]\n");
		return 0;
	} 
  }
#endif

  /* open dbox2-specific devices (LCD) */
  if((lcd_fd=open(LCD,O_RDWR))<0) {
    fprintf(stderr,"lcd open - Can't open LCD: %d\n",errno);
    lcd = 0;
  }
  else {
    lcd = 1;
  }

  /* open nokia-api specific devices (demux,tuner and sat-control) */
  if((dmx_fd=open(DMX,O_RDWR))<0) {
    perror("Can't open Demux");
    return 1;
  }
  
  if((fe_fd=open(FE,O_RDONLY))<0) {
    perror("[satfind.c] Can't open Tuner");
    return 1;
  }

  /* switch LCD to binary mode and clear it */
  if (lcd) { 
    lcd_mode=LCD_MODE_BIN;
    if ((ioctl(lcd_fd,LCD_IOCTL_ASC_MODE,&lcd_mode)<0) || (ioctl(lcd_fd,LCD_IOCTL_CLEAR)<0)) {
      fprintf(stderr,"lcd ioctl - error setting LCD-mode/clearing LCD: %d\n",errno);
      return 1;
    }
    memset(screen,0,sizeof(screen));
  }
  memset(&old_signal,0,sizeof(old_signal));
  
  /* initialize demux to get the NIT */
 
#if HAVE_DVB_API_VERSION >= 3
  memset(&flt, 0, sizeof(flt));
#else
  memset(&flt.filter.filter, 0, DMX_FILTER_SIZE);
  memset(&flt.filter.mask, 0, DMX_FILTER_SIZE);
#endif
  
  flt.pid=0x10;
  flt.filter.filter[0]=0x40;
  flt.filter.mask[0]=0xFF;
  flt.timeout=10000;
  flt.flags=DMX_IMMEDIATE_START;
  
  if (ioctl(dmx_fd, DMX_SET_FILTER, &flt)<0)  {
    perror("DMX_SET_FILTER");
    return -1;
  }
  
  /* main stuff here */
  if (lcd)
    prepare_main(screen);
  network_name[0]=0;
  old_name[0]=0;
  FD_ZERO(&rfds);
  FD_SET(dmx_fd,&rfds);
  tv.tv_sec=0;
  tv.tv_usec=10000;
 
#if HAVE_DVB_API_VERSION >= 3
  if (tune) {
  	/* TP 82 (ProSiebenSat.1 Media AG) on ASTRA 1H */
  	feparams.frequency = 1880000;
  	feparams.inversion = 0;
  	feparams.u.qpsk.symbol_rate = 27500000; 
  	feparams.u.qpsk.fec_inner = FEC_3_4; 
  }
#endif

  while(1) {
    if((result=select(dmx_fd+1,&rfds,NULL,NULL,&tv))>0) {
      if(FD_ISSET(dmx_fd,&rfds)) {
	/* got data */
	if((result=read(dmx_fd,buf,sizeof(buf)))>0)
	  get_network_name_from_nit(network_name,buf,result);
	/* zero or less read - we have to restart the DMX afaik*/
	else {
	  printf("result: %d\n",result);
	  ioctl(dmx_fd,DMX_STOP,0);
	  ioctl(dmx_fd,DMX_START,0);
	  network_name[0]=0;
	}
	/* new networkname != "" */
	if((memcmp(network_name,old_name,sizeof(network_name))!=0)&&(network_name[0]!=0)) {
	  int count;
	  for(count=strlen(network_name);count<=10;count++)
	    network_name[count]=0x20;
	  network_name[count]=0;
	  if (lcd)
	    render_string(screen,0,56,network_name);
	  memcpy(old_name,network_name,sizeof(old_name));
	}
      }
      else
	printf("that should never happen...\n");
    }

    FD_ZERO(&rfds);
    FD_SET(dmx_fd,&rfds);
    tv.tv_sec=0;
    tv.tv_usec=10000;

#if HAVE_DVB_API_VERSION >= 3
  if(tune) {
	/* TUNE and wait till a possibly LOCK is done */
  	ioctl(fe_fd,FE_SET_VOLTAGE,SEC_VOLTAGE_13);
	ioctl(fe_fd,FE_SET_FRONTEND, &feparams);
	ioctl(fe_fd,FE_SET_TONE, SEC_TONE_ON);
	usleep(250);
  }
#endif

    get_signal(&signal_quality,fe_fd);
    if (!signal_changed(&signal_quality, &old_signal))
	    continue;
    if (lcd) {
      draw_signal(&signal_quality,&old_signal,screen);
      draw_screen(screen,lcd_fd);
    }
    printf("%s %u %u %u [%c%c]\n",network_name,signal_quality.ber,signal_quality.snr,signal_quality.strength,signal_quality.status&FE_HAS_SIGNAL? 'S':' ',signal_quality.status&FE_HAS_LOCK? 'L':' ');
  }

  /* close devices */
  if (lcd)
    close(lcd_fd);
  close(dmx_fd);
  close(fe_fd);
  
  return 0;
}
void LineEditProxy::set(const string& value)
{
    m_line_edit->setText(QString::fromStdString(value));

    emit signal_changed();
}
Exemple #23
0
ColorMapInputProxy::ColorMapInputProxy(ColorMapInputWidget* input_widget)
  : m_input_widget(input_widget)
{
    connect(input_widget, SIGNAL(signal_changed()), SIGNAL(signal_changed()));
}
Exemple #24
0
EntityInputProxy::EntityInputProxy(EntityInputWidget* input_widget)
  : m_input_widget(input_widget)
{
    connect(input_widget, SIGNAL(signal_changed()), SIGNAL(signal_changed()));
}