summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-30 04:35:32 (UTC)
committer zautrix <zautrix>2005-06-30 04:35:32 (UTC)
commit63147898391dbeabca2dc8f48730b324c15a7498 (patch) (side-by-side diff)
tree6f42b6fc1d95ee584d44deb50726e94c02f986e5
parent54dd512d3980381c2b02263462db03ae7c5a0264 (diff)
downloadkdepimpi-63147898391dbeabca2dc8f48730b324c15a7498.zip
kdepimpi-63147898391dbeabca2dc8f48730b324c15a7498.tar.gz
kdepimpi-63147898391dbeabca2dc8f48730b324c15a7498.tar.bz2
fixxi
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/journalentry.cpp7
-rw-r--r--korganizer/kojournalview.cpp2
2 files changed, 4 insertions, 5 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index 232ea58..58863fe 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -24,118 +24,117 @@
//
// 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 <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)
{
heiHint = QApplication::desktop()->height() / 5 ;
showOnlyMode = false;
mCalendar = calendar;
mJournal = 0;
mDirty = false;
QHBox * vb = new QHBox ( this );
QIconSet icon;
QPushButton * toggleJournal = new QPushButton( vb );
icon = SmallIcon("1updownarrow");
toggleJournal->setIconSet (icon ) ;
- int size = toggleJournal->sizeHint().height();
- toggleJournal->setFixedSize( size * 2 /3 , size );
new QLabel(i18n(" Title: "),vb);
mTitle = new KLineEdit ( vb );
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 )
icon = SmallIcon("fileexport16");
else
icon = SmallIcon("fileexport");
saveTemplate->setIconSet (icon ) ;
- //size = saveTemplate->sizeHint().height();
- saveTemplate->setFixedSize( size, size );
+ int size = saveTemplate->sizeHint().height();
if ( QApplication::desktop()->width() < 321 )
icon = SmallIcon("fileimport16");
else
icon = SmallIcon("fileimport");
loadTemplate->setIconSet (icon ) ;
loadTemplate->setFixedSize( size, size );
+ saveTemplate->setFixedSize( size, size );
+ toggleJournal->setFixedSize( size , size );
mEditor = new KTextEdit(this);
connect(mEditor,SIGNAL(textChanged()),SLOT(setDirty()));
#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( mTitle, SIGNAL( textChanged ( const QString & ) ), this , SLOT( setDirty() ) );
connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) );
}
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'.")
.arg( fileName ) );
return;
}
// QString text;
QTextStream tsIn( &fileIn );
tsIn.setCodec( QTextCodec::codecForName("utf8") );
tsIn << mEditor->text();
fileIn.close();
}
void JournalEntry::slotLoadTemplate()
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index 4fc9013..ff87ef4 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -24,97 +24,97 @@
//
// View of Journal entries
#include <qlayout.h>
#include <qscrollview.h>
#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 );
QPushButton * newJournal = new QPushButton( vb );
QIconSet icon;
if ( QApplication::desktop()->width() < 321 )
icon = SmallIcon("ko16old");
else
icon = SmallIcon("ko24old");
newJournal->setIconSet (icon ) ;
int size = newJournal->sizeHint().height();
newJournal->setFixedSize( size, size );
mDateLabel = new QLabel ( vb );
mTopLayout->addWidget( vb );
- mDateLabel->setMargin(2);
+ mDateLabel->setMargin(1);
mDateLabel->setAlignment(AlignCenter);
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;
}
QPtrList<Incidence> KOJournalView::selectedIncidences()
{
QPtrList<Incidence> eventList;
return eventList;
}
void KOJournalView::updateConfig()
{
JournalEntry* mEntry = jEntries.first();
while ( mEntry ) {
mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
mEntry = jEntries.next();
}
}
void KOJournalView::updateView()
{
JournalEntry* mEntry = jEntries.first();
while ( mEntry ) {
mEntry->setFont ( KOPrefs::instance()->mJornalViewFont );
mEntry = jEntries.next();
}
showDates( mDate, QDate() );
}