~ubuntu-branches/ubuntu/vivid/kvpnc/vivid-proposed

« back to all changes in this revision

Viewing changes to src/profilesshoptions.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2009-04-23 09:18:50 UTC
  • mfrom: (1.1.10 upstream) (8.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090423091850-hweeg0jo64t0jx52
Tags: 0.9.1-1
* New upstream release (KDE4 is here)
* Add Build-Depends cmake and pkg-kde-tools
* Remove obsolete debian/patches
* Refresh debian/patches:
  - 10_su-to-root_usage.diff
  - 13_add_kuser_issuperuser.diff
* Cleanup debian/rules - simple under KDE4
* Update debian/watch for KDE4 version
* Update debian/copyright - use versionned licenses
* Update Section field - move to utils
* Remove obsolete dependencies: kdebase-bin, gksu, sux and modutils
* Update debian/kvpnc.{manpages,1}

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2007 by Christoph Thielecke                             *
 
3
 *   crissi99@gmx.de                                                       *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 *                                                                         *
 
10
 *   This program is distributed in the hope that it will be useful,       *
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
13
 *   GNU General Public License for more details.                          *
 
14
 *                                                                         *
 
15
 *   You should have received a copy of the GNU General Public License     *
 
16
 *   along with this program; if not, write to the                         *
 
17
 *   Free Software Foundation, Inc.,                                       *
 
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 
19
 ***************************************************************************/
 
20
#include "profilesshoptions.h"
 
21
 
 
22
#include <klineedit.h>
 
23
#include <kcombobox.h>
 
24
#include <kmessagebox.h>
 
25
#include <kurlrequester.h>
 
26
#include <qspinbox.h>
 
27
#include <qcheckbox.h>
 
28
#include <qradiobutton.h>
 
29
#include <qbuttongroup.h>
 
30
 
 
31
#include <qlabel.h>
 
32
#include "widgetnotifyhelper.h"
 
33
#include <iostream>
 
34
 
 
35
ProfileSshOptions::ProfileSshOptions(QWidget *parent)
 
36
{
 
37
        setupUi(this);
 
38
        WidgetNotifyHelper h;
 
39
        h.setupChangedAction(this);
 
40
        dialogModified=false;
 
41
}
 
42
 
 
43
 
 
44
ProfileSshOptions::~ProfileSshOptions()
 
45
{}
 
46
 
 
47
void ProfileSshOptions::usePortToggled(bool)
 
48
{
 
49
        if (UseUserdefinedRemotePortCheckBox->isChecked())
 
50
                UserdefinedRemotePortSpinBox->setEnabled(true);
 
51
        else
 
52
                UserdefinedRemotePortSpinBox->setEnabled(false);
 
53
}
 
54
 
 
55
void ProfileSshOptions::dialogChanged()
 
56
{
 
57
//      std::cout << "ProfileSshOptions::dialogChanged()" << std::endl;
 
58
        dialogModified=true;
 
59
}
 
60
 
 
61
void ProfileSshOptions::sshKeyToggled(bool)
 
62
{
 
63
        if (AutoKeyRadioButton->isChecked())
 
64
        {
 
65
                SshKeyComboBox->setEnabled(true);
 
66
                CostumkeyURLRequester->setEnabled(false);
 
67
        }
 
68
        else
 
69
        {
 
70
                SshKeyComboBox->setEnabled(false);
 
71
                CostumkeyURLRequester->setEnabled(true);
 
72
        }
 
73
}
 
74
 
 
75
void ProfileSshOptions::sshAuthToggled(bool)
 
76
{
 
77
        if (AuthKeyRadioButton->isChecked() && !AuthPassRadioButton->isChecked())
 
78
        {
 
79
//              KMessageBox::information ( this, "auth key is set", "a" );
 
80
                SshkeyButtonGroup->setEnabled(true);
 
81
        }
 
82
        if (!AuthKeyRadioButton->isChecked() && AuthPassRadioButton->isChecked())
 
83
        {
 
84
//              KMessageBox::information ( this, "auth pass is set", "a" );
 
85
                SshkeyButtonGroup->setEnabled(false);
 
86
        }
 
87
        sshKeyToggled(true);
 
88
}
 
89
 
 
90
 
 
91
 
 
92
void ProfileSshOptions::useSshConfigRemoteScriptToggled(bool)
 
93
{
 
94
        if (UseSshConfigRemoteScriptCheckBox->isChecked())
 
95
                SshConfigRemoteScriptLineEdit->setEnabled(true);
 
96
        else
 
97
                SshConfigRemoteScriptLineEdit->setEnabled(false);
 
98
}