[rkward-cvs] rkward/rkward/settings rksettingsmodulegeneral.cpp,NONE,1.1 rksettingsmodulegeneral.h,NONE,1.1 Makefile.am,1.4,1.5 rksettingsmodulelogfiles.cpp,1.7,NONE rksettingsmodulelogfiles.h,1.4,NONE
Thomas Friedrichsmeier
tfry at users.sourceforge.net
Thu Oct 20 19:28:22 UTC 2005
- Previous message: [rkward-cvs] rkward/rkward/settings rksettingsmodulelogfiles.cpp,1.6,1.7 rksettingsmodulelogfiles.h,1.3,1.4
- Next message: [rkward-cvs] rkward/rkward/settings rksettings.cpp,1.8,1.9 rksettingsmodulegeneral.cpp,1.1,1.2 rksettingsmodulegeneral.h,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/rkward/rkward/rkward/settings
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29077
Modified Files:
Makefile.am
Added Files:
rksettingsmodulegeneral.cpp rksettingsmodulegeneral.h
Removed Files:
rksettingsmodulelogfiles.cpp rksettingsmodulelogfiles.h
Log Message:
Rename RKSettingsModuleLogfiles to RKSettingsModuleGeneral for future extension
--- rksettingsmodulelogfiles.cpp DELETED ---
--- NEW FILE: rksettingsmodulegeneral.h ---
/***************************************************************************
rksettingsmodulegeneral - description
-------------------
begin : Fri Jul 30 2004
copyright : (C) 2004 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
/***************************************************************************
* *
* 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 RKSETTINGSMODULEGENERALFILES_H
#define RKSETTINGSMODULEGENERALFILES_H
#include "rksettingsmodule.h"
class GetFileNameWidget;
/**
@author Thomas Friedrichsmeier
*/
class RKSettingsModuleGeneral : public RKSettingsModule {
Q_OBJECT
public:
RKSettingsModuleGeneral (RKSettings *gui, QWidget *parent);
~RKSettingsModuleGeneral ();
bool hasChanges ();
void applyChanges ();
void save (KConfig *config);
static void saveSettings (KConfig *config);
static void loadSettings (KConfig *config);
QString caption ();
/// returns the directory-name where the logfiles should reside
static QString &filesPath () { return files_path; };
public slots:
void pathChanged ();
private:
GetFileNameWidget *files_choser;
static QString files_path;
/** since changing the files_path can not easily be done while in an active session, the setting should only take effect on the next start. This string stores a changed setting, while keeping the old one intact as long as RKWard is running */
static QString new_files_path;
};
#endif
Index: Makefile.am
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/settings/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Makefile.am 16 Oct 2005 18:48:34 -0000 1.4
--- Makefile.am 20 Oct 2005 19:28:20 -0000 1.5
***************
*** 3,10 ****
noinst_LIBRARIES = libsettings.a
libsettings_a_SOURCES = rksettings.cpp rksettingsmodule.cpp \
! rksettingsmodulelogfiles.cpp rksettingsmoduleoutput.cpp rksettingsmodulephp.cpp \
rksettingsmoduleplugins.cpp rksettingsmoduler.cpp rksettingsmodulewatch.cpp \
rksettingsmoduleobjectbrowser.cpp rksettingsmoduleconsole.cpp
! noinst_HEADERS = rksettings.h rksettingsmodule.h rksettingsmodulelogfiles.h \
rksettingsmoduleoutput.h rksettingsmodulephp.h rksettingsmoduleplugins.h rksettingsmoduler.h \
rksettingsmodulewatch.h rksettingsmoduleobjectbrowser.h rksettingsmoduleconsole.h
--- 3,10 ----
noinst_LIBRARIES = libsettings.a
libsettings_a_SOURCES = rksettings.cpp rksettingsmodule.cpp \
! rksettingsmodulegeneral.cpp rksettingsmoduleoutput.cpp rksettingsmodulephp.cpp \
rksettingsmoduleplugins.cpp rksettingsmoduler.cpp rksettingsmodulewatch.cpp \
rksettingsmoduleobjectbrowser.cpp rksettingsmoduleconsole.cpp
! noinst_HEADERS = rksettings.h rksettingsmodule.h rksettingsmodulegeneral.h \
rksettingsmoduleoutput.h rksettingsmodulephp.h rksettingsmoduleplugins.h rksettingsmoduler.h \
rksettingsmodulewatch.h rksettingsmoduleobjectbrowser.h rksettingsmoduleconsole.h
--- rksettingsmodulelogfiles.h DELETED ---
--- NEW FILE: rksettingsmodulegeneral.cpp ---
/***************************************************************************
rksettingsmodulegeneral - description
-------------------
begin : Fri Jul 30 2004
copyright : (C) 2004 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
/***************************************************************************
* *
* 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 "rksettingsmodulegeneral.h"
#include <klocale.h>
#include <kconfig.h>
#include <kglobal.h>
#include <kstandarddirs.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qdir.h>
#include "../misc/getfilenamewidget.h"
#include "../rkglobals.h"
#include "../debug.h"
// static members
QString RKSettingsModuleLogfiles::files_path;
QString RKSettingsModuleLogfiles::new_files_path;
RKSettingsModuleGeneral::RKSettingsModuleGeneral (RKSettings *gui, QWidget *parent) : RKSettingsModule (gui, parent) {
RK_TRACE (SETTINGS);
QVBoxLayout *main_vbox = new QVBoxLayout (this, RKGlobals::marginHint ());
QLabel *label = new QLabel (i18n ("Settings marked with (*) do not take effect until you restart RKWard"), this);
label->setAlignment (Qt::AlignAuto | Qt::AlignVCenter | Qt::ExpandTabs | Qt::WordBreak);
main_vbox->addWidget (label);
main_vbox->addStretch ();
files_choser = new GetFileNameWidget (this, GetFileNameWidget::ExistingDirectory, i18n ("Directory where the logfiles should be kept (*)"), QString::null, new_files_path);
connect (files_choser, SIGNAL (locationChanged ()), this, SLOT (pathChanged ()));
main_vbox->addWidget (files_choser);
}
RKSettingsModuleGeneral::~RKSettingsModuleGeneral() {
RK_TRACE (SETTINGS);
}
void RKSettingsModuleGeneral::pathChanged () {
RK_TRACE (SETTINGS);
change ();
}
QString RKSettingsModuleGeneral::caption () {
RK_TRACE (SETTINGS);
return (i18n ("General"));
}
bool RKSettingsModuleGeneral::hasChanges () {
RK_TRACE (SETTINGS);
return changed;
}
void RKSettingsModuleGeneral::applyChanges () {
RK_TRACE (SETTINGS);
new_files_path = files_choser->getLocation ();
}
void RKSettingsModuleGeneral::save (KConfig *config) {
RK_TRACE (SETTINGS);
saveSettings (config);
}
void RKSettingsModuleGeneral::saveSettings (KConfig *config) {
RK_TRACE (SETTINGS);
config->setGroup ("Logfiles");
config->writeEntry ("logfile dir", new_files_path);
}
void RKSettingsModuleGeneral::loadSettings (KConfig *config) {
RK_TRACE (SETTINGS);
config->setGroup ("Logfiles");
files_path = new_files_path = config->readEntry ("logfile dir", QDir ().homeDirPath () + "/.rkward/");
}
#include "rksettingsmodulelogfiles.moc"
- Previous message: [rkward-cvs] rkward/rkward/settings rksettingsmodulelogfiles.cpp,1.6,1.7 rksettingsmodulelogfiles.h,1.3,1.4
- Next message: [rkward-cvs] rkward/rkward/settings rksettings.cpp,1.8,1.9 rksettingsmodulegeneral.cpp,1.1,1.2 rksettingsmodulegeneral.h,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the rkward-tracker
mailing list