summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp7
-rw-r--r--korganizer/calendarview.h3
-rw-r--r--korganizer/koagenda.cpp5
-rw-r--r--korganizer/mainwindow.cpp12
-rw-r--r--korganizer/mainwindow.h5
5 files changed, 20 insertions, 12 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 5a2482e..17f1659 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -646,24 +646,31 @@ void CalendarView::init()
646 646
647CalendarView::~CalendarView() 647CalendarView::~CalendarView()
648{ 648{
649 // kdDebug() << "~CalendarView()" << endl; 649 // kdDebug() << "~CalendarView()" << endl;
650 //qDebug("CalendarView::~CalendarView() "); 650 //qDebug("CalendarView::~CalendarView() ");
651 delete mDialogManager; 651 delete mDialogManager;
652 delete mViewManager; 652 delete mViewManager;
653 delete mStorage; 653 delete mStorage;
654 delete mDateFrame ; 654 delete mDateFrame ;
655 delete mEventViewerDialog; 655 delete mEventViewerDialog;
656 //kdDebug() << "~CalendarView() done" << endl; 656 //kdDebug() << "~CalendarView() done" << endl;
657} 657}
658
659void CalendarView::slotResetFocus()
660{
661 qDebug(" CalendarView::slotResetFocus() %x", qApp->focusWidget());
662
663}
664
658void CalendarView::nextConflict( bool all, bool allday ) 665void CalendarView::nextConflict( bool all, bool allday )
659{ 666{
660 667
661 QPtrList<Event> testlist = mCalendar->events(); 668 QPtrList<Event> testlist = mCalendar->events();
662 Event * test = testlist.first(); 669 Event * test = testlist.first();
663 while ( test ) { 670 while ( test ) {
664 test->setTagged( false ); 671 test->setTagged( false );
665 test = testlist.next(); 672 test = testlist.next();
666 } 673 }
667 QTime st ( 0,0,0); 674 QTime st ( 0,0,0);
668 if ( mViewManager->currentView() == mViewManager->agendaView() ) 675 if ( mViewManager->currentView() == mViewManager->agendaView() )
669 st = mViewManager->agendaView()->agenda()->getEndTime(); 676 st = mViewManager->agendaView()->agenda()->getEndTime();
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 799c297..456c2d7 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -191,25 +191,26 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
191 191
192 /** Emitted, when the number of outgoing messages has changed. */ 192 /** Emitted, when the number of outgoing messages has changed. */
193 void numOutgoingChanged(int); 193 void numOutgoingChanged(int);
194 194
195 /** Send status message, which can e.g. be displayed in the status bar. */ 195 /** Send status message, which can e.g. be displayed in the status bar. */
196 void statusMessage(const QString &); 196 void statusMessage(const QString &);
197 197
198 void calendarViewExpanded( bool ); 198 void calendarViewExpanded( bool );
199 void updateSearchDialog(); 199 void updateSearchDialog();
200 void filtersUpdated(); 200 void filtersUpdated();
201 201
202 202
203 public slots: 203 public slots:
204 void slotResetFocus();
204 void nextConflict( bool all, bool allday ); 205 void nextConflict( bool all, bool allday );
205 void conflictAll(); 206 void conflictAll();
206 void conflictAllday(); 207 void conflictAllday();
207 void conflictNotAll(); 208 void conflictNotAll();
208 void setCalReadOnly( int id, bool readO ); 209 void setCalReadOnly( int id, bool readO );
209 void checkAlarms(); 210 void checkAlarms();
210 void checkFiles(); 211 void checkFiles();
211 void slotprintSelInc(); 212 void slotprintSelInc();
212 void showNextAlarms(); 213 void showNextAlarms();
213 void showOpenError(); 214 void showOpenError();
214 void watchSavedFile(); 215 void watchSavedFile();
215 void recheckTimerAlarm(); 216 void recheckTimerAlarm();
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 779f12e..0dd5ef5 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1626,25 +1626,28 @@ QTime KOAgenda::gyToTime(int gy)
1626 } 1626 }
1627 1627
1628 return time; 1628 return time;
1629} 1629}
1630 1630
1631void KOAgenda::setStartHour(int startHour) 1631void KOAgenda::setStartHour(int startHour)
1632{ 1632{
1633 int startCell = startHour * mRows / 24; 1633 int startCell = startHour * mRows / 24;
1634 setContentsPos(0,startCell * gridSpacingY()); 1634 setContentsPos(0,startCell * gridSpacingY());
1635} 1635}
1636QTime KOAgenda::getEndTime() 1636QTime KOAgenda::getEndTime()
1637{ 1637{
1638 return QTime ( (contentsY ()+viewport()->height())*24/contentsHeight ()+1,0,0); 1638 int tim = (contentsY ()+viewport()->height())*24/contentsHeight ();
1639 if ( tim > 23 )
1640 return QTime ( 23,59,59);
1641 return QTime ( tim,0,0);
1639} 1642}
1640void KOAgenda::hideUnused() 1643void KOAgenda::hideUnused()
1641{ 1644{
1642 // experimental only 1645 // experimental only
1643 // return; 1646 // return;
1644 KOAgendaItem *item; 1647 KOAgendaItem *item;
1645 for ( item=mUnusedItems.first(); item != 0; item=mUnusedItems.next() ) { 1648 for ( item=mUnusedItems.first(); item != 0; item=mUnusedItems.next() ) {
1646 item->hide(); 1649 item->hide();
1647 } 1650 }
1648} 1651}
1649 1652
1650 1653
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 4bedb61..21d5a35 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -12,33 +12,31 @@
12#include <qdir.h> 12#include <qdir.h>
13#include <qapp.h> 13#include <qapp.h>
14#include <qfileinfo.h> 14#include <qfileinfo.h>
15#include <qlabel.h> 15#include <qlabel.h>
16#include <qspinbox.h> 16#include <qspinbox.h>
17#include <qcheckbox.h> 17#include <qcheckbox.h>
18#include <qmap.h> 18#include <qmap.h>
19#include <qwmatrix.h> 19#include <qwmatrix.h>
20#include <qtextbrowser.h> 20#include <qtextbrowser.h>
21#include <qtextstream.h> 21#include <qtextstream.h>
22#ifndef DESKTOP_VERSION 22#ifndef DESKTOP_VERSION
23#include <qpe/global.h> 23#include <qpe/global.h>
24#include <qpe/qpemenubar.h>
25#include <qpe/qpetoolbar.h> 24#include <qpe/qpetoolbar.h>
26#include <qpe/resource.h> 25#include <qpe/resource.h>
27#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
28#include <qtopia/alarmserver.h> 27#include <qtopia/alarmserver.h>
29#include <qtopia/qcopenvelope_qws.h> 28#include <qtopia/qcopenvelope_qws.h>
30#include <unistd.h> // for sleep 29#include <unistd.h> // for sleep
31#else 30#else
32#include <qmenubar.h>
33#include <qtoolbar.h> 31#include <qtoolbar.h>
34#include <qapplication.h> 32#include <qapplication.h>
35//#include <resource.h> 33//#include <resource.h>
36 34
37#endif 35#endif
38#include <libkcal/calendarlocal.h> 36#include <libkcal/calendarlocal.h>
39#include <libkcal/todo.h> 37#include <libkcal/todo.h>
40#include <libkcal/phoneformat.h> 38#include <libkcal/phoneformat.h>
41#include <libkdepim/ksyncprofile.h> 39#include <libkdepim/ksyncprofile.h>
42#include <libkdepim/phoneaccess.h> 40#include <libkdepim/phoneaccess.h>
43#include <libkcal/kincidenceformatter.h> 41#include <libkcal/kincidenceformatter.h>
44#include <libkdepim/kpimglobalprefs.h> 42#include <libkdepim/kpimglobalprefs.h>
@@ -216,25 +214,25 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
216 if ( p->mToolBarUpF ) 214 if ( p->mToolBarUpF )
217 tbd = Bottom; 215 tbd = Bottom;
218 else 216 else
219 tbd = Top; 217 tbd = Top;
220 } 218 }
221 else { 219 else {
222 if ( p->mToolBarUpF ) 220 if ( p->mToolBarUpF )
223 tbd = Right; 221 tbd = Right;
224 else 222 else
225 tbd = Left; 223 tbd = Left;
226 } 224 }
227 filterToolBar = new QPEToolBar ( this ); 225 filterToolBar = new QPEToolBar ( this );
228 filterMenubar = new QMenuBar( 0 ); 226 filterMenubar = new KMenuBar( 0 );
229 QFontMetrics fm ( filterMenubar->font() ); 227 QFontMetrics fm ( filterMenubar->font() );
230 228
231 filterPopupMenu = new QPopupMenu( this ); 229 filterPopupMenu = new QPopupMenu( this );
232 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); 230 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
233 QString addTest = "A"; 231 QString addTest = "A";
234 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); 232 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
235#ifdef DESKTOP_VERSION 233#ifdef DESKTOP_VERSION
236 addTest = "AAABBBCCCx"; 234 addTest = "AAABBBCCCx";
237#else 235#else
238 addTest = "AAx"; 236 addTest = "AAx";
239#endif 237#endif
240 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); 238 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
@@ -673,60 +671,60 @@ void MainWindow::initActions()
673 QIconSet icon; 671 QIconSet icon;
674 int pixWid = 22, pixHei = 22; 672 int pixWid = 22, pixHei = 22;
675 QString pathString = ""; 673 QString pathString = "";
676 if ( !p->mToolBarMiniIcons ) { 674 if ( !p->mToolBarMiniIcons ) {
677 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { 675 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) {
678 pathString += "icons16/"; 676 pathString += "icons16/";
679 pixWid = 18; pixHei = 16; 677 pixWid = 18; pixHei = 16;
680 } 678 }
681 } else { 679 } else {
682 pathString += "iconsmini/"; 680 pathString += "iconsmini/";
683 pixWid = 18; pixHei = 16; 681 pixWid = 18; pixHei = 16;
684 } 682 }
683 KMenuBar *menuBar1;
685 if ( KOPrefs::instance()->mShowFullMenu ) { 684 if ( KOPrefs::instance()->mShowFullMenu ) {
686 QMenuBar *menuBar1; 685 menuBar1 = new KMenuBar( this );//menuBar();
687 menuBar1 = menuBar();
688 menuBar1->insertItem( i18n("File"), importMenu ); 686 menuBar1->insertItem( i18n("File"), importMenu );
689 menuBar1->insertItem( i18n("View"), viewMenu ); 687 menuBar1->insertItem( i18n("View"), viewMenu );
690 menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); 688 menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu );
691 menuBar1->insertItem( i18n("Action"), actionMenu ); 689 menuBar1->insertItem( i18n("Action"), actionMenu );
692#ifdef DESKTOP_VERSION 690#ifdef DESKTOP_VERSION
693 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 691 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
694 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 692 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
695#else 693#else
696 menuBar1->insertItem( i18n("Sync"), syncMenu ); 694 menuBar1->insertItem( i18n("Sync"), syncMenu );
697 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 695 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
698#endif 696#endif
699 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 697 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
700 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 698 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
701 menuBar1->insertItem( i18n("Help"), helpMenu ); 699 menuBar1->insertItem( i18n("Help"), helpMenu );
702 } else { 700 } else {
703 QPEMenuBar *menuBar1; 701 menuBar1 = new KMenuBar( iconToolBar );
704 menuBar1 = new QPEMenuBar( iconToolBar );
705 QPopupMenu *menuBar = new QPopupMenu( this ); 702 QPopupMenu *menuBar = new QPopupMenu( this );
706 icon = loadPixmap( pathString + "z_menu" ); 703 icon = loadPixmap( pathString + "z_menu" );
707 menuBar1->insertItem( icon.pixmap(), menuBar); 704 menuBar1->insertItem( icon.pixmap(), menuBar);
708 //menuBar1->insertItem( i18n("ME"), menuBar); 705 //menuBar1->insertItem( i18n("ME"), menuBar);
709 menuBar->insertItem( i18n("File"), importMenu ); 706 menuBar->insertItem( i18n("File"), importMenu );
710 menuBar->insertItem( i18n("View"), viewMenu ); 707 menuBar->insertItem( i18n("View"), viewMenu );
711 menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); 708 menuBar->insertItem( i18n("Edit"), mCurrentItemMenu );
712 menuBar->insertItem( i18n("Action"), actionMenu ); 709 menuBar->insertItem( i18n("Action"), actionMenu );
713 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 710 menuBar->insertItem( i18n("Synchronize"), syncMenu );
714 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 711 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
715 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 712 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
716 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 713 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
717 menuBar->insertItem( i18n("Help"), helpMenu ); 714 menuBar->insertItem( i18n("Help"), helpMenu );
718 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 715 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
719 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 716 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
720 } 717 }
718 connect ( menuBar1, SIGNAL( lostFocus () ), mView, SLOT ( slotResetFocus() ) );
721 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 719 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
722 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 720 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
723 721
724 722
725 mWeekBgColor = iconToolBar->backgroundColor(); 723 mWeekBgColor = iconToolBar->backgroundColor();
726 mWeekPixmap.resize( pixWid , pixHei ); 724 mWeekPixmap.resize( pixWid , pixHei );
727 mWeekPixmap.fill( mWeekBgColor ); 725 mWeekPixmap.fill( mWeekBgColor );
728 icon = mWeekPixmap; 726 icon = mWeekPixmap;
729 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 727 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
730 if ( p-> mShowIconWeekNum ) 728 if ( p-> mShowIconWeekNum )
731 mWeekAction->addTo( iconToolBar ); 729 mWeekAction->addTo( iconToolBar );
732 mWeekFont = font(); 730 mWeekFont = font();
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index d648f14..e2de3ba 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -2,37 +2,36 @@
2#define KORGE_MAINWINDOW_H 2#define KORGE_MAINWINDOW_H
3 3
4#include <qmainwindow.h> 4#include <qmainwindow.h>
5#include <qtimer.h> 5#include <qtimer.h>
6#include <qdict.h> 6#include <qdict.h>
7#include <qfile.h> 7#include <qfile.h>
8#include <qmenubar.h> 8#include <qmenubar.h>
9#include <qtextstream.h> 9#include <qtextstream.h>
10#include <qregexp.h> 10#include <qregexp.h>
11 11
12#include <libkcal/incidence.h> 12#include <libkcal/incidence.h>
13#include <ksyncmanager.h> 13#include <ksyncmanager.h>
14#include <kpopupmenu.h>
14#ifndef DESKTOP_VERSION 15#ifndef DESKTOP_VERSION
15#include <qcopchannel_qws.h> 16#include <qcopchannel_qws.h>
16#endif 17#endif
17class QAction; 18class QAction;
18class CalendarView; 19class CalendarView;
19class KSyncProfile; 20class KSyncProfile;
20#ifdef DESKTOP_VERSION 21#ifdef DESKTOP_VERSION
21 22
22#define QPEToolBar QToolBar 23#define QPEToolBar QToolBar
23#define QPEMenuBar QMenuBar
24#endif 24#endif
25class QPEToolBar; 25class QPEToolBar;
26class QPEMenuBar;
27 26
28 27
29namespace KCal { 28namespace KCal {
30class CalendarLocal; 29class CalendarLocal;
31} 30}
32 31
33using namespace KCal; 32using namespace KCal;
34 33
35class MainWindow : public QMainWindow 34class MainWindow : public QMainWindow
36{ 35{
37 Q_OBJECT 36 Q_OBJECT
38 public: 37 public:
@@ -119,25 +118,25 @@ class MainWindow : public QMainWindow
119 QCopChannel* infrared; 118 QCopChannel* infrared;
120#endif 119#endif
121 QAction* brAction; 120 QAction* brAction;
122 KSyncManager* mSyncManager; 121 KSyncManager* mSyncManager;
123 bool mClosed; 122 bool mClosed;
124 void saveOnClose(); 123 void saveOnClose();
125 bool mFlagKeyPressed; 124 bool mFlagKeyPressed;
126 bool mBlockAtStartup; 125 bool mBlockAtStartup;
127 QPEToolBar *iconToolBar; 126 QPEToolBar *iconToolBar;
128 QPEToolBar *viewToolBar; 127 QPEToolBar *viewToolBar;
129 QPEToolBar *navigatorToolBar; 128 QPEToolBar *navigatorToolBar;
130 QPEToolBar *filterToolBar; 129 QPEToolBar *filterToolBar;
131 QMenuBar *filterMenubar; 130 KMenuBar *filterMenubar;
132 QPopupMenu * filterPopupMenu; 131 QPopupMenu * filterPopupMenu;
133 QPopupMenu * mCurrentItemMenu; 132 QPopupMenu * mCurrentItemMenu;
134 void initActions(); 133 void initActions();
135 void setDefaultPreferences(); 134 void setDefaultPreferences();
136 void resizeEvent( QResizeEvent* e); 135 void resizeEvent( QResizeEvent* e);
137 void keyPressEvent ( QKeyEvent * ) ; 136 void keyPressEvent ( QKeyEvent * ) ;
138 void keyReleaseEvent ( QKeyEvent * ) ; 137 void keyReleaseEvent ( QKeyEvent * ) ;
139 QPopupMenu *configureToolBarMenu; 138 QPopupMenu *configureToolBarMenu;
140 QPopupMenu *selectFilterMenu; 139 QPopupMenu *selectFilterMenu;
141 QPopupMenu *selectFilterMenuTB; 140 QPopupMenu *selectFilterMenuTB;
142 QPopupMenu *configureAgendaMenu, *syncMenu; 141 QPopupMenu *configureAgendaMenu, *syncMenu;
143 CalendarLocal *mCalendar; 142 CalendarLocal *mCalendar;