summaryrefslogtreecommitdiffstats
path: root/krec/krecconfig_files.cpp
blob: 6d4d58a1249b3b738d5ac176b91835d77eeb4490 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/***************************************************************************
    copyright            : (C) 2003 by Arnold Krille
    email                : [email protected]
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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; version 2 of the License.               *
 *                                                                         *
 ***************************************************************************/

#include "krecconfig_files.h"
#include "krecconfig_files.moc"

#include "krecconfig_fileswidget.h"

#include <kgenericfactory.h>
#include <kdebug.h>
#include <tqlayout.h>
#include <tqbuttongroup.h>
#include <tqradiobutton.h>
#include <tqlineedit.h>
#include <tqhbox.h>
#include <tqlabel.h>
#include <tdeapplication.h>
#include <tdeconfig.h>
#include <tdelocale.h>

typedef KGenericFactory<KRecConfigFiles, TQWidget> KRecConfigFilesFactory;
K_EXPORT_COMPONENT_FACTORY( kcm_krec_files, KRecConfigFilesFactory( "krec" ) )

KRecConfigFiles::KRecConfigFiles( TQWidget* p, const char*, const TQStringList& s )
 : TDECModule( KRecConfigFilesFactory::instance(), p, s )
 , _layout( 0 )
 , _filewidget( 0 )
{
	_layout = new TQBoxLayout( this, TQBoxLayout::TopToBottom );

	_layout->addSpacing( 10 );

	_filewidget = new KRecConfigFilesWidget( this );
	connect( _filewidget, TQ_SIGNAL( sRateChanged( int ) ), this, TQ_SLOT( ratechanged( int ) ) );
	connect( _filewidget, TQ_SIGNAL( sChannelsChanged( int ) ), this, TQ_SLOT( channelschanged( int ) ) );
	connect( _filewidget, TQ_SIGNAL( sBitsChanged( int ) ), this, TQ_SLOT( bitschanged( int ) ) );
	connect( _filewidget, TQ_SIGNAL( sUseDefaultsChanged( bool ) ), this, TQ_SLOT( usedefaultschanged( bool ) ) );
	_layout->addWidget( _filewidget );

	_layout->addStretch( 100 );

	load();
}

KRecConfigFiles::~KRecConfigFiles() {
}

void KRecConfigFiles::load() {
kdDebug( 60005 ) << k_funcinfo << endl;
	defaults();
	_filewidget->load();
}

void KRecConfigFiles::save() {
	_filewidget->save();
	emit changed( false );
}

void KRecConfigFiles::defaults() {
	_filewidget->defaults();
}

void KRecConfigFiles::ratechanged( int ) {
	emit changed( true );
}
void KRecConfigFiles::channelschanged( int ) {
	emit changed( true );
}
void KRecConfigFiles::bitschanged( int ) {
	emit changed( true );
}
void KRecConfigFiles::usedefaultschanged( bool ) {
	emit changed( true );
}