summaryrefslogtreecommitdiffstats
path: root/vcs/cvsservice/cvsoptionswidget.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/cvsservice/cvsoptionswidget.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/cvsservice/cvsoptionswidget.cpp')
-rw-r--r--vcs/cvsservice/cvsoptionswidget.cpp190
1 files changed, 190 insertions, 0 deletions
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 <qcheckbox.h>
+#include <klineedit.h>
+#include <knuminput.h>
+#include <kdialog.h>
+
+#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"