[rkward-cvs] rkward/rkward/settings rksettings.cpp, 1.9, 1.10 rksettings.h, 1.6, 1.7 rksettingsmoduler.cpp, 1.13, 1.14 rksettingsmoduler.h, 1.7, 1.8
Thomas Friedrichsmeier
tfry at users.sourceforge.net
Thu Jun 22 18:56:19 UTC 2006
Update of /cvsroot/rkward/rkward/rkward/settings
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29747
Modified Files:
rksettings.cpp rksettings.h rksettingsmoduler.cpp
rksettingsmoduler.h
Log Message:
Started adding library location selection
Index: rksettingsmoduler.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/settings/rksettingsmoduler.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** rksettingsmoduler.cpp 13 Nov 2005 14:31:29 -0000 1.13
--- rksettingsmoduler.cpp 22 Jun 2006 18:56:17 -0000 1.14
***************
*** 22,25 ****
--- 22,26 ----
#include <kinputdialog.h>
#include <knuminput.h>
+ #include <kfiledialog.h>
#include <qlayout.h>
***************
*** 280,282 ****
--- 281,359 ----
}
+ //#################################################
+ //############### RKSettingsModuleRPackages ################
+ //#################################################
+
+ // static members
+ QStringList RKSettingsModuleRPackages::liblocs;
+
+ RKSettingsModuleRPackages::RKSettingsModuleRPackages (RKSettings *gui, QWidget *parent) : RKSettingsModule(gui, parent) {
+ RK_TRACE (SETTINGS);
+
+ QVBoxLayout *main_vbox = new QVBoxLayout (this, RKGlobals::marginHint ());
+
+ main_vbox->addSpacing (2*RKGlobals::spacingHint ());
+
+ libloc_selector = new MultiStringSelector (i18n ("R Library locations (where R addons get installed to) NOT USED, YET"), this);
+ libloc_selector->setValues (liblocs);
+ connect (libloc_selector, SIGNAL (listChanged ()), this, SLOT (listChanged ()));
+ connect (libloc_selector, SIGNAL (getNewStrings (QStringList*)), this, SLOT (addLibLoc (QStringList*)));
+ main_vbox->addWidget (libloc_selector);
+ QLabel *label = new QLabel (i18n ("If you leave the list empty, only the startup defaults will be used"), this);
+ main_vbox->addWidget (label);
+ }
+
+ RKSettingsModuleRPackages::~RKSettingsModuleRPackages() {
+ RK_TRACE (SETTINGS);
+ }
+
+ void RKSettingsModuleRPackages::listChanged () {
+ RK_TRACE (SETTINGS);
+ change ();
+ }
+
+ void RKSettingsModuleRPackages::addLibLoc (QStringList *string_list) {
+ RK_TRACE (SETTINGS);
+ QString new_string = KFileDialog::getExistingDirectory (QString::null, this, i18n ("Add R Library Directory"));
+ if (!new_string.isEmpty ()) {
+ (*string_list).append (new_string);
+ }
+ }
+
+ QString RKSettingsModuleRPackages::caption () {
+ RK_TRACE (SETTINGS);
+ return (i18n ("R-Packages"));
+ }
+
+ bool RKSettingsModuleRPackages::hasChanges () {
+ RK_TRACE (SETTINGS);
+ return changed;
+ }
+
+ void RKSettingsModuleRPackages::applyChanges () {
+ RK_TRACE (SETTINGS);
+
+ liblocs = libloc_selector->getValues ();
+ }
+
+ void RKSettingsModuleRPackages::save (KConfig *config) {
+ RK_TRACE (SETTINGS);
+
+ saveSettings (config);
+ }
+
+ void RKSettingsModuleRPackages::saveSettings (KConfig *config) {
+ RK_TRACE (SETTINGS);
+
+ config->setGroup ("R Settings");
+ config->writeEntry ("LibraryLocations", liblocs);
+ }
+
+ void RKSettingsModuleRPackages::loadSettings (KConfig *config) {
+ RK_TRACE (SETTINGS);
+
+ config->setGroup ("R Settings");
+ liblocs = config->readListEntry ("LibraryLocations");
+ }
+
#include "rksettingsmoduler.moc"
Index: rksettings.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/settings/rksettings.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** rksettings.h 16 Oct 2005 18:48:34 -0000 1.6
--- rksettings.h 22 Jun 2006 18:56:17 -0000 1.7
***************
*** 37,41 ****
class RKSettings : public KDialogBase {
public:
! enum SettingsPage { NoPage=0, Plugins=1, R=2, PHP=3, LogFiles=4, Output=5, Watch=6, ObjectBrowser=7, Console=8 };
static void configureSettings (SettingsPage page=NoPage, QWidget *parent=0, RCommandChain *chain=0);
--- 37,41 ----
class RKSettings : public KDialogBase {
public:
! enum SettingsPage { NoPage=0, Plugins=1, R=2, RPackages=3, PHP=4, LogFiles=5, Output=6, Watch=7, ObjectBrowser=8, Console=9 };
static void configureSettings (SettingsPage page=NoPage, QWidget *parent=0, RCommandChain *chain=0);
Index: rksettingsmoduler.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/settings/rksettingsmoduler.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** rksettingsmoduler.h 13 Nov 2005 14:31:29 -0000 1.7
--- rksettingsmoduler.h 22 Jun 2006 18:56:17 -0000 1.8
***************
*** 86,88 ****
--- 86,117 ----
};
+ /**
+ Configure packages and library paths
+
+ @author Thomas Friedrichsmeier
+ */
+ class RKSettingsModuleRPackages : public RKSettingsModule {
+ Q_OBJECT
+ public:
+ RKSettingsModuleRPackages (RKSettings *gui, QWidget *parent);
+
+ ~RKSettingsModuleRPackages ();
+
+ bool hasChanges ();
+ void applyChanges ();
+ void save (KConfig *config);
+
+ static void saveSettings (KConfig *config);
+ static void loadSettings (KConfig *config);
+
+ QString caption ();
+ public slots:
+ void listChanged ();
+ void addLibLoc (QStringList *string_list);
+ private:
+ MultiStringSelector *libloc_selector;
+
+ static QStringList liblocs;
+ };
+
#endif
Index: rksettings.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/settings/rksettings.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** rksettings.cpp 20 Oct 2005 19:45:54 -0000 1.9
--- rksettings.cpp 22 Jun 2006 18:56:17 -0000 1.10
***************
*** 83,86 ****
--- 83,87 ----
modules.append (new RKSettingsModulePlugins (this, this));
modules.append (new RKSettingsModuleR (this, this));
+ modules.append (new RKSettingsModuleRPackages (this, this));
modules.append (new RKSettingsModulePHP (this, this));
modules.append (new RKSettingsModuleGeneral (this, this));
***************
*** 146,149 ****
--- 147,151 ----
RKSettingsModulePlugins::loadSettings(config);
RKSettingsModuleR::loadSettings(config);
+ RKSettingsModuleRPackages::loadSettings(config);
RKSettingsModulePHP::loadSettings(config);
RKSettingsModuleGeneral::loadSettings(config);
***************
*** 159,162 ****
--- 161,165 ----
RKSettingsModulePlugins::saveSettings(config);
RKSettingsModuleR::saveSettings(config);
+ RKSettingsModuleRPackages::saveSettings(config);
RKSettingsModulePHP::saveSettings(config);
RKSettingsModuleGeneral::saveSettings(config);
More information about the rkward-tracker
mailing list