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 dfbcebeb authored by R. Harish Navnit's avatar R. Harish Navnit Committed by Pali Rohár

Port away from KMenu

parent 5f62e3ee
......@@ -50,7 +50,7 @@ void ChatMembersListView::slotContextMenuRequested( const QPoint & pos )
if (!c)
return;
KMenu *p = c->popupMenu();
QMenu *p = c->popupMenu();
connect( p, SIGNAL(aboutToHide()), p, SLOT(deleteLater()) );
p->popup( mapToGlobal(pos) );
}
......
......@@ -27,6 +27,8 @@
#include <ctime>
// Qt includes
#include <QIcon>
#include <QMenu>
#include <QByteArray>
#include <QLatin1String>
#include <QList>
......@@ -71,7 +73,6 @@
#include <klocale.h>
#include <kmessagebox.h>
#include <kmessagebox_queued.h>
#include <kmenu.h>
#include <krun.h>
#include <kstringhandler.h>
#include <ktemporaryfile.h>
......@@ -79,7 +80,6 @@
#include <kstandardaction.h>
#include <kiconloader.h>
#include <kcodecs.h>
#include <QIcon>
// Kopete includes
#include "kopetecontact.h"
......@@ -781,7 +781,7 @@ void ChatMessagePart::slotRightClick( const QString &, const QPoint &point )
if ( d->activeElement.isNull() )
return;
KMenu *chatWindowPopup = 0L;
QMenu *chatWindowPopup = 0L;
if ( Kopete::Contact *contact = contactFromNode( d->activeElement ) )
{
......@@ -790,7 +790,7 @@ void ChatMessagePart::slotRightClick( const QString &, const QPoint &point )
}
else
{
chatWindowPopup = new KMenu();
chatWindowPopup = new QMenu();
QAction *action;
if ( d->activeElement.className() == QLatin1String("KopeteDisplayName") )
......
......@@ -24,7 +24,7 @@
#include <dom/html_element.h>
#include <dom/dom2_events.h>
#include <kmenu.h>
#include <QMenu>
#include <kopetemessage.h>
#include <kopete_export.h>
......@@ -35,7 +35,7 @@ namespace Kopete
class ChatSession;
class Contact;
}
class KMenu;
class QMenu;
class ChatWindowStyle;
/**
......@@ -158,7 +158,7 @@ signals:
/**
* Emits before the context menu is about to show
*/
void contextMenuEvent( const QString &textUnderMouse, KMenu *popupMenu );
void contextMenuEvent( const QString &textUnderMouse, QMenu *popupMenu );
/**
* Emits before the tooltip is about to show
......
......@@ -39,7 +39,7 @@
#include <kdebug.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kmenu.h>
#include <QMenu>
#include <kstringhandler.h>
#include <kwindowsystem.h>
#include <kglobalsettings.h>
......@@ -1022,7 +1022,7 @@ void ChatView::dropEvent ( QDropEvent * event )
void ChatView::registerContextMenuHandler( QObject *target, const char* slot )
{
connect( m_messagePart,
SIGNAL(contextMenuEvent(Kopete::Message&,QString,KMenu*)),
SIGNAL(contextMenuEvent(Kopete::Message&,QString,QMenu*)),
target,
slot
);
......
......@@ -43,7 +43,7 @@
#include <klocale.h>
#include <kmenubar.h>
#include <kconfig.h>
#include <kmenu.h>
#include <QMenu>
#include <QIcon>
#include <kiconloader.h>
#include <kdebug.h>
......@@ -331,8 +331,8 @@ void KopeteChatWindow::slotTabContextMenu( QWidget *tab, const QPoint &pos )
{
m_popupView = static_cast<ChatView*>( tab );
KMenu popup;
popup.addTitle( KStringHandler::rsqueeze( m_popupView->caption() ) );
QMenu popup;
popup.addSection( KStringHandler::rsqueeze( m_popupView->caption() ) );
popup.addAction( actionContactMenu );
popup.addSeparator();
popup.addAction( actionTabPlacementMenu );
......@@ -1085,7 +1085,7 @@ void KopeteChatWindow::slotSendFile()
void KopeteChatWindow::slotPrepareContactMenu(void)
{
KMenu *contactsMenu = actionContactMenu->menu();
QMenu *contactsMenu = actionContactMenu->menu();
contactsMenu->clear();
Kopete::ContactPtrList m_them;
......@@ -1102,7 +1102,7 @@ void KopeteChatWindow::slotPrepareContactMenu(void)
foreach(Kopete::Contact *contact, m_them)
{
KMenu *p = contact->popupMenu();
QMenu *p = contact->popupMenu();
connect ( actionContactMenu->menu(), SIGNAL(aboutToHide()),
p, SLOT(deleteLater()) );
......
......@@ -47,7 +47,7 @@
#include <klocale.h>
#include <kmenubar.h>
#include <kmessagebox.h>
#include <kmenu.h>
#include <QMenu>
#include <kpushbutton.h>
#include <ktextedit.h>
#include <kwindowsystem.h>
......
......@@ -25,7 +25,7 @@
#include <kdebug.h>
#include <klocale.h>
#include <kmenubar.h>
#include <kmenu.h>
#include <QMenu>
#include <ktoolbar.h>
#include <kauthorized.h>
#include <QIcon>
......@@ -39,7 +39,7 @@ class KopeteEmoticonAction::KopeteEmoticonActionPrivate
public:
KopeteEmoticonActionPrivate()
{
m_popup = new KMenu(0L);
m_popup = new QMenu(0L);
emoticonSelector = new EmoticonSelector( m_popup );
emoticonSelector->setObjectName( QLatin1String("KopeteEmoticonActionPrivate::emoticonSelector") );
//FIXME do it the kde4 way
......@@ -57,7 +57,7 @@ public:
m_popup = 0;
}
KMenu *m_popup;
QMenu *m_popup;
EmoticonSelector *emoticonSelector;
};
......
......@@ -38,7 +38,7 @@
#include <kmessagebox.h>
#include <QIcon>
#include <QAction>
#include <kmenu.h>
#include <QMenu>
#include <kcolordialog.h>
#include "addaccountwizard.h"
......@@ -623,13 +623,13 @@ void KopeteAccountConfig::configureActions()
void KopeteAccountConfig::configureMenus()
{
// Account management context menu
m_accountContextMenu = new KMenu ( this );
m_accountContextMenu = new QMenu ( this );
m_accountContextMenu->addAction( m_actionAccountModify );
m_accountContextMenu->addAction( m_actionAccountRemove );
m_accountContextMenu->addAction( m_actionAccountSetColor );
// Identity management context menu
m_identityContextMenu = new KMenu ( this );
m_identityContextMenu = new QMenu ( this );
m_identityContextMenu->addAction( m_actionAccountAdd );
m_identityContextMenu->addSeparator();
m_identityContextMenu->addAction( m_actionIdentityModify );
......
......@@ -36,7 +36,7 @@ class Identity;
class KopeteAccountLVI;
class KopeteIdentityLVI;
class KMenu;
class QMenu;
class QAction;
/**
......@@ -67,8 +67,8 @@ private:
void modifyAccount(Kopete::Account *);
void modifyIdentity(Kopete::Identity *);
bool m_protected;
KMenu *m_identityContextMenu;
KMenu *m_accountContextMenu;
QMenu *m_identityContextMenu;
QMenu *m_accountContextMenu;
QAction *m_actionAccountAdd;
QAction *m_actionAccountModify;
......
......@@ -25,6 +25,7 @@
#include <QTextDocument>
#include <QDomDocument>
#include <KUrl>
#include <KDebug>
#include <KMessageBox>
#include <kmessagebox_queued.h>
......
......@@ -25,11 +25,12 @@
#include "kopetecontactlistview.h"
#include <QIcon>
#include <QMenu>
#include <QWidget>
#include <QHeaderView>
#include <QScrollBar>
#include <KDebug>
#include <KMenu>
#include <KStandardAction>
#include <KActionMenu>
#include <KActionCollection>
......@@ -76,7 +77,7 @@ public:
//QRect m_onItem;
// HACK: Used to update the KMEnu title - DarkShock
QMap<KMenu*, QAction*> menuTitleMap;
QMap<QMenu*, QAction*> menuTitleMap;
/* ACTIONS */
QAction *actionSendMessage;
......@@ -195,7 +196,7 @@ void KopeteContactListView::initActions( KActionCollection *ac )
d->actionAddContact = new KActionMenu( QIcon::fromTheme( QLatin1String("list-add-user") ), i18n( "&Add Contact" ), ac );
ac->addAction( "contactAddContact", d->actionAddContact );
d->actionAddContact->menu()->addTitle( i18n("Select Account") );
d->actionAddContact->menu()->setTitle( i18n("Select Account") );
d->actionAddTemporaryContact = new QAction( QIcon::fromTheme("list-add-user"), i18n( "Add to Your Contact List" ), ac );
ac->addAction( "contactAddTemporaryContact", d->actionAddTemporaryContact );
......@@ -585,7 +586,7 @@ void KopeteContactListView::contextMenuEvent( QContextMenuEvent* event )
Kopete::Contact* contact = contactAt( event->pos() );
if ( contact )
{
KMenu *menu = contact->popupMenu();
QMenu *menu = contact->popupMenu();
connect( menu, SIGNAL(aboutToHide()), menu, SLOT(deleteLater()) );
menu->popup( event->globalPos() );
}
......@@ -1032,21 +1033,22 @@ void KopeteContactListView::groupPopup( Kopete::Group *group, const QPoint& pos
if ( group == Kopete::Group::offline() )
return;
KMenu *popup = dynamic_cast<KMenu *>( window->factory()->container( "group_popup", window ) );
QMenu *popup = dynamic_cast<QMenu *>( window->factory()->container( "group_popup", window ) );
if ( popup )
{
QString title = group->displayName();
if ( title.length() > 32 )
title = title.left( 30 ) + QLatin1String( "..." );
// HACK: Used to update the KMenu title -DarkShock
// HACK: Used to update the QMenu title -DarkShock
if( d->menuTitleMap.contains(popup) )
{
QAction *action = d->menuTitleMap[popup];
popup->removeAction( action );
delete action;
}
d->menuTitleMap.insert( popup, popup->addTitle(title, popup->actions().first()) );
//COMPLETE IT : popup->actions().first()->menu()->setTitle(title);
d->menuTitleMap.insert( popup, popup->addSection(title, popup->actions().first()) );
popup->popup( pos );
}
}
......@@ -1062,7 +1064,7 @@ void KopeteContactListView::metaContactPopup( Kopete::MetaContact *metaContact,
return;
}
KMenu *popup = dynamic_cast<KMenu *>( window->factory()->container( "contact_popup", window ) );
QMenu *popup = dynamic_cast<QMenu *>( window->factory()->container( "contact_popup", window ) );
if ( popup )
{
QString title = i18nc( "Translators: format: '<nickname> (<online status>)'", "%1 (%2)",
......@@ -1071,14 +1073,14 @@ void KopeteContactListView::metaContactPopup( Kopete::MetaContact *metaContact,
if ( title.length() > 43 )
title = title.left( 40 ) + QLatin1String( "..." );
// HACK: Used to update the KMenu title -DarkShock
// HACK: Used to update the QMenu title -DarkShock
if( d->menuTitleMap.contains(popup) )
{
QAction *action = d->menuTitleMap[popup];
popup->removeAction( action );
delete action;
}
d->menuTitleMap.insert( popup, popup->addTitle(title, popup->actions().first()) );
d->menuTitleMap.insert( popup, popup->addSection(title, popup->actions().first()) );
// Submenus for separate contact actions
bool sep = false; //FIXME: find if there is already a separator in the end - Olivier
......@@ -1090,7 +1092,7 @@ void KopeteContactListView::metaContactPopup( Kopete::MetaContact *metaContact,
sep = false;
}
KMenu *contactMenu = c->popupMenu();
QMenu *contactMenu = c->popupMenu();
connect( popup, SIGNAL(aboutToHide()), contactMenu, SLOT(deleteLater()) );
QString text = i18nc( "Translators: format: '<displayName> (<id>)'", "%2 <%1>", c->contactId(), c->nickName() );
text=text.replace('&',"&&"); // cf BUG 115449
......@@ -1127,9 +1129,9 @@ void KopeteContactListView::miscPopup( QModelIndexList indexes, const QPoint& po
}
}
KMenu *popup = 0;
QMenu *popup = 0;
if ( onlyMetaContacts )
popup = dynamic_cast<KMenu *>( window->factory()->container( "contactlistitems_popup", window ) );
popup = dynamic_cast<QMenu *>( window->factory()->container( "contactlistitems_popup", window ) );
if ( popup )
popup->popup( pos );
......
......@@ -23,31 +23,32 @@
#include <kdebug.h>
#include <qapplication.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qtabwidget.h>
#include <qcombobox.h>
#include <QApplication>
#include <QCheckBox>
#include <QLabel>
#include <QLayout>
#include <QPushButton>
#include <QRadioButton>
#include <QTabWidget>
#include <QComboBox>
#include <QPixmap>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QBoxLayout>
#include <QSize>
#include <kfiledialog.h>
#include <kicondialog.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <KFileDialog>
#include <KIconDialog>
#include <KIconLoader>
#include <KGlobal>
#include <KLocale>
#include <KUrlRequester>
#include <KStandardDirs>
#include <KMessageBox>
#include <kmessagebox_queued.h>
#include <kurlrequester.h>
#include <kabc/addresseedialog.h>
#include <kabc/stdaddressbook.h>
#include <kabc/addressee.h>
#include <kstandarddirs.h>
#include "kabcpersistence.h"
#include "kopeteaddrbookexport.h"
......
......@@ -22,7 +22,7 @@
#include "addaccountwizard.h"
#include <QIcon>
#include <KMenu>
#include <QMenu>
#include <KActionMenu>
#include <QTimeLine>
#include <QToolTip>
......
......@@ -20,7 +20,7 @@
#include <QMouseEvent>
#include <QMovie>
#include <KMenu>
#include <QMenu>
#include <KActionMenu>
#include <KGlobal>
#include <KDebug>
......
......@@ -22,7 +22,7 @@
#include <kopetestatusrootaction.h>
#include <kactionmenu.h>
#include <KMenu>
#include <QMenu>
KopeteIdentityStatusBarIcon::KopeteIdentityStatusBarIcon( Kopete::Identity *identity, QWidget *parent )
: QLabel( parent )
......
......@@ -50,7 +50,7 @@
#include <kiconloader.h>
#include <kmessagebox.h>
#include <knotifyconfigwidget.h>
#include <kmenu.h>
#include <QMenu>
#include <kshortcutsdialog.h>
#include <kedittoolbar.h>
#include <kmenubar.h>
......@@ -557,8 +557,8 @@ void KopeteWindow::initSystray()
if ( Kopete::BehaviorSettings::self()->showSystemTray() ) {
d->tray = KopeteSystemTray::systemTray ( this );
QObject::connect ( d->tray, SIGNAL (aboutToShowMenu(KMenu*)),
this, SLOT (slotTrayAboutToShowMenu(KMenu*)) );
QObject::connect ( d->tray, SIGNAL (aboutToShowMenu(QMenu*)),
this, SLOT (slotTrayAboutToShowMenu(QMenu*)) );
// :FIXME: The signal quitSelected does not exist on KopeteSystemTray
// QObject::connect ( d->tray, SIGNAL (quitSelected()), this, SLOT (slotQuit()) );
}
......@@ -1258,7 +1258,7 @@ void KopeteWindow::slotAccountUnregistered ( const Kopete::Account *account )
}
}
void KopeteWindow::slotTrayAboutToShowMenu ( KMenu * popup )
void KopeteWindow::slotTrayAboutToShowMenu ( QMenu * popup )
{
KActionCollection *actionCollection = d->tray->actionCollection();
......@@ -1366,9 +1366,9 @@ void KopeteWindow::globalStatusChanged()
void KopeteWindow::slotGlobalStatusMessageIconClicked ( const QPoint &position )
{
KMenu *menu = new KMenu ( this );
QMenu *menu = new QMenu ( this );
menu->addTitle ( i18n ( "Status Message" ) );
menu->addSection ( i18n ( "Status Message" ) );
Kopete::UI::StatusEditAction* statusEditAction = new Kopete::UI::StatusEditAction ( this );
statusEditAction->setStatusMessage ( Kopete::StatusManager::self()->globalStatusMessage() );
......
......@@ -30,7 +30,7 @@ class QCloseEvent;
class QEvent;
class QShowEvent;
class KMenu;
class QMenu;
namespace Kopete
{
......@@ -164,7 +164,7 @@ private slots:
*/
void slotAccountUnregistered( const Kopete::Account *account );
void slotTrayAboutToShowMenu(KMenu *);
void slotTrayAboutToShowMenu(QMenu *);
/**
* Show the Add Contact wizard
......
......@@ -15,7 +15,7 @@
*/
#include "kopetestatusrootaction.h"
#include <KMenu>
#include <QMenu>
#include <KCMultiDialog>
#include <kopeteonlinestatusmanager.h>
......
......@@ -24,7 +24,7 @@
#include <kaboutdata.h>
#include <kactioncollection.h>
#include <QAction>
#include <kmenu.h>
#include <QMenu>
#include <klocale.h>
#include <kdebug.h>
#include "kopetechatsessionmanager.h"
......@@ -97,7 +97,7 @@ KopeteSystemTray::~KopeteSystemTray()
void KopeteSystemTray::slotAboutToShowMenu()
{
emit aboutToShowMenu(qobject_cast<KMenu *>(contextMenu()));
emit aboutToShowMenu(qobject_cast<QMenu *>(contextMenu()));
}
void KopeteSystemTray::activate(const QPoint &pos)
......@@ -113,7 +113,7 @@ void KopeteSystemTray::activate(const QPoint &pos)
}
}
// void KopeteSystemTray::contextMenuAboutToShow( KMenu *me )
// void KopeteSystemTray::contextMenuAboutToShow( QMenu *me )
// {
// //kDebug(14010) << "Called.";
// emit aboutToShowMenu( me );
......
......@@ -25,7 +25,7 @@
#include "kopetemessageevent.h"
class QTimer;
class KMenu;
class QMenu;
/**
* @author Nick Betcher <nbetcher@kde.org>
......@@ -53,7 +53,7 @@ public:
bool isBlinking() const;
Q_SIGNALS:
void aboutToShowMenu(KMenu *am);
void aboutToShowMenu(QMenu *am);
private Q_SLOTS:
void slotAboutToShowMenu();
......
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