#include <QDropEvent>
#include <QFuture>
#include <QFutureWatcher>
+#include <QGroupBox>
#include <QLabel>
#include <QList>
#include <QMenu>
static void handleExportStatus(GuiView * view, Buffer::ExportStatus status,
string const & format)
{
- docstring const fmt = theFormats().prettyName(format);
+ docstring const fmt = translateIfPossible(theFormats().prettyName(format));
docstring msg;
switch (status) {
case Buffer::ExportSuccess:
flag.setOnOff(lyxrc.spellcheck_continuously);
break;
+ case LFUN_CITATION_OPEN:
+ enable = true;
+ break;
+
default:
return false;
}
if (loader_format.empty()) {
frontend::Alert::error(_("Couldn't import file"),
bformat(_("No information for importing the format %1$s."),
- theFormats().prettyName(format)));
+ translateIfPossible(theFormats().prettyName(format))));
return false;
}
} else
}
docstring const text = bformat(_("Select %1$s file to import"),
- theFormats().prettyName(format));
+ translateIfPossible(theFormats().prettyName(format)));
FileDialog dlg(toqstr(text));
dlg.setButton1(qt_("D&ocuments"), toqstr(lyxrc.document_path));
dlg.setButton2(qt_("&Examples"), toqstr(lyxrc.example_path));
- docstring filter = theFormats().prettyName(format);
+ docstring filter = translateIfPossible(theFormats().prettyName(format));
filter += " (*.{";
// FIXME UNICODE
filter += from_utf8(theFormats().extensions(format));
dr.screenUpdate(Update::Force);
break;
+ case LFUN_CITATION_OPEN: {
+ string pdfv, psv;
+ if (theFormats().getFormat("pdf"))
+ pdfv = theFormats().getFormat("pdf")->viewer();
+ if (theFormats().getFormat("ps"))
+ psv = theFormats().getFormat("ps")->viewer();
+ frontend::showTarget(argument, pdfv, psv);
+ break;
+ }
+
default:
// The LFUN must be for one of BufferView, Buffer or Cursor;
// let's try that:
}
+void GuiView::flatGroupBoxes(const QObject * widget, bool flag)
+{
+ for (QObject * child: widget->children()) {
+ if (child->inherits("QGroupBox")) {
+ QGroupBox * box = (QGroupBox*) child;
+ box->setFlat(flag);
+ } else {
+ flatGroupBoxes(child, flag);
+ }
+ }
+}
+
+
Dialog * GuiView::findOrBuild(string const & name, bool hide_it)
{
if (!isValidName(name))
Dialog * dialog = build(name);
d.dialogs_[name].reset(dialog);
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
+ // Force a uniform style for group boxes
+ // On Mac non-flat works better, on Linux flat is standard
+ flatGroupBoxes(dialog->asQWidget(), guiApp->platformName() != "cocoa");
+#endif
if (lyxrc.allow_geometry_session)
dialog->restoreSession();
if (hide_it)