Bug 59267 - Add "clear" command in CVS console area in main window
Summary: Add "clear" command in CVS console area in main window
Status: RESOLVED FIXED
Alias: None
Product: cervisia
Classification: Applications
Component: general (show other bugs)
Version: 2.0
Platform: RedHat Enterprise Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Christian Loose
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-02 23:32 UTC by greendeath
Modified: 2003-06-03 21:35 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 greendeath 2003-06-02 23:32:52 UTC
Version:           2.0 (using KDE KDE 3.1)
Installed from:    RedHat RPMs
OS:          Linux

This command must clear console area in main window. Very useful for repeative checkouts when user want to see CVS messages only from last command.

This command existed in older version (1.4.1).
Comment 1 Christian Loose 2003-06-03 21:35:15 UTC
Subject: KDE_3_1_BRANCH: kdesdk/cervisia

CVS commit by cloose: 

Backport fix for BR #59267:
* Re-added "clear" command to the RMB context menu 
   of the ProtocolView.
* Removed non functional methods that were supposed
   to handle the RMB context menu from ProtocolView
   source.

CCMAIL: 59267-done@bugs.kde.org


  M +8 -0      ChangeLog   1.22.2.8
  M +15 -37    protocolview.cpp   1.7.2.3
  M +7 -6      protocolview.h   1.6.2.1


--- kdesdk/cervisia/ChangeLog  #1.22.2.7:1.22.2.8
@@ -1,2 +1,10 @@
+2003-06-03  Christian Loose <christian.loose@hamburg.de>
+
+        * Fix BR #59267: Re-added "clear" command to the
+          RMB context menu of the ProtocolView
+        * Removed non functional methods that were supposed
+          to handle the RMB context menu from ProtocolView
+          source.
+
 2003-02-28  Christian Loose <christian.loose@hamburg.de>
 

--- kdesdk/cervisia/protocolview.cpp  #1.7.2.2:1.7.2.3
@@ -98,4 +98,17 @@ bool ProtocolView::startJob(const QStrin
 
 
+QPopupMenu* ProtocolView::createPopupMenu(const QPoint &pos)
+{
+    QPopupMenu* menu = QTextEdit::createPopupMenu(pos);
+
+    int id = menu->insertItem(i18n("Clear"), this, SLOT( clear() ), 0, -1, 0);
+
+    if( text().isEmpty() )
+        menu->setItemEnabled(id, false);
+
+    return menu;
+}
+
+
 void ProtocolView::cancelJob()
 {
@@ -170,39 +183,4 @@ void ProtocolView::appendLine(const QStr
 }
 
-
-void ProtocolView::execContextMenu(const QPoint &p)
-{
-    QPopupMenu *popup = new QPopupMenu(this);
-    int clearId = popup->insertItem(i18n("Clear"));
-    int selallId = popup->insertItem(i18n("Select All"));
-    
-    int res = popup->exec(p);
-    if (res == clearId)
-        clear();
-    else if (res == selallId)
-        selectAll();
-    
-    delete popup;
-}
-
-
-void ProtocolView::mousePressEvent(QMouseEvent *e)
-{
-    if (e->button() == RightButton)
-        execContextMenu(e->globalPos());
-    else
-        QTextEdit::mousePressEvent(e);
-}
-
-
-void ProtocolView::keyPressEvent(QKeyEvent *e)
-{
-    if (e->key() == KGlobalSettings::contextMenuKey())
-        execContextMenu(mapToGlobal(QPoint(10, 10)));
-    else if (e->key() == Key_Tab)
-        QTextEdit::focusNextPrevChild(true);
-    else
-        QTextEdit::keyPressEvent(e);
-}
 
 #include "protocolview.moc"

--- kdesdk/cervisia/protocolview.h  #1.6:1.6.2.1
@@ -19,4 +19,7 @@
 #include <kprocess.h>
 
+class QPoint;
+class QPopupMenu;
+
 
 class ProtocolView : public QTextEdit
@@ -35,6 +38,5 @@ signals:
 
 protected:
-    void mousePressEvent(QMouseEvent *e);
-    void keyPressEvent(QKeyEvent *e);
+    virtual QPopupMenu* createPopupMenu(const QPoint &pos);
     
 private slots:
@@ -46,5 +48,4 @@ private:
     void processOutput();
     void appendLine(const QString &line);
-    void execContextMenu(const QPoint &pos);
     
     KShellProcess *childproc;