}
-} // anon namespace
+} // namespace
GuiDelimiter::GuiDelimiter(GuiView & lv)
{
setupUi(this);
- connect(closePB, SIGNAL(clicked()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(accept()));
setFocusProxy(leftLW);
}
-void GuiDelimiter::on_insertPB_clicked()
+void GuiDelimiter::on_buttonBox_clicked(QAbstractButton * button)
+{
+ switch (buttonBox->standardButton(button)) {
+ case QDialogButtonBox::Apply:
+ insert();
+ break;
+ case QDialogButtonBox::Ok:
+ insert();
+ // fall through
+ case QDialogButtonBox::Cancel:
+ accept();
+ break;
+ default:
+ break;
+ }
+}
+
+
+void GuiDelimiter::insert()
{
if (sizeCO->currentIndex() == 0)
dispatch(FuncRequest(LFUN_MATH_DELIM, tex_code_));
command = support::subst(command, from_ascii(" "), from_ascii("\" \""));
dispatch(FuncRequest(LFUN_MATH_BIGDELIM, command));
}
+ buttonBox->button(QDialogButtonBox::Cancel)->setText(qt_("Close"));
}
// do not auto-apply if !matchCB->isChecked()
if (!matchCB->isChecked())
return;
- on_insertPB_clicked();
+ insert();
accept();
}
// do not auto-apply if !matchCB->isChecked()
if (!matchCB->isChecked())
return;
- on_insertPB_clicked();
+ insert();
accept();
}
QChar(nrms.fontcode) : toqstr(docstring(1, nrms.unicode)));
// Handle unencoded "symbol" of "(None)".
- if (lqs.toStdString() == "?")
+ if (lqs == "?")
lqs = qt_("(None)");
- if(rqs.toStdString() == "?")
+ if(rqs == "?")
rqs = qt_("(None)");
// Locate matching QListWidgetItem.