1
/***************************************************************************
2
* Copyright (C) 2004-2009 by Thomas Fischer *
3
* fischer@unix-ag.uni-kl.de *
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. *
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. *
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
***************************************************************************/
24
#include <kiconloader.h>
26
#include <settingsfileio.h>
27
#include <settingsediting.h>
28
#include <settingssearchurl.h>
29
#include <settingsidsuggestions.h>
30
#include <settingskeyword.h>
31
#include <settingsuserdefinedinput.h>
33
#include <settingsz3950.h>
35
#include "settingsdlg.h"
39
SettingsDlg::SettingsDlg( QWidget *parent, const char *name )
40
: KDialogBase( Tabbed, i18n( "Configure" ), Ok | Apply | Cancel, Ok, parent, name, true )
42
QFrame * page = addPage( i18n( "&Editing" ) );
43
QVBoxLayout *layout = new QVBoxLayout( page, 0, spacingHint() );
44
m_editing = new SettingsEditing( page );
45
layout->addWidget( m_editing );
46
connect( m_editing, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) );
48
page = addPage( i18n( "&File Open&&Save" ) );
49
layout = new QVBoxLayout( page, 0, spacingHint() );
50
m_fileIO = new SettingsFileIO( page );
51
layout->addWidget( m_fileIO );
52
connect( m_fileIO, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) );
54
page = addPage( i18n( "&Search URLs" ) );
55
layout = new QVBoxLayout( page, 0, spacingHint() );
56
m_searchURL = new SettingsSearchURL( page );
57
layout->addWidget( m_searchURL );
58
connect( m_searchURL, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) );
60
page = addPage( i18n( "Global &Keywords" ), QString::null, SmallIcon( "package" ) );
61
layout = new QVBoxLayout( page, 0, spacingHint() );
62
m_keyword = new SettingsKeyword( page );
63
layout->addWidget( m_keyword );
64
connect( m_keyword, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) );
66
page = addPage( i18n( "Id Suggestions" ) );
67
layout = new QVBoxLayout( page, 0, spacingHint() );
68
m_idSuggestions = new SettingsIdSuggestions( page );
69
layout->addWidget( m_idSuggestions );
70
connect( m_idSuggestions, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) );
72
page = addPage( i18n( "User Defined Fields" ) );
73
layout = new QVBoxLayout( page, 0, spacingHint() );
74
m_userDefinedInput = new SettingsUserDefinedInput( page );
75
layout->addWidget( m_userDefinedInput );
76
connect( m_userDefinedInput, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) );
79
page = addPage( i18n( "Z39.50" ) );
80
layout = new QVBoxLayout( page, 0, spacingHint() );
81
m_z3950config = new SettingsZ3950( page );
82
layout->addWidget( m_z3950config );
83
connect( m_z3950config, SIGNAL( configChanged() ), this, SLOT( slotConfigChanged() ) );
86
connect( this, SIGNAL( applyClicked() ), SLOT( slotApplySettings() ) );
90
SettingsDlg::~SettingsDlg()
95
int SettingsDlg::exec()
98
m_editing->readData();
99
m_searchURL->readData();
100
m_keyword->readData();
101
m_idSuggestions->readData();
102
m_userDefinedInput->readData();
104
m_z3950config->readData();
106
enableButton( Apply, FALSE );
108
return KDialogBase::exec();
111
void SettingsDlg::slotConfigChanged()
113
enableButton( Apply, TRUE );
116
void SettingsDlg::slotApplySettings()
118
m_fileIO->applyData();
119
m_editing->applyData();
120
m_searchURL->applyData();
121
m_keyword->applyData();
122
m_idSuggestions->applyData();
123
m_userDefinedInput->applyData();
125
m_z3950config->applyData();
127
enableButton( Apply, FALSE );
130
void SettingsDlg::accept()
133
KDialogBase::accept();
137
#include "settingsdlg.moc"