#include "support/os.h"
#include "support/Package.h"
+#include "BufferList.h"
#include "BufferView.h"
#include "Color.h"
#include "debug.h"
#include <QLocale>
#include <QLibraryInfo>
#include <QPixmapCache>
+#include <QSessionManager>
#include <QTextCodec>
#include <QTimer>
#include <QTranslator>
socket_callbacks_.erase(fd);
}
+
+void GuiApplication::commitData(QSessionManager & sm)
+{
+ /// The implementation is required to avoid an application exit
+ /// when session state save is triggered by session manager.
+ /// The default implementation sends a close event to all
+ /// visible top level widgets when session managment allows
+ /// interaction.
+ /// We are changing that to write all unsaved buffers...
+ if (sm.allowsInteraction() && !theBufferList().quitWriteAll())
+ sm.cancel();
+}
+
+
////////////////////////////////////////////////////////////////////////
// X11 specific stuff goes here...
#ifdef Q_WS_X11
#include <QApplication>
#include <QTranslator>
+class QSessionManager;
+
namespace lyx {
class BufferView;
void unregisterSocketCallback(int fd);
//@}
- /// Methods inherited from \c Application class
+ /// Methods inherited from \c QApplication class
//@{
- virtual bool notify(QObject * receiver, QEvent * event);
+ bool notify(QObject * receiver, QEvent * event);
+ void commitData(QSessionManager & sm);
//@}
///