Commit 816bcd0b authored by Michal Humpula's avatar Michal Humpula

port from KMenu to Qmenu

parent 791e112c
......@@ -44,7 +44,6 @@
#include <KLocale>
#include <KMessageBox>
#include <KOpenWithDialog>
#include <KMenu>
#include <KConfig>
#include <kstandardaction.h>
#include <KMimeTypeTrader>
......@@ -67,8 +66,9 @@
#include <QDropEvent>
#include <QList>
#include <QDesktopWidget>
#include <QMimeData>
#include <QMimeDatabase>
#include <QtCore/QMimeData>
#include <QtCore/QMimeDatabase>
#include <QtWidgets/QMenu>
#include <kio/job.h>
#include <KIO/ListJob>
......
......@@ -33,21 +33,22 @@
#include <khbox.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kmenu.h>
#include <kmessagebox.h>
#include <kvbox.h>
#include <kxmlguifactory.h>
#include <kdeversion.h>
#include <klocalizedstring.h>
#include <QEvent>
#include <QShortcut>
#include <QContextMenuEvent>
#include <QPixmap>
#include <QChildEvent>
#include <QSizePolicy>
#include <QDomDocument>
#include <QStyle>
#include <QtCore/QChildEvent>
#include <QtCore/QEvent>
#include <QtGui/QContextMenuEvent>
#include <QtGui/QPixmap>
#include <QtWidgets/QMenu>
#include <QtWidgets/QShortcut>
#include <QtWidgets/QSizePolicy>
#include <QtWidgets/QStyle>
#include <QtXml/QDomDocument>
namespace KateMDI
{
......@@ -489,40 +490,40 @@ namespace KateMDI
if (w)
{
KMenu *p = new KMenu (this);
QMenu *menu = new QMenu(this);
if (!w->plugin.isNull()) {
Kate::PluginConfigPageInterface* pcpi=dynamic_cast<Kate::PluginConfigPageInterface*>(w->plugin.data());
if (pcpi) {
if (pcpi->configPages()>0)
p->addAction(i18n("Configure ..."))->setData(20);
menu->addAction(i18n("Configure ..."))->setData(20);
}
}
p->addTitle(SmallIcon("view_remove"), i18n("Behavior"));
menu->addSection(SmallIcon("view_remove"), i18n("Behavior"));
p->addAction(w->persistent ? KIcon("view-restore") : KIcon("view-fullscreen"),
menu->addAction(w->persistent ? KIcon("view-restore") : KIcon("view-fullscreen"),
w->persistent ? i18n("Make Non-Persistent") : i18n("Make Persistent") ) -> setData(10);
p->addTitle(SmallIcon("move"), i18n("Move To"));
menu->addSection(SmallIcon("move"), i18n("Move To"));
if (position() != 0)
p->addAction(KIcon("go-previous"), i18n("Left Sidebar"))->setData(0);
menu->addAction(KIcon("go-previous"), i18n("Left Sidebar"))->setData(0);
if (position() != 1)
p->addAction(KIcon("go-next"), i18n("Right Sidebar"))->setData(1);
menu->addAction(KIcon("go-next"), i18n("Right Sidebar"))->setData(1);
if (position() != 2)
p->addAction(KIcon("go-up"), i18n("Top Sidebar"))->setData(2);
menu->addAction(KIcon("go-up"), i18n("Top Sidebar"))->setData(2);
if (position() != 3)
p->addAction(KIcon("go-down"), i18n("Bottom Sidebar"))->setData(3);
menu->addAction(KIcon("go-down"), i18n("Bottom Sidebar"))->setData(3);
connect(p, SIGNAL(triggered(QAction*)),
connect(menu, SIGNAL(triggered(QAction*)),
this, SLOT(buttonPopupActivate(QAction*)));
p->exec(e->globalPos());
delete p;
menu->exec(e->globalPos());
delete menu;
return true;
}
......
......@@ -36,7 +36,6 @@
#include <KCodecs>
#include <KStandardGuiItem>
#include <KPushButton>
#include <KMenu>
#include <KActionCollection>
#include <KIO/NetAccess>
#include <KIO/CopyJob>
......@@ -52,6 +51,7 @@
#include <QStyle>
#include <QtAlgorithms>
#include <QCollator>
#include <QtWidgets/QMenu>
#include <unistd.h>
#include <time.h>
......
......@@ -80,7 +80,6 @@
#include <kmessagebox.h>
#include <kmimetypechooser.h>
#include <knuminput.h>
#include <kmenu.h>
#include <kprocess.h>
#include <krun.h>
#include <kseparator.h>
......
......@@ -64,7 +64,6 @@
#include <klocale.h>
#include <kglobal.h>
#include <kmenu.h>
#include <kconfig.h>
#include <kfiledialog.h>
#include <kmessagebox.h>
......
......@@ -26,9 +26,6 @@
#include "katedocument.h"
#include "kateview.h"
#include <kmenu.h>
#include <klocale.h>
namespace KTextEditor { class View; }
KateBrowserExtension::KateBrowserExtension( KateDocument* doc )
......
......@@ -38,7 +38,6 @@
#include <kicon.h>
#include <knuminput.h>
#include <klocale.h>
#include <kmenu.h>
#include <QtCore/QRegExp>
#include <QtWidgets/QCheckBox>
......
......@@ -37,7 +37,6 @@
#include <kiconloader.h>
#include <knuminput.h>
#include <klocale.h>
#include <kmenu.h>
#include <QtCore/QRegExp>
#include <QtWidgets/QCheckBox>
......
......@@ -37,7 +37,6 @@
#include <kiconloader.h>
#include <knuminput.h>
#include <klocale.h>
#include <kmenu.h>
#include <QtCore/QRegExp>
#include <QtWidgets/QCheckBox>
......
......@@ -30,7 +30,6 @@
#include <kcolorscheme.h>
#include <klocale.h>
#include "katepartdebug.h"
#include <kmenu.h>
#include <kconfiggroup.h>
//END
......
......@@ -24,14 +24,14 @@
#include <QtGui/QPainter>
#include <QtGui/QKeyEvent>
#include <QtWidgets/QAction>
#include <QtWidgets/QStyledItemDelegate>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QMenu>
#include <QtWidgets/QStyledItemDelegate>
#include <klocale.h>
#include <klocalizedstring.h>
#include <kicon.h>
#include <kcolorscheme.h>
#include <kmenu.h>
#include <kmessagebox.h>
#include <kcolordialog.h>
......@@ -207,7 +207,7 @@ void KateStyleTreeWidget::contextMenuEvent( QContextMenuEvent * event )
KateStyleTreeWidgetItem *i = dynamic_cast<KateStyleTreeWidgetItem*>(itemAt(event->pos()));
if (!i) return;
KMenu m( this );
QMenu m(this);
KTextEditor::Attribute::Ptr currentStyle = i->style();
// the title is used, because the menu obscures the context name when
// displayed on behalf of spacePressed().
......@@ -219,7 +219,7 @@ void KateStyleTreeWidget::contextMenuEvent( QContextMenuEvent * event )
QIcon bgcl = brushIcon( i->style()->hasProperty(QTextFormat::BackgroundBrush) ? i->style()->background().color() : viewport()->palette().base().color() );
QIcon sbgcl = brushIcon( i->style()->hasProperty(KTextEditor::Attribute::SelectedBackground) ? i->style()->selectedBackground().color() : viewport()->palette().base().color() );
m.addTitle( i->contextName() );
m.addSection(i->contextName());
QAction* a = m.addAction( i18n("&Bold"), this, SLOT(changeProperty()) );
a->setCheckable(true);
......
......@@ -24,10 +24,9 @@
#include "kateglobal.h"
#include "kateviewhelpers.h"
#include "kactioncollection.h"
#include "katepartdebug.h"
#include <kxmlguifactory.h>
#include <kmenu.h>
#include "katepartdebug.h"
#include <klocale.h>
//BEGIN KateScriptAction
......
......@@ -23,8 +23,7 @@
#include "snippetview.h"
#include <QContextMenuEvent>
#include <KMenu>
#include <QtGui/QContextMenuEvent>
#include <KMessageBox>
#include "snippet.h"
......@@ -154,24 +153,25 @@ void SnippetView::contextMenu (const QPoint& pos)
QStandardItem* item = SnippetStore::self()->itemFromIndex( index );
if (!item) {
// User clicked into an empty place of the tree
KMenu menu(this);
menu.addTitle(i18n("Snippets"));
QMenu menu(this);
// FIXME: what is correct way to this in KF5?
menu.addSection(i18n("Snippets"));
menu.addAction(m_addRepoAction);
menu.addAction(m_getNewStuffAction);
menu.exec(snippetTree->mapToGlobal(pos));
} else if (Snippet* snippet = dynamic_cast<Snippet*>( item )) {
KMenu menu(this);
menu.addTitle(i18n("Snippet: %1", snippet->text()));
QMenu menu(this);
menu.addSection(i18n("Snippet: %1", snippet->text()));
menu.addAction(m_editSnippetAction);
menu.addAction(m_removeSnippetAction);
menu.exec(snippetTree->mapToGlobal(pos));
} else if (SnippetRepository* repo = dynamic_cast<SnippetRepository*>( item )) {
KMenu menu(this);
menu.addTitle(i18n("Repository: %1", repo->text()));
QMenu menu(this);
menu.addSection(i18n("Repository: %1", repo->text()));
menu.addAction(m_editRepoAction);
menu.addAction(m_removeRepoAction);
......
......@@ -26,7 +26,6 @@
#include <kactioncollection.h>
#include <kactionmenu.h>
#include <kmenu.h>
#include <ktexteditor/movingrange.h>
#include <ktexteditor/movingrangefeedback.h>
#include <ktexteditor/range.h>
......
......@@ -34,24 +34,23 @@
#include "kateschema.h"
#include "kateconfig.h"
#include "kateextendedattribute.h"
#include "katepartdebug.h"
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kcomponentdata.h>
#include <klocale.h>
#include <kmenu.h>
#include "katepartdebug.h"
#include <kmessagebox.h>
#include <kapplication.h>
#include <ktexteditor/highlightinterface.h>
#include <QtCore/QSet>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtCore/QStringList>
#include <QtCore/QTextStream>
#include <QVarLengthArray>
#include <QtCore/QVarLengthArray>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
//END
//BEGIN defines
......
......@@ -26,16 +26,15 @@
#include "kateglobal.h"
#include "katesyntaxmanager.h"
#include "katesyntaxdocument.h"
#include "katepartdebug.h"
#include "ui_filetypeconfigwidget.h"
#include <kconfig.h>
#include <kmimetypechooser.h>
#include "katepartdebug.h"
#include <kiconloader.h>
#include <knuminput.h>
#include <klocale.h>
#include <kmenu.h>
#include <QtCore/QRegExp>
#include <QtWidgets/QCheckBox>
......
......@@ -34,16 +34,15 @@
#include "kateconfig.h"
#include "kateextendedattribute.h"
#include "katehighlight.h"
#include "katepartdebug.h"
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kglobal.h>
#include <kcomponentdata.h>
#include <klocale.h>
#include <kmenu.h>
#include <kcolorscheme.h>
#include <kcolorutils.h>
#include "katepartdebug.h"
#include <kmessagebox.h>
#include <kapplication.h>
......
......@@ -29,10 +29,9 @@
#include "kateview.h"
#include "kateextendedattribute.h"
#include "katedocument.h"
#include "katepartdebug.h"
#include <klocale.h>
#include "katepartdebug.h"
#include <kmenu.h>
#include <klocalizedstring.h>
#include <cctype>
......
......@@ -27,7 +27,6 @@
#include <kactioncollection.h>
#include <kguiitem.h>
#include <kicon.h>
#include <kmenu.h>
#include <kstringhandler.h>
#include <kxmlguiclient.h>
#include <kxmlguifactory.h>
......
......@@ -78,7 +78,6 @@
#include <kxmlguiclient.h>
#include <kencodingfiledialog.h>
#include <kstandardshortcut.h>
#include <kmenu.h>
#include <ktoggleaction.h>
#include <kselectaction.h>
#include <kactioncollection.h>
......@@ -2794,7 +2793,7 @@ QMenu *KateView::contextMenu( ) const
QMenu * KateView::defaultContextMenu(QMenu* menu) const
{
if (!menu)
menu = new KMenu(const_cast<KateView*>(this));
menu = new QMenu(const_cast<KateView*>(this));
menu->addAction(m_editUndo);
menu->addAction(m_editRedo);
......
......@@ -40,41 +40,40 @@
#include "katetextlayout.h"
#include "kateglobal.h"
#include "kateviglobal.h"
#include "katepartdebug.h"
#include <katevicommandrangeexpressionparser.h>
#include <kapplication.h>
#include <kcharsets.h>
#include <kcolorscheme.h>
#include <kcolorutils.h>
#include "katepartdebug.h"
#include <klocale.h>
#include <klocalizedstring.h>
#include <knotification.h>
#include <kmenu.h>
#include <kiconloader.h>
#include <kconfiggroup.h>
#include <khelpclient.h>
#include <QtAlgorithms>
#include <QVariant>
#include <QtGui/QCursor>
#include <QtWidgets/QMenu>
#include <QtGui/QPainter>
#include <QtWidgets/QStyle>
#include <QtCore/QTimer>
#include <QtCore/QRegExp>
#include <QtCore/QTextCodec>
#include <QtCore/QTimer>
#include <QtCore/QVariant>
#include <QtCore/QtAlgorithms>
#include <QtGui/QCursor>
#include <QtGui/QKeyEvent>
#include <QtGui/QLinearGradient>
#include <QtGui/QPainter>
#include <QtGui/QPainterPath>
#include <QtWidgets/QStyleOption>
#include <QtGui/QPalette>
#include <QtGui/QPen>
#include <QtWidgets/QAction>
#include <QtWidgets/QBoxLayout>
#include <QtWidgets/QMenu>
#include <QtWidgets/QStyle>
#include <QtWidgets/QStyleOption>
#include <QtWidgets/QToolButton>
#include <QtWidgets/QToolTip>
#include <QtWidgets/QAction>
#include <QtWidgets/QWhatsThis>
#include <QtGui/QLinearGradient>
#include <math.h>
......@@ -2057,8 +2056,8 @@ void KateIconBorder::showMarkMenu( uint line, const QPoint& pos )
if( !m_view->config()->allowMarkMenu() )
return;
KMenu markMenu;
KMenu selectDefaultMark;
QMenu markMenu;
QMenu selectDefaultMark;
QVector<int> vec( 33 );
int i=1;
......@@ -2159,7 +2158,7 @@ void KateIconBorder::updateAnnotationLine( int line )
void KateIconBorder::showAnnotationMenu( int line, const QPoint& pos)
{
KMenu menu;
QMenu menu;
QAction a(i18n("Disable Annotation Bar"), &menu);
a.setIcon(KIcon("dialog-close"));
menu.addAction(&a);
......
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