KDevelop API Documentation

cvslogdialog.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 200?-2003 by KDevelop Authors                           *
00003  *   www.kdevelop.org                                                      *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00012 #include <qvbox.h>
00013 #include <qregexp.h>
00014 #include <qdir.h>
00015 #include <qstringlist.h>
00016 
00017 #include <kmessagebox.h>
00018 #include <kcursor.h>
00019 #include <klocale.h>
00020 #include <kdebug.h>
00021 
00022 #include <cvsjob_stub.h>
00023 #include <cvsservice_stub.h>
00024 
00025 #include "cvsoptions.h"
00026 #include "cvslogpage.h"
00027 #include "cvsdiffpage.h"
00028 
00029 #include "cvslogdialog.h"
00030 
00032 // class CVSLogDialog
00034 
00035 CVSLogDialog::CVSLogDialog( CvsService_stub *cvsService, QWidget *parent, const char *name, int )
00036     : KDialogBase( Tabbed, i18n("CVS Log & Diff Dialog"), Close, Close,
00037     parent, name? name : "logformdialog", false /*modal*/, true /*separator*/ ),
00038     m_cvsLogPage( 0 ), m_cvsService( cvsService )
00039 {
00040     setWFlags( getWFlags() | WDestructiveClose );
00041 
00042     QVBox *vbox = addVBoxPage( i18n("Log From CVS") );
00043     m_cvsLogPage = new CVSLogPage( m_cvsService, vbox );
00044 
00045     connect( m_cvsLogPage, SIGNAL(diffRequested(const QString&, const QString&, const QString&)),
00046         this, SLOT(slotDiffRequested(const QString&, const QString&, const QString&)) );
00047 }
00048 
00050 
00051 CVSLogDialog::~CVSLogDialog()
00052 {
00053     kdDebug(9006) << "CVSLogDialog::~CVSLogDialog()" << endl;
00054 }
00055 
00057 
00058 void CVSLogDialog::startLog( const QString &workDir, const QString &pathName )
00059 {
00060     kdDebug(9006) << "CVSLogDialog::start() here! workDir = " << workDir <<
00061         ", pathName = " << pathName << endl;
00062 
00063 //    displayActionFeedback( true );
00064 /*
00065     QVBox *vbox = addVBoxPage( i18n("Log From CVS: ") + pathName );
00066     m_cvsLogPage = new CVSLogPage( m_cvsService, vbox );
00067     this->resize( m_cvsLogPage->size() );
00068 
00069     connect( m_cvsLogPage, SIGNAL(linkClicked(const QString&, const QString&)),
00070         this, SLOT(slotDiffRequested(const QString&, const QString&)) );
00071 */
00072     m_cvsLogPage->startLog( workDir, pathName );
00073 }
00074 
00076 
00077 void CVSLogDialog::slotDiffRequested( const QString &pathName, const QString &revA, const QString &revB )
00078 {
00079     kdDebug(9006) << "CVSLogDialog::slotDiffRequested()" << endl;
00080 
00081     // Create a new CVSDiffPage and start diffing process
00082     QString diffTitle =  i18n("Diff between %1 and %2").arg( revA ).arg( revB );
00083     QVBox *vbox = addVBoxPage( diffTitle );
00084     CVSDiffPage *diffPage = new CVSDiffPage( m_cvsService, vbox );
00085     diffPage->startDiff( pathName, revA, revB );
00086 }
00087 
00089 
00090 void CVSLogDialog::slotCancel()
00091 {
00092     // Hmmm ...
00093 
00094     KDialogBase::slotCancel();
00095 }
00096 
00098 
00099 void CVSLogDialog::displayActionFeedback( bool working )
00100 {
00101     if (working)
00102     {
00103         setCursor( KCursor::waitCursor() );
00104     }
00105     else
00106     {
00107         setCursor( KCursor::arrowCursor() );
00108     }
00109 }
00110 
00111 #include "cvslogdialog.moc"
00112 
00113 
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:03:59 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003