Add menu to exit to "fullscreen" but it doesn't work

because "m_part is a "KParts::ReadOnlyPart*" and not a kpdf_part
and I don't know how to create it.
I need help from a people who knows kpart please.
Regards
(see kpdf_shell.cpp)

svn path=/trunk/kdegraphics/kpdf/; revision=251221
This commit is contained in:
Laurent Montel 2003-09-15 12:44:23 +00:00
parent 9220ef7f35
commit 10f5a7bb56
5 changed files with 24 additions and 0 deletions

View file

@ -46,6 +46,10 @@ namespace KPDF
{
if (m_doc == 0)
return;
if ( e->button() & RightButton )
{
emit rightClick();
}
m_pressedAction = m_doc->findLink(e->x()/m_ppp, e->y()/m_ppp);
}

View file

@ -57,6 +57,8 @@ namespace KPDF
void ReadDown();
void ZoomOut();
void ZoomIn();
void rightClick();
protected:
virtual void keyPressEvent( QKeyEvent* );
void contentsMousePressEvent(QMouseEvent*);

View file

@ -71,6 +71,8 @@ namespace KPDF
void displayDestination(LinkDest*);
void updateActionPage();
void setFullScreen( bool fs );
PageWidget* pageWidget() const {return m_outputDev;}
protected:
/**
* This must be implemented by each part

View file

@ -21,7 +21,9 @@
#include <klocale.h>
#include <kmainwindow.h>
#include <kmenubar.h>
#include <kpopupmenu.h>
#include <kparts/componentfactory.h>
#include <qcursor.h>
using namespace KPDF;
@ -63,6 +65,8 @@ Shell::Shell()
// next time we enter the event loop...
return;
}
//FIXME m_part is not a KPART::readon... it's a kdpf_part...
//connect( m_part->pageWidget(), SIGNAL( rightClick() ),SLOT( slotRMBClick() ) );
readSettings();
}
@ -128,6 +132,9 @@ Shell::setupActions()
#else
m_fullScreenAction = new KToggleAction( this, SLOT( slotToggleFullScreen() ) );
#endif
m_popup = new KPopupMenu( this, "rmb popup" );
m_popup->insertTitle( i18n( "Full Screen Options" ) );
m_fullScreenAction->plug( m_popup );
}
void
@ -236,5 +243,10 @@ void Shell::setFullScreen( bool useFullScreen )
}
}
void Shell::slotRMBClick()
{
m_popup->exec( QCursor::pos() );
}
// vim:ts=2:sw=2:tw=78:et

View file

@ -7,6 +7,7 @@
#include <kapplication.h>
#include <kparts/mainwindow.h>
class KPopupMenu;
namespace KPDF
@ -62,6 +63,8 @@ namespace KPDF
void applyNewToolbarConfig();
void slotToggleFullScreen();
void slotRMBClick();
public slots:
void openURL( const KURL & url );
@ -74,6 +77,7 @@ namespace KPDF
KRecentFilesAction* recent;
KToggleAction* m_fullScreenAction;
bool m_isFullScreen;
KPopupMenu* m_popup;
};
}