diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-08-04 03:27:13 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-08-04 03:27:13 +0000 |
| commit | 373e686bf4ecaaabcf80544e74f017eebe05213f (patch) | |
| tree | cddf7a223f16944b0380386e568f2606f634c366 /pokemodr/ScriptWidget.cpp | |
| parent | 63417b1c5057d22bd853e92cd3a25aa812b8d917 (diff) | |
| download | sigen-373e686bf4ecaaabcf80544e74f017eebe05213f.tar.gz sigen-373e686bf4ecaaabcf80544e74f017eebe05213f.tar.xz sigen-373e686bf4ecaaabcf80544e74f017eebe05213f.zip | |
[FIX] Cleaned up the RC file
[FIX] Script editing is getting there (still a little weird...)
[FIX] Cleaned up the main file a bit
[FIX] Added the Skin class
[FIX] All sprites and skins are internally linked now
[FIX] No more image restraints (tiles are still enforced so that map editing works)
[FIX] Cleaned up checking for valid values when setting in pokemod
[FIX] Removed FileDialog files
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@233 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/ScriptWidget.cpp')
| -rw-r--r-- | pokemodr/ScriptWidget.cpp | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/pokemodr/ScriptWidget.cpp b/pokemodr/ScriptWidget.cpp index 57cec072..3258daa8 100644 --- a/pokemodr/ScriptWidget.cpp +++ b/pokemodr/ScriptWidget.cpp @@ -20,8 +20,11 @@ // KDE includes #include <KActionCollection> +#include <KApplication> #include <KStandardAction> #include <KMessageBox> +#include <KXMLGUIFactory> +#include <KXmlGuiWindow> #include <KTextEditor/Document> #include <KTextEditor/Editor> #include <KTextEditor/EditorChooser> @@ -35,7 +38,7 @@ Pokemodr::ScriptWidget::ScriptWidget(QWidget* parent, const Pokemod::Script& val setupUi(this); QMap<QString, QString> languages; languages["C#"] = "mono"; - languages["Falcon"] = "falcon"; // No highlight rules yet + languages["Falcon"] = "falcon"; languages["Java"] = "java"; languages["JavaScript"] = "kjs"; languages["Lua"] = "lua"; @@ -49,32 +52,18 @@ Pokemodr::ScriptWidget::ScriptWidget(QWidget* parent, const Pokemod::Script& val if (!editor) { KMessageBox::error(this, "A KDE text-editor component could not be found;\nplease check your KDE installation."); - Q_ASSERT(false); + KApplication::kApplication()->exit(1); } m_document = editor->createDocument(NULL); m_view = m_document->createView(NULL); m_view->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); m_view->setMinimumHeight(300); - // FIXME: KatePart bug here? - // Stop colliding shortcuts from KateView - m_view->action(KStandardAction::name(KStandardAction::Cut))->setShortcuts(QKeySequence::UnknownKey); - m_view->action(KStandardAction::name(KStandardAction::Copy))->setShortcuts(QKeySequence::UnknownKey); - m_view->action(KStandardAction::name(KStandardAction::PasteText))->setShortcuts(QKeySequence::UnknownKey); - // FIXME: Uncomment to get copy/paste to work in KatePart (KDE 4.1) - // FIXME: I hate this way of finding ActionCollections (names anyone?) -// QList<KActionCollection*> collections = KActionCollection::allCollections(); -// foreach (KActionCollection* collection, collections) -// { -// // FIXME: Nothing else should have a Preferences action right? -// if (collection->action(KStandardAction::name(KStandardAction::Preferences))) -// { -// // TODO: Works like crap since it doesn't check to see if the widget is focused -// connect(collection->action(KStandardAction::name(KStandardAction::Cut)), SIGNAL(triggered()), m_view->action(KStandardAction::name(KStandardAction::Cut)), SIGNAL(triggered())); -// connect(collection->action(KStandardAction::name(KStandardAction::Copy)), SIGNAL(triggered()), m_view->action(KStandardAction::name(KStandardAction::Copy)), SIGNAL(triggered())); -// connect(collection->action(KStandardAction::name(KStandardAction::PasteText)), SIGNAL(triggered()), m_view->action(KStandardAction::name(KStandardAction::PasteText)), SIGNAL(triggered())); -// break; -// } -// } + qobject_cast<KXmlGuiWindow*>(KApplication::kApplication()->activeWindow())->guiFactory()->addClient(m_view); +// // FIXME: KatePart bug here? +// // Stop colliding shortcuts from KateView +// m_view->action(KStandardAction::name(KStandardAction::Cut))->setShortcuts(QKeySequence::UnknownKey); +// m_view->action(KStandardAction::name(KStandardAction::Copy))->setShortcuts(QKeySequence::UnknownKey); +// m_view->action(KStandardAction::name(KStandardAction::PasteText))->setShortcuts(QKeySequence::UnknownKey); layoutScript->addWidget(m_view); connect(m_document, SIGNAL(textChanged(KTextEditor::Document*)), this, SLOT(scriptChanged())); connect(this, SIGNAL(valueChanged(const Pokemod::Script&)), SLOT(setGui())); @@ -83,6 +72,7 @@ Pokemodr::ScriptWidget::ScriptWidget(QWidget* parent, const Pokemod::Script& val Pokemodr::ScriptWidget::~ScriptWidget() { + qobject_cast<KXmlGuiWindow*>(KApplication::kApplication()->activeWindow())->guiFactory()->removeClient(m_view); delete m_document; } |
