Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 077689c4 authored by Vishesh Handa's avatar Vishesh Handa

Port KAction and KMenu

parent e038950f
......@@ -61,7 +61,7 @@ KIMGIOGenerator::KIMGIOGenerator( QObject *parent, const QVariantList &args )
setComponentData( *ownComponentData() );
setXMLFile( "gui.rc" );
KAction * kimgio_test = new KAction( this );
QAction * kimgio_test = new QAction( this );
kimgio_test->setText( "Image test" );
kimgio_test->setIcon( QIcon::fromTheme( "smiley" ) );
connect( kimgio_test, SIGNAL(triggered(bool)), this, SLOT(slotTest()) );
......
......@@ -652,7 +652,7 @@ void Part::setupViewerActions()
prefs->setText( i18n( "Configure Viewer..." ) );
}
KAction * genPrefs = new KAction( ac );
QAction * genPrefs = new QAction( ac );
ac->addAction("options_configure_generators", genPrefs);
if ( m_embedMode == ViewerWidgetMode )
{
......@@ -691,7 +691,7 @@ void Part::setupViewerActions()
m_aboutBackend->setEnabled( false );
connect(m_aboutBackend, SIGNAL(triggered()), this, SLOT(slotAboutBackend()));
KAction *reload = ac->add<KAction>( "file_reload" );
QAction *reload = ac->add<QAction>( "file_reload" );
reload->setText( i18n( "Reloa&d" ) );
reload->setIcon( QIcon::fromTheme( "view-refresh" ) );
reload->setWhatsThis( i18n( "Reload the current document from disk." ) );
......@@ -704,7 +704,8 @@ void Part::setupViewerActions()
m_closeFindBar->setShortcut( QKeySequence(Qt::Key_Escape) );
m_closeFindBar->setEnabled( false );
KAction *pageno = new KAction( i18n( "Page Number" ), ac );
QWidgetAction *pageno = new QWidgetAction( ac );
pageno->setText( i18n( "Page Number" ) );
pageno->setDefaultWidget( m_pageNumberTool );
ac->addAction( "page_number", pageno );
}
......@@ -724,7 +725,7 @@ void Part::setViewerShortcuts()
m_beginningOfDocument->setShortcut( QKeySequence( Qt::CTRL + Qt::ALT + Qt::Key_Home ) );
m_endOfDocument->setShortcut( QKeySequence( Qt::CTRL + Qt::ALT + Qt::Key_End ) );
KAction *action = static_cast<KAction*>( ac->action( "file_reload" ) );
QAction *action = static_cast<QAction*>( ac->action( "file_reload" ) );
if( action ) action->setShortcuts( QList<QKeySequence>() << QKeySequence( Qt::ALT + Qt::Key_F5 ) );
}
......@@ -812,17 +813,17 @@ void Part::setupActions()
drawingAction->setIcon( QIcon::fromTheme( "draw-freehand" ) );
drawingAction->setEnabled( false );
KAction *eraseDrawingAction = new KAction( i18n( "Erase Drawings" ), ac );
QAction *eraseDrawingAction = new QAction( i18n( "Erase Drawings" ), ac );
ac->addAction( "presentation_erase_drawings", eraseDrawingAction );
eraseDrawingAction->setIcon( QIcon::fromTheme( "draw-eraser" ) );
eraseDrawingAction->setEnabled( false );
KAction *configureAnnotations = new KAction( i18n( "Configure Annotations..." ), ac );
QAction *configureAnnotations = new QAction( i18n( "Configure Annotations..." ), ac );
ac->addAction( "options_configure_annotations", configureAnnotations );
configureAnnotations->setIcon( QIcon::fromTheme( "configure" ) );
connect(configureAnnotations, SIGNAL(triggered()), this, SLOT(slotAnnotationPreferences()));
KAction *playPauseAction = new KAction( i18n( "Play/Pause Presentation" ), ac );
QAction *playPauseAction = new QAction( i18n( "Play/Pause Presentation" ), ac );
ac->addAction( "presentation_play_pause", playPauseAction );
playPauseAction->setEnabled( false );
}
......@@ -2392,13 +2393,13 @@ void Part::slotShowMenu(const Okular::Page *page, const QPoint &point)
m_actionsSearched = true;
}
KMenu *popup = new KMenu( widget() );
QMenu *popup = new QMenu( widget() );
QAction *addBookmark = 0;
QAction *removeBookmark = 0;
QAction *fitPageWidth = 0;
if (page)
{
popup->addTitle( i18n( "Page %1", page->number() + 1 ) );
popup->setTitle( i18n( "Page %1", page->number() + 1 ) );
if ( ( !currentPage && m_document->bookmarkManager()->isBookmarked( page->number() ) ) ||
( currentPage && m_document->bookmarkManager()->isBookmarked( m_document->viewport() ) ) )
removeBookmark = popup->addAction( QIcon::fromTheme("edit-delete-bookmark"), i18n("Remove Bookmark") );
......@@ -2420,7 +2421,7 @@ void Part::slotShowMenu(const Okular::Page *page, const QPoint &point)
if ((m_showMenuBarAction && !m_showMenuBarAction->isChecked()) || (m_showFullScreenAction && m_showFullScreenAction->isChecked()))
{
popup->addTitle( i18n( "Tools" ) );
popup->setTitle( i18n( "Tools" ) );
if (m_showMenuBarAction && !m_showMenuBarAction->isChecked()) popup->addAction(m_showMenuBarAction);
if (m_showFullScreenAction && m_showFullScreenAction->isChecked()) popup->addAction(m_showFullScreenAction);
reallyShow = true;
......@@ -2896,7 +2897,7 @@ void Part::rebuildBookmarkMenu( bool unplugActions )
if ( m_bookmarkActions.isEmpty() )
{
havebookmarks = false;
QAction * a = new KAction( 0 );
QAction * a = new QAction( 0 );
a->setText( i18n( "No Bookmarks" ) );
a->setEnabled( false );
m_bookmarkActions.append( a );
......
......@@ -48,8 +48,7 @@ class KToggleFullScreenAction;
class KSelectAction;
class KAboutData;
class KTemporaryFile;
class KAction;
class KMenu;
class QAction;
namespace KParts { class GUIActivateEvent; }
class FindBar;
......@@ -187,7 +186,7 @@ class OKULAR_PART_EXPORT Part : public KParts::ReadWritePart, public Okular::Doc
void slotAddBookmark();
void slotRenameBookmarkFromMenu();
void slotRenameCurrentViewportBookmark();
void slotAboutToShowContextMenu(KMenu *menu, QAction *action, QMenu *contextMenu);
void slotAboutToShowContextMenu(QMenu *menu, QAction *action, QMenu *contextMenu);
void slotPreviousBookmark();
void slotNextBookmark();
void slotFindNext();
......
......@@ -39,7 +39,7 @@ void AnnotationPopup::exec( const QPoint &point )
if ( mAnnotations.isEmpty() )
return;
KMenu menu( mParent );
QMenu menu( mParent );
QAction *action = 0;
Okular::FileAttachmentAnnotation *fileAttachAnnot = 0;
......@@ -58,7 +58,7 @@ void AnnotationPopup::exec( const QPoint &point )
const AnnotPagePair &pair = mAnnotations.at(0);
menu.addTitle( i18np( "Annotation", "%1 Annotations", mAnnotations.count() ) );
menu.setTitle( i18np( "Annotation", "%1 Annotations", mAnnotations.count() ) );
action = menu.addAction( QIcon::fromTheme( "comment" ), i18n( "&Open Pop-up Note" ) );
action->setData( QVariant::fromValue( pair ) );
......@@ -95,7 +95,7 @@ void AnnotationPopup::exec( const QPoint &point )
{
foreach ( const AnnotPagePair& pair, mAnnotations )
{
menu.addTitle( GuiUtils::captionForAnnotation( pair.annotation ) );
menu.setTitle( GuiUtils::captionForAnnotation( pair.annotation ) );
action = menu.addAction( QIcon::fromTheme( "comment" ), i18n( "&Open Pop-up Note" ) );
action->setData( QVariant::fromValue( pair ) );
......
......@@ -244,7 +244,7 @@ void BookmarkList::contextMenuForBookmarkItem( const QPoint& p, BookmarkItem* bm
if ( !bmItem || !bmItem->viewport().isValid() )
return;
KMenu menu( this );
QMenu menu( this );
QAction * gotobm = menu.addAction( i18n( "Go to This Bookmark" ) );
QAction * editbm = menu.addAction( QIcon::fromTheme( "edit-rename" ), i18n( "Rename Bookmark" ) );
QAction * removebm = menu.addAction( QIcon::fromTheme( "list-remove" ), i18n( "Remove Bookmark" ) );
......@@ -269,7 +269,7 @@ void BookmarkList::contextMenuForFileItem( const QPoint& p, FileItem* fItem )
const KUrl itemurl = fItem->data( 0, UrlRole ).value< KUrl >();
const bool thisdoc = itemurl == m_document->currentDocument();
KMenu menu( this );
QMenu menu( this );
QAction * open = 0;
if ( !thisdoc )
open = menu.addAction( i18nc( "Opens the selected document", "Open Document" ) );
......
This diff is collapsed.
......@@ -27,9 +27,7 @@
#include "core/observer.h"
#include "core/view.h"
class KAction;
class KActionCollection;
class KMenu;
namespace Okular {
class Action;
......@@ -97,7 +95,7 @@ Q_OBJECT
void reparseConfig();
KActionCollection *actionCollection() const;
KAction *toggleFormsAction() const;
QAction *toggleFormsAction() const;
int contentAreaWidth() const;
int contentAreaHeight() const;
......@@ -182,7 +180,7 @@ Q_OBJECT
void resizeContentArea( const QSize & newSize );
void updatePageStep();
void addWebShortcutsMenu( KMenu * menu, const QString & text );
void addWebShortcutsMenu( QMenu * menu, const QString & text );
// used when selecting stuff, makes the view scroll as necessary to keep the mouse inside the view
void scrollPosIntoView( const QPoint & pos );
......
......@@ -701,8 +701,8 @@ void Sidebar::saveSplitterSize() const
void Sidebar::listContextMenu( const QPoint &pos )
{
KMenu menu( this );
menu.addTitle( i18n( "Okular" ) );
QMenu menu( this );
menu.setTitle( i18n( "Okular" ) );
QAction *showTextAct = menu.addAction( i18n( "Show Text" ) );
showTextAct->setCheckable( true );
showTextAct->setChecked( d->sideDelegate->isTextShown() );
......
......@@ -16,7 +16,7 @@
#include <klocale.h>
ToolAction::ToolAction( QObject *parent )
: KAction( parent )
: QAction( parent )
{
setText( i18n( "Selection Tools" ) );
}
......
......@@ -17,7 +17,7 @@
class QToolButton;
class ToolAction : public KAction
class ToolAction : public QAction
{
Q_OBJECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment