summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-27 00:49:03 (UTC)
committer zautrix <zautrix>2004-10-27 00:49:03 (UTC)
commitba3d660ed4f856362d2b914ed744874c235b4001 (patch) (unidiff)
treed70423c6bf3a6342a6ae2277dda70f15736086a9
parent00d623c9391a9bdaeb142f443f1dd09861317608 (diff)
downloadkdepimpi-ba3d660ed4f856362d2b914ed744874c235b4001.zip
kdepimpi-ba3d660ed4f856362d2b914ed744874c235b4001.tar.gz
kdepimpi-ba3d660ed4f856362d2b914ed744874c235b4001.tar.bz2
fixed some whantsnext view kayout
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp10
-rw-r--r--korganizer/kowhatsnextview.cpp19
-rw-r--r--libkdepim/categoryeditdialog.cpp2
-rw-r--r--libkdepim/categoryselectdialog.cpp8
4 files changed, 28 insertions, 11 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 3aae076..749204b 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -361,34 +361,40 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
361#endif 361#endif
362 mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); 362 mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this);
363 mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 363 mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
364 topLayout->addWidget( mSplitterAgenda ); 364 topLayout->addWidget( mSplitterAgenda );
365 mAllDayFrame = new QHBox(mSplitterAgenda); 365 mAllDayFrame = new QHBox(mSplitterAgenda);
366 mAllDayFrame->setFocusPolicy(NoFocus); 366 mAllDayFrame->setFocusPolicy(NoFocus);
367 QWidget *agendaFrame = new QWidget(mSplitterAgenda); 367 QWidget *agendaFrame = new QWidget(mSplitterAgenda);
368 agendaFrame->setFocusPolicy(NoFocus); 368 agendaFrame->setFocusPolicy(NoFocus);
369 369
370#endif 370#endif
371 371
372 // Create all-day agenda widget 372 // Create all-day agenda widget
373 mDummyAllDayLeft = new QVBox( mAllDayFrame ); 373 mDummyAllDayLeft = new QVBox( mAllDayFrame );
374 374
375 mExpandButton = new QPushButton(mDummyAllDayLeft); 375 mExpandButton = new QPushButton(mDummyAllDayLeft);
376 mExpandButton->setPixmap( mNotExpandedPixmap ); 376 mExpandButton->setPixmap( mNotExpandedPixmap );
377 mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, 377 int widebut = mExpandButton->sizeHint().width();
378 QSizePolicy::Fixed ) ); 378 if ( QApplication::desktop()->width() < 480 )
379 widebut = widebut*2;
380 else
381 widebut = (widebut*3) / 2;
382 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed,
383 // QSizePolicy::Fixed ) );
384 mExpandButton->setFixedSize( widebut, widebut);
379 connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); 385 connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) );
380 mExpandButton->setFocusPolicy(NoFocus); 386 mExpandButton->setFocusPolicy(NoFocus);
381 mAllDayAgenda = new KOAgenda(1,mAllDayFrame); 387 mAllDayAgenda = new KOAgenda(1,mAllDayFrame);
382 mAllDayAgenda->setFocusPolicy(NoFocus); 388 mAllDayAgenda->setFocusPolicy(NoFocus);
383 QWidget *dummyAllDayRight = new QWidget(mAllDayFrame); 389 QWidget *dummyAllDayRight = new QWidget(mAllDayFrame);
384 390
385 // Create event context menu for all day agenda 391 // Create event context menu for all day agenda
386 mAllDayAgendaPopup = eventPopup(); 392 mAllDayAgendaPopup = eventPopup();
387 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 393 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
388 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 394 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
389 395
390 // Create agenda frame 396 // Create agenda frame
391 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); 397 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3);
392 // QHBox *agendaFrame = new QHBox(splitterAgenda); 398 // QHBox *agendaFrame = new QHBox(splitterAgenda);
393 399
394 // create event indicator bars 400 // create event indicator bars
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 0fea9be..59b864c 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -26,62 +26,72 @@
26#include <qapplication.h> 26#include <qapplication.h>
27 27
28#include <kglobal.h> 28#include <kglobal.h>
29#include <klocale.h> 29#include <klocale.h>
30#include <kdebug.h> 30#include <kdebug.h>
31#include <kiconloader.h> 31#include <kiconloader.h>
32#include <kmessagebox.h> 32#include <kmessagebox.h>
33 33
34#include <libkcal/calendar.h> 34#include <libkcal/calendar.h>
35 35
36#ifndef KORG_NOPRINTER 36#ifndef KORG_NOPRINTER
37#include "calprinter.h" 37#include "calprinter.h"
38#endif 38#endif
39#include "koglobals.h" 39#include "koglobals.h"
40#include "koprefs.h" 40#include "koprefs.h"
41#include "koeventviewerdialog.h" 41#include "koeventviewerdialog.h"
42 42#include <qstylesheet.h>
43#include "kowhatsnextview.h" 43#include "kowhatsnextview.h"
44using namespace KOrg; 44using namespace KOrg;
45 45
46void WhatsNextTextBrowser::setSource(const QString& n) 46void WhatsNextTextBrowser::setSource(const QString& n)
47{ 47{
48 48
49 if (n.startsWith("event:")) { 49 if (n.startsWith("event:")) {
50 emit showIncidence(n); 50 emit showIncidence(n);
51 return; 51 return;
52 } else if (n.startsWith("todo:")) { 52 } else if (n.startsWith("todo:")) {
53 emit showIncidence(n); 53 emit showIncidence(n);
54 return; 54 return;
55 } else { 55 } else {
56 QTextBrowser::setSource(n); 56 QTextBrowser::setSource(n);
57 } 57 }
58} 58}
59 59
60KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, 60KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent,
61 const char *name) 61 const char *name)
62 : KOrg::BaseView(calendar, parent, name) 62 : KOrg::BaseView(calendar, parent, name)
63{ 63{
64 // mDateLabel = 64 // mDateLabel =
65 // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); 65 // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this);
66 // mDateLabel->setMargin(2); 66 // mDateLabel->setMargin(2);
67 // mDateLabel->setAlignment(AlignCenter); 67 // mDateLabel->setAlignment(AlignCenter);
68 setFont( KOPrefs::instance()->mWhatsNextFont ); 68 setFont( KOPrefs::instance()->mWhatsNextFont );
69 mView = new WhatsNextTextBrowser(this); 69 mView = new WhatsNextTextBrowser(this);
70 connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); 70 connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &)));
71 71 QStyleSheet* stsh = mView->styleSheet();
72 QStyleSheetItem * style ;
73
74 style = stsh->item ("h2" );
75 if ( style ) {
76 style->setMargin(QStyleSheetItem::MarginAll,0);
77 }
78 style = stsh->item ("table" );
79 if ( style ) {
80 style->setMargin(QStyleSheetItem::MarginAll,0);
81 }
72 mEventViewer = 0; 82 mEventViewer = 0;
73 83
74 QBoxLayout *topLayout = new QVBoxLayout(this); 84 QBoxLayout *topLayout = new QVBoxLayout(this);
75 // topLayout->addWidget(mDateLabel); 85 // topLayout->addWidget(mDateLabel);
76 topLayout->addWidget(mView); 86 topLayout->addWidget(mView);
77 mTimer = new QTimer( this ); 87 mTimer = new QTimer( this );
78 connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); 88 connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView()));
79 89
80 connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); 90 connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
81 connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); 91 connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
82} 92}
83 93
84KOWhatsNextView::~KOWhatsNextView() 94KOWhatsNextView::~KOWhatsNextView()
85{ 95{
86} 96}
87 97
@@ -131,33 +141,33 @@ void KOWhatsNextView::hideEvent ( QHideEvent * e)
131void KOWhatsNextView::restartTimer() 141void KOWhatsNextView::restartTimer()
132{ 142{
133 //qDebug("KOWhatsNextView::restartTimer() "); 143 //qDebug("KOWhatsNextView::restartTimer() ");
134 mTimer->start( 300000 ); 144 mTimer->start( 300000 );
135 //mTimer->start( 5000 ); 145 //mTimer->start( 5000 );
136} 146}
137void KOWhatsNextView::updateView() 147void KOWhatsNextView::updateView()
138{ 148{
139 if ( mTimer->isActive() ) 149 if ( mTimer->isActive() )
140 restartTimer(); 150 restartTimer();
141 //qDebug("KOWhatsNextView::updateView() "); 151 //qDebug("KOWhatsNextView::updateView() ");
142 // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); 152 // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate()));
143 KIconLoader kil("korganizer"); 153 KIconLoader kil("korganizer");
144 QString ipath;// = new QString(); 154 QString ipath;// = new QString();
145 // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); 155 // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath);
146 //<big><big><strong>" + date + "</strong></big></big>\n"; 156 //<big><big><strong>" + date + "</strong></big></big>\n";
147 mText = "<table width=\"100%\">\n"; 157 mText = "<qt><table width=\"100%\">\n";
148 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; 158 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
149#ifdef DESKTOP_VERSION 159#ifdef DESKTOP_VERSION
150 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>"; 160 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>";
151#else 161#else
152 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; 162 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
153#endif 163#endif
154 // mText += "<img src=\""; 164 // mText += "<img src=\"";
155 // mText += ipath; 165 // mText += ipath;
156 // mText += "\">"; 166 // mText += "\">";
157 mEventDate = QDate::currentDate(); 167 mEventDate = QDate::currentDate();
158#ifdef DESKTOP_VERSION 168#ifdef DESKTOP_VERSION
159 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>"; 169 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>";
160#else 170#else
161 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; 171 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>";
162#endif 172#endif
163 mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; 173 mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>";
@@ -313,46 +323,47 @@ void KOWhatsNextView::updateView()
313 if (me->status()==Attendee::NeedsAction && me->RSVP()) { 323 if (me->status()==Attendee::NeedsAction && me->RSVP()) {
314 if (replys == 0) { 324 if (replys == 0) {
315 mText +="<big><big><strong><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></strong></big></big>\n"; 325 mText +="<big><big><strong><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></strong></big></big>\n";
316 mText += "<table>\n"; 326 mText += "<table>\n";
317 } 327 }
318 replys++; 328 replys++;
319 appendEvent(to, true); 329 appendEvent(to, true);
320 } 330 }
321 } 331 }
322 } 332 }
323 to = todos.next(); 333 to = todos.next();
324 } 334 }
325 } 335 }
326 if (replys > 0 ) mText += "</table>\n"; 336 if (replys > 0 ) mText += "</table>\n";
327 337
328 338
329 mText += "</td></tr>\n</table>\n"; 339 mText += "</td></tr>\n</table></qt>\n";
330 340
331 mView->setText(mText); 341 mView->setText(mText);
332 mView->setFocus(); 342 mView->setFocus();
333 343
334 // QPixmap bPix = SmallIcon( "back" ); 344 // QPixmap bPix = SmallIcon( "back" );
335 // qDebug("xxxxxxxxxxxxxxxxxxxxx "); 345 // qDebug("xxxxxxxxxxxxxxxxxxxxx ");
336 // QWidget* test = new QWidget(); 346 // QWidget* test = new QWidget();
337 // test->setBackgroundMode(FixedPixmap ); 347 // test->setBackgroundMode(FixedPixmap );
338 // test->setBackgroundPixmap ( bPix ); 348 // test->setBackgroundPixmap ( bPix );
339 // test->resize( 300, 400 ); 349 // test->resize( 300, 400 );
340 // test->show(); 350 // test->show();
341 // mView->setBackgroundMode(FixedPixmap ); 351 // mView->setBackgroundMode(FixedPixmap );
342 // mView->setBackgroundPixmap ( bPix ); 352 // mView->setBackgroundPixmap ( bPix );
353 qDebug("%s ",mText.latin1());
343} 354}
344 355
345void KOWhatsNextView::appendDay( int i, QDate eventDate ) 356void KOWhatsNextView::appendDay( int i, QDate eventDate )
346{ 357{
347 QString date; 358 QString date;
348 QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); 359 QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer);
349 if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { 360 if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) {
350 if ( i == 0 ) { 361 if ( i == 0 ) {
351 mText += "<table>\n"; 362 mText += "<table>\n";
352 return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; 363 return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>";
353 } 364 }
354 else if ( i == 1 ) 365 else if ( i == 1 )
355 date = "<em><font color=\"#000080\">" + day + "</font></em>" ; 366 date = "<em><font color=\"#000080\">" + day + "</font></em>" ;
356 else date = "<em><font color=\"#000080\">" + day + "</font></em>"; 367 else date = "<em><font color=\"#000080\">" + day + "</font></em>";
357 //mText += "<h2>" + date + "</h2>\n"; 368 //mText += "<h2>" + date + "</h2>\n";
358 mText += "<big><big><strong>" + date + "</strong></big></big>\n"; 369 mText += "<big><big><strong>" + date + "</strong></big></big>\n";
diff --git a/libkdepim/categoryeditdialog.cpp b/libkdepim/categoryeditdialog.cpp
index f719c31..a19900f 100644
--- a/libkdepim/categoryeditdialog.cpp
+++ b/libkdepim/categoryeditdialog.cpp
@@ -45,32 +45,34 @@ CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent,
45 QStringList::Iterator it; 45 QStringList::Iterator it;
46 bool categoriesExist=false; 46 bool categoriesExist=false;
47 for (it = mPrefs->mCustomCategories.begin(); 47 for (it = mPrefs->mCustomCategories.begin();
48 it != mPrefs->mCustomCategories.end(); ++it ) { 48 it != mPrefs->mCustomCategories.end(); ++it ) {
49 new QListViewItem(mCategories,*it); 49 new QListViewItem(mCategories,*it);
50 categoriesExist=true; 50 categoriesExist=true;
51 } 51 }
52 52
53 connect(mCategories,SIGNAL(selectionChanged(QListViewItem *)), 53 connect(mCategories,SIGNAL(selectionChanged(QListViewItem *)),
54 SLOT(editItem(QListViewItem *))); 54 SLOT(editItem(QListViewItem *)));
55 connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &))); 55 connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &)));
56 mButtonRemove->setEnabled(categoriesExist); 56 mButtonRemove->setEnabled(categoriesExist);
57 mButtonModify->setEnabled(categoriesExist); 57 mButtonModify->setEnabled(categoriesExist);
58 mButtonAdd->setEnabled(!mEdit->text().isEmpty()); 58 mButtonAdd->setEnabled(!mEdit->text().isEmpty());
59 if ( QApplication::desktop()->width() > 460 ) 59 if ( QApplication::desktop()->width() > 460 )
60 resize( 300, 360 ); 60 resize( 300, 360 );
61 else
62 showMaximized();
61} 63}
62 64
63/* 65/*
64 * Destroys the object and frees any allocated resources 66 * Destroys the object and frees any allocated resources
65 */ 67 */
66CategoryEditDialog::~CategoryEditDialog() 68CategoryEditDialog::~CategoryEditDialog()
67{ 69{
68 // no need to delete child widgets, Qt does it all for us 70 // no need to delete child widgets, Qt does it all for us
69} 71}
70 72
71void CategoryEditDialog::slotTextChanged(const QString &text) 73void CategoryEditDialog::slotTextChanged(const QString &text)
72{ 74{
73 mButtonAdd->setEnabled(!text.isEmpty()); 75 mButtonAdd->setEnabled(!text.isEmpty());
74} 76}
75 77
76void CategoryEditDialog::add() 78void CategoryEditDialog::add()
diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp
index 40b46cf..7df9154 100644
--- a/libkdepim/categoryselectdialog.cpp
+++ b/libkdepim/categoryselectdialog.cpp
@@ -33,38 +33,36 @@
33 33
34#include "kpimprefs.h" 34#include "kpimprefs.h"
35 35
36using namespace KPIM; 36using namespace KPIM;
37 37
38CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent, 38CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent,
39 const char* name, 39 const char* name,
40 bool modal, WFlags fl ) 40 bool modal, WFlags fl )
41 : CategorySelectDialog_base( parent, name, true, fl ), 41 : CategorySelectDialog_base( parent, name, true, fl ),
42 mPrefs( prefs ) 42 mPrefs( prefs )
43{ 43{
44 mCategories->header()->hide(); 44 mCategories->header()->hide();
45 45
46 setCategories(); 46 setCategories();
47 47
48 connect(mButtonEdit,SIGNAL(clicked()),this, SLOT(editCategoriesDialog())); 48 connect(mButtonEdit,SIGNAL(clicked()),this, SLOT(editCategoriesDialog()));
49 if ( qApp->desktop()->height() < 321 )
50 setMaximumHeight( QApplication::desktop()->height() - 50 );
51 else
52 setMaximumHeight( QApplication::desktop()->height() - 80 );
53 if ( QApplication::desktop()->width() > 460 ) 49 if ( QApplication::desktop()->width() > 460 )
54 resize( 260, 360 ); 50 resize( 300, 360 );
51 else
52 showMaximized();
55} 53}
56void CategorySelectDialog::editCategoriesDialog() 54void CategorySelectDialog::editCategoriesDialog()
57{ 55{
58 KPIM::CategoryEditDialog* ced = new KPIM::CategoryEditDialog(mPrefs,this ); 56 KPIM::CategoryEditDialog* ced = new KPIM::CategoryEditDialog(mPrefs,this );
59 57
60 ced->exec(); 58 ced->exec();
61 delete ced; 59 delete ced;
62 setCategories(); 60 setCategories();
63} 61}
64void CategorySelectDialog::setCategories() 62void CategorySelectDialog::setCategories()
65{ 63{
66 mCategories->clear(); 64 mCategories->clear();
67 mCategoryList.clear(); 65 mCategoryList.clear();
68 66
69 QStringList::Iterator it; 67 QStringList::Iterator it;
70 68