[rkward-cvs] SF.net SVN: rkward:[2479] trunk/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Thu May 14 12:18:28 UTC 2009
Revision: 2479
http://rkward.svn.sourceforge.net/rkward/?rev=2479&view=rev
Author: tfry
Date: 2009-05-14 12:18:27 +0000 (Thu, 14 May 2009)
Log Message:
-----------
Add setting for options(editor)
Modified Paths:
--------------
trunk/rkward/ChangeLog
trunk/rkward/rkward/settings/rksettings.cpp
trunk/rkward/rkward/settings/rksettingsmoduler.cpp
trunk/rkward/rkward/settings/rksettingsmoduler.h
Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog 2009-05-13 21:39:09 UTC (rev 2478)
+++ trunk/rkward/ChangeLog 2009-05-14 12:18:27 UTC (rev 2479)
@@ -1,4 +1,4 @@
-- Fixed: Make built-in editor work again for file.edit () TODO: set options("editor")
+- Fixed: Make built-in editor work again for file.edit ()
- (Almost) all plugins now write a header to the output window TODO: work in progress; which ones should not?
- Add makeHeaderCode convenience function for use inside plugins TODO: document
- Adjust some icons
Modified: trunk/rkward/rkward/settings/rksettings.cpp
===================================================================
--- trunk/rkward/rkward/settings/rksettings.cpp 2009-05-13 21:39:09 UTC (rev 2478)
+++ trunk/rkward/rkward/settings/rksettings.cpp 2009-05-14 12:18:27 UTC (rev 2479)
@@ -2,7 +2,7 @@
rksettings - description
-------------------
begin : Wed Jul 28 2004
- copyright : (C) 2004, 2007, 2008 by Thomas Friedrichsmeier
+ copyright : (C) 2004, 2007, 2008, 2009 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
@@ -70,6 +70,7 @@
setFaceType (KPageDialog::Tree);
setCaption (i18n ("Settings"));
setButtons (KDialog::Ok | KDialog::Apply | KDialog::Cancel | KDialog::Help);
+ enableButtonApply (false);
setAttribute (Qt::WA_DeleteOnClose, true);
Modified: trunk/rkward/rkward/settings/rksettingsmoduler.cpp
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmoduler.cpp 2009-05-13 21:39:09 UTC (rev 2478)
+++ trunk/rkward/rkward/settings/rksettingsmoduler.cpp 2009-05-14 12:18:27 UTC (rev 2479)
@@ -47,6 +47,9 @@
int RKSettingsModuleR::options_digits;
bool RKSettingsModuleR::options_checkbounds;
QString RKSettingsModuleR::options_printcmd;
+QString RKSettingsModuleR::options_editor;
+// static constants
+QString RKSettingsModuleR::builtin_editor = "<rkward>";
RKSettingsModuleR::RKSettingsModuleR (RKSettings *gui, QWidget *parent) : RKSettingsModule(gui, parent) {
RK_TRACE (SETTINGS);
@@ -114,7 +117,7 @@
grid->addWidget (new QLabel (i18n ("Keep comments in packages"), this), ++row, 0);
keepsourcepkgs_input = new QComboBox (this);
keepsourcepkgs_input->setEditable (false);
- keepsourcepkgs_input->addItem (i18n ("TRUE)"), true);
+ keepsourcepkgs_input->addItem (i18n ("TRUE"), true);
keepsourcepkgs_input->addItem (i18n ("FALSE (default)"), false);
keepsourcepkgs_input->setCurrentIndex (options_keepsourcepkgs ? 0 : 1);
connect (keepsourcepkgs_input, SIGNAL (activated (int)), this, SLOT (boxChanged (int)));
@@ -136,7 +139,7 @@
grid->addWidget (new QLabel (i18n ("Check vector bounds (warn)"), this), ++row, 0);
checkbounds_input = new QComboBox (this);
checkbounds_input->setEditable (false);
- checkbounds_input->addItem (i18n ("TRUE)"), true);
+ checkbounds_input->addItem (i18n ("TRUE"), true);
checkbounds_input->addItem (i18n ("FALSE (default)"), false);
checkbounds_input->setCurrentIndex (options_checkbounds ? 0 : 1);
connect (checkbounds_input, SIGNAL (activated (int)), this, SLOT (boxChanged (int)));
@@ -147,6 +150,17 @@
connect (printcmd_input, SIGNAL (textChanged (const QString &)), this, SLOT (textChanged (const QString &)));
grid->addWidget (printcmd_input, row, 1);
+ grid->addWidget (new QLabel (i18n ("Editor command"), this), ++row, 0);
+ editor_input = new QComboBox (this);
+ editor_input->setEditable (true);
+ editor_input->addItem (builtin_editor);
+ if (options_editor != builtin_editor) {
+ editor_input->addItem (options_editor);
+ editor_input->setCurrentIndex (1);
+ }
+ connect (editor_input, SIGNAL (editTextChanged (const QString &)), this, SLOT (textChanged (const QString &)));
+ grid->addWidget (editor_input, row, 1);
+
main_vbox->addStretch ();
}
@@ -193,6 +207,7 @@
options_digits = digits_input->value ();
options_checkbounds = checkbounds_input->itemData (checkbounds_input->currentIndex ()).toBool ();
options_printcmd = printcmd_input->text ();
+ options_editor = editor_input->currentText ();
// apply run time options in R
QStringList commands = makeRRunTimeOptionCommands ();
@@ -220,6 +235,8 @@
if (options_checkbounds) tf = "TRUE"; else tf = "FALSE";
list.append ("options (checkbounds=" + tf + ")\n");
list.append ("options (printcmd=\"" + options_printcmd + "\")\n");
+ if (options_editor == builtin_editor) list.append ("options (editor=rk.edit.files)\n");
+ else list.append ("options (editor=\"" + options_editor + "\")\n");
#warning TODO make configurable
list.append ("options (device=\"rk.screen.device\")\n");
@@ -250,6 +267,7 @@
cg.writeEntry ("digits", options_digits);
cg.writeEntry ("check.bounds", options_checkbounds);
cg.writeEntry ("printcmd", options_printcmd);
+ cg.writeEntry ("editor", options_editor);
}
void RKSettingsModuleR::loadSettings (KConfig *config) {
@@ -267,6 +285,7 @@
options_digits = cg.readEntry ("digits", 7);
options_checkbounds = cg.readEntry ("check.bounds", false);
options_printcmd = cg.readEntry ("printcmd", "kprinter");
+ options_editor = cg.readEntry ("editor", builtin_editor);
}
//#################################################
Modified: trunk/rkward/rkward/settings/rksettingsmoduler.h
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmoduler.h 2009-05-13 21:39:09 UTC (rev 2478)
+++ trunk/rkward/rkward/settings/rksettingsmoduler.h 2009-05-14 12:18:27 UTC (rev 2479)
@@ -69,6 +69,7 @@
KIntSpinBox *digits_input;
QComboBox *checkbounds_input;
QLineEdit *printcmd_input;
+ QComboBox *editor_input;
static QString options_outdec;
static int options_width;
@@ -81,6 +82,10 @@
static int options_digits;
static bool options_checkbounds;
static QString options_printcmd;
+ static QString options_editor;
+
+// constants
+ static QString builtin_editor;
};
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list