void Dwarf::read_settings() { QSettings *s = DT->user_settings(); bool new_show_full_name = s->value("options/show_full_dwarf_names", false).toBool(); if (new_show_full_name != m_show_full_name) { calc_names(); emit name_changed(); } m_show_full_name = new_show_full_name; }
void ServerWidget::on_button_setup_clicked() { ServerSetupDialog dlg(connection.details(), this); if ( dlg.exec() ) { auto oldname = connection.details().name; connection.set_details(dlg.connection_details()); auto newname = connection.details().name; if ( newname != oldname ) emit name_changed(QString::fromStdString(newname)); } }
void Peer::handle_property_change (const char *name, GVariant *property) { if (g_strcmp0(name, "State") == 0) { state_changed (g_variant_get_string (property, NULL)); } else if (g_strcmp0(name, "Name") == 0) { name_changed (g_variant_get_string (property, NULL)); } else if (g_strcmp0(name, "Services") == 0) { GVariantIter *service_array, *services; GVariant *spec_val; g_variant_get (property, "a(a{sv})", &service_array); while (g_variant_iter_loop (service_array, "(a{sv})", &services)) { const char *service_name; while (g_variant_iter_loop (services, "{sv}", &service_name, &spec_val)) { if (g_strcmp0 (service_name, "WiFiDisplayIEs") == 0) { uint8_t *bytes; gsize length; bytes = (uint8_t*)g_variant_get_fixed_array (spec_val, &length, 1); std::unique_ptr<P2P::InformationElementArray> array (new P2P::InformationElementArray(length, bytes)); ie_.reset(new P2P::InformationElement (array)); } } } g_variant_iter_free (service_array); } else if (g_strcmp0(name, "IPv4") == 0) { GVariantIter *ips; GVariant *spec_val; char *name; const char *remote = ""; const char *local = ""; g_variant_get (property, "a{sv}", &ips); while (g_variant_iter_loop (ips, "{sv}", &name, &spec_val)) { if (g_strcmp0 (name, "Remote") == 0) { remote = g_variant_get_string (spec_val, NULL); } else if (g_strcmp0 (name, "Local") == 0) { local = g_variant_get_string (spec_val, NULL); } } ips_changed (remote, local); g_variant_iter_free (ips); } }
/* Intercept thread_setname */ int pthread_setname_np(pthread_t thread, const char *name) { int rval; /* Make sure we've got our passthrough set up */ if( ensure_intercepts() < 0 ) return -EOPNOTSUPP; /* Call the original function */ rval = _pthread_setname_np(thread, name); /* Check and see whether the new name is interesting */ if( rval >= 0 ) name_changed(thread, name); LOG("pthread_setname_np returning %d", rval); return rval; }
/* Intercept prctl, as one of its options lets a user change * the name of a thread */ int prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) { int rval; /* Make sure we've got our passthrough set up */ if( ensure_intercepts() < 0 ) return -EOPNOTSUPP; /* Call the original prctl function */ rval = _prctl(option, arg2, arg3, arg4, arg5); /* If this was a name setting call, check if we want to alter * stackname in resopnse */ if( option == PR_SET_NAME && rval >= 0 ) name_changed(pthread_self(), (char const *) arg2); LOG("prctl returning %d", rval); return rval; }
PaletteEditor::PaletteEditor(MainWindow * parent) : QWidget(parent), window(parent), ignore_rgb(false) { QVBoxLayout * layout = new QVBoxLayout(this); color_space = new ColorSpace(this); color_slider = new ColorSlider(this); grid = new PaletteGrid(window); name = new QLineEdit(this); layout->addWidget(grid, 0, Qt::AlignHCenter); layout->addWidget(color_space); layout->addWidget(color_slider); QHBoxLayout * rgb_layout = new QHBoxLayout; rgb_layout->addWidget(create_label("RGB")); r_edit = create_color_spinbox(); rgb_layout->addWidget(r_edit); g_edit = create_color_spinbox(); rgb_layout->addWidget(g_edit); b_edit = create_color_spinbox(); rgb_layout->addWidget(b_edit); layout->addLayout(rgb_layout); QHBoxLayout * name_layout = new QHBoxLayout; name_layout->addWidget(create_label("Name")); connect(name, SIGNAL(textEdited(QString)), this, SLOT(name_changed())); name_layout->addWidget(name); layout->addLayout(name_layout); setLayout(layout); set_current(); }