summaryrefslogtreecommitdiffstats
path: root/vcs/subversion/svn_copywidget.cpp
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/subversion/svn_copywidget.cpp
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/subversion/svn_copywidget.cpp')
-rw-r--r--vcs/subversion/svn_copywidget.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/vcs/subversion/svn_copywidget.cpp b/vcs/subversion/svn_copywidget.cpp
new file mode 100644
index 00000000..a5d74bcb
--- /dev/null
+++ b/vcs/subversion/svn_copywidget.cpp
@@ -0,0 +1,75 @@
+#include "svn_copywidget.h"
+#include <klineedit.h>
+#include <kurl.h>
+#include "subversion_global.h"
+#include <kurlrequester.h>
+#include <knuminput.h>
+#include <kcombobox.h>
+#include <qradiobutton.h>
+
+SvnCopyDialog::SvnCopyDialog( const QString &reqPath, SvnGlobal::SvnInfoHolder *holder, QWidget *parent )
+ : SvnCopyDialogBase( parent )
+ , m_holder(holder)
+{
+ reqEdit->setText( reqPath );
+
+ connect( urlRadio, SIGNAL(clicked()), this, SLOT(setSourceAsUrl()) );
+ connect( pathRadio, SIGNAL(clicked()), this, SLOT(setSourceAsLocalPath()) );
+ connect( revnumRadio, SIGNAL(toggled(bool)), revnumInput, SLOT(setEnabled(bool)) );
+ connect( revnumRadio, SIGNAL(toggled(bool)), revkindCombo, SLOT(setDisabled(bool)) );
+
+ // In many cases, users copy from reository to repository. This is for making tag/branche.
+ // The case where copying from local path to repository may be lesser than the above one.
+ // Thus, by default retrieve the repository URL of the given local path
+ urlRadio->setChecked( true );
+ srcEdit->setText( m_holder->url.prettyURL() );
+ // Also, revision is set to HEAD by default
+ revkindRadio->setChecked( true );
+ revkindCombo->insertItem( "HEAD" );
+}
+
+SvnCopyDialog::~SvnCopyDialog()
+{
+}
+
+KURL SvnCopyDialog::sourceUrl()
+{
+ return KURL( srcEdit->text() );
+}
+
+int SvnCopyDialog::revision()
+{
+ if( revnumRadio->isChecked() )
+ return revnumInput->value();
+ else
+ return -1;
+}
+
+QString SvnCopyDialog::revKind()
+{
+ if( revkindRadio->isChecked() )
+ return revkindCombo->currentText();
+ else
+ return QString("");
+}
+
+KURL SvnCopyDialog::destUrl()
+{
+ return KURL( destRequester->url() );
+}
+
+void SvnCopyDialog::setSourceAsUrl()
+{
+ srcEdit->setText( m_holder->url.prettyURL() );
+ revkindCombo->clear();
+ revkindCombo->insertItem( "HEAD" );
+}
+
+void SvnCopyDialog::setSourceAsLocalPath()
+{
+ srcEdit->setText( reqEdit->text() );
+ revkindCombo->clear();
+ revkindCombo->insertItem( "WORKING" );
+}
+
+#include "svn_copywidget.moc"