[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/koffice-isi/kpresenter/part
From: Jeremy Florent Lugagne <lugagne.jeremy () gmail ! com>
Date: 2009-01-10 1:23:40
Message-ID: 1231550620.345325.17850.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 908632 by jlugagne:
- Modify cursor when painting mode is selected.
- Block next and previous slides in painting mode.
- Leave painting mode by pressing ESC key
M +23 -0 KPrPresentationTool.cpp
M +4 -0 KPrPresentationTool.h
M +3 -0 KPrViewModePresentation.cpp
--- branches/work/koffice-isi/kpresenter/part/KPrPresentationTool.cpp #908631:908632
@@ -29,6 +29,7 @@
#include <QtGui/QPaintEvent>
#include <QtGui/QPixmap>
#include <QtGui/QPicture>
+#include <QCursor>
#include <KoShape.h>
#include <KoShapeManager.h>
@@ -39,6 +40,8 @@
#include "KPrViewModePresentation.h"
+bool KPrPresentationTool::drawMode = false;
+
KPrPresentationTool::KPrPresentationTool( KPrViewModePresentation & viewMode )
: KoTool( viewMode.canvas() )
, m_viewMode( viewMode )
@@ -57,6 +60,7 @@
// Connections of button clicked to slots
connect( presentationToolWidget->presentationToolUi().penButton, SIGNAL( \
clicked() ), this, SLOT( drawOnPresentation() ) );
connect( presentationToolWidget->presentationToolUi().highLightButton, SIGNAL( \
clicked() ), this, SLOT( highLightPresentation() ) ); +
}
KPrPresentationTool::~KPrPresentationTool()
@@ -116,6 +120,9 @@
switch ( event->key() )
{
case Qt::Key_Escape:
+ if(KPrPresentationTool::drawMode)
+ this->drawOnPresentation();
+ else
m_viewMode.activateSavedViewMode();
break;
case Qt::Key_Home:
@@ -229,9 +236,25 @@
}
+bool KPrPresentationTool::getDrawMode(){
+ return KPrPresentationTool::drawMode;
+}
+
+void KPrPresentationTool::switchDrawMode(){
+ if(!KPrPresentationTool::drawMode){
+ KPrPresentationTool::drawMode = true;
+ QApplication::setOverrideCursor(QCursor(Qt::CrossCursor));
+ }else{
+ KPrPresentationTool::drawMode = false;
+ QApplication::restoreOverrideCursor();
+ }
+}
+
void KPrPresentationTool::drawOnPresentation()
{
presentationToolWidget->presentationToolUi().penButton->setText("test...");
+ KPrPresentationTool::switchDrawMode();
+ presentationToolWidget->presentationToolUi().penButton->setDown(KPrPresentationTool::drawMode);
}
// get the acces on m_frame
--- branches/work/koffice-isi/kpresenter/part/KPrPresentationTool.h #908631:908632
@@ -54,6 +54,7 @@
QWidget *m_blackBackgroundPresentation();
void setBlackBackgroundVisibility(bool b);
bool getBlackBackgroundVisibility();
+ static bool getDrawMode();
public slots:
void activate( bool temporary = false );
@@ -63,6 +64,7 @@
private:
void finishEventActions();
+ static void switchDrawMode();
KPrViewModePresentation & m_viewMode;
QList<KoEventAction *> m_eventActions;
@@ -71,6 +73,8 @@
QFrame *m_blackBackgroundframe;
KPrPresentationHighlightWidget * m_blackBackgroundwidget;
bool m_blackBackgroundVisibility;
+ static bool drawMode;
+
};
#endif /* KPRPRESENTATIONTOOL_H */
--- branches/work/koffice-isi/kpresenter/part/KPrViewModePresentation.cpp \
#908631:908632 @@ -19,6 +19,7 @@
*/
#include "KPrViewModePresentation.h"
+#include "KPrPresentationTool.h"
#include <QEvent>
#include <QKeyEvent>
@@ -263,6 +264,7 @@
void KPrViewModePresentation::navigate( KPrAnimationDirector::Navigation navigation \
) {
+ if(!KPrPresentationTool::getDrawMode()){
bool finished = m_animationDirector->navigate( navigation );
//update current slide widget
@@ -276,6 +278,7 @@
if ( finished ) {
activateSavedViewMode();
}
+ }
}
void KPrViewModePresentation::navigateToPage( int index )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic