3
// Copyright (C) 2000 Neil Stevens <multivac@fcmail.com>
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
6
// of this software and associated documentation files (the "Software"), to deal
7
// in the Software without restriction, including without limitation the rights
8
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
// copies of the Software, and to permit persons to whom the Software is
10
// furnished to do so, subject to the following conditions:
12
// The above copyright notice and this permission notice shall be included in
13
// all copies or substantial portions of the Software.
15
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19
// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
// Except as contained in this notice, the name(s) of the author(s) shall not be
23
// used in advertising or otherwise to promote the sale, use or other dealings
24
// in this Software without prior written authorization from the author(s).
32
#include "pluginloader.h"
40
NOATUNPLUGINC(Marquis);
42
kdDebug() << "number of members == " << memberList->count() << endl;
49
void Marquis::restore(void)
51
KConfig *config = kapp->sessionConfig();
52
kdDebug() << "Marquis::restore()" << endl;
53
readGlobalProperties(config);
54
config->setGroup(QString::fromLatin1("Number"));
55
config->writeEntry(QString::fromLatin1("NumberOfWindows"), 1);
58
// unload every window, and save ihe config a QStringList of those loaded
59
void Marquis::saveGlobalProperties(KConfig *c)
61
kdDebug() << "Marquis::saveGlobalProperties()" << endl;
62
// borrowed from Plugin config dialog
64
QValueList<NoatunLibraryInfo> loaded = napp->libraryLoader()->loaded();
65
for( QValueList<NoatunLibraryInfo>::Iterator i = loaded.begin(); i != loaded.end(); ++i)
67
if(!specList.contains((*i).specfile)
68
&& napp->libraryLoader()->isLoaded((*i).specfile)
69
&& (*i).specfile != "marquis.plugin")
71
specList += (*i).specfile;
72
napp->libraryLoader()->remove((*i).specfile);
75
c->writeEntry("Loaded Plugins", specList);
76
c->writeEntry("Volume", napp->player()->volume());
79
// get the list of loaded plugins from the config, and load them
80
void Marquis::readGlobalProperties(KConfig *c)
82
c->setGroup(QString::null);
83
QStringList list = c->readListEntry("Loaded Plugins");
85
kdDebug() << "Marquis::readGlobalProperties()" << endl;
86
for(QStringList::ConstIterator i=list.begin(); i!=list.end(); ++i)
87
kdDebug() << *i << endl;
88
kdDebug() << "Marquis::readGlobalProperties() there we go" << endl;
90
napp->libraryLoader()->loadAll(list);
92
napp->player()->setVolume( c->readNumEntry("Volume", 100) );
95
#include "marquis.moc"