• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

parley

  • sources
  • kde-4.14
  • kdeedu
  • parley
  • src
  • scripts
scriptdialog.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 
3  Copyright 2008 Avgoustinos Kadis <avgoustinos.kadis@kdemail.net>
4 
5  ***************************************************************************/
6 
7 /***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #include "scriptdialog.h"
16 
17 #include "scripting/parley.h"
18 
19 #include <KLocale>
20 #include <KPluginInfo>
21 #include <KSharedConfig>
22 #include <KConfigGroup>
23 
24 #include <kross/core/action.h>
25 #include <kross/core/manager.h>
26 
27 ScriptDialog::ScriptDialog(ScriptManager * scriptManager)
28  : KDialog()
29 {
30  m_scriptManager = scriptManager;
31 
32  //Configure window
33  setCaption(i18n("Script Dialog"));
34  setButtons(Ok | Cancel);
35 
36  //Add KPluginSelector as the main widget of the dialog
37  m_kps = new KPluginSelector(0);
38  m_kps->setMinimumSize(500, 500);
39 
40  setMainWidget(m_kps);
41 
42  //Load available plugins
43  pluginsInfoList = KPluginInfo::fromFiles(ScriptManager::getDesktopFiles());
44 
45 // m_kps->addPlugins ( pluginsInfoList,KPluginSelector::ReadConfigFile,i18n ( "Playlist" ),QString ( "playlist" ),KSharedConfig::openConfig ( "parleyrc" ) );
46  m_kps->addPlugins(pluginsInfoList,
47  KPluginSelector::ReadConfigFile,
48  QString(),
49  QString(),
50  KSharedConfig::openConfig("parleyrc"));
51 }
52 
53 ScriptDialog::~ScriptDialog()
54 {
55  delete m_kps;
56 }
57 
58 void ScriptDialog::accept()
59 {
60  //Update KPluginInfo object changes
61  m_kps->updatePluginsState(); //necessary for KPluginInfo::isPluginEnabled to work
62 
63  //Save changes in config file (parleyrc)
64  m_kps->save();
65 
66  //Reload scripts
67  m_scriptManager->reloadScripts();
68 
69  //Close dialog
70  done(0);
71 }
ScriptDialog::ScriptDialog
ScriptDialog(ScriptManager *scriptManager)
Definition: scriptdialog.cpp:27
ScriptDialog::accept
void accept()
Executed when user clicks OK button.
Definition: scriptdialog.cpp:58
scriptdialog.h
KDialog
parley.h
ScriptManager::reloadScripts
void reloadScripts()
Reloads all the scripts.
Definition: scriptmanager.cpp:144
QString
ScriptDialog::~ScriptDialog
~ScriptDialog()
Definition: scriptdialog.cpp:53
ScriptManager
This class finds the scripts installed in the application directory and manages loading and unloading...
Definition: scriptmanager.h:30
ScriptManager::getDesktopFiles
static QStringList getDesktopFiles()
Finds all the available desktop files in {PARLEY_DATA_FOLDER}/plugins.
Definition: scriptmanager.cpp:45
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal