~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to vcs/cvsservice/cvsoptionswidget.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2003 by KDevelop Authors                                *
3
 
 *   kdevelop-devel@kde.org                                                *
4
 
 *   Copyright (C) 2003 by Mario Scalas                                    *
5
 
 *   mario.scalas@libero.it                                                *
6
 
 *                                                                         *
7
 
 *   This program is free software; you can redistribute it and/or modify  *
8
 
 *   it under the terms of the GNU General Public License as published by  *
9
 
 *   the Free Software Foundation; either version 2 of the License, or     *
10
 
 *   (at your option) any later version.                                   *
11
 
 *                                                                         *
12
 
 ***************************************************************************/
13
 
 
14
 
#include <qcheckbox.h>
15
 
#include <klineedit.h>
16
 
#include <knuminput.h>
17
 
#include <kdialog.h>
18
 
 
19
 
#include "domutil.h"
20
 
#include "cvsoptions.h"
21
 
#include "cvsoptionswidget.h"
22
 
 
23
 
///////////////////////////////////////////////////////////////////////////////
24
 
// class DiffDialog
25
 
///////////////////////////////////////////////////////////////////////////////
26
 
 
27
 
CvsOptionsWidget::CvsOptionsWidget( QWidget *parent, const char *name )
28
 
    : CvsOptionsWidgetBase( parent, name )
29
 
{
30
 
    readConfig();
31
 
}
32
 
 
33
 
///////////////////////////////////////////////////////////////////////////////
34
 
 
35
 
CvsOptionsWidget::~CvsOptionsWidget()
36
 
{
37
 
}
38
 
 
39
 
///////////////////////////////////////////////////////////////////////////////
40
 
 
41
 
void CvsOptionsWidget::readConfig()
42
 
{
43
 
    CvsOptions *options = CvsOptions::instance();
44
 
 
45
 
    this->setCvsRshEnvVar( options->cvsRshEnvVar() );
46
 
    this->setServerLocation( options->location() );
47
 
    this->setPruneEmptyDirWhenUpdating( options->pruneEmptyDirsWhenUpdate() );
48
 
    this->setCreateNewDirWhenUpdating( options->createDirsWhenUpdate() );
49
 
    this->setRecursiveWhenUpdating( options->recursiveWhenUpdate() );
50
 
    this->setRecursiveWhenCommittingRemoving( options->recursiveWhenCommitRemove() );
51
 
    this->setDiffOptions( options->diffOptions() );
52
 
    this->setContextLines( options->contextLines() );
53
 
}
54
 
 
55
 
///////////////////////////////////////////////////////////////////////////////
56
 
 
57
 
void CvsOptionsWidget::storeConfig()
58
 
{
59
 
    CvsOptions *options = CvsOptions::instance();
60
 
 
61
 
    options->setCvsRshEnvVar( this->cvsRshEnvVar().stripWhiteSpace() );
62
 
    options->setLocation( this->serverLocation().stripWhiteSpace() );
63
 
    options->setPruneEmptyDirsWhenUpdate( this->pruneEmptyDirWhenUpdating() );
64
 
    options->setCreateDirsWhenUpdate( this->createNewDirWhenUpdating() );
65
 
    options->setRecursiveWhenUpdate( this->recursiveWhenUpdating() );
66
 
    options->setRecursiveWhenCommitRemove( this->recursiveWhenCommittingRemoving() );
67
 
    options->setDiffOptions( this->diffOptions().stripWhiteSpace() );
68
 
    options->setContextLines( this->contextLines() );
69
 
}
70
 
 
71
 
///////////////////////////////////////////////////////////////////////////////
72
 
 
73
 
void CvsOptionsWidget::accept() {
74
 
    storeConfig();
75
 
//    emit configChange();
76
 
}
77
 
 
78
 
///////////////////////////////////////////////////////////////////////////////
79
 
 
80
 
void CvsOptionsWidget::setPruneEmptyDirWhenUpdating( bool b )
81
 
{
82
 
    this->pruneEmptyDirWhenUpdateCheck->setChecked( b );
83
 
}
84
 
 
85
 
