diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch) | |
tree | acaf47eb0fa12142d3896416a69e74cbf5a72242 /embedded | |
download | tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'embedded')
-rw-r--r-- | embedded/Makefile.am | 13 | ||||
-rw-r--r-- | embedded/visualboyadvance/Makefile.am | 17 | ||||
-rw-r--r-- | embedded/visualboyadvance/kdevpart_visualboyadvance.rc | 11 | ||||
-rw-r--r-- | embedded/visualboyadvance/kdevvisualboyadvance.desktop | 86 | ||||
-rw-r--r-- | embedded/visualboyadvance/vbaconfigwidget.cpp | 144 | ||||
-rw-r--r-- | embedded/visualboyadvance/vbaconfigwidget.h | 42 | ||||
-rw-r--r-- | embedded/visualboyadvance/vbaconfigwidgetbase.ui | 249 | ||||
-rw-r--r-- | embedded/visualboyadvance/visualboyadvance_part.cpp | 77 | ||||
-rw-r--r-- | embedded/visualboyadvance/visualboyadvance_part.h | 29 |
9 files changed, 668 insertions, 0 deletions
diff --git a/embedded/Makefile.am b/embedded/Makefile.am new file mode 100644 index 00000000..9bd593c0 --- /dev/null +++ b/embedded/Makefile.am @@ -0,0 +1,13 @@ +## +## Do NOT remove the comments that start with "kdevelop:" +## They are actually directives to the kdevelop plugin system +## +## The include_xxxx variables are controlled by configure.in.in +## + +#kdevelop: VISUALBOYADVANCE_SUBDIR = visualboyadvance +if include_vba +VISUALBOYADVANCE_SUBDIR = visualboyadvance +endif + +SUBDIRS = $(VISUALBOYADVANCE_SUBDIR)
\ No newline at end of file diff --git a/embedded/visualboyadvance/Makefile.am b/embedded/visualboyadvance/Makefile.am new file mode 100644 index 00000000..4732b646 --- /dev/null +++ b/embedded/visualboyadvance/Makefile.am @@ -0,0 +1,17 @@ +INCLUDES = -I$(top_srcdir)/lib/interfaces \ + -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util $(all_includes) + +kde_module_LTLIBRARIES = libkdevvisualboyadvance.la +libkdevvisualboyadvance_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) +libkdevvisualboyadvance_la_LIBADD = $(top_builddir)/lib/libkdevelop.la + +libkdevvisualboyadvance_la_SOURCES = visualboyadvance_part.cpp vbaconfigwidgetbase.ui vbaconfigwidget.cpp + +METASOURCES = AUTO + +servicedir = $(kde_servicesdir) +service_DATA = kdevvisualboyadvance.desktop + +rcdir = $(kde_datadir)/kdevvisualboyadvance +rc_DATA = kdevpart_visualboyadvance.rc + diff --git a/embedded/visualboyadvance/kdevpart_visualboyadvance.rc b/embedded/visualboyadvance/kdevpart_visualboyadvance.rc new file mode 100644 index 00000000..674cd41f --- /dev/null +++ b/embedded/visualboyadvance/kdevpart_visualboyadvance.rc @@ -0,0 +1,11 @@ +<!DOCTYPE kpartgui> +<kpartplugin name="visualboyadvance" library="libvisualboyadvanceplugin" version="1"> +<MenuBar> + <Menu name="build" > + <Action name="build_execute" /> + </Menu> +</MenuBar> +<ToolBar name="mainToolBar"> + <Action name="build_execute" group="build_operations"/> +</ToolBar> +</kpartplugin> diff --git a/embedded/visualboyadvance/kdevvisualboyadvance.desktop b/embedded/visualboyadvance/kdevvisualboyadvance.desktop new file mode 100644 index 00000000..bec85456 --- /dev/null +++ b/embedded/visualboyadvance/kdevvisualboyadvance.desktop @@ -0,0 +1,86 @@ +[Desktop Entry] +Type=Service +Exec=blubb +Comment=VisualBoyAdvance is a GameBoyAdvance emulator. http://vboy.emuhq.com/ +Comment[ca]=VisualBoyAdvance és un emulador de GameBoyAdvance. http://vboy.emuhq.com/ +Comment[da]=VisualBoyAdvance er en GameBoyAdvance emulator. http://vboy.emuhq.com/ +Comment[de]=VisualBoy Advance ist ein Emulator für den GameBoy Advance (http://vboy.emuhq.com/) +Comment[el]=Το VisualBoyAdvance είναι ένας εξομοιωτής του GameBoyAdvance. http://vboy.emuhq.com/ +Comment[es]=VisualBoyAdvance es un emulador de GameBoyAdvance. http://vboy.emuhq.com/ +Comment[et]=VisualBoyAdvance on GameBoyAdvance emulaator. http://vboy.emuhq.com/ +Comment[eu]=VisualBoyAdvance GameBoyAdvance-en emulatzaile bat da. http://vboy.emuhq.com/ +Comment[fa]=VisualBoyAdvance یک مقلد GameBoyAdvanc است. http://vboy.emuhq.com/ +Comment[fr]=VisualBoyAdvance est un émulateur de GameBoyAdvance. http://vboy.emuhq.com/ +Comment[ga]=Is aithriseoir GameBoyAdvance é VisualBoyAdvance. Féach ar http://vboy.emuhq.com/ +Comment[gl]=VisualBoyAdvance é un emulador de GameBoyAdvance. http://vboy.emuhq.com/ +Comment[hi]=विज़ुअल-बॉय-एडवांस एक गेम-बॉय-एडवांस एमुलेटर है. http://vboy.emuhq.com/ +Comment[hu]=A VisualBoyAdvance egy emulátor a Game Boy Advance-hoz - http://vboy.emuhq.com/ +Comment[is]=VisualBoyAdvance er GameBoyAdvance hermir. http://vboy.emuhq.com/ +Comment[it]=VisualBoyAdvance è un emulatore per GameBoyAdvance. http://vboy.emuhq.com/ +Comment[ja]=VisualBoyAdvance は、ゲームボーイアドバンスエミュレータです。http://vboy.emuhq.com/ +Comment[ms]=VisualBoyAdvance adalah emulator GameBoyAdvance. http://vboy.emuhq.com/ +Comment[nds]=VisualBoy Advance is en GameBoy-Advance-Emulator (http://vboy.emuhq.com/) +Comment[ne]=VisualBoyAdvance एउटा GameBoyAdvance इमुलेटर हो । http://vboy.emuhq.com/ +Comment[nl]=VisualBoyAdvance is een GameBoyAdvance-emulator (http://vboy.emuhq.com/ +Comment[pl]=VisualBoyAdvance to emulator GameBoyAdvance. http://vboy.emuhq.com/ +Comment[pt]=O VisualBoyAdvance é um emulador do GameBoyAdvance. http://vboy.emuhq.com/ +Comment[pt_BR]=VisualBoyAdvance é um emulador do GameBoyAdvance. http://vboy.emuhq.com/ +Comment[ru]=VisualBoyAdvance - эмулятор GameBoyAdvance. http://vboy.emuhq.com/ +Comment[sk]=VisualBoyAdvance je emulátor GameBoyAdvance. http://vboy.emuhq.com/ +Comment[sl]=VisualBoyAdvance je emulator GameBoyAdvance. http://vboy.emuhq.com/ +Comment[sr]=VisualBoyAdvance je емулатор GameBoyAdvance-а. http://vboy.emuhq.com/ +Comment[sr@Latn]=VisualBoyAdvance je emulator GameBoyAdvance-a. http://vboy.emuhq.com/ +Comment[sv]=VisualBoyAdvance är en emulator för GameBoyAdvance. http://vboy.emuhq.com/ +Comment[ta]=கெடெவ் காட்சியாக்க பாய் அட்வான்ஸ் பொன்மி.. http://vboy.emuhq.com/ +Comment[tg]=VisualBoyAdvance-ин эмулятори GameBoyAdvance мебошад. http://vboy.emuhq.com/ +Comment[tr]=VisualBoyAdvance bir GameBoyAdvance emülatörüdür: http://vboy.emuhq.com/ +Comment[zh_CN]=VisualBoyAdvance 是 GameBoyAdvance 的模拟器。http://vboy.emuhq.com/ +Comment[zh_TW]=VisualBoyAdvance 是一個 GameBoyAdvance 模擬器。http://vboy.emuhq.com/ +Name=KDevVisualBoyAdvance +Name[da]=KDevelop VisualBoyAdvance +Name[de]=VisualBoy Advance (KDevelop) +Name[hi]=के-डेव-विज़ुअल-बॉय-एडवांस +Name[nds]=VisualBoy Advance för KDevelop +Name[sv]=KDevelop Visual Boy Advance +Name[ta]=கெடெவ் காட்சியாக்க பாய் அட்வான்ஸ் +Name[zh_TW]=KDevelop VisualBoyAdvance +GenericName=VisualBoyAdvance Support +GenericName[ca]=Suport per a VisualBoyAdvance +GenericName[da]=VisualBoyAdvance understøttelse +GenericName[de]=Unterstützung für VisualBoy Advance +GenericName[el]=Υποστήριξη VisualBoyAdvance +GenericName[es]=Soporte para VisualBoyAdvance +GenericName[et]=VisualBoyAdvance toetus +GenericName[eu]=VisualBoyAdvance euskarria +GenericName[fa]=پشتیبانی VisualBoyAdvance +GenericName[fr]=Prise en charge de VisualBoyAdvance +GenericName[ga]=Tacaíocht VisualBoyAdvance +GenericName[gl]=Soporte de VisualBoyAdvance +GenericName[hu]=VisualBoyAdvance-támogatás +GenericName[it]=Supporto per VisualBoyAdvance +GenericName[ja]=VisualBoyAdvance サポート +GenericName[ms]=Sokongan VisualBoyAdvance +GenericName[nds]=Unnerstütten för VisualBoy Advance +GenericName[ne]=VisualBoyAdvance समर्थन +GenericName[nl]=Ondersteuning voor VisualBoyAdvance +GenericName[pl]=Obsługa VisualBoyAdvance +GenericName[pt]=Suporte a VisualBoyAdvance +GenericName[pt_BR]=Suporte ao VisualBoyAdvance +GenericName[ru]=Поддержка VisualBoyAdvance +GenericName[sk]=VisualBoyAdvance podpora +GenericName[sl]=Podpora VisualBoyAdvance +GenericName[sr]=Подршка за VisualBoyAdvance +GenericName[sr@Latn]=Podrška za VisualBoyAdvance +GenericName[sv]=Stöd för Visual Boy Advance +GenericName[ta]=காட்சியாக்க பாய் அட்வான்ஸ் ஆதரவு +GenericName[tg]=Ёри намудан ба VisualBoyAdvance +GenericName[tr]=VisualBoyAdvance Desteği +GenericName[zh_CN]=VisualBoyAdvance 支持 +GenericName[zh_TW]=VisualBoyAdvance 支援 +Icon=kdevelop +ServiceTypes=KDevelop/Plugin +X-KDE-Library=libkdevvisualboyadvance +X-KDevelop-Version=5 +X-KDevelop-Scope=Project +Keywords=GBA +Keywords[hi]=जीबीए diff --git a/embedded/visualboyadvance/vbaconfigwidget.cpp b/embedded/visualboyadvance/vbaconfigwidget.cpp new file mode 100644 index 00000000..e9c00c12 --- /dev/null +++ b/embedded/visualboyadvance/vbaconfigwidget.cpp @@ -0,0 +1,144 @@ +/*************************************************************************** + vbaconfigwidget.cpp + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001 by Sandy Meier + email : smeier@kdevelop.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 "vbaconfigwidget.h" + +#include <qcheckbox.h> +#include <qdir.h> +#include <qlineedit.h> +#include <qradiobutton.h> +#include <qtoolbutton.h> + +#include <kfiledialog.h> + +#include "domutil.h" + + +using namespace VisualBoyAdvance; + +VBAConfigWidget::VBAConfigWidget(VisualBoyAdvancePart* part,QWidget *parent, const char *name ) : VBAConfigWidgetBase(parent,name) { + m_part = part; + QDomDocument &doc = *m_part->projectDom(); + // read + QString emulator = DomUtil::readEntry(doc, "/kdevvisualadvance/emulator"); + QString binary = DomUtil::readEntry(doc, "/kdevvisualadvance/binary"); + QString graphicFilter = DomUtil::readEntry(doc, "/kdevvisualadvance/graphicFilter"); + QString scaling = DomUtil::readEntry(doc, "/kdevvisualadvance/scaling"); + QString addOptions = DomUtil::readEntry(doc, "/kdevvisualadvance/addOptions"); + bool terminal = DomUtil::readBoolEntry(doc, "/kdevvisualadvance/terminal"); + bool fullscreen = DomUtil::readBoolEntry(doc, "/kdevvisualadvance/fullscreen"); + // set the widgets + + if(emulator.isNull()){ + emuPathEdit->setText("VisualBoyAdvance"); // default + }else{ + emuPathEdit->setText(emulator); + } + binaryEdit->setText(binary); + + // graphic + if(graphicFilter.isNull()){ + normalModeButton->setChecked(true); + }else{ + if(graphicFilter == "-f0"){ + normalModeButton->setChecked(true); + } + if(graphicFilter == "-f1"){ + tvModeButton->setChecked(true); + } + if(graphicFilter == "-f2"){ + salModeButton->setChecked(true); + } + if(graphicFilter == "-f3"){ + superSalModeButton->setChecked(true); + } + if(graphicFilter == "-f4"){ + superEagleModeButton->setChecked(true); + } + } + + // scaling + if(scaling.isNull()){ + scaling1Button->setChecked(true);//default + }else{ + if(scaling == "-1"){ + scaling1Button->setChecked(true); + } + if(scaling == "-2"){ + scaling2Button->setChecked(true); + } + if(scaling == "-3"){ + scaling3Button->setChecked(true); + } + if(scaling == "-4"){ + scaling4Button->setChecked(true); + } + + } + + if(fullscreen){ + fullscreenCheckBox->setChecked(true); + } + if(terminal){ + terminalCheckBox->setChecked(true); + } + + addOptionsEdit->setText(addOptions); + connect(emuPathButton,SIGNAL(clicked()),this,SLOT(emuPathButtonClicked())); +} +VBAConfigWidget::~VBAConfigWidget(){ +} + +void VBAConfigWidget::accept(){ + QDomDocument &doc = *m_part->projectDom(); + + DomUtil::writeEntry(doc, "/kdevvisualadvance/emulator",emuPathEdit->text()); + DomUtil::writeEntry(doc, "/kdevvisualadvance/binary",binaryEdit->text()); + DomUtil::writeEntry(doc, "/kdevvisualadvance/addOptions",addOptionsEdit->text()); + DomUtil::writeBoolEntry(doc, "/kdevvisualadvance/terminal",terminalCheckBox->isChecked()); + DomUtil::writeBoolEntry(doc, "/kdevvisualadvance/fullscreen",fullscreenCheckBox->isChecked()); + + if(normalModeButton->isChecked()){ + DomUtil::writeEntry(doc, "/kdevvisualadvance/graphicFilter","-f0"); + }else if (tvModeButton->isChecked()){ + DomUtil::writeEntry(doc, "/kdevvisualadvance/graphicFilter","-f1"); + }else if (salModeButton->isChecked()){ + DomUtil::writeEntry(doc, "/kdevvisualadvance/graphicFilter","-f2"); + }else if (superSalModeButton->isChecked()){ + DomUtil::writeEntry(doc, "/kdevvisualadvance/graphicFilter","-f3"); + }else if (superEagleModeButton->isChecked()){ + DomUtil::writeEntry(doc, "/kdevvisualadvance/graphicFilter","-f4"); + } + + if(scaling1Button->isChecked()){ + DomUtil::writeEntry(doc, "/kdevvisualadvance/scaling","-1"); + }else if(scaling2Button->isChecked()){ + DomUtil::writeEntry(doc, "/kdevvisualadvance/scaling","-2"); + }else if(scaling3Button->isChecked()){ + DomUtil::writeEntry(doc, "/kdevvisualadvance/scaling","-3"); + }else if(scaling4Button->isChecked()){ + DomUtil::writeEntry(doc, "/kdevvisualadvance/scaling","-4"); + } +} +void VBAConfigWidget::emuPathButtonClicked(){ + QString emu = KFileDialog::getOpenFileName(QDir::homeDirPath()); + if(!emu.isEmpty()){ + emuPathEdit->setText(emu); + } +} + +#include "vbaconfigwidget.moc" diff --git a/embedded/visualboyadvance/vbaconfigwidget.h b/embedded/visualboyadvance/vbaconfigwidget.h new file mode 100644 index 00000000..61866eb6 --- /dev/null +++ b/embedded/visualboyadvance/vbaconfigwidget.h @@ -0,0 +1,42 @@ +/*************************************************************************** + vbaconfigwidget.h - VisualBoy Advance configuration Widget + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001 by Sandy Meier + email : smeier@kdevelop.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#ifndef VBACONFIGWIDGET_H +#define VBACONFIGWIDGET_H + +#include <qwidget.h> +#include "vbaconfigwidgetbase.h" +#include "visualboyadvance_part.h" + +namespace VisualBoyAdvance { +/** + *@author + */ + +class VBAConfigWidget : public VBAConfigWidgetBase { + Q_OBJECT +public: + VBAConfigWidget(VisualBoyAdvancePart* part,QWidget *parent=0, const char *name=0); + ~VBAConfigWidget(); +public slots: + void accept(); + void emuPathButtonClicked(); + private: + VisualBoyAdvancePart* m_part; +}; +} +#endif diff --git a/embedded/visualboyadvance/vbaconfigwidgetbase.ui b/embedded/visualboyadvance/vbaconfigwidgetbase.ui new file mode 100644 index 00000000..fb24e2d7 --- /dev/null +++ b/embedded/visualboyadvance/vbaconfigwidgetbase.ui @@ -0,0 +1,249 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>VBAConfigWidgetBase</class> +<widget class="QWidget"> + <property name="name"> + <cstring>VBAConfigWigdet</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>510</width> + <height>367</height> + </rect> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + + <widget class="QLineEdit" row="1" column="2" rowspan="1" colspan="2"> + <property name="name"> + <cstring>binaryEdit</cstring> + </property> + </widget> + <widget class="QButtonGroup" row="2" column="0" rowspan="3" colspan="1"> + <property name="name"> + <cstring>ButtonGroup3</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Graphic Filter</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + + <widget class="QRadioButton"> + <property name="name"> + <cstring>normalModeButton</cstring> + </property> + <property name="text"> + <string>Normal mode</string> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>tvModeButton</cstring> + </property> + <property name="text"> + <string>TV mode</string> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>salModeButton</cstring> + </property> + <property name="text"> + <string>2xSaI</string> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>superSalModeButton</cstring> + </property> + <property name="text"> + <string>Super 2xSal</string> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>superEagleModeButton</cstring> + </property> + <property name="text"> + <string>Super Eagle</string> + </property> + </widget> + </vbox> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>TextLabel2</cstring> + </property> + <property name="text"> + <string>GBA binary:</string> + </property> + </widget> + <widget class="QLineEdit" row="0" column="2" rowspan="1" colspan="2"> + <property name="name"> + <cstring>emuPathEdit</cstring> + </property> + </widget> + <widget class="QLabel" row="5" column="0"> + <property name="name"> + <cstring>TextLabel4</cstring> + </property> + <property name="text"> + <string>Additional parameters:</string> + </property> + </widget> + <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>TextLabel3</cstring> + </property> + <property name="text"> + <string>VisualBoy Advance (emulator):</string> + </property> + </widget> + <widget class="QToolButton" row="0" column="4"> + <property name="name"> + <cstring>emuPathButton</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>22</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>...</string> + </property> + </widget> + <widget class="QButtonGroup" row="2" column="1" rowspan="3" colspan="2"> + <property name="name"> + <cstring>ButtonGroup4</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>120</width> + <height>0</height> + </size> + </property> + <property name="title"> + <string>Scaling</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + + <widget class="QRadioButton"> + <property name="name"> + <cstring>scaling1Button</cstring> + </property> + <property name="text"> + <string>1x</string> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>scaling2Button</cstring> + </property> + <property name="text"> + <string>2x</string> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>scaling3Button</cstring> + </property> + <property name="text"> + <string>3x</string> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>scaling4Button</cstring> + </property> + <property name="text"> + <string>4x</string> + </property> + </widget> + </vbox> + </widget> + <widget class="QCheckBox" row="2" column="3"> + <property name="name"> + <cstring>fullscreenCheckBox</cstring> + </property> + <property name="text"> + <string>Full screen</string> + </property> + </widget> + <widget class="QCheckBox" row="3" column="3"> + <property name="name"> + <cstring>terminalCheckBox</cstring> + </property> + <property name="text"> + <string>Start in external terminal</string> + </property> + </widget> + <spacer row="4" column="3"> + <property name="name"> + <cstring>Spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + </spacer> + <widget class="QLineEdit" row="5" column="1" rowspan="1" colspan="3"> + <property name="name"> + <cstring>addOptionsEdit</cstring> + </property> + </widget> + <spacer row="6" column="2"> + <property name="name"> + <cstring>Spacer2</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + </spacer> + </grid> +</widget> +<includes> + <include location="global" impldecl="in implementation">kdialog.h</include> +</includes> +<layoutdefaults spacing="6" margin="11"/> +<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> + +</UI> diff --git a/embedded/visualboyadvance/visualboyadvance_part.cpp b/embedded/visualboyadvance/visualboyadvance_part.cpp new file mode 100644 index 00000000..ad434b43 --- /dev/null +++ b/embedded/visualboyadvance/visualboyadvance_part.cpp @@ -0,0 +1,77 @@ +#include "visualboyadvance_part.h" + +#include <qvbox.h> +#include <qwhatsthis.h> + +#include <kaction.h> +#include <kdevgenericfactory.h> +#include <kiconloader.h> +#include <klocale.h> + +#include "kdevcore.h" +#include "kdevproject.h" +#include "kdevappfrontend.h" +#include "domutil.h" +#include "kdevplugininfo.h" + +#include "vbaconfigwidget.h" + + +using namespace VisualBoyAdvance; + +typedef KDevGenericFactory<VisualBoyAdvancePart> VisualBoyAdvanceFactory; +static const KDevPluginInfo data("kdevvisualboyadvance"); +K_EXPORT_COMPONENT_FACTORY( libkdevvisualboyadvance, VisualBoyAdvanceFactory( data ) ) + +VisualBoyAdvancePart::VisualBoyAdvancePart(QObject *parent, const char *name, const QStringList &) + : KDevPlugin(&data, parent, name){ + setInstance(VisualBoyAdvanceFactory::instance()); + + setXMLFile("kdevpart_visualboyadvance.rc"); + + KAction *action; + action = new KAction( i18n("Execute Program"), "exec", Key_F9, + this, SLOT(slotExecute()), + actionCollection(), "build_execute" ); + + connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)), + this, SLOT(projectConfigWidget(KDialogBase*)) ); +} + + +VisualBoyAdvancePart::~VisualBoyAdvancePart() +{ + +} +void VisualBoyAdvancePart::slotExecute(){ + KDevProject* prj = project(); + QDomDocument &doc = *projectDom(); + QString binary = DomUtil::readEntry(doc, "/kdevvisualadvance/binary"); + QString emulator = DomUtil::readEntry(doc, "/kdevvisualadvance/emulator"); + QString graphicFilter = DomUtil::readEntry(doc, "/kdevvisualadvance/graphicFilter"); + QString scaling = DomUtil::readEntry(doc, "/kdevvisualadvance/scaling"); + QString addOptions = DomUtil::readEntry(doc, "/kdevvisualadvance/addOptions"); + bool terminal = DomUtil::readBoolEntry(doc, "/kdevvisualadvance/terminal"); + bool fullscreen = DomUtil::readBoolEntry(doc, "/kdevvisualadvance/fullscreen"); + + if(emulator.isNull()) emulator = "VisualBoyAdvance"; + QString program = emulator + " " + graphicFilter +" " + scaling + " " + addOptions +" "; + if(fullscreen){ + program += "-F "; + } + + program += prj->projectDirectory() + "/" + binary; + + if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend")) + appFrontend->startAppCommand(QString::QString(), program, terminal); +} + +void VisualBoyAdvancePart::projectConfigWidget(KDialogBase *dlg){ + QVBox *vbox; + vbox = dlg->addVBoxPage(i18n("Run Options"), i18n("Run Options"), BarIcon( "make", KIcon::SizeMedium )); + VBAConfigWidget* w = new VBAConfigWidget(this,vbox); + connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) ); +} + + +#include "visualboyadvance_part.moc" diff --git a/embedded/visualboyadvance/visualboyadvance_part.h b/embedded/visualboyadvance/visualboyadvance_part.h new file mode 100644 index 00000000..86903d0b --- /dev/null +++ b/embedded/visualboyadvance/visualboyadvance_part.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2001 Sandy Meier <smeier@kdevelop.org> + */ + + +#ifndef __KDEVPART_VISUALBOYADVANCE_H__ +#define __KDEVPART_VISUALBOYADVANCE_H__ + +#include <qguardedptr.h> +#include <kdevplugin.h> +#include <kdialogbase.h> + +namespace VisualBoyAdvance { + class VisualBoyAdvancePart : public KDevPlugin + { + Q_OBJECT + + public: + + VisualBoyAdvancePart(QObject *parent, const char *name, const QStringList &); + ~VisualBoyAdvancePart(); + private slots: + void slotExecute(); + void projectConfigWidget(KDialogBase *dlg); + + }; + +} +#endif |