{
static bool initialized = false;
if (!initialized) {
- Q_INIT_RESOURCE(Resources);
+ Q_INIT_RESOURCE(Resources);
initialized = true;
}
}
path = ":/images/" + path;
QDir res(path);
if (!res.exists()) {
- LYXERR0("Directory " << path << " not found in resource!");
+ LYXERR0("Directory " << path << " not found in resource!");
return QString();
}
name1 += ".png";
LYXERR(Debug::GUI, "Cannot find icon with filename "
<< "\"" << name1 << "\""
<< " or filename "
- << "\"" << name2 << "\""
+ << "\"" << name2 << "\""
<< " for command \""
<< lyxaction.getActionName(f.action())
<< '(' << to_utf8(f.argument()) << ")\"");
: QTranslator(parent)
{}
- QString translate(const char * /*context*/,
- const char * sourceText,
- const char * /*comment*/ = 0)
+ QString translate(const char * /*context*/,
+ const char * sourceText,
+ const char * /*comment*/ = 0)
{
string const s = sourceText;
- if (s == N_("About %1") || s == N_("Preferences")
+ if (s == N_("About %1") || s == N_("Preferences")
|| s == N_("Reconfigure") || s == N_("Quit %1"))
return qt_(s);
- else
+ else
return QString();
}
};
public:
///
GlobalMenuBar() : QMenuBar(0) {}
-
+
///
bool event(QEvent * e)
{
{
switch (formatetc.cfFormat) {
case CF_ENHMETAFILE:
- return emfMimeType();
+ return emfMimeType();
case CF_METAFILEPICT:
return wmfMimeType();
}
/// Only needed with Qt/Mac.
installTranslator(new MenuTranslator(this));
#endif
-
+
#ifdef Q_WS_X11
// doubleClickInterval() is 400 ms on X11 which is just too long.
// On Windows and Mac OS X, the operating system's value is used.
BufferView * bv = 0;
BufferView * doc_bv = 0;
-
+
if (cmd.action() == LFUN_NOACTION) {
status.message(from_utf8(N_("Nothing to do")));
status.setEnabled(false);
// If we do not have a GuiView, then other functions are disabled
else if (!current_view_)
status.setEnabled(false);
-
+
// Does the GuiView know something?
else if (current_view_->getStatus(cmd, status)) { }
// If we do not have a BufferView, then other functions are disabled
else if (!(bv = current_view_->currentBufferView()))
status.setEnabled(false);
-
+
// Does the current BufferView know something?
else if (bv->getStatus(cmd, status)) { }
-
+
// Does the current Buffer know something?
else if (bv->buffer().getStatus(cmd, status)) { }
// Does the document Buffer know something?
else if (doc_bv->buffer().getStatus(cmd, status)) { }
- else {
+ else {
LYXERR(Debug::ACTION, "LFUN not handled in getStatus(): " << cmd);
status.message(from_utf8(N_("Command not handled")));
status.setEnabled(false);
}
-
+
// the default error message if we disable the command
if (!status.enabled() && status.message().empty())
status.message(from_utf8(N_("Command disabled")));
case LFUN_FILE_OPEN: {
// FIXME: create a new method shared with LFUN_HELP_OPEN.
string const fname = to_utf8(cmd.argument());
- if (d->views_.empty() || (!lyxrc.open_buffers_in_tabs
+ if (d->views_.empty() || (!lyxrc.open_buffers_in_tabs
&& current_view_->documentBufferView() != 0)) {
// We want the ui session to be saved per document and not per
// window number. The filename crc is a good enough identifier.
}
string const graphicsbg = lcolor.getLyXName(Color_graphicsbg);
- bool const graphicsbg_changed =
+ bool const graphicsbg_changed =
lyx_name == graphicsbg && x11_name != graphicsbg;
if (graphicsbg_changed) {
// FIXME: The graphics cache no longer has a changeDisplay method.
}
-FontLoader & GuiApplication::fontLoader()
+FontLoader & GuiApplication::fontLoader()
{
return d->font_loader_;
}
-Toolbars const & GuiApplication::toolbars() const
+Toolbars const & GuiApplication::toolbars() const
{
return d->toolbars_;
}
Toolbars & GuiApplication::toolbars()
{
- return d->toolbars_;
+ return d->toolbars_;
}
-Menus const & GuiApplication::menus() const
+Menus const & GuiApplication::menus() const
{
return d->menus_;
}
Menus & GuiApplication::menus()
{
- return d->menus_;
+ return d->menus_;
}
// install translation file for Qt built-in dialogs
QString const language_name = QString("qt_") + default_locale.name();
- // language_name can be short (e.g. qt_zh) or long (e.g. qt_zh_CN).
+ // language_name can be short (e.g. qt_zh) or long (e.g. qt_zh_CN).
// Short-named translator can be loaded from a long name, but not the
// opposite. Therefore, long name should be used without truncation.
// c.f. http://doc.trolltech.com/4.1/qtranslator.html#load
return;
Session & session = theSession();
- LastOpenedSection::LastOpened const & lastopened =
+ LastOpenedSection::LastOpened const & lastopened =
session.lastOpened().getfiles();
FileName active_file;
return QApplication::notify(receiver, event);
}
catch (ExceptionMessage const & e) {
- switch(e.type_) {
+ switch(e.type_) {
case ErrorException:
emergencyCleanup();
setQuitOnLastWindowClosed(false);