summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-04 14:29:18 (UTC)
committer zautrix <zautrix>2005-07-04 14:29:18 (UTC)
commit7221ff029af217ae703e8217333bd9b170203181 (patch) (side-by-side diff)
treef294b7f4c0235858868c2a44f70b3014b7c53aab
parent172078c08cd183e9f7ec913a9bf42426e3585b78 (diff)
downloadkdepimpi-7221ff029af217ae703e8217333bd9b170203181.zip
kdepimpi-7221ff029af217ae703e8217333bd9b170203181.tar.gz
kdepimpi-7221ff029af217ae703e8217333bd9b170203181.tar.bz2
box
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/journalentry.cpp36
-rw-r--r--korganizer/journalentry.h3
-rw-r--r--korganizer/koeditorgeneral.cpp4
-rw-r--r--korganizer/kojournalview.cpp18
-rw-r--r--korganizer/kolocationbox.cpp8
-rw-r--r--korganizer/kolocationbox.h2
-rw-r--r--korganizer/koprefs.cpp2
-rw-r--r--korganizer/koprefs.h1
8 files changed, 47 insertions, 27 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index 3c38f34..4751d40 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -22,112 +22,118 @@
*/
//
// Journal Entry
#include <qlabel.h>
#include <qlayout.h>
#include <qvbox.h>
#include <qfile.h>
#include <qdir.h>
#include <qtextstream.h>
#include <qtextcodec.h>
#include <qpixmap.h>
#include <qpushbutton.h>
#include <qapplication.h>
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
#include <ktextedit.h>
#include <kfiledialog.h>
#include <kmessagebox.h>
#include "koprefs.h"
#include <klineedit.h>
+#include <kdialog.h>
+#include "kolocationbox.h"
#include <libkcal/journal.h>
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <kresources/resourceselectdialog.h>
#include "journalentry.h"
//#include "journalentry.moc"
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#endif
JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
QFrame(parent)
{
int fac = 5;
heiHint = QApplication::desktop()->height();
if ( heiHint > 800 )
fac += 2;
heiHint = heiHint / fac;
showOnlyMode = false;
mCalendar = calendar;
mJournal = 0;
visibleMode = true;
QHBox * vb = new QHBox ( this );
QPixmap iconp;
-
+ vb->setMargin ( KDialog::marginHint()-1 );
QPushButton * toggleJournal = new QPushButton( vb );
iconp = SmallIcon("1updownarrow");
toggleJournal->setPixmap (iconp ) ;
new QLabel(" "+i18n("Title: "),vb);
- mTitle = new KLineEdit ( vb );
+ mTitle = new KOLocationBox(TRUE, vb, 30);
+ mTitle->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding ,QSizePolicy::Fixed ,FALSE) );
mTitleLabel = new QLabel(i18n("Title"),vb);
mTitleLabel->setMargin(0);
mTitleLabel->setAlignment(AlignCenter);
QPushButton * loadTemplate = new QPushButton( vb );
QPushButton * saveTemplate = new QPushButton( vb );
if ( QApplication::desktop()->width() < 321 )
iconp = SmallIcon("fileexport16");
else
iconp = SmallIcon("fileexport");
saveTemplate->setPixmap (iconp ) ;
int size = saveTemplate->sizeHint().height();
if ( QApplication::desktop()->width() < 321 )
iconp = SmallIcon("fileimport16");
else
iconp = SmallIcon("fileimport");
loadTemplate->setPixmap (iconp ) ;
loadTemplate->setFixedSize( size, size );
saveTemplate->setFixedSize( size, size );
toggleJournal->setFixedSize( size , size );
+ mTitle->setMaximumHeight( size+4);
mEditor = new KTextEdit(this);
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold );
#endif
mEditor->setWordWrap( KTextEdit::WidgetWidth );
QBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->addWidget(vb);
topLayout->addWidget(mEditor);
mEditor->installEventFilter(this);
connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) );
+ mTitle->load( KOLocationBox::SUMMARYJOURNAL );
+ mTitle->lineEdit ()->setText("");
}
JournalEntry::~JournalEntry()
{
//qDebug("JournalEntry::~JournalEntry() ");
}
QSize JournalEntry::sizeHint() const
{
return QSize ( 240, heiHint );
}
void JournalEntry::slotSaveTemplate()
{
QString fileName =locateLocal( "templates", "journals" );
QDir t_dir;
if ( !t_dir.exists(fileName) )
t_dir.mkdir ( fileName );
fileName += "/journal";
fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this );
if ( fileName.length() == 0 )
return;
QFile fileIn( fileName );
if (!fileIn.open( IO_WriteOnly ) ) {
KMessageBox::error( this, i18n("Error saving template file\n '%1'.")
@@ -156,134 +162,138 @@ void JournalEntry::slotLoadTemplate()
.arg( fileName ) );
return;
}
QTextStream tsIn( &fileIn );
tsIn.setCodec( QTextCodec::codecForName("utf8") );
QString text = tsIn.read();
fileIn.close();
int line, col;
mEditor->getCursorPosition (& line, & col );
mEditor-> insertAt ( text, line, col, true );
//mEditor->setIgnoreMark( true );
}
void JournalEntry::setDate(const QDate &date)
{
showOnlyMode = false;
writeJournal();
mDate = date;
int id = mCalendar->defaultCalendar();
QString calname = KOPrefs::instance()->getCalendar( id )->mName;
mTitleLabel->setText( " (" + calname +")");
}
void JournalEntry::toggleShowJournal()
{
- if (!mEditor->text().isEmpty() || !mTitle->text().isEmpty())
+ if (!mEditor->text().isEmpty() || !mTitle->currentText ().isEmpty())
flushEntry();
if ( showOnlyMode )
emit showJournalOnly( 0 );
else {
// we have to protect mJournal from deleting if mJournal has empty text
visibleMode = false; // set to true via :setShowOnly()
emit showJournalOnly( mJournal );
//QTimer::singleShot( 0, this, SLOT( setVisibleOn() ) );
}
}
void JournalEntry::setVisibleOn()
{
visibleMode = true;
}
void JournalEntry::setShowOnly()
{
showOnlyMode = true;
- if ( mTitle->text().isEmpty() )
+ if ( mTitle->currentText().isEmpty() )
mTitle->setFocus();
else
mEditor->setFocus();
}
void JournalEntry::setJournal(Journal *journal)
{
writeJournal();
+ mTitle->load( KOLocationBox::SUMMARYJOURNAL );
mJournal = journal;
if ( journal->isReadOnly() )
- mTitle->setText(mJournal->summary()+" ("+i18n("readonly")+")");
+ mTitle->lineEdit ()->setText(mJournal->summary()+" ("+i18n("readonly")+")");
else
- mTitle->setText(mJournal->summary());
+ mTitle->lineEdit ()->setText(mJournal->summary());
mEditor->setText(mJournal->description());
- mTitle->setReadOnly (journal->isReadOnly() );
+ mTitle->setEnabled (!journal->isReadOnly() );
mEditor->setReadOnly ( journal->isReadOnly() );
int id = mJournal->calID();
QString calname = KOPrefs::instance()->getCalendar( id )->mName;
mTitleLabel->setText( " (" + calname +")");
-
}
Journal *JournalEntry::journal() const
{
return mJournal;
}
void JournalEntry::clear()
{
mJournal = 0;
mEditor->setText("");
- mTitle->setText("");
+ mTitle->load( KOLocationBox::SUMMARYJOURNAL );
+ mTitle->lineEdit ()->setText("");
}
bool JournalEntry::eventFilter( QObject *o, QEvent *e )
{
// kdDebug() << "JournalEntry::event received " << e->type() << endl;
if ( e->type() == QEvent::FocusOut ) {
writeJournal();
}
if ( e->type() == QEvent::KeyPress ) {
QKeyEvent * k = (QKeyEvent *) e;
if ( k->state() == Qt::ControlButton ) {
k->ignore();
//return true;
}
}
return QFrame::eventFilter( o, e ); // standard event processing
}
void JournalEntry::writeJournal()
{
if ( !visibleMode ) return;
- if (mEditor->text().isEmpty() && mTitle->text().isEmpty()) {
+ if (mEditor->text().isEmpty() && mTitle->currentText().isEmpty()) {
if ( mJournal ) {
Journal* j = mJournal;
mJournal = 0;
bool conf = KOPrefs::instance()->mConfirm;
KOPrefs::instance()->mConfirm = false;
emit deleteJournal(j);
KOPrefs::instance()->mConfirm = conf;
}
return;
}
// kdDebug() << "JournalEntry::writeJournal()..." << endl;
if (!mJournal) {
mJournal = new Journal;
mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0)));
mCalendar->addJournal(mJournal);
}
- if ( mJournal->description() != mEditor->text() )
+ if ( mJournal->description() != mEditor->text() ) {
mJournal->setDescription(mEditor->text());
- if ( mJournal->summary() != mTitle->text() )
- mJournal->setSummary(mTitle->text());
+ }
+ if ( mJournal->summary() != mTitle->currentText() ) {
+ mJournal->setSummary(mTitle->currentText());
+ mTitle->save(KOLocationBox::SUMMARYJOURNAL);
+ }
}
void JournalEntry::flushEntry()
{
writeJournal();
}
void JournalEntry::keyPressEvent ( QKeyEvent * e )
{
e->ignore();
}
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h
index cc9b5ef..fb19fb1 100644
--- a/korganizer/journalentry.h
+++ b/korganizer/journalentry.h
@@ -11,74 +11,75 @@
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 JOURNALENTRY_H
#define JOURNALENTRY_H
//
// Widget showing one Journal entry
#include <qframe.h>
#include <libkcal/calendar.h>
class QLabel;
class KTextEdit;
class KLineEdit;
+class KOLocationBox;
using namespace KCal;
class JournalEntry : public QFrame {
Q_OBJECT
public:
JournalEntry(Calendar *,QWidget *parent);
virtual ~JournalEntry();
void setJournal(Journal *);
Journal *journal() const;
void setDate(const QDate &);
void clear();
void flushEntry();
void setShowOnly();
QSize sizeHint() const;
void setVisibleMode( bool b ) { visibleMode = b;}
protected slots:
void slotSaveTemplate();
void slotLoadTemplate();
void toggleShowJournal();
void setVisibleOn();
signals:
void deleteJournal(Journal *);
void newJournal();
void showJournalOnly( Journal * );
protected:
bool eventFilter( QObject *o, QEvent *e );
void writeJournal();
private:
bool visibleMode;
bool showOnlyMode;
Calendar *mCalendar;
Journal *mJournal;
QDate mDate;
void keyPressEvent ( QKeyEvent * ) ;
QLabel *mTitleLabel;
- KLineEdit * mTitle;
+ KOLocationBox * mTitle;
KTextEdit *mEditor;
int heiHint;
};
#endif
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 407a5d5..fd50b05 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -62,71 +62,71 @@
KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) :
QObject( parent, name)
{
mNextFocus = 0;
}
KOEditorGeneral::~KOEditorGeneral()
{
}
void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
{
QGridLayout *headerLayout = new QGridLayout(topLayout);
#if 0
mOwnerLabel = new QLabel(i18n("Owner:"),parent);
headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1);
#endif
// 1 on pda
// 11 on desktop
headerLayout->setSpacing( (KDialog::spacingHint()-3)*2+1 );
QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent);
headerLayout->addWidget(summaryLabel,0,0);
- mSummaryEdit = new KOLocationBox(TRUE,parent, 10);
+ mSummaryEdit = new KOLocationBox(TRUE,parent, 50);
mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
//mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) );
//qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() );
int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2;
if ( QApplication::desktop()->width() > 320 )
mSummaryEdit->setMaximumHeight( hei +6 );
//qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding );
// SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink }
// mSummaryEdit = new QLineEdit(parent);
if ( QApplication::desktop()->height() < 320 )
headerLayout->addWidget(mSummaryEdit,0,1);
else
headerLayout->addMultiCellWidget(mSummaryEdit,0,0,1,2);
connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
QLabel *locationLabel = new QLabel(i18n("Location:"),parent);
if ( QApplication::desktop()->height() < 320 )
headerLayout->addWidget(locationLabel,0,2);
else
headerLayout->addWidget(locationLabel,1,0);
- mLocationEdit = new KOLocationBox(TRUE,parent,10);
+ mLocationEdit = new KOLocationBox(TRUE,parent,30);
mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->height() > 240 )
mLocationEdit->setMaximumHeight( hei + 6);
// mLocationEdit = new QLineEdit(parent);
connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
mCalendarBox = new QComboBox ( parent );
mCalendarBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
if ( QApplication::desktop()->height() < 320 ) {
headerLayout->addWidget(mLocationEdit,0,3);
headerLayout->addWidget(mCalendarBox,0,4);
headerLayout->setColStretch( 1, 10);
headerLayout->setColStretch( 3, 10);
mCalendarBox->setMaximumWidth( 64 );
}
else {
headerLayout->addWidget(mLocationEdit,1,1);
headerLayout->addWidget(mCalendarBox,1,2);
headerLayout->setColStretch( 1, 3);
headerLayout->setColStretch( 2, 1);
}
}
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index 6fa9b23..9b0e748 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -29,69 +29,69 @@
#include <qpopupmenu.h>
#include <qhbox.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qapplication.h>
#include <klocale.h>
#include <kdebug.h>
#include "koprefs.h"
#include <kglobal.h>
#include <libkcal/calendar.h>
#include "journalentry.h"
#include "kojournalview.h"
using namespace KOrg;
KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
const char *name)
: KOrg::BaseView(calendar, parent, name)
{
mCalendar = calendar;
- QScrollView * sv = new QScrollView( this );
- QHBoxLayout * hbl = new QHBoxLayout( this );
- hbl->addWidget( sv );
- parWid = new QWidget( sv->viewport() );
- sv->addChild(parWid);
- sv->setResizePolicy( QScrollView:: AutoOneFit );
- mTopLayout = new QVBoxLayout(parWid);
- QHBox * vb = new QHBox ( parWid );
+ QHBox * vb = new QHBox ( this );
QPushButton * newJournal = new QPushButton( vb );
QPixmap icon;
if ( QApplication::desktop()->width() < 321 )
icon = SmallIcon("ko16old");
else
icon = SmallIcon("ko24old");
newJournal->setPixmap (icon ) ;
int size = newJournal->sizeHint().height();
newJournal->setFixedSize( size, size );
mDateLabel = new QLabel ( vb );
- mTopLayout->addWidget( vb );
mDateLabel->setMargin(1);
mDateLabel->setAlignment(AlignCenter);
+ QScrollView * sv = new QScrollView( this );
+ QVBoxLayout * hbl = new QVBoxLayout( this );
+ hbl->addWidget( vb );
+ hbl->addWidget( sv );
+ parWid = new QWidget( sv->viewport() );
+ sv->addChild(parWid);
+ sv->setResizePolicy( QScrollView:: AutoOneFit );
+ mTopLayout = new QVBoxLayout(parWid);
connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) );
getNewEntry();
}
KOJournalView::~KOJournalView()
{
}
int KOJournalView::currentDateCount()
{
return 0;
}
JournalEntry* KOJournalView::getNewEntry()
{
JournalEntry* Entry = new JournalEntry(mCalendar,parWid);
jEntries.append( Entry );
mTopLayout->addWidget(Entry);
Entry->setFont ( KOPrefs::instance()->mJornalViewFont );
connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ;
connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ;
connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ;
return Entry;
}
diff --git a/korganizer/kolocationbox.cpp b/korganizer/kolocationbox.cpp
index 35a8123..9d5aafc 100644
--- a/korganizer/kolocationbox.cpp
+++ b/korganizer/kolocationbox.cpp
@@ -13,84 +13,90 @@
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.
*/
#include "kolocationbox.h"
#include <qstring.h>
#include <qlineedit.h>
#include <qapplication.h>
KOLocationBox::KOLocationBox( bool rw , QWidget *parent , int _maxItems) :
QComboBox( rw , parent )
{
maxItems = _maxItems;
- maxItems = 50; // sorry - hack from me to set maxitems globally to 30
+ //maxItems = 50; // sorry - hack from me to set maxitems globally to 30
setInsertionPolicy(AtTop);
setDuplicatesEnabled( FALSE );
setMaxCount( maxItems );
setAutoCompletion( TRUE );
}
KOLocationBox::~KOLocationBox()
{
}
void KOLocationBox::load(int what)
{
clear();
// qDebug("load %d ",what );
switch(what) {
case LOCATION:
insertStringList( KOPrefs::instance()->mLocationDefaults, 0 );
// insertStringList( KOPrefs::instance()->mLocationUserDefaults, 0 );
break; // don't disable
case SUMMARYEVENT:
insertStringList( KOPrefs::instance()->mEventSummaryUser, 0 );
break; // don't disable
case SUMMARYTODO:
insertStringList( KOPrefs::instance()->mTodoSummaryUser, 0 );
break; // don't disable
+ case SUMMARYJOURNAL:
+ insertStringList( KOPrefs::instance()->mJournalSummaryUser, 0 );
+ break; // don't disable
}
}
void KOLocationBox::save(int what)
{
strlist.clear();
for( int l = 0; l < count() ; l++ ) {
strlist << text( l );
}
// strlist.sort();
QString currentLine = lineEdit()->text();
if ( !strlist.contains( currentLine ) )
strlist.prepend( currentLine );
// qDebug("save %d ", what);
switch(what) {
case LOCATION:
KOPrefs::instance()->mLocationDefaults = strlist;
// KOPrefs::instance()->mLocationUserDefaults = strlist;
break; // don't disable
case SUMMARYEVENT:
KOPrefs::instance()->mEventSummaryUser = strlist;
break; // don't disable
case SUMMARYTODO:
KOPrefs::instance()->mTodoSummaryUser = strlist;
break; // don't disable
+ case SUMMARYJOURNAL:
+ KOPrefs::instance()->mJournalSummaryUser = strlist;
+ break; // don't disable
}
}
void KOLocationBox::clearItems(int what)
{
clear();
save(what);
}
diff --git a/korganizer/kolocationbox.h b/korganizer/kolocationbox.h
index b604d33..6a42de6 100644
--- a/korganizer/kolocationbox.h
+++ b/korganizer/kolocationbox.h
@@ -15,41 +15,41 @@
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 KOLOCATIONBOX_H
#define KOLOCATIONBOX_H
#include <qcombobox.h>
#include "koprefs.h"
class KOLocationBox : public QComboBox
{
public:
KOLocationBox( bool rw , QWidget *parent , int _maxItems );
virtual ~KOLocationBox();
- enum {LOCATION, SUMMARYEVENT, SUMMARYTODO};
+ enum {LOCATION, SUMMARYEVENT, SUMMARYTODO,SUMMARYJOURNAL};
public slots:
void load(int);
void save(int);
void clearItems(int); // clear listbox and config rc items
protected:
// void focusOutEvent( QFocusEvent * );
// void timerEvent( QTimerEvent * );
private:
int maxItems; // maximal listbox items
QStringList strlist; // temporary stringlist
};
#endif
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 6337ca5..bb3d720 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -110,48 +110,49 @@ KOPrefs::KOPrefs() :
addItemBool("ToolBarHor",&mToolBarHor, true );
addItemBool("ToolBarUp",&mToolBarUp, false );
addItemBool("ToolBarHorV",&mToolBarHorV, true );
addItemBool("ToolBarUpV",&mToolBarUpV, false );
addItemBool("ToolBarHorN",&mToolBarHorN, true );
addItemBool("ToolBarUpN",&mToolBarUpN, false );
addItemBool("ToolBarHorF",&mToolBarHorF, true );
addItemBool("ToolBarUpF",&mToolBarUpF, false );
addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
addItemInt("Whats Next Days",&mWhatsNextDays,3);
addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true);
addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
addItemInt("AllDay Size",&mAllDaySize,28);
QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
addItemStringList("LocationDefaults",&mLocationDefaults );
addItemStringList("EventSummary User",&mEventSummaryUser);
addItemStringList("TodoSummary User",&mTodoSummaryUser);
+ addItemStringList("JournalSummary User",&mJournalSummaryUser);
addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
addItemBool("Enable Project View",&mEnableProjectView,false);
addItemBool("Auto Save",&mAutoSave,false);
addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
addItemBool("Confirm Deletes",&mConfirm,true);
addItemString("Archive File",&mArchiveFile);
addItemString("Html Export File",&mHtmlExportFile,
QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
addItemBool("Html With Save",&mHtmlWithSave,false);
KPrefs::setCurrentGroup("Personal Settings");
addItemInt("Mail Client",&mMailClient,MailClientKMail);
addItemBool("Use Control Center Email",&mEmailControlCenter,false);
addItemBool("Bcc",&mBcc,false);
KPrefs::setCurrentGroup("Time & Date");
addItemInt("Default Start Time",&mStartTime,10);
addItemInt("Default Duration",&mDefaultDuration,2);
addItemInt("Default Alarm Time",&mAlarmTime,3);
KPrefs::setCurrentGroup("AlarmSettings");
@@ -342,48 +343,49 @@ KOPrefs *KOPrefs::instance()
return mInstance;
}
void KOPrefs::usrSetDefaults()
{
}
void KOPrefs::fillMailDefaults()
{
if (mName.isEmpty()) mName = i18n("Anonymous");
if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
}
void KOPrefs::setTimeZoneIdDefault()
{
;
}
void KOPrefs::setAllDefaults()
{
setCategoryDefaults();
mEventSummaryUser = getDefaultList() ;
mTodoSummaryUser = getDefaultList() ;
+ mJournalSummaryUser = getDefaultList() ;
mLocationDefaults = getLocationDefaultList();
}
void KOPrefs::setCategoryDefaults()
{
mCustomCategories.clear();
mCustomCategories = getDefaultList();
QStringList::Iterator it;
for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
setCategoryColor(*it,mDefaultCategoryColor);
}
}
QStringList KOPrefs::getLocationDefaultList()
{
QStringList retval ;
retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
<< i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room")
<< i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
<< i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
// << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
retval.sort();
return retval;
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 5cc9bfa..53d193b 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -294,48 +294,49 @@ class KOPrefs : public KPimPrefs
bool mViewChangeHoldNonFullscreen;
bool mCenterOnCurrentTime;
bool mSetTimeToDayStartAt;
bool mHighlightCurrentDay;
bool mUseHighlightLightColor;
bool mListViewMonthTimespan;
bool mWNViewShowsParents;
bool mWNViewShowsPast;
bool mWNViewShowLocation;
bool mTodoViewShowsPercentage;
bool mTodoViewUsesCatColors;
bool mMonthViewUsesBigFont;
bool mTodoViewUsesSmallFont;
bool mTodoViewUsesForegroundColor;
bool mMonthViewUsesForegroundColor;
bool mHightlightDateTimeEdit;
bool mShortDateInViewer;
bool mShowDateNavigator;
QStringList mLocationDefaults;
QStringList mEventSummaryUser;
QStringList mTodoSummaryUser;
+ QStringList mJournalSummaryUser;
bool mUseInternalAlarmNotification;
int mAlarmPlayBeeps;
int mAlarmSuspendTime;
int mAlarmSuspendCount;
int mAlarmBeepInterval;
int mOldLanguage;
int mOldLoadedLanguage;
QString mActiveSyncPort;
QString mActiveSyncIP;
// settings for eventviewer
bool mEVshowDetails;
bool mEVshowCreated;
bool mEVshowChanged;
bool mWTshowDetails;
bool mWTshowCreated;
bool mWTshowChanged;
int mCurrentDisplayedView;
QPtrList<KopiCalendarFile> mCalendars;
int mNextAvailableCalendar;