KDevelop API Documentation

cvsoptionswidget.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2003 by KDevelop Authors                                *
00003  *   kdevelop-devel@kde.org                                                *
00004  *   Copyright (C) 2003 by Mario Scalas                                    *
00005  *   mario.scalas@libero.it                                                *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  ***************************************************************************/
00013 
00014 #include <qcheckbox.h>
00015 #include <qlineedit.h>
00016 #include <knuminput.h>
00017 #include <kdialog.h>
00018 
00019 #include "domutil.h"
00020 #include "cvsoptions.h"
00021 #include "cvsoptionswidget.h"
00022 
00024 // class DiffDialog
00026 
00027 CvsOptionsWidget::CvsOptionsWidget( QWidget *parent, const char *name )
00028     : CvsOptionsWidgetBase( parent, name )
00029 {
00030     readConfig();
00031 }
00032 
00034 
00035 CvsOptionsWidget::~CvsOptionsWidget()
00036 {
00037 }
00038 
00040 
00041 void CvsOptionsWidget::readConfig()
00042 {
00043     CvsOptions *options = CvsOptions::instance();
00044 
00045     this->setCvsRshEnvVar( options->cvsRshEnvVar() );
00046     this->setServerLocation( options->location() );
00047     this->setPruneEmptyDirWhenUpdating( options->pruneEmptyDirsWhenUpdate() );
00048     this->setCreateNewDirWhenUpdating( options->createDirsWhenUpdate() );
00049     this->setRecursiveWhenUpdating( options->recursiveWhenUpdate() );
00050     this->setRecursiveWhenCommittingRemoving( options->recursiveWhenCommitRemove() );
00051     this->setDiffOptions( options->diffOptions() );
00052     this->setContextLines( options->contextLines() );
00053 }
00054 
00056 
00057 void CvsOptionsWidget::storeConfig()
00058 {
00059     CvsOptions *options = CvsOptions::instance();
00060 
00061     options->setCvsRshEnvVar( this->cvsRshEnvVar() );
00062     options->setLocation( this->serverLocation() );
00063     options->setPruneEmptyDirsWhenUpdate( this->pruneEmptyDirWhenUpdating() );
00064     options->setCreateDirsWhenUpdate( this->createNewDirWhenUpdating() );
00065     options->setRecursiveWhenUpdate( this->recursiveWhenUpdating() );
00066     options->setRecursiveWhenCommitRemove( this->recursiveWhenCommittingRemoving() );
00067     options->setDiffOptions( this->diffOptions() );
00068     options->setContextLines( this->contextLines() );
00069 }
00070 
00072 
00073 void CvsOptionsWidget::accept() {
00074     storeConfig();
00075 //    emit configChange();
00076 }
00077 
00079 
00080 void CvsOptionsWidget::setPruneEmptyDirWhenUpdating( bool b )
00081 {
00082     this->pruneEmptyDirWhenUpdateCheck->setChecked( b );
00083 }
00084 
00086 
00087 void CvsOptionsWidget::setCreateNewDirWhenUpdating( bool b )
00088 {
00089     this->createNewDirWhenUpdateCheck->setChecked( b );
00090 }
00091 
00093 
00094 void CvsOptionsWidget::setRecursiveWhenUpdating( bool b )
00095 {
00096     this->recursiveWhenUpdateCheck->setChecked( b );
00097 }
00098 
00100 
00101 void CvsOptionsWidget::setRecursiveWhenCommittingRemoving( bool b )
00102 {
00103     this->recursiveWhenCommitRemoveCheck->setChecked( b );
00104 }
00105 
00107 
00108 void CvsOptionsWidget::setContextLines( unsigned int p )
00109 {
00110     this->contextLinesInput->setValue( p );
00111 }
00112 
00114 
00115 void CvsOptionsWidget::setDiffOptions( const QString &p )
00116 {
00117     this->diffOptionsEdit->setText( p );
00118 }
00119 
00121 
00122 QString CvsOptionsWidget::diffOptions() const
00123 {
00124     return this->diffOptionsEdit->text();
00125 }
00126 
00128 
00129 void CvsOptionsWidget::setCvsRshEnvVar( const QString &p )
00130 {
00131     this->cvsRshEnvVarEdit->setText( p );
00132 }
00133 
00135 
00136 void CvsOptionsWidget::setServerLocation( const QString &p )
00137 {
00138     this->serverLocationEdit->setText( p );
00139 }
00140 
00142 
00143 bool CvsOptionsWidget::pruneEmptyDirWhenUpdating() const
00144 {
00145     return pruneEmptyDirWhenUpdateCheck->isChecked();
00146 }
00147 
00149 
00150 bool CvsOptionsWidget::createNewDirWhenUpdating() const
00151 {
00152     return createNewDirWhenUpdateCheck->isChecked();
00153 }
00154 
00156 
00157 bool CvsOptionsWidget::recursiveWhenUpdating() const
00158 {
00159     return recursiveWhenUpdateCheck->isChecked();
00160 }
00161 
00163 
00164 bool CvsOptionsWidget::recursiveWhenCommittingRemoving() const
00165 {
00166     return recursiveWhenCommitRemoveCheck->isChecked();
00167 }
00168 
00170 
00171 unsigned int CvsOptionsWidget::contextLines() const
00172 {
00173     return contextLinesInput->value();
00174 }
00175 
00177 
00178 QString CvsOptionsWidget::cvsRshEnvVar() const
00179 {
00180     return cvsRshEnvVarEdit->text();
00181 }
00182 
00184 
00185 QString CvsOptionsWidget::serverLocation() const
00186 {
00187     return serverLocationEdit->text();
00188 }
00189 
00190 #include "cvsoptionswidget.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:43 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003