From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- vcs/cvsservice/cvslogdialog.cpp | 113 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 vcs/cvsservice/cvslogdialog.cpp (limited to 'vcs/cvsservice/cvslogdialog.cpp') diff --git a/vcs/cvsservice/cvslogdialog.cpp b/vcs/cvsservice/cvslogdialog.cpp new file mode 100644 index 00000000..ac6fd97c --- /dev/null +++ b/vcs/cvsservice/cvslogdialog.cpp @@ -0,0 +1,113 @@ +/*************************************************************************** + * Copyright (C) 200?-2003 by KDevelop Authors * + * www.kdevelop.org * + * * + * 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. * + * * + ***************************************************************************/ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "cvsoptions.h" +#include "cvslogpage.h" +#include "cvsdiffpage.h" + +#include "cvslogdialog.h" + +/////////////////////////////////////////////////////////////////////////////// +// class CVSLogDialog +/////////////////////////////////////////////////////////////////////////////// + +CVSLogDialog::CVSLogDialog( CvsService_stub *cvsService, QWidget *parent, const char *name, int ) + : KDialogBase( Tabbed, i18n("CVS Log & Diff Dialog"), Close, Close, + parent, name? name : "logformdialog", false /*modal*/, true /*separator*/ ), + m_cvsLogPage( 0 ), m_cvsService( cvsService ) +{ + setWFlags( getWFlags() | WDestructiveClose ); + + QVBox *vbox = addVBoxPage( i18n("Log From CVS") ); + m_cvsLogPage = new CVSLogPage( m_cvsService, vbox ); + + connect( m_cvsLogPage, SIGNAL(diffRequested(const QString&, const QString&, const QString&)), + this, SLOT(slotDiffRequested(const QString&, const QString&, const QString&)) ); +} + +/////////////////////////////////////////////////////////////////////////////// + +CVSLogDialog::~CVSLogDialog() +{ + kdDebug(9006) << "CVSLogDialog::~CVSLogDialog()" << endl; +} + +/////////////////////////////////////////////////////////////////////////////// + +void CVSLogDialog::startLog( const QString &workDir, const QString &pathName ) +{ + kdDebug(9006) << "CVSLogDialog::start() here! workDir = " << workDir << + ", pathName = " << pathName << endl; + +// displayActionFeedback( true ); +/* + QVBox *vbox = addVBoxPage( i18n("Log From CVS: ") + pathName ); + m_cvsLogPage = new CVSLogPage( m_cvsService, vbox ); + this->resize( m_cvsLogPage->size() ); + + connect( m_cvsLogPage, SIGNAL(linkClicked(const QString&, const QString&)), + this, SLOT(slotDiffRequested(const QString&, const QString&)) ); +*/ + m_cvsLogPage->startLog( workDir, pathName ); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CVSLogDialog::slotDiffRequested( const QString &pathName, const QString &revA, const QString &revB ) +{ + kdDebug(9006) << "CVSLogDialog::slotDiffRequested()" << endl; + + // Create a new CVSDiffPage and start diffing process + QString diffTitle = i18n("Diff between %1 and %2").arg( revA ).arg( revB ); + QVBox *vbox = addVBoxPage( diffTitle ); + CVSDiffPage *diffPage = new CVSDiffPage( m_cvsService, vbox ); + diffPage->startDiff( pathName, revA, revB ); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CVSLogDialog::slotCancel() +{ + // Hmmm ... + + KDialogBase::slotCancel(); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CVSLogDialog::displayActionFeedback( bool working ) +{ + if (working) + { + setCursor( KCursor::waitCursor() ); + } + else + { + setCursor( KCursor::arrowCursor() ); + } +} + +#include "cvslogdialog.moc" + + -- cgit v1.2.1