Skip to content

Commit

Permalink
User Formula updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kanurag94 committed Aug 19, 2020
1 parent eb62d34 commit c1d70af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/ui-hlp/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,13 @@ void uih_unregistermenus(void)
#ifdef USE_SFFE
void uih_sffein(uih_context *c, const char *text)
{
// Keep only top 10 entries
QSettings settings;
QStringList values = settings.value("Formulas/UserFormulas").toStringList();
values.push_back(text);
while (values.size() > 10) values.pop_back();
settings.setValue("Formulas/UserFormulas", values);

uih_sffeset(c, c->fcontext->userformula, text);
}

Expand Down
9 changes: 1 addition & 8 deletions src/ui/customdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,7 @@ void CustomDialog::accept()
mkcustompalette(palcontext->image->palette, newColors);
} else if (m_dialog[i].type == DIALOG_ILIST) {
QComboBox *list = findChild<QComboBox *>(label);
if (list->count() > 0) {
m_parameters[i].dstring = strdup(list->currentText().toUtf8());
QSettings settings;
QStringList values = settings.value("Formulas/UserFormulas").toStringList();
values.push_front(list->currentText());
while (values.size() > 10) values.pop_back();
settings.setValue("Formulas/UserFormulas", values);
}
m_parameters[i].dstring = strdup(list->currentText().toUtf8());
}
else
m_parameters[i].dstring = strdup(field->text().toUtf8());
Expand Down

0 comments on commit c1d70af

Please sign in to comment.