2
* Copyright 2009 Aaron Seigo <aseigo@kde.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Library General Public License as
6
* published by the Free Software Foundation; either version 2, or
7
* (at your option) any later version.
9
* This program 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
12
* GNU General Public License for more details
14
* You should have received a copy of the GNU Library General Public
15
* License along with this program; if not, write to the
16
* Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
#ifndef INTERACTIVECONSOLE
21
#define INTERACTIVECONSOLE
23
#include <QWeakPointer>
24
#include <QScriptValue>
50
class InteractiveConsole : public KDialog
55
InteractiveConsole(Plasma::Corona *corona, QWidget *parent = 0);
56
~InteractiveConsole();
58
void loadScript(const QString &path);
61
void showEvent(QShowEvent *);
62
void closeEvent(QCloseEvent *event);
65
void print(const QString &string);
69
void openScriptFile();
71
void scriptTextChanged();
72
void evaluateScript();
75
void scriptFileDataRecvd(KIO::Job *job, const QByteArray &data);
76
void scriptFileDataReq(KIO::Job *job, QByteArray &data);
77
void reenableEditor(KJob *job);
78
void saveScriptUrlSelected();
79
void openScriptUrlSelected();
80
void loadScriptFromUrl(const KUrl &url);
81
void populateTemplatesMenu();
82
void loadTemplate(QAction *);
83
void useTemplate(QAction *);
87
void saveScript(const KUrl &url);
89
Plasma::Corona *m_corona;
90
QSplitter *m_splitter;
91
KTextEditor::Document *m_editorPart;
93
KTextBrowser *m_output;
94
KAction *m_loadAction;
95
KAction *m_saveAction;
96
KAction *m_clearAction;
97
KAction *m_executeAction;
98
KMenu *m_snippetsMenu;
100
KFileDialog *m_fileDialog;
101
QWeakPointer<KIO::Job> m_job;
102
bool m_closeWhenCompleted;