• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeabc
 

tdeabc

  • tdeabc
  • plugins
  • sql
resourcesqlconfig.cpp
1/*
2 This file is part of libtdeabc.
3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library 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 GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#include <tqlabel.h>
22#include <tqlayout.h>
23#include <tqspinbox.h>
24#include <tqvbox.h>
25
26#include <klineedit.h>
27#include <tdelocale.h>
28
29#include "resource.h"
30#include "resourcesqlconfig.h"
31
32using namespace TDEABC;
33
34ResourceSqlConfig::ResourceSqlConfig( TQWidget* parent, const char* name )
35 : ResourceConfigWidget( parent, name )
36{
37 resize( 290, 170 );
38
39 TQGridLayout *mainLayout = new TQGridLayout( this, 4, 2 );
40
41 TQLabel *label = new TQLabel( i18n( "Username:" ), this );
42 mUser = new KLineEdit( this );
43
44 mainLayout->addWidget( label, 0, 0 );
45 mainLayout->addWidget( mUser, 0, 1 );
46
47 label = new TQLabel( i18n( "Password:" ), this );
48 mPassword = new KLineEdit( this );
49 mPassword->setEchoMode( KLineEdit::Password );
50
51 mainLayout->addWidget( label, 1, 0 );
52 mainLayout->addWidget( mPassword, 1, 1 );
53
54 label = new TQLabel( i18n( "Host:" ), this );
55 mHost = new KLineEdit( this );
56
57 mainLayout->addWidget( label, 2, 0 );
58 mainLayout->addWidget( mHost, 2, 1 );
59
60 label = new TQLabel( i18n( "Port:" ), this );
61 TQVBox *box = new TQVBox(this);
62 mPort = new TQSpinBox(0, 65535, 1, box );
63 mPort->setSizePolicy(TQSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Preferred));
64 mPort->setValue(389);
65 new TQWidget(box, "dummy");
66
67 mainLayout->addWidget( label, 3, 0 );
68 mainLayout->addWidget( box, 3, 1 );
69
70 label = new TQLabel( i18n( "Database:" ), this );
71 mDbName = new KLineEdit( this );
72
73 mainLayout->addWidget( label, 4, 0 );
74 mainLayout->addWidget( mDbName, 4, 1 );
75}
76
77void ResourceSqlConfig::loadSettings( TDEConfig *config )
78{
79 mUser->setText( config->readEntry( "SqlUser" ) );
80 mPassword->setText( TDEABC::Resource::cryptStr( config->readEntry( "SqlPassword" ) ) );
81 mDbName->setText( config->readEntry( "SqlName" ) );
82 mHost->setText( config->readEntry( "SqlHost" ) );
83 mPort->setValue( config->readNumEntry( "SqlPort" ) );
84}
85
86void ResourceSqlConfig::saveSettings( TDEConfig *config )
87{
88 config->writeEntry( "SqlUser", mUser->text() );
89 config->writeEntry( "SqlPassword", TDEABC::Resource::cryptStr( mPassword->text() ) );
90 config->writeEntry( "SqlName", mDbName->text() );
91 config->writeEntry( "SqlHost", mHost->text() );
92 config->writeEntry( "SqlPort", mPort->value() );
93}
94
95#include "resourcesqlconfig.moc"
KLineEdit
TDEConfigBase::readEntry
TQString readEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
TDEConfigBase::readNumEntry
int readNumEntry(const TQString &pKey, int nDefault=0) const
TDEConfigBase::writeEntry
void writeEntry(const TQString &pKey, const TQString &pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
TDEConfig
TDEABC
static data, shared by ALL addressee objects
Definition: address.h:48
TDEStdAccel::name
TQString name(StdAccel id)
TDEStdAccel::label
TQString label(StdAccel id)
tdelocale.h

tdeabc

Skip menu "tdeabc"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeabc

Skip menu "tdeabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeabc by doxygen 1.9.4
This website is maintained by Timothy Pearson.