[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdevelop/vcs/cvsservice
From:       John Tapsell <john.tapsell () kdemail ! net>
Date:       2005-03-25 14:45:32
Message-ID: 20050325144532.CD3E048F () office ! kde ! org
[Download RAW message or body]

CVS commit by johnflux: 

Improve the "Show difference between revisions" dialog by showing what the current
revision is.


  M +4 -1      cvspartimpl.cpp   1.38
  M +18 -1     diffdialog.cpp   1.5
  M +5 -1      diffdialog.h   1.4


--- kdevelop/vcs/cvsservice/cvspartimpl.cpp  #1.37:1.38
@@ -594,5 +594,8 @@ void CvsServicePartImpl::diff( const KUR
         return;
 
-    DiffDialog dlg;
+    CVSDir cvsdir = CVSDir( urlList[0].directory() );
+    CVSEntry entry = cvsdir.fileStatus( urlList[0].fileName() );
+
+    DiffDialog dlg(entry);
     if (dlg.exec() != QDialog::Accepted)
         return;

--- kdevelop/vcs/cvsservice/diffdialog.cpp  #1.4:1.5
@@ -14,4 +14,6 @@
 
 #include "diffdialog.h"
+#include <klocale.h>
+#include <qbuttongroup.h>
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -19,7 +21,13 @@
 ///////////////////////////////////////////////////////////////////////////////
 
-DiffDialog::DiffDialog( QWidget *parent, const char *name, WFlags f )
+DiffDialog::DiffDialog( const CVSEntry &entry, QWidget *parent, const char *name, WFlags f )
     : DiffDialogBase( parent, name, true, f)
 {
+    m_entry = entry;
+    QString currentRevision = entry.revision();
+    revaEdit->setText(currentRevision);
+    revbEdit->setText(currentRevision);
+    revOtherEdit->setText(currentRevision);
+    languageChange();
 }
 
@@ -68,3 +76,12 @@ QString DiffDialog::revB() const
 }
 
+///////////////////////////////////////////////////////////////////////////////
+
+void DiffDialog::languageChange() {
+    DiffDialogBase::languageChange();
+    //buttonGroup1->setTitle( tr2i18n( "Build Difference Between" ) );
+    if(!m_entry.revision().isNull())
+      diffLocalHeadRadio->setText( tr2i18n( "Local copy and &HEAD (%1)" ).arg( m_entry.revision()) );
+}
+
 #include "diffdialog.moc"

--- kdevelop/vcs/cvsservice/diffdialog.h  #1.3:1.4
@@ -14,4 +14,5 @@
 
 #include "diffdialogbase.h"
+#include "cvsentry.h"
 
 /**
@@ -24,5 +25,5 @@ class DiffDialog : public DiffDialogBase
     Q_OBJECT
 public:
-    DiffDialog( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
+    DiffDialog(const CVSEntry &entry, QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
     virtual ~DiffDialog();
 
@@ -34,4 +35,7 @@ private:
 
     DiffType requestedDiff() const;
+    CVSEntry m_entry;
+protected slots:
+    virtual void languageChange();
 };
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic