delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / phonon / kcm / main.cpp
bloba7eefbaf5a5bf41afa016846efffa2a6ad84516a
1 /* This file is part of the KDE project
2 Copyright (C) 2006-2007 Matthias Kretz <kretz@kde.org>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) version 3.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
21 #include "main.h"
22 #include <kgenericfactory.h>
23 #include <ktabwidget.h>
24 #include <kaboutdata.h>
25 #include <kdeversion.h>
26 #include <QtGui/QBoxLayout>
27 #include <kdialog.h>
28 #include "devicepreference.h"
29 #include "backendselection.h"
31 K_PLUGIN_FACTORY(PhononKcmFactory, registerPlugin<PhononKcm>();)
32 K_EXPORT_PLUGIN(PhononKcmFactory("kcm_phonon"))
34 PhononKcm::PhononKcm(QWidget *parent, const QVariantList &args)
35 : KCModule(PhononKcmFactory::componentData(), parent, args)
37 KAboutData *about = new KAboutData(
38 "kcm_phonon", 0, ki18n("Phonon Configuration Module"),
39 KDE_VERSION_STRING, KLocalizedString(), KAboutData::License_GPL,
40 ki18n("Copyright 2006 Matthias Kretz"));
41 about->addAuthor(ki18n("Matthias Kretz"), KLocalizedString(), "kretz@kde.org");
42 setAboutData(about);
44 setLayout(new QHBoxLayout);
45 layout()->setMargin(0);
46 layout()->setSpacing(0);
48 KTabWidget *tabs = new KTabWidget(this);
49 layout()->addWidget(tabs);
51 m_devicePreferenceWidget = new DevicePreference;
52 tabs->addTab(m_devicePreferenceWidget, i18n("Device Preference"));
53 m_backendSelection = new BackendSelection;
54 tabs->addTab(m_backendSelection, i18n("Backend"));
55 load();
56 connect(m_backendSelection, SIGNAL(changed()), SLOT(changed()));
57 connect(m_devicePreferenceWidget, SIGNAL(changed()), SLOT(changed()));
58 setButtons( KCModule::Default|KCModule::Apply );
61 void PhononKcm::load()
63 m_devicePreferenceWidget->load();
64 m_backendSelection->load();
67 void PhononKcm::save()
69 m_devicePreferenceWidget->save();
70 m_backendSelection->save();
73 void PhononKcm::defaults()
75 m_devicePreferenceWidget->defaults();
76 m_backendSelection->defaults();
79 #include "main.moc"
80 // vim: ts=4