static void on_config_indent_wrapped_changed(GSettings *settings, const char *key) { /* update application to reflect new value */ I7App *theapp = i7_app_get(); update_tabs(theapp->prefs->tab_example); update_tabs(theapp->prefs->source_example); i7_app_foreach_document(theapp, (I7DocumentForeachFunc)i7_document_update_tabs, NULL); i7_app_foreach_document(theapp, (I7DocumentForeachFunc)i7_document_update_indent_tags, NULL); }
static void on_config_tab_width_changed(GSettings *settings, const char *key) { unsigned newvalue = g_settings_get_uint(settings, key); /* Use default if set to 0, as per schema description */ if(newvalue == 0) newvalue = DEFAULT_TAB_WIDTH; /* update application to reflect new value */ I7App *theapp = i7_app_get(); update_tabs(theapp->prefs->tab_example); update_tabs(theapp->prefs->source_example); i7_app_foreach_document(theapp, (I7DocumentForeachFunc)i7_document_update_tabs, NULL); }
void AccountsPage::init_with_step(const int _step) { active_step_ = _step; MacProfileType active_account_type = (_step == 1 ? MacProfileType::Agent : MacProfileType::ICQ); icq_accounts_count_ = 0; agent_accounts_count_ = 0; selected_icq_accounts_count_ = 0; selected_agent_accounts_count_ = 0; for (auto _widget : account_widgets_) { accounts_layout_->removeWidget(_widget); delete _widget; } account_widgets_.clear(); for (MacProfile &account : profiles_) { if (account.type() == active_account_type) { account_widget* widget = new account_widget(accounts_area_widget_, account); connect(widget, SIGNAL(checked()), this, SLOT(updateNextButtonState()), Qt::QueuedConnection); accounts_layout_->addWidget(widget); account_widgets_.push_back(widget); connect(widget, &QPushButton::toggled, [this, widget](bool _checked) { if (_checked) { for (auto _widget : account_widgets_) { if (_widget != widget && _widget->isChecked()) { _widget->setChecked(false); } } } selected_agent_accounts_count_ = 0; selected_icq_accounts_count_ = 0; for (auto _widget : account_widgets_) { if (_widget->isChecked()) { if (_widget->profileType() == MacProfileType::Agent) selected_agent_accounts_count_ = 1; else if (_widget->profileType() == MacProfileType::ICQ) selected_icq_accounts_count_ = 1; } for (MacProfile &account : profiles_) { if (account.uin() == _widget->uid()) { account.setSelected(_widget->isChecked()); } } } update_tabs(); update_buttons(); }); } if (account.type() == MacProfileType::ICQ) { ++icq_accounts_count_; if (account.selected()) ++selected_icq_accounts_count_; } else if (account.type() == MacProfileType::Agent) { ++agent_accounts_count_; if (account.selected()) ++selected_agent_accounts_count_; } } updateNextButtonState(); buttonSkip_->setVisible(build::is_agent() && active_step_ == 2); update_tabs(); update_buttons(); }