summaryrefslogtreecommitdiffstats
path: root/languages/ruby/rubyconfigwidget.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /languages/ruby/rubyconfigwidget.cpp
downloadtdevelop-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 'languages/ruby/rubyconfigwidget.cpp')
-rw-r--r--languages/ruby/rubyconfigwidget.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/languages/ruby/rubyconfigwidget.cpp b/languages/ruby/rubyconfigwidget.cpp
new file mode 100644
index 00000000..d0ffc5b4
--- /dev/null
+++ b/languages/ruby/rubyconfigwidget.cpp
@@ -0,0 +1,53 @@
+
+#include "rubyconfigwidget.h"
+#include "domutil.h"
+
+#include <stdlib.h>
+
+#include <klineedit.h>
+#include <qcheckbox.h>
+#include <qbuttongroup.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <kdebug.h>
+
+RubyConfigWidget::RubyConfigWidget(QDomDocument &projectDom, QWidget* parent, const char* name)
+: RubyConfigWidgetBase(parent,name), dom (projectDom) {
+ kdDebug (9019) << "Creating RubyConfigWidget" << endl;
+ interpreterEdit->setText(DomUtil::readEntry(dom, "/kdevrubysupport/run/interpreter"));
+ if (interpreterEdit->text().isEmpty()) {
+ interpreterEdit->setText("ruby");
+ }
+ shellEdit->setText(DomUtil::readEntry(dom, "/kdevrubysupport/run/shell"));
+ if (shellEdit->text().isEmpty()) {
+ shellEdit->setText("irb");
+ }
+ mainProgramEdit->setText(DomUtil::readEntry(dom, "/kdevrubysupport/run/mainprogram"));
+ programArgsEdit->setText(DomUtil::readEntry(dom, "/kdevrubysupport/run/programargs"));
+ runRadioBox->setButton(DomUtil::readIntEntry(dom, "/kdevrubysupport/run/runmainprogram"));
+ terminalCheckbox->setChecked(DomUtil::readBoolEntry(dom, "/kdevrubysupport/run/terminal"));
+ characterCodingRadioBox->setButton(DomUtil::readIntEntry(dom, "/kdevrubysupport/run/charactercoding"));
+ enableFloatingToolBarBox->setChecked( DomUtil::readBoolEntry(dom, "/kdevrbdebugger/general/floatingtoolbar", false));
+ showConstants->setChecked( DomUtil::readBoolEntry(dom, "/kdevrbdebugger/general/showconstants", false));
+ traceIntoRuby->setChecked( DomUtil::readBoolEntry(dom, "/kdevrbdebugger/general/traceintoruby", false));
+ workingDir->completionObject()->setMode(KURLCompletion::DirCompletion);
+ workingDir->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+ workingDir->setURL(DomUtil::readEntry(dom, "/kdevscriptproject/run/globalcwd", "") );
+}
+
+void RubyConfigWidget::accept() {
+ DomUtil::writeEntry(dom, "/kdevrubysupport/run/interpreter", interpreterEdit->text());
+ DomUtil::writeEntry(dom, "/kdevrubysupport/run/shell", shellEdit->text());
+ DomUtil::writeEntry(dom, "/kdevrubysupport/run/mainprogram", mainProgramEdit->text());
+ DomUtil::writeEntry(dom, "/kdevrubysupport/run/programargs", programArgsEdit->text());
+ DomUtil::writeIntEntry(dom, "/kdevrubysupport/run/runmainprogram", runRadioBox->selectedId());
+ DomUtil::writeBoolEntry(dom, "/kdevrubysupport/run/terminal", terminalCheckbox->isChecked());
+ DomUtil::writeIntEntry(dom, "/kdevrubysupport/run/charactercoding", characterCodingRadioBox->selectedId());
+ DomUtil::writeBoolEntry(dom, "/kdevrbdebugger/general/floatingtoolbar", enableFloatingToolBarBox->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevrbdebugger/general/showconstants", showConstants->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevrbdebugger/general/traceintoruby", traceIntoRuby->isChecked());
+ DomUtil::writeEntry(dom, "/kdevscriptproject/run/globalcwd", workingDir->url() );
+}
+
+#include "rubyconfigwidget.moc"
+