///////////////////////////////////////////////////////////////////////////////
86
 
 
87
 
void CvsOptionsWidget::setCreateNewDirWhenUpdating( bool b )
88
 
{
89
 
    this->createNewDirWhenUpdateCheck->setChecked( b );
90
 
}
91
 
 
92
 
///////////////////////////////////////////////////////////////////////////////
93
 
 
94
 
void CvsOptionsWidget::setRecursiveWhenUpdating( bool b )
95
 
{
96
 
    this->recursiveWhenUpdateCheck->setChecked( b );
97
 
}
98
 
 
99
 
///////////////////////////////////////////////////////////////////////////////
100
 
 
101
 
void CvsOptionsWidget::setRecursiveWhenCommittingRemoving( bool b )
102
 
{
103
 
    this->recursiveWhenCommitRemoveCheck->setChecked( b );
104
 
}
105
 
 
106
 
///////////////////////////////////////////////////////////////////////////////
107
 
 
108
 
void CvsOptionsWidget::setContextLines( unsigned int p )
109
 
{
110
 
    this->contextLinesInput->setValue( p );
111
 
}
112
 
 
113
 
///////////////////////////////////////////////////////////////////////////////
114
 
 
115
 
void CvsOptionsWidget::setDiffOptions( const QString &p )
116
 
{
117
 
    this->diffOptionsEdit->setText( p );
118
 
}
119
 
 
120
 
///////////////////////////////////////////////////////////////////////////////
121
 
 
122
 
QString CvsOptionsWidget::diffOptions() const
123
 
{
124
 
    return this->diffOptionsEdit->text();
125
 
}
126
 
 
127
 
///////////////////////////////////////////////////////////////////////////////
128
 
 
129
 
void CvsOptionsWidget::setCvsRshEnvVar( const QString &p )
130
 
{
131
 
    this->cvsRshEnvVarEdit->setText( p );
132
 
}
133
 
 
134
 
///////////////////////////////////////////////////////////////////////////////
135
 
 
136
 
void CvsOptionsWidget::setServerLocation( const QString &p )
137
 
{
138
 
    this->serverLocationEdit->setText( p );
139
 
}
140
 
 
141
 
///////////////////////////////////////////////////////////////////////////////
142
 
 
143
 
bool CvsOptionsWidget::pruneEmptyDirWhenUpdating() const
144
 
{
145
 
    return pruneEmptyDirWhenUpdateCheck->isChecked();
146
 
}
147
 
 
148
 
///////////////////////////////////////////////////////////////////////////////
149
 
 
150
 
bool CvsOptionsWidget::createNewDirWhenUpdating() const
151
 
{
152
 
    return createNewDirWhenUpdateCheck->isChecked();
153
 
}
154
 
 
155
 
///////////////////////////////////////////////////////////////////////////////
156
 
 
157
 
bool CvsOptionsWidget::recursiveWhenUpdating() const
158
 
{
159
 
    return recursiveWhenUpdateCheck->isChecked();
160
 
}
161
 
 
162
 
///////////////////////////////////////////////////////////////////////////////
163
 
 
164
 
bool CvsOptionsWidget::recursiveWhenCommittingRemoving() const
165
 
{
166
 
    return recursiveWhenCommitRemoveCheck->isChecked();
167
 
}
168
 
 
169
 
///////////////////////////////////////////////////////////////////////////////
170
 
 
171
 
unsigned int CvsOptionsWidget::contextLines() const
172
 
{
173
 
    return contextLinesInput->value();
174
 
}
175
 
 
176
 
///////////////////////////////////////////////////////////////////////////////
177
 
 
178
 
QString CvsOptionsWidget::cvsRshEnvVar() const
179
 
{
180
 
    return cvsRshEnvVarEdit->text();
181
 
}
182
 
 
183
 
///////////////////////////////////////////////////////////////////////////////
184
 
 
185
 
QString CvsOptionsWidget::serverLocation() const
186
 
{
187
 
    return serverLocationEdit->text();
188
 
}
189
 
 
190
 
#include "cvsoptionswidget.moc"