mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37226 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f97bc9b9e7
commit
a26dd20159
@ -139,7 +139,7 @@ static void initializeResources()
|
|||||||
{
|
{
|
||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
Q_INIT_RESOURCE(Resources);
|
Q_INIT_RESOURCE(Resources);
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -378,7 +378,7 @@ QString iconName(FuncRequest const & f, bool unknown)
|
|||||||
path = ":/images/" + path;
|
path = ":/images/" + path;
|
||||||
QDir res(path);
|
QDir res(path);
|
||||||
if (!res.exists()) {
|
if (!res.exists()) {
|
||||||
LYXERR0("Directory " << path << " not found in resource!");
|
LYXERR0("Directory " << path << " not found in resource!");
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
name1 += ".png";
|
name1 += ".png";
|
||||||
@ -392,7 +392,7 @@ QString iconName(FuncRequest const & f, bool unknown)
|
|||||||
LYXERR(Debug::GUI, "Cannot find icon with filename "
|
LYXERR(Debug::GUI, "Cannot find icon with filename "
|
||||||
<< "\"" << name1 << "\""
|
<< "\"" << name1 << "\""
|
||||||
<< " or filename "
|
<< " or filename "
|
||||||
<< "\"" << name2 << "\""
|
<< "\"" << name2 << "\""
|
||||||
<< " for command \""
|
<< " for command \""
|
||||||
<< lyxaction.getActionName(f.action())
|
<< lyxaction.getActionName(f.action())
|
||||||
<< '(' << to_utf8(f.argument()) << ")\"");
|
<< '(' << to_utf8(f.argument()) << ")\"");
|
||||||
@ -478,15 +478,15 @@ public:
|
|||||||
: QTranslator(parent)
|
: QTranslator(parent)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QString translate(const char * /*context*/,
|
QString translate(const char * /*context*/,
|
||||||
const char * sourceText,
|
const char * sourceText,
|
||||||
const char * /*comment*/ = 0)
|
const char * /*comment*/ = 0)
|
||||||
{
|
{
|
||||||
string const s = sourceText;
|
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"))
|
|| s == N_("Reconfigure") || s == N_("Quit %1"))
|
||||||
return qt_(s);
|
return qt_(s);
|
||||||
else
|
else
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -496,7 +496,7 @@ class GlobalMenuBar : public QMenuBar
|
|||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
GlobalMenuBar() : QMenuBar(0) {}
|
GlobalMenuBar() : QMenuBar(0) {}
|
||||||
|
|
||||||
///
|
///
|
||||||
bool event(QEvent * e)
|
bool event(QEvent * e)
|
||||||
{
|
{
|
||||||
@ -662,7 +662,7 @@ public:
|
|||||||
{
|
{
|
||||||
switch (formatetc.cfFormat) {
|
switch (formatetc.cfFormat) {
|
||||||
case CF_ENHMETAFILE:
|
case CF_ENHMETAFILE:
|
||||||
return emfMimeType();
|
return emfMimeType();
|
||||||
case CF_METAFILEPICT:
|
case CF_METAFILEPICT:
|
||||||
return wmfMimeType();
|
return wmfMimeType();
|
||||||
}
|
}
|
||||||
@ -791,7 +791,7 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
|
|||||||
/// Only needed with Qt/Mac.
|
/// Only needed with Qt/Mac.
|
||||||
installTranslator(new MenuTranslator(this));
|
installTranslator(new MenuTranslator(this));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
// doubleClickInterval() is 400 ms on X11 which is just too long.
|
// doubleClickInterval() is 400 ms on X11 which is just too long.
|
||||||
// On Windows and Mac OS X, the operating system's value is used.
|
// On Windows and Mac OS X, the operating system's value is used.
|
||||||
@ -861,7 +861,7 @@ FuncStatus GuiApplication::getStatus(FuncRequest const & cmd) const
|
|||||||
|
|
||||||
BufferView * bv = 0;
|
BufferView * bv = 0;
|
||||||
BufferView * doc_bv = 0;
|
BufferView * doc_bv = 0;
|
||||||
|
|
||||||
if (cmd.action() == LFUN_NOACTION) {
|
if (cmd.action() == LFUN_NOACTION) {
|
||||||
status.message(from_utf8(N_("Nothing to do")));
|
status.message(from_utf8(N_("Nothing to do")));
|
||||||
status.setEnabled(false);
|
status.setEnabled(false);
|
||||||
@ -879,7 +879,7 @@ FuncStatus GuiApplication::getStatus(FuncRequest const & cmd) const
|
|||||||
// If we do not have a GuiView, then other functions are disabled
|
// If we do not have a GuiView, then other functions are disabled
|
||||||
else if (!current_view_)
|
else if (!current_view_)
|
||||||
status.setEnabled(false);
|
status.setEnabled(false);
|
||||||
|
|
||||||
// Does the GuiView know something?
|
// Does the GuiView know something?
|
||||||
else if (current_view_->getStatus(cmd, status)) { }
|
else if (current_view_->getStatus(cmd, status)) { }
|
||||||
|
|
||||||
@ -896,10 +896,10 @@ FuncStatus GuiApplication::getStatus(FuncRequest const & cmd) const
|
|||||||
// If we do not have a BufferView, then other functions are disabled
|
// If we do not have a BufferView, then other functions are disabled
|
||||||
else if (!(bv = current_view_->currentBufferView()))
|
else if (!(bv = current_view_->currentBufferView()))
|
||||||
status.setEnabled(false);
|
status.setEnabled(false);
|
||||||
|
|
||||||
// Does the current BufferView know something?
|
// Does the current BufferView know something?
|
||||||
else if (bv->getStatus(cmd, status)) { }
|
else if (bv->getStatus(cmd, status)) { }
|
||||||
|
|
||||||
// Does the current Buffer know something?
|
// Does the current Buffer know something?
|
||||||
else if (bv->buffer().getStatus(cmd, status)) { }
|
else if (bv->buffer().getStatus(cmd, status)) { }
|
||||||
|
|
||||||
@ -911,12 +911,12 @@ FuncStatus GuiApplication::getStatus(FuncRequest const & cmd) const
|
|||||||
// Does the document Buffer know something?
|
// Does the document Buffer know something?
|
||||||
else if (doc_bv->buffer().getStatus(cmd, status)) { }
|
else if (doc_bv->buffer().getStatus(cmd, status)) { }
|
||||||
|
|
||||||
else {
|
else {
|
||||||
LYXERR(Debug::ACTION, "LFUN not handled in getStatus(): " << cmd);
|
LYXERR(Debug::ACTION, "LFUN not handled in getStatus(): " << cmd);
|
||||||
status.message(from_utf8(N_("Command not handled")));
|
status.message(from_utf8(N_("Command not handled")));
|
||||||
status.setEnabled(false);
|
status.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// the default error message if we disable the command
|
// the default error message if we disable the command
|
||||||
if (!status.enabled() && status.message().empty())
|
if (!status.enabled() && status.message().empty())
|
||||||
status.message(from_utf8(N_("Command disabled")));
|
status.message(from_utf8(N_("Command disabled")));
|
||||||
@ -1333,7 +1333,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
|||||||
case LFUN_FILE_OPEN: {
|
case LFUN_FILE_OPEN: {
|
||||||
// FIXME: create a new method shared with LFUN_HELP_OPEN.
|
// FIXME: create a new method shared with LFUN_HELP_OPEN.
|
||||||
string const fname = to_utf8(cmd.argument());
|
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)) {
|
&& current_view_->documentBufferView() != 0)) {
|
||||||
// We want the ui session to be saved per document and not per
|
// We want the ui session to be saved per document and not per
|
||||||
// window number. The filename crc is a good enough identifier.
|
// window number. The filename crc is a good enough identifier.
|
||||||
@ -1390,7 +1390,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
string const graphicsbg = lcolor.getLyXName(Color_graphicsbg);
|
string const graphicsbg = lcolor.getLyXName(Color_graphicsbg);
|
||||||
bool const graphicsbg_changed =
|
bool const graphicsbg_changed =
|
||||||
lyx_name == graphicsbg && x11_name != graphicsbg;
|
lyx_name == graphicsbg && x11_name != graphicsbg;
|
||||||
if (graphicsbg_changed) {
|
if (graphicsbg_changed) {
|
||||||
// FIXME: The graphics cache no longer has a changeDisplay method.
|
// FIXME: The graphics cache no longer has a changeDisplay method.
|
||||||
@ -1854,13 +1854,13 @@ Selection & GuiApplication::selection()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FontLoader & GuiApplication::fontLoader()
|
FontLoader & GuiApplication::fontLoader()
|
||||||
{
|
{
|
||||||
return d->font_loader_;
|
return d->font_loader_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Toolbars const & GuiApplication::toolbars() const
|
Toolbars const & GuiApplication::toolbars() const
|
||||||
{
|
{
|
||||||
return d->toolbars_;
|
return d->toolbars_;
|
||||||
}
|
}
|
||||||
@ -1868,11 +1868,11 @@ Toolbars const & GuiApplication::toolbars() const
|
|||||||
|
|
||||||
Toolbars & GuiApplication::toolbars()
|
Toolbars & GuiApplication::toolbars()
|
||||||
{
|
{
|
||||||
return d->toolbars_;
|
return d->toolbars_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Menus const & GuiApplication::menus() const
|
Menus const & GuiApplication::menus() const
|
||||||
{
|
{
|
||||||
return d->menus_;
|
return d->menus_;
|
||||||
}
|
}
|
||||||
@ -1880,7 +1880,7 @@ Menus const & GuiApplication::menus() const
|
|||||||
|
|
||||||
Menus & GuiApplication::menus()
|
Menus & GuiApplication::menus()
|
||||||
{
|
{
|
||||||
return d->menus_;
|
return d->menus_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1926,7 +1926,7 @@ void GuiApplication::setGuiLanguage()
|
|||||||
// install translation file for Qt built-in dialogs
|
// install translation file for Qt built-in dialogs
|
||||||
QString const language_name = QString("qt_") + default_locale.name();
|
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
|
// Short-named translator can be loaded from a long name, but not the
|
||||||
// opposite. Therefore, long name should be used without truncation.
|
// opposite. Therefore, long name should be used without truncation.
|
||||||
// c.f. http://doc.trolltech.com/4.1/qtranslator.html#load
|
// c.f. http://doc.trolltech.com/4.1/qtranslator.html#load
|
||||||
@ -2020,7 +2020,7 @@ void GuiApplication::restoreGuiSession()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Session & session = theSession();
|
Session & session = theSession();
|
||||||
LastOpenedSection::LastOpened const & lastopened =
|
LastOpenedSection::LastOpened const & lastopened =
|
||||||
session.lastOpened().getfiles();
|
session.lastOpened().getfiles();
|
||||||
|
|
||||||
FileName active_file;
|
FileName active_file;
|
||||||
@ -2118,7 +2118,7 @@ bool GuiApplication::notify(QObject * receiver, QEvent * event)
|
|||||||
return QApplication::notify(receiver, event);
|
return QApplication::notify(receiver, event);
|
||||||
}
|
}
|
||||||
catch (ExceptionMessage const & e) {
|
catch (ExceptionMessage const & e) {
|
||||||
switch(e.type_) {
|
switch(e.type_) {
|
||||||
case ErrorException:
|
case ErrorException:
|
||||||
emergencyCleanup();
|
emergencyCleanup();
|
||||||
setQuitOnLastWindowClosed(false);
|
setQuitOnLastWindowClosed(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user