summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp1
-rw-r--r--korganizer/koprefs.h12
2 files changed, 7 insertions, 6 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 9147af3..5078c57 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -415,96 +415,97 @@ QStringList KOPrefs::getDefaultList()
<< i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")
<< i18n("Vacation") ;
retval.sort();
//qDebug("cat %s ", retval.join("-").latin1());
return retval;
}
// << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch")<< i18n("University")<< i18n("School")<< i18n("Flight")<< i18n("Key Customer") << i18n("VIP") << i18n("SyncEvent") << i18n("Cinema")
void KOPrefs::usrReadConfig()
{
config()->setGroup("General");
//qDebug("KOPrefs::usrReadConfig() ");
mCustomCategories = config()->readListEntry("Custom Categories");
mOldLoadedLanguage = mOldLanguage ;
mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
if (mLocationDefaults.isEmpty()) {
mLocationDefaults = getLocationDefaultList();
}
if (mEventSummaryUser.isEmpty()) {
mEventSummaryUser = getDefaultList() ;
}
if (mTodoSummaryUser.isEmpty()) {
mTodoSummaryUser = getDefaultList() ;
}
if (mCustomCategories.isEmpty()) setCategoryDefaults();
config()->setGroup("Personal Settings");
mName = config()->readEntry("user_name","");
mEmail = config()->readEntry("user_email","");
fillMailDefaults();
config()->setGroup("Category Colors");
QStringList::Iterator it;
for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
}
KConfig fc (locateLocal("config","kopicalendarrc"));
fc.setGroup("CC");
int numCals = fc.readNumEntry("NumberCalendars",0 );
mNextAvailableCalendar = 1;
if ( numCals == 0 ) {
KopiCalendarFile *kkf = getNewCalendar();
kkf->isStandard = true;
kkf->mName = i18n("Standard");
kkf->mFileName = QDir::convertSeparators( locateLocal( "data", "korganizer/mycalendar.ics" ) );
+ kkf->isReadOnly = false;
}
while ( mNextAvailableCalendar <= numCals ) {
//qDebug("Read cal #%d ", mNextAvailableCalendar );
QString prefix = "Cal_" +QString::number( mNextAvailableCalendar );
KopiCalendarFile *kkf = getNewCalendar();
kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false );
kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true);
kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false );
kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true);
kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false);
kkf->mName = fc.readEntry( prefix+"_Name", "Calendar");
kkf->mFileName = QDir::convertSeparators( fc.readEntry( prefix+"_FileName", kkf->mFileName) );
kkf->mSavedFileName = QDir::convertSeparators( fc.readEntry( prefix+"_SavedFileName", kkf->mFileName) );
kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor);
if ( kkf->mCalNumber == 1 ) {
kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
}
//qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() );
if ( kkf->mName == i18n("Birthdays") ) {
kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" );
}
if ( kkf->isRelative )
kkf->mFileName = QDir::convertSeparators( KGlobalSettings::calendarDir() + kkf->mSavedFileName );
}
KPimPrefs::usrReadConfig();
}
KopiCalendarFile * KOPrefs::getCalendar( int num )
{
return mDefCalColors[num-1];
}
KopiCalendarFile * KOPrefs::getNewCalendar()
{
KopiCalendarFile * kkf = new KopiCalendarFile();
kkf->mCalNumber = mNextAvailableCalendar;
mDefCalColors.resize( mNextAvailableCalendar );
mDefCalColors[mNextAvailableCalendar-1] = kkf;
++mNextAvailableCalendar;
kkf->mDefaultColor = mEventColor;
kkf->mName = i18n("New Calendar");
mCalendars.append( kkf );
return kkf;
}
void KOPrefs::deleteCalendar( int num )
{
KopiCalendarFile * kkf = mCalendars.first();
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 70da096..94bdd33 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -7,114 +7,114 @@
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KOPREFS_H
#define KOPREFS_H
#include <libkdepim/kpimprefs.h>
#include <qdict.h>
#include <qdir.h>
#include <qobject.h>
class KConfig;
class QFont;
class QColor;
class QStringList;
#define VIEW_WN_VIEW 1
#define VIEW_NX_VIEW 2
#define VIEW_J_VIEW 3
#define VIEW_A_VIEW 4
#define VIEW_ML_VIEW 5
#define VIEW_M_VIEW 6
#define VIEW_L_VIEW 7
#define VIEW_T_VIEW 8
class KopiCalendarFile : public QObject
{
public:
KopiCalendarFile( ) : QObject( )
{
isStandard = false;
isEnabled = true;
isAlarmEnabled = true;
isReadOnly = false;
+ mErrorOnLoad = false;
+ isRelative = false;
+ mCalNumber = 0;
+ mDefaultColor = Qt::red;
mName = "Calendar";
mFileName = QDir::homeDirPath() + "/icalfile.ics";
mSavedFileName = "icalfile.ics";
- mCalNumber = 0;
- mDefaultColor = Qt::red;
- mErrorOnLoad = false;
- isRelative = false;
}
bool isStandard;
bool isEnabled;
bool isAlarmEnabled;
bool isReadOnly;
bool mErrorOnLoad;
+ bool isRelative;
+ int mCalNumber;
QString mName;
QString mFileName;
QString mSavedFileName;
- bool isRelative;
- int mCalNumber;
QColor mDefaultColor;
QDateTime mLoadDt;
};
class KOPrefs : public KPimPrefs
{
public:
enum { FormatVCalendar, FormatICalendar };
enum { MailClientKMail, MailClientSendmail };
enum { IMIPDummy, IMIPKMail };
enum { IMIPOutbox, IMIPdirectsend };
enum { neverAuto, addressbookAuto, selectedAuto };
enum { standardDestination, askDestination };
virtual ~KOPrefs();
/** Get instance of KOPrefs. It is made sure that there is only one
instance. */
static KOPrefs *instance();
/** Set preferences to default values */
void usrSetDefaults();
/** Read preferences from config file */
void usrReadConfig();
/** Write preferences to config file */
void usrWriteConfig();
void setCategoryDefaults();
void setAllDefaults();
KopiCalendarFile * getNewCalendar();
KopiCalendarFile * getCalendar( int );
void deleteCalendar( int );
QColor defaultColor( int ) const;
QString calName( int ) const;
int getCalendarID( const QString & name );
int getFuzzyCalendarID( const QString & name );
protected:
void setTimeZoneIdDefault();
/** Fill empty mail fields with default values. */
void fillMailDefaults();
private:
/** Constructor disabled for public. Use instance() to create a KOPrefs
object. */
KOPrefs();
static KOPrefs *mInstance;