File: kautocmodule.cpp

package info (click to toggle)
skim 1.4.4-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,876 kB
  • ctags: 1,247
  • sloc: cpp: 9,421; python: 1,608; sh: 260; makefile: 68
file content (80 lines) | stat: -rw-r--r-- 2,243 bytes parent folder | download
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
/***************************************************************************
 *   Copyright (C) 2003-2005 by liuspider                                  *
 *   liuspider@users.sourceforge.net                                       *
 *                                                                         *
 *   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; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/
#include "kautocmodule.h"
#include "scimkdesettings.h"

#include <qlayout.h>
#include <kconfigdialogmanager.h>

class KAutoCModule::KAutoCModulePrivate
{
    public:
    KConfigDialogManager *kautoconfig;
};

#include <iostream>
KAutoCModule::KAutoCModule( KInstance * instance, QWidget * parent, 
    const QStringList & args, KConfigSkeleton * conf )
    : KCModule( instance, parent, args )
    , d( new KAutoCModulePrivate )
{
    if(!conf)
      conf = ScimKdeSettings::self();

    d->kautoconfig = new KConfigDialogManager( this, conf );
    connect(d->kautoconfig, SIGNAL(widgetModified()), SLOT(slotWidgetModified()));
    connect(d->kautoconfig, SIGNAL(settingsChanged()), SLOT(slotWidgetModified()));
}

KAutoCModule::~KAutoCModule()
{
    delete d;
}


void KAutoCModule::load()
{
    d->kautoconfig->updateWidgets();
}

void KAutoCModule::save()
{
    d->kautoconfig->updateSettings();
}

void KAutoCModule::defaults()
{
    d->kautoconfig->updateWidgetsDefault();
    if(d->kautoconfig->hasChanged())
      emit changed(true);
}

//Remove this if we do not want KDE < 3.4.0 support
void KAutoCModule::slotWidgetModified()
{
    emit changed(d->kautoconfig->hasChanged());
}

KConfigDialogManager *KAutoCModule::configDialgoMgr()
{
    return d->kautoconfig;
}

void KAutoCModule::setMainWidget(QWidget *widget/*, const QString& group*/ )
{
    QBoxLayout * l = new QVBoxLayout( this );
    l->addWidget( widget );
  
    d->kautoconfig->addWidget(widget/*,group*/);
    d->kautoconfig->updateWidgets();
}


#include "kautocmodule.moc"