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/cvsoptionswidget.cpp | 190 ++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 vcs/cvsservice/cvsoptionswidget.cpp (limited to 'vcs/cvsservice/cvsoptionswidget.cpp') diff --git a/vcs/cvsservice/cvsoptionswidget.cpp b/vcs/cvsservice/cvsoptionswidget.cpp new file mode 100644 index 00000000..aa7a98c1 --- /dev/null +++ b/vcs/cvsservice/cvsoptionswidget.cpp @@ -0,0 +1,190 @@ +/*************************************************************************** + * Copyright (C) 2003 by KDevelop Authors * + * kdevelop-devel@kde.org * + * Copyright (C) 2003 by Mario Scalas * + * mario.scalas@libero.it * + * * + * 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 "domutil.h" +#include "cvsoptions.h" +#include "cvsoptionswidget.h" + +/////////////////////////////////////////////////////////////////////////////// +// class DiffDialog +/////////////////////////////////////////////////////////////////////////////// + +CvsOptionsWidget::CvsOptionsWidget( QWidget *parent, const char *name ) + : CvsOptionsWidgetBase( parent, name ) +{ + readConfig(); +} + +/////////////////////////////////////////////////////////////////////////////// + +CvsOptionsWidget::~CvsOptionsWidget() +{ +} + +/////////////////////////////////////////////////////////////////////////////// + +void CvsOptionsWidget::readConfig() +{ + CvsOptions *options = CvsOptions::instance(); + + this->setCvsRshEnvVar( options->cvsRshEnvVar() ); + this->setServerLocation( options->location() ); + this->setPruneEmptyDirWhenUpdating( options->pruneEmptyDirsWhenUpdate() ); + this->setCreateNewDirWhenUpdating( options->createDirsWhenUpdate() ); + this->setRecursiveWhenUpdating( options->recursiveWhenUpdate() ); + this->setRecursiveWhenCommittingRemoving( options->recursiveWhenCommitRemove() ); + this->setDiffOptions( options->diffOptions() ); + this->setContextLines( options->contextLines() ); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CvsOptionsWidget::storeConfig() +{ + CvsOptions *options = CvsOptions::instance(); + + options->setCvsRshEnvVar( this->cvsRshEnvVar().stripWhiteSpace() ); + options->setLocation( this->serverLocation().stripWhiteSpace() ); + options->setPruneEmptyDirsWhenUpdate( this->pruneEmptyDirWhenUpdating() ); + options->setCreateDirsWhenUpdate( this->createNewDirWhenUpdating() ); + options->setRecursiveWhenUpdate( this->recursiveWhenUpdating() ); + options->setRecursiveWhenCommitRemove( this->recursiveWhenCommittingRemoving() ); + options->setDiffOptions( this->diffOptions().stripWhiteSpace() ); + options->setContextLines( this->contextLines() ); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CvsOptionsWidget::accept() { + storeConfig(); +// emit configChange(); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CvsOptionsWidget::setPruneEmptyDirWhenUpdating( bool b ) +{ + this->pruneEmptyDirWhenUpdateCheck->setChecked( b ); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CvsOptionsWidget::setCreateNewDirWhenUpdating( bool b ) +{ + this->createNewDirWhenUpdateCheck->setChecked( b ); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CvsOptionsWidget::setRecursiveWhenUpdating( bool b ) +{ + this->recursiveWhenUpdateCheck->setChecked( b ); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CvsOptionsWidget::setRecursiveWhenCommittingRemoving( bool b ) +{ + this->recursiveWhenCommitRemoveCheck->setChecked( b ); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CvsOptionsWidget::setContextLines( unsigned int p ) +{ + this->contextLinesInput->setValue( p ); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CvsOptionsWidget::setDiffOptions( const QString &p ) +{ + this->diffOptionsEdit->setText( p ); +} + +/////////////////////////////////////////////////////////////////////////////// + +QString CvsOptionsWidget::diffOptions() const +{ + return this->diffOptionsEdit->text(); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CvsOptionsWidget::setCvsRshEnvVar( const QString &p ) +{ + this->cvsRshEnvVarEdit->setText( p ); +} + +/////////////////////////////////////////////////////////////////////////////// + +void CvsOptionsWidget::setServerLocation( const QString &p ) +{ + this->serverLocationEdit->setText( p ); +} + +/////////////////////////////////////////////////////////////////////////////// + +bool CvsOptionsWidget::pruneEmptyDirWhenUpdating() const +{ + return pruneEmptyDirWhenUpdateCheck->isChecked(); +} + +/////////////////////////////////////////////////////////////////////////////// + +bool CvsOptionsWidget::createNewDirWhenUpdating() const +{ + return createNewDirWhenUpdateCheck->isChecked(); +} + +/////////////////////////////////////////////////////////////////////////////// + +bool CvsOptionsWidget::recursiveWhenUpdating() const +{ + return recursiveWhenUpdateCheck->isChecked(); +} + +/////////////////////////////////////////////////////////////////////////////// + +bool CvsOptionsWidget::recursiveWhenCommittingRemoving() const +{ + return recursiveWhenCommitRemoveCheck->isChecked(); +} + +/////////////////////////////////////////////////////////////////////////////// + +unsigned int CvsOptionsWidget::contextLines() const +{ + return contextLinesInput->value(); +} + +/////////////////////////////////////////////////////////////////////////////// + +QString CvsOptionsWidget::cvsRshEnvVar() const +{ + return cvsRshEnvVarEdit->text(); +} + +/////////////////////////////////////////////////////////////////////////////// + +QString CvsOptionsWidget::serverLocation() const +{ + return serverLocationEdit->text(); +} + +#include "cvsoptionswidget.moc" -- cgit v1.2.1