SANKORE-186: Sankore hotkey Alt+F4 doesn't remove sankore from active processes

preferencesAboutTextFull
Anatoly Mihalchenko 13 years ago
parent bfe6df11f0
commit 42d519e60c
  1. 10
      src/core/UBApplication.cpp
  2. 2
      src/core/UBApplication.h
  3. 4
      src/domain/UBGraphicsScene.cpp
  4. 2
      src/domain/UBGraphicsScene.h
  5. 7
      src/gui/UBMainWindow.cpp
  6. 4
      src/gui/UBMainWindow.h

@ -233,7 +233,8 @@ int UBApplication::exec(const QString& pFileToImport)
connect(mainWindow->actionWeb, SIGNAL(triggered()), this, SLOT(showInternet())); connect(mainWindow->actionWeb, SIGNAL(triggered()), this, SLOT(showInternet()));
connect(mainWindow->actionDocument, SIGNAL(triggered()), this, SLOT(showDocument())); connect(mainWindow->actionDocument, SIGNAL(triggered()), this, SLOT(showDocument()));
connect(mainWindow->actionQuit, SIGNAL(triggered()), this, SLOT(closing())); connect(mainWindow->actionQuit, SIGNAL(triggered()), this, SLOT(closing()));
connect(mainWindow, SIGNAL(closeEvent_Signal(QCloseEvent*)), this, SLOT(closeEvent(QCloseEvent*)));
boardController = new UBBoardController(mainWindow); boardController = new UBBoardController(mainWindow);
boardController->init(); boardController->init();
@ -379,6 +380,13 @@ void UBApplication::toolBarDisplayTextChanged(QVariant display)
} }
void UBApplication::closeEvent(QCloseEvent *event)
{
Q_UNUSED(event);
closing();
}
void UBApplication::closing() void UBApplication::closing()
{ {

@ -99,6 +99,8 @@ class UBApplication : public QtSingleApplication
void toolBarPositionChanged(QVariant topOrBottom); void toolBarPositionChanged(QVariant topOrBottom);
void toolBarDisplayTextChanged(QVariant display); void toolBarDisplayTextChanged(QVariant display);
void closeEvent(QCloseEvent *event);
/** /**
* Used on Windows platform to open file in running application. On MacOS X opening file is done through the * Used on Windows platform to open file in running application. On MacOS X opening file is done through the
* FileOpen event that is handle in eventFilter method. * FileOpen event that is handle in eventFilter method.

@ -238,7 +238,7 @@ bool UBGraphicsScene::inputDevicePress(const QPointF& scenePos, const qreal& pre
} }
else if (currentTool == UBStylusTool::Magnifier) else if (currentTool == UBStylusTool::Magnifier)
{ {
CreateMagnifierQWidgets(QCursor::pos() /*scenePos*/); CreateMagnifierQWidgets();
magniferControlViewWidget->grabNMove(QCursor::pos(), true); magniferControlViewWidget->grabNMove(QCursor::pos(), true);
magniferDisplayViewWidget->grabNMove(scenePos, true); magniferDisplayViewWidget->grabNMove(scenePos, true);
magniferControlViewWidget->show(); magniferControlViewWidget->show();
@ -424,7 +424,7 @@ void UBGraphicsScene::drawPointer(const QPointF &pPoint)
} }
// call this function when user press mouse button in Magnifier mode // call this function when user press mouse button in Magnifier mode
void UBGraphicsScene::CreateMagnifierQWidgets(const QPoint & globalPos) void UBGraphicsScene::CreateMagnifierQWidgets()
{ {
UBApplication::app()->setOverrideCursor( QCursor( Qt::BlankCursor ) ); UBApplication::app()->setOverrideCursor( QCursor( Qt::BlankCursor ) );

@ -289,7 +289,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
void drawEraser(const QPointF& pEndPoint); void drawEraser(const QPointF& pEndPoint);
void drawPointer(const QPointF& pEndPoint); void drawPointer(const QPointF& pEndPoint);
void CreateMagnifierQWidgets(const QPoint &point); void CreateMagnifierQWidgets();
void DisposeMagnifierQWidgets(); void DisposeMagnifierQWidgets();

@ -40,6 +40,7 @@ UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags)
actionQuit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); actionQuit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
#elif defined(Q_WS_WIN) #elif defined(Q_WS_WIN)
actionPreferences->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Return)); actionPreferences->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Return));
// this code, because it unusable, system key combination can`t be triggered, even we add it manually
actionQuit->setShortcut(QKeySequence(Qt::ALT + Qt::Key_F4)); actionQuit->setShortcut(QKeySequence(Qt::ALT + Qt::Key_F4));
#else #else
actionQuit->setShortcut(QKeySequence(Qt::ALT + Qt::Key_F4)); actionQuit->setShortcut(QKeySequence(Qt::ALT + Qt::Key_F4));
@ -118,6 +119,12 @@ void UBMainWindow::keyPressEvent(QKeyEvent *event)
*/ */
} }
void UBMainWindow::closeEvent(QCloseEvent *event)
{
event->ignore();
emit closeEvent_Signal(event);
}
void UBMainWindow::onExportDone() void UBMainWindow::onExportDone()
{ {
// HACK : When opening the file save dialog during the document exportation, // HACK : When opening the file save dialog during the document exportation,

@ -42,12 +42,16 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
void addDocumentsWidget(QWidget *pWidget); void addDocumentsWidget(QWidget *pWidget);
void switchToDocumentsWidget(); void switchToDocumentsWidget();
signals:
void closeEvent_Signal( QCloseEvent *event );
public slots: public slots:
void onExportDone(); void onExportDone();
protected: protected:
virtual void keyPressEvent(QKeyEvent *event); virtual void keyPressEvent(QKeyEvent *event);
virtual void closeEvent (QCloseEvent *event);
virtual QMenu* createPopupMenu () virtual QMenu* createPopupMenu ()
{ {

Loading…
Cancel
Save