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
@@ -634,48 +634,55 @@ void CalendarView::init()
634 mAlarmDialog->setServerNotification( false ); 634 mAlarmDialog->setServerNotification( false );
635 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 635 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
636 636
637 637
638#ifndef DESKTOP_VERSION 638#ifndef DESKTOP_VERSION
639//US listen for arriving address resultsets 639//US listen for arriving address resultsets
640 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 640 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
641 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 641 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
642#endif 642#endif
643 mDateNavigator->setCalendar( mCalendar ); 643 mDateNavigator->setCalendar( mCalendar );
644} 644}
645 645
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();
670 //qDebug("time %s ", st.toString().latin1()); 677 //qDebug("time %s ", st.toString().latin1());
671 QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st); 678 QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st);
672 QDateTime conflict; 679 QDateTime conflict;
673 QDateTime retVal; 680 QDateTime retVal;
674 bool found = false; 681 bool found = false;
675 Event * cE = 0; 682 Event * cE = 0;
676 Event * cE2 = 0; 683 Event * cE2 = 0;
677 QPtrList<Event> testlist2 = testlist; 684 QPtrList<Event> testlist2 = testlist;
678 test = testlist.first(); 685 test = testlist.first();
679 bool skip = false; 686 bool skip = false;
680 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); 687 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
681 while ( test ) { 688 while ( test ) {
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 799c297..456c2d7 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -179,49 +179,50 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
179 void incidenceSelected( Incidence * ); 179 void incidenceSelected( Incidence * );
180 /** Emitted, when a todoitem is selected or deselected. */ 180 /** Emitted, when a todoitem is selected or deselected. */
181 void todoSelected( bool ); 181 void todoSelected( bool );
182 182
183 /** 183 /**
184 Emitted, when clipboard content changes. Parameter indicates if paste 184 Emitted, when clipboard content changes. Parameter indicates if paste
185 is possible or not. 185 is possible or not.
186 */ 186 */
187 void pasteEnabled(bool); 187 void pasteEnabled(bool);
188 188
189 /** Emitted, when the number of incoming messages has changed. */ 189 /** Emitted, when the number of incoming messages has changed. */
190 void numIncomingChanged(int); 190 void numIncomingChanged(int);
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();
216 void checkNextTimerAlarm(); 217 void checkNextTimerAlarm();
217 void addAlarm(const QDateTime &qdt, const QString &noti ); 218 void addAlarm(const QDateTime &qdt, const QString &noti );
218 void addSuspendAlarm(const QDateTime &qdt, const QString &noti ); 219 void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
219 void removeAlarm(const QDateTime &qdt, const QString &noti ); 220 void removeAlarm(const QDateTime &qdt, const QString &noti );
220 221
221 /** options dialog made a changed to the configuration. we catch this 222 /** options dialog made a changed to the configuration. we catch this
222 * and notify all widgets which need to update their configuration. */ 223 * and notify all widgets which need to update their configuration. */
223 void updateConfig(); 224 void updateConfig();
224 225
225 void insertBirthdays(const QString& uid, const QStringList& birthdayList, 226 void insertBirthdays(const QString& uid, const QStringList& birthdayList,
226 const QStringList& anniversaryList, const QStringList& realNameList, 227 const QStringList& anniversaryList, const QStringList& realNameList,
227 const QStringList& emailList, const QStringList& assembledNameList, 228 const QStringList& emailList, const QStringList& assembledNameList,
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 779f12e..0dd5ef5 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1614,49 +1614,52 @@ int KOAgenda::timeToY(const QTime &time)
1614QTime KOAgenda::gyToTime(int gy) 1614QTime KOAgenda::gyToTime(int gy)
1615{ 1615{
1616 1616
1617 int secondsPerCell = 24 * 60 * 60/ mRows; 1617 int secondsPerCell = 24 * 60 * 60/ mRows;
1618 1618
1619 int timeSeconds = secondsPerCell * gy; 1619 int timeSeconds = secondsPerCell * gy;
1620 1620
1621 QTime time( 0, 0, 0 ); 1621 QTime time( 0, 0, 0 );
1622 if ( timeSeconds < 24 * 60 * 60 ) { 1622 if ( timeSeconds < 24 * 60 * 60 ) {
1623 time = time.addSecs(timeSeconds); 1623 time = time.addSecs(timeSeconds);
1624 } else { 1624 } else {
1625 time.setHMS( 23, 59, 59 ); 1625 time.setHMS( 23, 59, 59 );
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
1651KOAgendaItem *KOAgenda::getNewItem(Incidence * event,QDate qd, QWidget* view) 1654KOAgendaItem *KOAgenda::getNewItem(Incidence * event,QDate qd, QWidget* view)
1652{ 1655{
1653 1656
1654 KOAgendaItem *fi; 1657 KOAgendaItem *fi;
1655 for ( fi=mUnusedItems.first(); fi != 0; fi=mUnusedItems.next() ) { 1658 for ( fi=mUnusedItems.first(); fi != 0; fi=mUnusedItems.next() ) {
1656 if ( fi->incidence() == event ) { 1659 if ( fi->incidence() == event ) {
1657 mUnusedItems.remove(); 1660 mUnusedItems.remove();
1658 fi->init( event, qd ); 1661 fi->init( event, qd );
1659 return fi; 1662 return fi;
1660 } 1663 }
1661 } 1664 }
1662 fi=mUnusedItems.first(); 1665 fi=mUnusedItems.first();
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 4bedb61..21d5a35 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1,56 +1,54 @@
1#include <stdlib.h> 1#include <stdlib.h>
2 2
3#include <qaction.h> 3#include <qaction.h>
4#include <qpopupmenu.h> 4#include <qpopupmenu.h>
5#include <qpainter.h> 5#include <qpainter.h>
6#include <qwhatsthis.h> 6#include <qwhatsthis.h>
7#include <qpushbutton.h> 7#include <qpushbutton.h>
8#include <qmessagebox.h> 8#include <qmessagebox.h>
9#include <qlineedit.h> 9#include <qlineedit.h>
10#include <qtextcodec.h> 10#include <qtextcodec.h>
11#include <qfile.h> 11#include <qfile.h>
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>
45 43
46#include "calendarview.h" 44#include "calendarview.h"
47#include "koviewmanager.h" 45#include "koviewmanager.h"
48#include "datenavigator.h" 46#include "datenavigator.h"
49#include "koagendaview.h" 47#include "koagendaview.h"
50#include "kojournalview.h" 48#include "kojournalview.h"
51#include "koagenda.h" 49#include "koagenda.h"
52#include "kodialogmanager.h" 50#include "kodialogmanager.h"
53#include "kdialogbase.h" 51#include "kdialogbase.h"
54#include "kapplication.h" 52#include "kapplication.h"
55#include "kofilterview.h" 53#include "kofilterview.h"
56#include "kstandarddirs.h" 54#include "kstandarddirs.h"
@@ -204,49 +202,49 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
204 globalFlagBlockStartup = 1; 202 globalFlagBlockStartup = 1;
205 iconToolBar = new QPEToolBar( this ); 203 iconToolBar = new QPEToolBar( this );
206 addToolBar (iconToolBar , tbd ); 204 addToolBar (iconToolBar , tbd );
207 205
208#ifdef DESKTOP_VERSION 206#ifdef DESKTOP_VERSION
209 if ( KOPrefs::instance()->mShowIconFilter ) 207 if ( KOPrefs::instance()->mShowIconFilter )
210#else 208#else
211 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) 209 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar )
212#endif 210#endif
213 211
214{ 212{
215 if ( p->mToolBarHorF ) { 213 if ( p->mToolBarHorF ) {
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 ) );
241 addToolBar (filterToolBar , tbd ); 239 addToolBar (filterToolBar , tbd );
242 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); 240 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
243 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); 241 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
244 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) 242 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
245 filterToolBar->hide(); 243 filterToolBar->hide();
246 } else { 244 } else {
247 filterToolBar = 0; 245 filterToolBar = 0;
248 filterMenubar = 0; 246 filterMenubar = 0;
249 filterPopupMenu = 0; 247 filterPopupMenu = 0;
250 } 248 }
251 if ( p->mShowIconOnetoolbar ) { 249 if ( p->mShowIconOnetoolbar ) {
252 viewToolBar = iconToolBar ; 250 viewToolBar = iconToolBar ;
@@ -661,84 +659,84 @@ void MainWindow::initActions()
661 mCurrentItemMenu = new QPopupMenu ( this ); 659 mCurrentItemMenu = new QPopupMenu ( this );
662 QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); 660 QPopupMenu *nextConflictMenu = new QPopupMenu ( this );
663 QPopupMenu *importMenu = new QPopupMenu( this ); 661 QPopupMenu *importMenu = new QPopupMenu( this );
664 QPopupMenu *importMenu_X = new QPopupMenu( this ); 662 QPopupMenu *importMenu_X = new QPopupMenu( this );
665 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 663 QPopupMenu *exportMenu_X = new QPopupMenu( this );
666 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 664 QPopupMenu *beamMenu_X = new QPopupMenu( this );
667 selectFilterMenu = new QPopupMenu( this ); 665 selectFilterMenu = new QPopupMenu( this );
668 selectFilterMenu->setCheckable( true ); 666 selectFilterMenu->setCheckable( true );
669 syncMenu = new QPopupMenu( this ); 667 syncMenu = new QPopupMenu( this );
670 configureAgendaMenu = new QPopupMenu( this ); 668 configureAgendaMenu = new QPopupMenu( this );
671 configureToolBarMenu = new QPopupMenu( this ); 669 configureToolBarMenu = new QPopupMenu( this );
672 QPopupMenu *helpMenu = new QPopupMenu( this ); 670 QPopupMenu *helpMenu = new QPopupMenu( this );
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();
733 731
734 int fontPoint = mWeekFont.pointSize(); 732 int fontPoint = mWeekFont.pointSize();
735 QFontMetrics f( mWeekFont ); 733 QFontMetrics f( mWeekFont );
736 int fontWid = f.width( "30" ); 734 int fontWid = f.width( "30" );
737 while ( fontWid > pixWid ) { 735 while ( fontWid > pixWid ) {
738 --fontPoint; 736 --fontPoint;
739 mWeekFont.setPointSize( fontPoint ); 737 mWeekFont.setPointSize( fontPoint );
740 QFontMetrics f( mWeekFont ); 738 QFontMetrics f( mWeekFont );
741 fontWid = f.width( "30" ); 739 fontWid = f.width( "30" );
742 //qDebug("dec-- "); 740 //qDebug("dec-- ");
743 } 741 }
744 742
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index d648f14..e2de3ba 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -1,50 +1,49 @@
1#ifndef KORGE_MAINWINDOW_H 1#ifndef KORGE_MAINWINDOW_H
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:
39 MainWindow( QWidget *parent = 0, const char *name = 0 ); 38 MainWindow( QWidget *parent = 0, const char *name = 0 );
40 ~MainWindow(); 39 ~MainWindow();
41 bool beamReceiveEnabled(); 40 bool beamReceiveEnabled();
42 static QString defaultFileName(); 41 static QString defaultFileName();
43 static QString syncFileName(); 42 static QString syncFileName();
44 static QString resourcePath(); 43 static QString resourcePath();
45 public slots: 44 public slots:
46 void setUsesBigPixmaps ( bool ); 45 void setUsesBigPixmaps ( bool );
47 void setCaption ( const QString & ); 46 void setCaption ( const QString & );
48 void updateWeekNum(const KCal::DateList &); 47 void updateWeekNum(const KCal::DateList &);
49 void updateWeek(QDate); 48 void updateWeek(QDate);
50 void updateFilterToolbar(); 49 void updateFilterToolbar();
@@ -107,49 +106,49 @@ class MainWindow : public QMainWindow
107 void getFile( bool ); 106 void getFile( bool );
108 void syncFileRequest(); 107 void syncFileRequest();
109 108
110 protected: 109 protected:
111 void hideEvent ( QHideEvent * ); 110 void hideEvent ( QHideEvent * );
112 QString sentSyncFile(); 111 QString sentSyncFile();
113 void displayText( QString, QString); 112 void displayText( QString, QString);
114 void enableIncidenceActions( bool ); 113 void enableIncidenceActions( bool );
115 114
116 private: 115 private:
117 bool mBRdisabled; 116 bool mBRdisabled;
118#ifndef DESKTOP_VERSION 117#ifndef DESKTOP_VERSION
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;
144 CalendarView *mView; 143 CalendarView *mView;
145 QAction *mNewSubTodoAction; 144 QAction *mNewSubTodoAction;
146 QAction *mWeekAction; 145 QAction *mWeekAction;
147 QFont mWeekFont; 146 QFont mWeekFont;
148 QPixmap mWeekPixmap; 147 QPixmap mWeekPixmap;
149 QColor mWeekBgColor; 148 QColor mWeekBgColor;
150 149
151 QAction *mShowAction; 150 QAction *mShowAction;
152 QAction *mEditAction; 151 QAction *mEditAction;
153 QAction *mDeleteAction; 152 QAction *mDeleteAction;
154 QAction *mCloneAction; 153 QAction *mCloneAction;
155 QAction *mMoveAction; 154 QAction *mMoveAction;