X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fqtui%2Fchatscene.cpp;h=dc0abf1013aeeefc4e9e5e52687f4ccd9a577018;hb=a7f69cdd5a7ddd31fc461bc41f2320ba3e3e4738;hp=631e10de712719d141cd8c58e56d924c1adbba34;hpb=5b686746c880e5cda6d5de3e08180ea4332ff222;p=quassel.git diff --git a/src/qtui/chatscene.cpp b/src/qtui/chatscene.cpp index 631e10de..dc0abf10 100644 --- a/src/qtui/chatscene.cpp +++ b/src/qtui/chatscene.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2012 by the Quassel Project * + * Copyright (C) 2005-2013 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -799,11 +799,6 @@ void ChatScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) chatView()->addActionsToMenu(&menu, pos); menu.addSeparator(); - if (isPosOverSelection(pos)) - menu.addAction(SmallIcon("edit-copy"), tr("Copy Selection"), - this, SLOT(selectionToClipboard()), - QKeySequence::Copy); - // item-specific options (select link etc) ChatItem *item = chatItemAt(pos); if (item) @@ -812,6 +807,13 @@ void ChatScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) // no item -> default scene actions GraphicalUi::contextMenuActionProvider()->addActions(&menu, filter(), BufferId()); + // If we have text selected, insert the Copy Selection as first item + if (isPosOverSelection(pos)) { + QAction *act = new Action(SmallIcon("edit-copy"), tr("Copy Selection"), &menu, this, + SLOT(selectionToClipboard()), QKeySequence::Copy); + menu.insertAction(menu.actions().at(0), act); + } + if (QtUi::mainWindow()->menuBar()->isHidden()) menu.addAction(QtUi::actionCollection("General")->action("ToggleMenuBar"));