summaryrefslogtreecommitdiffstats
path: root/vcs/subversion/svn_switchwidget.cpp
blob: 97744b0663f7e1ff61bf1250ca5af5ac833fc379 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <kurl.h>
#include <klineedit.h>
#include <tqcheckbox.h>
#include <tqradiobutton.h>

#include "svn_switchwidget.h"
#include "subversion_global.h"

SvnSwitchDlg::SvnSwitchDlg( const SvnGlobal::SvnInfoHolder *holder,
							const TQString &wcPath, TQWidget *tqparent )
	: SvnSwitchDlgBase( tqparent )
	, m_info( holder )
{
	connect( switchOnlyRadio, TQT_SIGNAL(clicked()), this, TQT_SLOT(resetCurrentRepositoryUrlEdit()) );
	connect( relocationRadio , TQT_SIGNAL(clicked()), this, TQT_SLOT(resetCurrentRepositoryUrlEdit()) );
	// set switch only
	switchOnlyRadio->setChecked( true );
	wcUrlEdit->setText( wcPath );
	currentUrlEdit->setText( m_info->url.prettyURL() );
}

SvnSwitchDlg::~SvnSwitchDlg()
{}

const TQString SvnSwitchDlg::currentUrl()
{
	return currentUrlEdit->text();
}
const TQString SvnSwitchDlg::destUrl()
{
	return destUrlEdit->text();
}

bool SvnSwitchDlg::recursive()
{
	return (! nonRecurseCheck->isChecked() );
}
bool SvnSwitchDlg::switchOnly()
{
	return switchOnlyRadio->isChecked();
}
bool SvnSwitchDlg::relocation()
{
	return relocationRadio->isChecked();
}

void SvnSwitchDlg::resetCurrentRepositoryUrlEdit()
{
	if( relocation() ){
		// only ROOT repository url should be given
		currentUrlEdit->setText( m_info->reposRootUrl.prettyURL() );
	} else if( switchOnly() ){
		// the full URL of item should be given
		currentUrlEdit->setText( m_info->url.prettyURL() );
	} else{
		// should not reach here!!
	}
}

#include "svn_switchwidget.moc"