summaryrefslogtreecommitdiffstats
path: root/vcs/cvsservice/annotatepage.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /vcs/cvsservice/annotatepage.h
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'vcs/cvsservice/annotatepage.h')
-rw-r--r--vcs/cvsservice/annotatepage.h125
1 files changed, 125 insertions, 0 deletions
diff --git a/vcs/cvsservice/annotatepage.h b/vcs/cvsservice/annotatepage.h
new file mode 100644
index 00000000..2a062804
--- /dev/null
+++ b/vcs/cvsservice/annotatepage.h
@@ -0,0 +1,125 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Robert Gruber *
+ * rgruber@users.sourceforge.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef ANNOTATEPAGE_H
+#define ANNOTATEPAGE_H
+
+#include "cvsservicedcopIface.h"
+#include <qwidget.h>
+#include <qmap.h>
+#include <qlistview.h>
+
+class CvsJob_stub;
+class CvsService_stub;
+class QTextBrowser;
+class AnnotateView;
+class QStringList;
+class KLineEdit;
+class KPushButton;
+
+/**
+ * Implementation for the page displaying 'cvs annotate' output.
+ * To the top of the page the user can enter a revision and request
+ * a annotate run for it.
+ * The main widget of a page is the AnnotateView. It holds the output
+ * of the cvs annotate job. See there for further detail.
+ *
+ * @author Robert Gruber <rgruber@users.sourceforge.net>
+ */
+class AnnotatePage : public QWidget, virtual public CVSServiceDCOPIface
+{
+ Q_OBJECT
+
+ friend class AnnotateDialog;
+ friend class AnnotateView;
+
+public:
+ AnnotatePage( CvsService_stub *cvsService, QWidget *parent=0, const char *name=0, int flags=0 );
+ virtual ~AnnotatePage();
+
+ /**
+ * Call cvs annotate for the given file and revistion.
+ * @param pathName The filename to annotate
+ * @param revision The CVS revision number
+ */
+ void startAnnotate( const QString pathName, const QString revision="" );
+
+ /**
+ * Cancels the current operation if any
+ */
+ void cancel();
+
+signals:
+ /**
+ * This signal is ment to be emitted by the nested AnnotateView.
+ * The dialog that holds this page catches it in order to create
+ * a new page with the annotate output for the given revision.
+ * @param rev The revision for which a new annotate run is requested
+ */
+ void requestAnnotate(const QString rev);
+
+private slots:
+ // DCOP Iface
+ virtual void slotJobExited( bool normalExit, int exitStatus );
+ virtual void slotReceivedOutput( QString someOutput );
+ virtual void slotReceivedErrors( QString someErrors );
+
+ /**
+ * This slot is connected to the button next to m_leRevision.
+ * It clears the AnnotateView and reruns cvs annotate with the
+ * revision the user entered into m_leRevision
+ */
+ void slotNewAnnotate();
+
+private:
+ /**
+ * This method is executed after the cvs annotate job finished.
+ * It parses the output and passes it to the AnnotateView
+ */
+ void parseAnnotateOutput(QStringList& lines);
+
+
+ /**
+ * This is the output buffer for the cvs annotate job.
+ * Everytime slotReceivedOutput() is called by dcop
+ * we append the gained data to this buffer.
+ */
+ QString m_output;
+ /**
+ * This is the AnnotateView. It gets nested into this page.
+ */
+ AnnotateView *m_annotateView;
+ /**
+ * The file for which this page holds the annotate output.
+ */
+ QString m_pathName;
+ /**
+ * Maps the checkin comments to revision numbers
+ */
+ QMap<QString, QString> m_comments;
+
+ /**
+ * With this KLineEdit and the KPushButton next to it
+ * the user can rerun cvs annotate for any revision he
+ * enters into this KLineEdit.
+ */
+ KLineEdit *m_leRevision;
+ /**
+ * With this KPushButton the user can rerun cvs annotate
+ * for the revision he entered into m_leRevision
+ */
+ KPushButton *m_btnAnnotate;
+
+ CvsService_stub *m_cvsService;
+ CvsJob_stub *m_cvsAnnotateJob;
+};
+
+#endif