#include "support/ExceptionMessage.h"
#include "support/FileName.h"
+#include "support/ForkedCalls.h"
#include "support/lstrings.h"
#include "support/os.h"
#include "support/Package.h"
if (lyxrc.typewriter_font_name.empty())
lyxrc.typewriter_font_name = fromqstr(typewriterFontName());
+
+ general_timer_.setInterval(500);
+ connect(&general_timer_, SIGNAL(timeout()),
+ this, SLOT(handleRegularEvents()));
+ general_timer_.start();
}
}
+void GuiApplication::handleRegularEvents()
+{
+ ForkedCallsController::handleCompletedProcesses();
+}
+
+
bool GuiApplication::event(QEvent * e)
{
switch(e->type()) {
#include <QObject>
#include <QApplication>
+#include <QTimer>
#include <QTranslator>
#include <map>
void execBatchCommands();
///
void socketDataReceived(int fd);
+ /// events to be triggered by general_timer_ should go here
+ void handleRegularEvents();
private:
///
std::map<int, SocketNotifier *> socket_notifiers_;
///
Menus menus_;
+ /// this timer is used for any regular events one wants to
+ /// perform. at present it is used to check if forked processes
+ /// are done.
+ QTimer general_timer_;
#ifdef Q_WS_X11
public:
#include "support/debug.h"
#include "support/gettext.h"
#include "support/FileName.h"
-#include "support/ForkedCalls.h"
#include "frontends/Application.h"
#include "frontends/FontMetrics.h"
// let's initialize this just to be safe
cursor_timeout_.setInterval(500);
- general_timer_.setInterval(500);
- connect(&general_timer_, SIGNAL(timeout()),
- this, SLOT(handleRegularEvents()));
- startGeneralTimer();
-
screen_ = QPixmap(viewport()->width(), viewport()->height());
cursor_ = new frontend::CursorWidget();
cursor_->hide();
{
// In order to avoid bad surprise in the middle of an operation,
// we better stop the blinking cursor...
+ // the cursor gets restarted in GuiView::restartCursor()
stopBlinkingCursor();
- // ...and the general timer.
- stopGeneralTimer();
theLyXFunc().setLyXView(lyx_view_);
theLyXFunc().processKeySym(key, mod);
- // the cursor gets restarted in GuiView::restartCursor()
- startGeneralTimer();
}
cmd.action != LFUN_MOUSE_MOTION || cmd.button() != mouse_button::none;
// In order to avoid bad surprise in the middle of an operation, we better stop
- // the blinking cursor and the general timer
- if (notJustMovingTheMouse) {
+ // the blinking cursor.
+ if (notJustMovingTheMouse)
stopBlinkingCursor();
- stopGeneralTimer();
- }
buffer_view_->mouseEventDispatch(cmd);
// Show the cursor immediately after any operation
startBlinkingCursor();
- startGeneralTimer();
}
}
}
-void GuiWorkArea::handleRegularEvents()
-{
- ForkedCallsController::handleCompletedProcesses();
-}
-
-
void GuiWorkArea::updateScrollbar()
{
ScrollbarParameters const & scroll_ = buffer_view_->scrollbarParameters();
void stopBlinkingCursor();
///
void startBlinkingCursor();
- ///
- void startGeneralTimer() { general_timer_.start(); }
- ///
- void stopGeneralTimer() { general_timer_.stop(); }
/// Process Key pressed event.
/// This needs to be public because it is accessed externally by GuiView.
void processKeySym(KeySymbol const & key, KeyModifier mod);
void doubleClickTimeout();
/// toggle the cursor's visibility
void toggleCursor();
- /// events to be triggered by general_timer_ should go here
- void handleRegularEvents();
/// close this work area.
/// Slot for Buffer::closing signal.
void close();
///
QTimer cursor_timeout_;
- /// this timer is used for any regular events one wants to
- /// perform. at present it is used to check if forked processes
- /// are done.
- QTimer general_timer_;
///
SyntheticMouseEvent synthetic_mouse_event_;
///