Bug 245179 - [Usability] Tab context menu doesn't always have "Close Tab" as lowest entry
Summary: [Usability] Tab context menu doesn't always have "Close Tab" as lowest entry
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: 1.3.1
Platform: Fedora RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-19 23:33 UTC by Jonas Thiem
Modified: 2010-07-20 10:56 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Thiem 2010-07-19 23:33:52 UTC
Version:           1.3.1 (using Devel) 
OS:                Linux

The "Rejoin Channel" entry of the tab context menu appears below the "Close Tab" entry which is usually the bottom most one. At least once I accidentially clicked this after getting kicked from a channel instead of the "Close Tab" entry when I attempted to close the channel tab.

Suggested change: Make "Rejoin Channel" appear above the "Close Tab" context menu entry

Reproducible: Always




KDE version is 4.4.5
Comment 1 Eike Hein 2010-07-20 10:56:45 UTC
commit 990ddadf57dc2d4d2422dfc1fb1ec1b576c0cf5b
Author: Eike Hein <hein@kde.org>
Date:   Tue Jul 20 10:56:29 2010 +0200

    Move "Rejoin Channel" action above "Close Tab".
    
    BUG:245179

diff --git a/ChangeLog b/ChangeLog
index c953701..eef26c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@ Changes since 1.3.1:
 * Added support for UnrealIRCd's 671 numeric.
 * Ignore network up/down notifications for localhost connections.
 * Fix WolframAlpha urls.
+* The "Rejoin Channel" context menu action, shown when a channel could not
+  be rejoined automatically on reconnect as well as after having been kicked
+  from a channel, will now appear above the "Close Tab" action rather than
+  at the end of the context menu, so "Close Tab" is always the last item.
 
 Changes from 1.3 to 1.3.1:
 Konversation 1.3.1 is a maintenance release that improves program behavior
diff --git a/src/viewer/viewcontainer.cpp b/src/viewer/viewcontainer.cpp
index 208956b..b74cd66 100644
--- a/src/viewer/viewcontainer.cpp
+++ b/src/viewer/viewcontainer.cpp
@@ -1745,6 +1745,7 @@ void ViewContainer::showViewContextMenu(QWidget* tab, const QPoint& pos)
     ChatWindow* view = static_cast<ChatWindow*>(tab);
     KToggleAction* autoJoinAction = qobject_cast<KToggleAction*>(actionCollection()->action("tab_autojoin"));
     QAction* rejoinAction = actionCollection()->action("rejoin_channel");
+    QAction* closeAction = actionCollection()->action("close_tab");
 
     QAction* renameAct = new QAction(this);
     renameAct->setText(i18n("&Rename Tab..."));
@@ -1765,7 +1766,7 @@ void ViewContainer::showViewContextMenu(QWidget* tab, const QPoint& pos)
             Channel *channel = static_cast<Channel*>(view);
             if (channel->rejoinable() && rejoinAction)
             {
-                menu->addAction(rejoinAction);
+                menu->insertAction(closeAction, rejoinAction);
                 rejoinAction->setEnabled(true);
             }
         }