Exemple #1
0
void UatDialog::acceptChanges()
{
    if (!uat_) return;

    if (uat_->changed) {
        gchar *err = NULL;

        if (!uat_save(uat_, &err)) {
            report_failure("Error while saving %s: %s", uat_->name, err);
            g_free(err);
        }

        if (uat_->post_update_cb) {
            uat_->post_update_cb();
        }
        applyChanges();
    }
}
void FilterExpressionToolBar::onActionMoved(QAction* action, int oldPos, int newPos)
{
    gchar* err = NULL;
    if ( oldPos == newPos )
        return;

    QString label = action->property(dfe_property_label_).toString();
    QString expr = action->property(dfe_property_expression_).toString();

    int idx = uatRowIndexForFilter(label, expr);

    if ( idx > -1 && oldPos > -1 && newPos > -1 )
    {
        uat_t * table = uat_get_table_by_name("Display expressions");
        uat_move_index(table, oldPos, newPos);
        uat_save(table, &err);

        g_free(err);
    }
}