-rw-r--r-- | core/pim/today/today.cpp | 4 | ||||
-rw-r--r-- | core/pim/today/todaybase.cpp | 1 | ||||
-rw-r--r-- | core/pim/today/todayconfig.cpp | 1 |
3 files changed, 2 insertions, 4 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 66a4152..51aba69 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -222,198 +222,198 @@ void Today::startConfig() { Config cfg("today"); cfg.setGroup("BaseConfig"); //init(); conf->SpinBox1->setValue(MAX_LINES_MEET); // location show box conf->CheckBox1->setChecked(SHOW_LOCATION); // notes show box conf->CheckBox2->setChecked(SHOW_NOTES); // task lines conf->SpinBox2->setValue(MAX_LINES_TASK); // clip when? conf->SpinBox7->setValue(MAX_CHAR_CLIP); // only later conf->CheckBox3->setChecked(ONLY_LATER); // if today should be autostarted conf->CheckBoxAuto->setChecked(AUTOSTART); conf->exec(); int maxlinestask = conf->SpinBox2->value(); int maxmeet = conf->SpinBox1->value(); int location = conf->CheckBox1->isChecked(); int notes = conf->CheckBox2->isChecked(); int maxcharclip = conf->SpinBox7->value(); int onlylater = conf->CheckBox3->isChecked(); int autostart =conf->CheckBoxAuto->isChecked(); cfg.writeEntry("maxlinestask",maxlinestask); cfg.writeEntry("maxcharclip", maxcharclip); cfg.writeEntry("maxlinesmeet",maxmeet); cfg.writeEntry("showlocation",location); cfg.writeEntry("shownotes", notes); cfg.writeEntry("onlylater", onlylater); cfg.setGroup("Autostart"); cfg.writeEntry("autostart", autostart); // sync it to "disk" cfg.write(); NEW_START=1; draw(); autoStart(); } /* * Get all events that are in the datebook xml file for today */ void Today::getDates() { QDate date = QDate::currentDate(); if (AllDateBookEvents) delete AllDateBookEvents; AllDateBookEvents = new QWidget( ); QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents); QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date); qBubbleSort(list); // printf("Get dates\n"); Config config( "qpe" ); // if 24 h format //bool ampm = config.readBoolEntry( "AMPM", TRUE ); int count=0; if ( list.count() > 0 ) { for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); it!=list.end(); ++it ) { if ( count <= MAX_LINES_MEET ) { QTime time = QTime::currentTime(); if (!ONLY_LATER) { count++; DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES); layoutDates->addWidget(l); connect (l, SIGNAL(editEvent(const Event &)), this, SLOT(editEvent(const Event &))); } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { count++; // show only later appointments DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES); layoutDates->addWidget(l); connect (l, SIGNAL(editEvent(const Event &)), this, SLOT(editEvent(const Event &))); } } } if (ONLY_LATER && count==0) { QLabel* noMoreEvents = new QLabel(AllDateBookEvents); - noMoreEvents->setText("No more appointments today"); + noMoreEvents->setText(tr("No more appointments today")); layoutDates->addWidget(noMoreEvents); } } else { QLabel* noEvents = new QLabel(AllDateBookEvents); - noEvents->setText("No appointments today"); + noEvents->setText(tr("No appointments today")); layoutDates->addWidget(noEvents); } layoutDates->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); sv1->addChild(AllDateBookEvents); AllDateBookEvents->show(); } void Today::getMail() { Config cfg("opiemail"); cfg.setGroup("today"); // how many lines should be showed in the task section int NEW_MAILS = cfg.readNumEntry("newmails",0); int OUTGOING = cfg.readNumEntry("outgoing",0); QString output = tr("<b>%1</b> new mail(s), <b>%2</b> outgoing").arg(NEW_MAILS).arg(OUTGOING); MailField->setText(output); } /* * Get the todos */ void Today::getTodo() { QString output; QString tmpout; int count = 0; int ammount = 0; // get overdue todos first QValueList<ToDoEvent> overDueList = todo->overDue(); qBubbleSort(overDueList); for ( QValueList<ToDoEvent>::Iterator it=overDueList.begin(); it!=overDueList.end(); ++it ) { if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) { tmpout += "<font color=#e00000><b>-" +((*it).description()).mid(0, MAX_CHAR_CLIP) + "</b></font><br>"; ammount++; } } // get total number of still open todos QValueList<ToDoEvent> open = todo->rawToDos(); qBubbleSort(open); for ( QValueList<ToDoEvent>::Iterator it=open.begin(); it!=open.end(); ++it ) { if (!(*it).isCompleted()){ count +=1; // not the overdues, we allready got them, and not if we are // over the maxlines if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>"; ammount++; } } } if (count > 0) { if( count == 1 ) { output = tr("There is <b> 1</b> active task: <br>" ); } else { output = tr("There are <b> %1</b> active tasks: <br>").arg(count); } output += tmpout; } else { output = tr("No active tasks"); } TodoField->setText(tr(output)); } /* * launches datebook */ void Today::startDatebook() { QCopEnvelope e("QPE/System", "execute(QString)"); e << QString("datebook"); } /* * starts the edit dialog as known from datebook */ extern QPEApplication *todayApp; void Today::editEvent(const Event &e) { startDatebook(); while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents(); QCopEnvelope env("QPE/Datebook", "editEvent(int)"); env << e.uid(); } diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index c0b8d34..dfcc34e 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp @@ -1,122 +1,121 @@ /* * todaybase.cpp * * --------------------- * * begin : Sun 10 17:20:00 CEST 2002 * copyright : (c) 2002 by Maximilian Reiß * email : max.reiss@gmx.de * */ /*************************************************************************** * * * 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 "todaybase.h" #include <qframe.h> #include <qlabel.h> #include <qpushbutton.h> #include <qlayout.h> #include <qvariant.h> -#include <qtooltip.h> #include <qwhatsthis.h> #include <qimage.h> #include <qpixmap.h> #include <qscrollview.h> #include <qvbox.h> #include <qapplication.h> #include <qpe/resource.h> /* * Constructs a TodayBase which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo QPixmap datebook = Resource::loadPixmap("DateBook"); // datebook QPixmap todo = Resource::loadPixmap( "TodoList" ); // todo QPixmap config = Resource::loadPixmap( "today/config" ); // config icon QPixmap mail = Resource::loadPixmap( "today/mail" ); // mail icon QPalette pal = this->palette(); QColor col = pal.color(QPalette::Active, QColorGroup::Background); pal.setColor(QPalette::Active, QColorGroup::Button, col); this->setPalette(pal); QWidget *d = QApplication::desktop(); int w=d->width(); int h=d->height(); resize( w , h ); // hehe, qt is ... getridoffuckingstrippeldlinesbutton = new QPushButton (this, "asdfsad" ); getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); QVBoxLayout * layout = new QVBoxLayout(this); // --- logo Section --- QPalette pal2; QColorGroup cg; cg.setColor( QColorGroup::Text, white ); cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) ); pal2.setActive( cg ); // today logo Frame = new QLabel( this, "Frame" ); Frame->setPalette( pal2 ); Frame->setFrameShape( QFrame::StyledPanel ); Frame->setFrameShadow( QFrame::Raised ); Frame->setLineWidth( 0 ); Frame->setMaximumHeight(50); Frame->setMinimumHeight(50); // date TextLabel1 = new QLabel( Frame, "TextLabel1" ); TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); QFont TextLabel1_font( TextLabel1->font() ); TextLabel1_font.setBold( TRUE ); TextLabel1->setFont( TextLabel1_font ); TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); TextLabel1->setTextFormat( RichText ); OwnerField = new QLabel(this , "Owner" ); OwnerField->setGeometry(QRect(0,0, this->width(), 12 )); OwnerField->setAlignment(int (QLabel::AlignTop | QLabel::AlignLeft ) ); OwnerField->setMaximumHeight(12); // --- dates section --- Frame4 = new QFrame( this, "Frame4" ); Frame4->setPalette( pal ); Frame4->setFrameShape( QScrollView::StyledPanel ); Frame4->setFrameShadow( QScrollView::Sunken ); Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); Frame4->setFrameStyle( QFrame::NoFrame ); Frame4->setGeometry (QRect( 0, 8, this->width() , this->height()) ); sv1 = new QScrollView( Frame4 ); sv1->setResizePolicy(QScrollView::AutoOneFit); sv1->setHScrollBarMode( QScrollView::AlwaysOff ); // need to find a better way!!! sv1->setGeometry (QRect( 40, 2, Frame4->width()-40 , (Frame4->height()/3)+20 ) ); sv1->setFrameShape(QFrame::NoFrame); DatesButton = new QPushButton (Frame4, "DatesButton" ); DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) ); DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); DatesButton->setPalette( pal ); DatesButton->setPixmap( datebook ); DatesButton->setFlat( TRUE ); // --- mail section ---) MailFrame = new QFrame( this ,"MailFrame" ); MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin ); MailFrame->setGeometry (QRect( 0, 0, this->width() , 15) ); MailFrame->setFrameStyle( QFrame::NoFrame ); diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index 7c690a7..a908d98 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp @@ -1,115 +1,114 @@ /**************************************************************************** ** Form implementation generated from reading ui file 'todayconfig.ui' ** ** Created: Thu Feb 14 15:04:33 2002 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "todayconfig.h" #include <qcheckbox.h> #include <qframe.h> #include <qlabel.h> #include <qspinbox.h> #include <qtabwidget.h> #include <qwidget.h> #include <qlayout.h> #include <qvariant.h> -#include <qtooltip.h> #include <qwhatsthis.h> /* * Constructs a todayconfig which is a child of 'parent', with the * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ todayconfig::todayconfig( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "todayconfig" ); resize( 175, 232 ); setCaption( tr( "Today config" ) ); TabWidget3 = new QTabWidget( this, "TabWidget3" ); TabWidget3->setGeometry( QRect( 0, 0, 220, 320 ) ); TabWidget3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, TabWidget3->sizePolicy().hasHeightForWidth() ) ); TabWidget3->setAutoMask( FALSE ); TabWidget3->setTabShape( QTabWidget::Rounded ); tab = new QWidget( TabWidget3, "tab" ); Frame8 = new QFrame( tab, "Frame8" ); Frame8->setGeometry( QRect( -5, 0, 200, 300 ) ); Frame8->setFrameShape( QFrame::StyledPanel ); Frame8->setFrameShadow( QFrame::Raised ); TextLabel4 = new QLabel( Frame8, "TextLabel4" ); TextLabel4->setGeometry( QRect( 20, 65, 100, 60 ) ); TextLabel4->setText( tr( "Should the \n" "location \n" "be shown?" ) ); TextLabel5 = new QLabel( Frame8, "TextLabel5" ); TextLabel5->setGeometry( QRect( 20, 160, 120, 40 ) ); TextLabel5->setText( tr( "Should the notes \n" "be shown?" ) ); CheckBox2 = new QCheckBox( Frame8, "CheckBox2" ); CheckBox2->setGeometry( QRect( 158, 170, 27, 21 ) ); //CheckBox2->setText( tr( "" ) ); CheckBox1 = new QCheckBox( Frame8, "CheckBox1" ); CheckBox1->setGeometry( QRect( 158, 65, 27, 50 ) ); //CheckBox1->setText( tr( "" ) ); CheckBox3 = new QCheckBox (Frame8, "CheckBox3" ); CheckBox3->setGeometry( QRect( 158, 125, 27, 21 ) ); TextLabel6 = new QLabel( Frame8, "All Day"); TextLabel6->setGeometry( QRect( 20, 120, 100, 30 ) ); TextLabel6->setText( tr( "Show only later\n" "appointments") ); SpinBox1 = new QSpinBox( Frame8, "SpinBox1" ); SpinBox1->setGeometry( QRect( 115, 20, 58, 25 ) ); SpinBox1->setMaxValue( 10 ); SpinBox1->setValue( 5 ); TextLabel3 = new QLabel( Frame8, "TextLabel3" ); TextLabel3->setGeometry( QRect( 20, 10, 90, 60 ) ); TextLabel3->setText( tr( "How many \n" "appointment\n" "should should \n" "be shown?" ) ); TabWidget3->insertTab( tab, tr( "Calendar" ) ); tab_2 = new QWidget( TabWidget3, "tab_2" ); Frame9 = new QFrame( tab_2, "Frame9" ); Frame9->setGeometry( QRect( -5, 0, 230, 310 ) ); Frame9->setFrameShape( QFrame::StyledPanel ); Frame9->setFrameShadow( QFrame::Raised ); TextLabel6 = new QLabel( Frame9, "TextLabel6" ); TextLabel6->setGeometry( QRect( 20, 10, 100, 60 ) ); TextLabel6->setText( tr( "How many\n" "tasks should \n" "be shown?" ) ); SpinBox2 = new QSpinBox( Frame9, "SpinBox2" ); SpinBox2->setGeometry( QRect( 115, 20, 58, 25 ) ); SpinBox2->setMaxValue( 20 ); SpinBox2->setValue( 5 ); TabWidget3->insertTab( tab_2, tr( "Tasks" ) ); tab_3 = new QWidget( TabWidget3, "tab_3" ); Frame14 = new QFrame( tab_3, "Frame14" ); Frame14->setGeometry( QRect( -5, 0, 200, 220 ) ); Frame14->setFrameShape( QFrame::StyledPanel ); Frame14->setFrameShadow( QFrame::Raised ); |