Commit 8245bc4e authored by Laurent Montel's avatar Laurent Montel 😁

Port to QMenu

parent 8d1b26e9
......@@ -13,7 +13,7 @@
#include "kget.h"
#include <kmenu.h>
#include <QMenu>
#include <klocale.h>
#include <kdebug.h>
......
......@@ -18,7 +18,7 @@
#include "core/kget.h"
#include <kdebug.h>
#include <kmenu.h>
#include <QMenu>
#include <QAction>
#include <kactioncollection.h>
#include <klocale.h>
......
......@@ -23,7 +23,7 @@
#include <KComponentData>
#include <KLocale>
#include <KMessageBox>
#include <KMenu>
#include <QMenu>
#include <KRun>
#include <KIcon>
#include <KToolInvocation>
......
......@@ -25,7 +25,7 @@
#include <klocale.h>
#include <kiconloader.h>
#include <kglobal.h>
#include <kmenu.h>
#include <QMenu>
#include <krun.h>
#include <kmessagebox.h>
#include <kmimetype.h>
......@@ -62,7 +62,7 @@ namespace kt
proxy_model->setSortRole(Qt::UserRole);
setModel(proxy_model);
context_menu = new KMenu(this);
context_menu = new QMenu(this);
open_action = context_menu->addAction(KIcon("document-open"),i18nc("Open file", "Open"),this,SLOT(open()));
context_menu->addSeparator();
download_first_action = context_menu->addAction(i18n("Download first"),this,SLOT(downloadFirst()));
......
......@@ -24,7 +24,7 @@
#include <util/constants.h>
#include <ksharedconfig.h>
class KMenu;
class QMenu;
class QSortFilterProxyModel;
namespace bt
......@@ -86,7 +86,7 @@ namespace kt
bt::TorrentInterface* curr_tc;
TorrentFileModel* model;
KMenu* context_menu;
QMenu* context_menu;
QAction* open_action;
QAction* download_first_action;
QAction* download_normal_action;
......
......@@ -23,7 +23,7 @@
#include <QHeaderView>
#include <klocale.h>
#include <kicon.h>
#include <kmenu.h>
#include <QMenu>
#include <kstandarddirs.h>
#include <kconfiggroup.h>
#include <interfaces/peerinterface.h>
......@@ -48,7 +48,7 @@ namespace kt
model = new PeerViewModel(this);
setModel(model);
context_menu = new KMenu(this);
context_menu = new QMenu(this);
context_menu->addAction(KIcon("list-remove-user"),i18n("Kick Peer"),this,SLOT(kickPeer()));
context_menu->addAction(KIcon("view-filter"),i18n("Ban Peer"),this,SLOT(banPeer()));
connect(this,SIGNAL(customContextMenuRequested(QPoint)),
......
......@@ -26,7 +26,7 @@
#include <interfaces/peerinterface.h>
#include <ksharedconfig.h>
class KMenu;
class QMenu;
namespace kt
{
......@@ -63,7 +63,7 @@ namespace kt
void kickPeer();
private:
KMenu* context_menu;
QMenu* context_menu;
PeerViewModel* model;
};
}
......
......@@ -20,14 +20,14 @@
#include "core/plugin/transferfactory.h"
#include "core/transferhandler.h"
#include "core/transfergrouphandler.h"
#include <KMenu>
#include <QMenu>
#include <QWidgetAction>
#include <KFileItem>
#include <kfileitemlistproperties.h>
#include <kfileitemactions.h>
KMenu * ContextMenu::createTransferContextMenu(QList<TransferHandler*> transfers, QWidget *parent)
QMenu * ContextMenu::createTransferContextMenu(QList<TransferHandler*> transfers, QWidget *parent)
{
if (transfers.empty())
return 0;
......@@ -45,11 +45,11 @@ KMenu * ContextMenu::createTransferContextMenu(QList<TransferHandler*> transfers
// transfers.first()->m_transfer->factory() );
}*/
KMenu *popup = new KMenu(parent);
popup->addTitle(transfers.first()->dest().fileName());
QMenu *popup = new QMenu(parent);
popup->addSection(transfers.first()->dest().fileName());
//Get the transfer factory actions
QList<QAction*> actionList = transfers.first()->factoryActions();
// popup->addTitle( i18np("%1 Download selected", "%1 Downloads selected", transfers.count()) );
// popup->addSection( i18np("%1 Download selected", "%1 Downloads selected", transfers.count()) );
//Plug all the actions in the popup menu
popup->addActions(transfers.first()->contextActions());
......@@ -72,7 +72,7 @@ KMenu * ContextMenu::createTransferContextMenu(QList<TransferHandler*> transfers
items << transfer->nepomukHandler()->fileItems();
}
KMenu *nepomukMenu = new KMenu(i18n("Semantic Desktop"), parent);
QMenu *nepomukMenu = new QMenu(i18n("Semantic Desktop"), parent);
nepomukMenu->setIcon(KIcon("nepomuk"));
QWidgetAction *nepomukWidgetAction = new QWidgetAction(parent);
Nepomuk2::FileMetaDataWidget *nepomukWidget = new Nepomuk2::FileMetaDataWidget(parent);
......@@ -90,9 +90,9 @@ KMenu * ContextMenu::createTransferContextMenu(QList<TransferHandler*> transfers
return popup;
}
KMenu * ContextMenu::createTransferContextMenu(TransferHandler* handler, QWidget *parent)
QMenu * ContextMenu::createTransferContextMenu(TransferHandler* handler, QWidget *parent)
{
KMenu *popup = ContextMenu::createTransferContextMenu(QList<TransferHandler*>() << handler, parent);
QMenu *popup = ContextMenu::createTransferContextMenu(QList<TransferHandler*>() << handler, parent);
// only shows the open with actions if the transfer is finished
if (handler->status() == Job::Finished || handler->status() == Job::FinishedKeepAlive) {
......@@ -117,13 +117,13 @@ KMenu * ContextMenu::createTransferContextMenu(TransferHandler* handler, QWidget
return popup;
}
KMenu * ContextMenu::createTransferGroupContextMenu(TransferGroupHandler *handler, QWidget *parent)
QMenu * ContextMenu::createTransferGroupContextMenu(TransferGroupHandler *handler, QWidget *parent)
{
if (!handler)
return 0;
KMenu * popup = new KMenu(parent);
popup->addTitle(handler->name());
QMenu * popup = new QMenu(parent);
popup->addSection(handler->name());
popup->addActions(handler->actions());
popup->addSeparator();
......
......@@ -16,14 +16,14 @@
class TransferHandler;
class TransferGroupHandler;
class KMenu;
class QMenu;
class QWidget;
namespace ContextMenu
{
KMenu * createTransferContextMenu(QList<TransferHandler*> transfer, QWidget *parent);
KMenu * createTransferContextMenu(TransferHandler* handler, QWidget *parent);
KMenu * createTransferGroupContextMenu(TransferGroupHandler *handler, QWidget *parent);
QMenu * createTransferContextMenu(QList<TransferHandler*> transfer, QWidget *parent);
QMenu * createTransferContextMenu(TransferHandler* handler, QWidget *parent);
QMenu * createTransferGroupContextMenu(TransferGroupHandler *handler, QWidget *parent);
}
#endif
......@@ -21,7 +21,7 @@
#include "ui/newtransferdialog.h"
#include <kwindowsystem.h>
#include <kmenu.h>
#include <QMenu>
#include <kmessagebox.h>
#include <KPassivePopup>
#include <kapplication.h>
......@@ -72,8 +72,8 @@ DropTarget::DropTarget(MainWindow * mw)
setMask(QBitmap());
// popup menu for right mouse button
popupMenu = new KMenu(this);
popupMenu->addTitle(mw->windowTitle());
popupMenu = new QMenu(this);
popupMenu->addSection(mw->windowTitle());
QAction * downloadAction = mw->actionCollection()->action("start_all_download");
popupMenu->addAction( downloadAction );
......
......@@ -22,7 +22,7 @@
class QAction;
class QTimer;
class KMenu;
class QMenu;
class MainWindow;
class DropTargetModelObserver;
......@@ -72,7 +72,7 @@ private slots:
void slotClose();
private:
KMenu * popupMenu;
QMenu * popupMenu;
MainWindow * parentWidget;
QTimer * animTimer;
QTimer * popupTimer;
......
......@@ -19,7 +19,7 @@
#include <KDebug>
#include <QAction>
#include <KLocale>
#include <KMenu>
#include <QMenu>
#include <KRun>
#include <QDropEvent>
......@@ -39,7 +39,7 @@ TransfersView::TransfersView(QWidget * parent)
header()->setMinimumSectionSize(80);
header()->setContextMenuPolicy(Qt::CustomContextMenu);
header()->setClickable(true);
m_headerMenu = new KMenu(header());
m_headerMenu = new QMenu(header());
setSelectionMode(QAbstractItemView::ExtendedSelection);
setDragEnabled(true);
......@@ -124,7 +124,7 @@ void TransfersView::rowsInserted(const QModelIndex & parent, int start, int end)
void TransfersView::populateHeaderActions()
{
m_headerMenu->clear();
m_headerMenu->addTitle(i18n("Select columns"));
m_headerMenu->addSection(i18n("Select columns"));
QSignalMapper *columnMapper = new QSignalMapper(this);
connect(columnMapper, SIGNAL(mapped(int)), SLOT(slotHideSection(int)));
......
......@@ -13,7 +13,7 @@
#include <QTreeView>
class KMenu;
class QMenu;
class TransferHandler;
class TransfersView : public QTreeView
......@@ -53,7 +53,7 @@ class TransfersView : public QTreeView
QWidget *getDetailsWidgetForTransfer(TransferHandler *handler);
QList<QModelIndex> m_editingIndexes;
KMenu *m_headerMenu;
QMenu *m_headerMenu;
};
#endif
......@@ -24,7 +24,7 @@
#include <kdebug.h>
#include <klocale.h>
#include <kmenu.h>
#include <QMenu>
#include <kicon.h>
#include <QApplication>
......@@ -456,7 +456,7 @@ bool TransfersViewDelegate::editorEvent(QEvent * event, QAbstractItemModel * mod
{
// kDebug(5001) << "TransfersViewDelegate::editorEvent() -> rightClick";
KMenu *popup = 0;
QMenu *popup = 0;
TransferTreeModel * transferTreeModel = KGet::model();
......
......@@ -13,7 +13,7 @@
#include <kaboutdata.h>
#include <kactioncollection.h>
#include <kapplication.h>
#include <kmenu.h>
#include <QMenu>
#include <kdebug.h>
#include <klocale.h>
......
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