Exemplo n.º 1
0
void DsoFinder::init_ui_options()
{
    //SET OPTION UI
    ui->ontopcheckbox->setChecked(config.ontop);
    ui->waittime_slider->setSliderPosition(config.waittime);
    ui->waittime_lineEdit->setText(QString("%1").arg(config.waittime));
    ui->searchtimercheckBox->setChecked(config.show_searchtimer);
    ui->colorstandardpushButton->setStyleSheet(QString("border-radius: 10px; background-color: rgb(%1, %2, %3);").arg(config.items_standard_color.red()).arg(config.items_standard_color.green()).arg(config.items_standard_color.blue()));
    ui->coloreventpushButton->setStyleSheet(QString("border-radius: 10px; background-color: rgb(%1, %2, %3);").arg(config.items_event_color.red()).arg(config.items_event_color.green()).arg(config.items_event_color.blue()));

    ui->itembasiccheckBox->setChecked(config.useitems_basic);
    ui->itemadventurecheckBox->setChecked(config.useitems_adventure);

    ui->halfsizecheckbox->setChecked(config.usehalfsize);

    populate_event_combo();

    ui->languagecomboBox->setCurrentText(config.language);
    select_language(config.language);
// ui->bgcomboBox->view()->setMinimumWidth(150)      ( not supported with QT 5.11.+)
    ui->bgcomboBox->setMinimumWidth(150);
    for(int i=0;i<bg_count;i++) {
        ui->bgcomboBox->addItem(QString("%1: %2").arg(i+1).arg(config.bg_caption[i]));
    }
    ui->bgcomboBox->addItem(tr("+: New Slot"));
    ui->bgcomboBox->setCurrentIndex(config.use_bg);
    if(config.use_bg >= bg_count) activate_buttons(false);
    else activate_buttons(true);

    ui->jumpcheckBox->setChecked(config.jump_position);
    ui->staybigcheckBox->setChecked(config.stay_big);
    if(config.stay_big) ui->waittimegroupbox->setDisabled(true);
}
Exemplo n.º 2
0
static void fixed_toggled(GtkCellRendererToggle *cell,gchar *path_str,gpointer data)
{
    GtkTreeModel *model=gtk_tree_view_get_model(GTK_TREE_VIEW(treeview));
    GtkTreePath *path=gtk_tree_path_new_from_string(path_str);

    GtkTreeIter  iter;
    gtk_tree_model_get_iter(model,&iter,path);

    gboolean fixed;
    gtk_tree_model_get(model,&iter,COLUMN_SELECTED,&fixed,-1);

    fixed=!fixed;

    int* index=gtk_tree_path_get_indices(path);

    if (index!=NULL && index[0]<gUpdater.getBoardList().size())
    {
        gUpdater.getBoardList()[index[0]].mSelected=fixed;
    }
    else
    {
        yError ("Something wrong in the selection\n");
    }

    gtk_list_store_set(GTK_LIST_STORE(model),&iter,COLUMN_SELECTED,fixed,-1);

    gtk_tree_path_free(path);

    activate_buttons();
}