summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-08-17 16:19:18 (UTC)
committer zautrix <zautrix>2005-08-17 16:19:18 (UTC)
commitc21edc19916722f5dd4e939f1522d311a86411fd (patch) (unidiff)
treeed91c2cd9afb7d37c73f2056851c95293eff6038 /korganizer
parent9e6d1f7f45ef1444dc6ee96347a2dbd67a0d79dd (diff)
downloadkdepimpi-c21edc19916722f5dd4e939f1522d311a86411fd.zip
kdepimpi-c21edc19916722f5dd4e939f1522d311a86411fd.tar.gz
kdepimpi-c21edc19916722f5dd4e939f1522d311a86411fd.tar.bz2
minor kopi fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 45775c5..94bc4c1 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -113,223 +113,223 @@ class KOex2phonePrefs : public QDialog
113 lay->addWidget( ok ); 113 lay->addWidget( ok );
114 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 114 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
115 lay->addWidget( cancel ); 115 lay->addWidget( cancel );
116 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 116 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
117 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 117 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
118 resize( 220, 240 ); 118 resize( 220, 240 );
119 qApp->processEvents(); 119 qApp->processEvents();
120 int dw = QApplication::desktop()->width(); 120 int dw = QApplication::desktop()->width();
121 int dh = QApplication::desktop()->height(); 121 int dh = QApplication::desktop()->height();
122 move( (dw-width())/2, (dh - height() )/2 ); 122 move( (dw-width())/2, (dh - height() )/2 );
123 } 123 }
124 124
125public: 125public:
126 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 126 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
127 QCheckBox* mWriteBackFuture; 127 QCheckBox* mWriteBackFuture;
128 QSpinBox* mWriteBackFutureWeeks; 128 QSpinBox* mWriteBackFutureWeeks;
129}; 129};
130 130
131QPixmap* sgListViewCompletedPix[6]; 131QPixmap* sgListViewCompletedPix[6];
132QPixmap* sgListViewJournalPix; 132QPixmap* sgListViewJournalPix;
133 133
134 134
135int globalFlagBlockStartup; 135int globalFlagBlockStartup;
136MainWindow::MainWindow( QWidget *parent, const char *name ) : 136MainWindow::MainWindow( QWidget *parent, const char *name ) :
137 QMainWindow( parent, name ) 137 QMainWindow( parent, name )
138{ 138{
139 sgListViewCompletedPix[5] = &listviewPix; 139 sgListViewCompletedPix[5] = &listviewPix;
140 sgListViewCompletedPix[0] = &listviewPix0; 140 sgListViewCompletedPix[0] = &listviewPix0;
141 sgListViewCompletedPix[1] = &listviewPix20; 141 sgListViewCompletedPix[1] = &listviewPix20;
142 sgListViewCompletedPix[2] = &listviewPix40; 142 sgListViewCompletedPix[2] = &listviewPix40;
143 sgListViewCompletedPix[3] = &listviewPix60; 143 sgListViewCompletedPix[3] = &listviewPix60;
144 sgListViewCompletedPix[4] = &listviewPix80; 144 sgListViewCompletedPix[4] = &listviewPix80;
145 //int size = 12; 145 //int size = 12;
146 { 146 {
147 sgListViewCompletedPix[5]->resize( 11, 11 ); 147 sgListViewCompletedPix[5]->resize( 11, 11 );
148 sgListViewCompletedPix[5]->fill( Qt::white ); 148 sgListViewCompletedPix[5]->fill( Qt::white );
149 QPainter p ( sgListViewCompletedPix[5] ); 149 QPainter p ( sgListViewCompletedPix[5] );
150 p.drawRect( 0,0,11,11); 150 p.drawRect( 0,0,11,11);
151 p.drawLine ( 2, 5, 4 , 7 ) ; 151 p.drawLine ( 2, 5, 4 , 7 ) ;
152 p.drawLine ( 4 , 7 , 8, 3) ; 152 p.drawLine ( 4 , 7 , 8, 3) ;
153 int iii = 0; 153 int iii = 0;
154 for ( iii = 0; iii < 5; ++iii ) { 154 for ( iii = 0; iii < 5; ++iii ) {
155 sgListViewCompletedPix[iii]->resize( 11, 11 ); 155 sgListViewCompletedPix[iii]->resize( 11, 11 );
156 sgListViewCompletedPix[iii]->fill( Qt::white ); 156 sgListViewCompletedPix[iii]->fill( Qt::white );
157 QPainter p ( sgListViewCompletedPix[iii] ); 157 QPainter p ( sgListViewCompletedPix[iii] );
158 p.drawRect( 0,0,11,11); 158 p.drawRect( 0,0,11,11);
159 if ( iii ) 159 if ( iii )
160 p.fillRect( 1,1,iii*2,9,Qt::gray ); 160 p.fillRect( 1,1,iii*2,9,Qt::gray );
161 } 161 }
162 sgListViewJournalPix = &journalPix; 162 sgListViewJournalPix = &journalPix;
163 sgListViewJournalPix->resize( 11, 11 ); 163 sgListViewJournalPix->resize( 11, 11 );
164 sgListViewJournalPix->fill( Qt::white ); 164 sgListViewJournalPix->fill( Qt::white );
165 { 165 {
166 QPainter p ( sgListViewJournalPix ); 166 QPainter p ( sgListViewJournalPix );
167 p.drawRect( 0,0,11,11); 167 p.drawRect( 0,0,11,11);
168 p.drawLine( 2,3,5,3); 168 p.drawLine( 2,3,5,3);
169 p.drawLine( 2,5,8,5); 169 p.drawLine( 2,5,8,5);
170 p.drawLine( 2,7,6,7); 170 p.drawLine( 2,7,6,7);
171 } 171 }
172 } 172 }
173 mClosed = false; 173 mClosed = false;
174 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 174 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
175 QString confFile = locateLocal("config","korganizerrc"); 175 QString confFile = locateLocal("config","korganizerrc");
176 QFileInfo finf ( confFile ); 176 QFileInfo finf ( confFile );
177 bool showWarning = !finf.exists(); 177 bool showWarning = !finf.exists();
178 setIcon(SmallIcon( "ko24" ) ); 178 setIcon(SmallIcon( "ko24" ) );
179 mBlockAtStartup = true; 179 mBlockAtStartup = true;
180 mFlagKeyPressed = false; 180 mFlagKeyPressed = false;
181 setCaption("KO/Pi"); 181 setCaption("KO/Pi");
182 KOPrefs *p = KOPrefs::instance(); 182 KOPrefs *p = KOPrefs::instance();
183 //KPimGlobalPrefs::instance()->setGlobalConfig(); 183 //KPimGlobalPrefs::instance()->setGlobalConfig();
184 p->mCurrentDisplayedView = 0; 184 p->mCurrentDisplayedView = 0;
185 if ( p->mHourSize > 22 ) 185 if ( p->mHourSize > 22 )
186 p->mHourSize = 22; 186 p->mHourSize = 22;
187 QMainWindow::ToolBarDock tbd; 187 QMainWindow::ToolBarDock tbd;
188 if ( p->mToolBarHor ) { 188 if ( p->mToolBarHor ) {
189 if ( p->mToolBarUp ) 189 if ( p->mToolBarUp )
190 tbd = Bottom; 190 tbd = Bottom;
191 else 191 else
192 tbd = Top; 192 tbd = Top;
193 } 193 }
194 else { 194 else {
195 if ( p->mToolBarUp ) 195 if ( p->mToolBarUp )
196 tbd = Right; 196 tbd = Right;
197 else 197 else
198 tbd = Left; 198 tbd = Left;
199 } 199 }
200 if ( KOPrefs::instance()->mUseAppColors ) 200 if ( KOPrefs::instance()->mUseAppColors )
201 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 201 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
202 globalFlagBlockStartup = 1; 202 globalFlagBlockStartup = 1;
203 iconToolBar = new QPEToolBar( this ); 203 iconToolBar = new QPEToolBar( this );
204 addToolBar (iconToolBar , tbd ); 204 addToolBar (iconToolBar , tbd );
205 205
206#ifdef DESKTOP_VERSION 206#ifdef DESKTOP_VERSION
207 if ( KOPrefs::instance()->mShowIconFilter ) 207 if ( KOPrefs::instance()->mShowIconFilter )
208#else 208#else
209 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) 209 if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) )
210#endif 210#endif
211 211
212{ 212{
213 if ( p->mToolBarHorF ) { 213 if ( p->mToolBarHorF ) {
214 if ( p->mToolBarUpF ) 214 if ( p->mToolBarUpF )
215 tbd = Bottom; 215 tbd = Bottom;
216 else 216 else
217 tbd = Top; 217 tbd = Top;
218 } 218 }
219 else { 219 else {
220 if ( p->mToolBarUpF ) 220 if ( p->mToolBarUpF )
221 tbd = Right; 221 tbd = Right;
222 else 222 else
223 tbd = Left; 223 tbd = Left;
224 } 224 }
225 filterToolBar = new QPEToolBar ( this ); 225 filterToolBar = new QPEToolBar ( this );
226 filterMenubar = new KMenuBar( 0 ); 226 filterMenubar = new KMenuBar( 0 );
227 QFontMetrics fm ( filterMenubar->font() ); 227 QFontMetrics fm ( filterMenubar->font() );
228#ifndef DESKTOP_VERSION 228#ifndef DESKTOP_VERSION
229 filterToolBar->setFocusPolicy( NoFocus ); 229 filterToolBar->setFocusPolicy( NoFocus );
230 filterMenubar->setFocusPolicy( NoFocus ); 230 filterMenubar->setFocusPolicy( NoFocus );
231#endif 231#endif
232 filterPopupMenu = new QPopupMenu( this ); 232 filterPopupMenu = new QPopupMenu( this );
233 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); 233 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
234 QString addTest = "A"; 234 QString addTest = "A";
235 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); 235 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
236#ifdef DESKTOP_VERSION 236#ifdef DESKTOP_VERSION
237 addTest = "AAABBBCCCx"; 237 addTest = "AAAAAABBBCCCx";
238#else 238#else
239 addTest = "AAx"; 239 addTest = "AAAAAx";
240#endif 240#endif
241 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); 241 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
242 addToolBar (filterToolBar , tbd ); 242 addToolBar (filterToolBar , tbd );
243 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); 243 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
244 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); 244 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
245 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) 245 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
246 filterToolBar->hide(); 246 filterToolBar->hide();
247 } else { 247 } else {
248 filterToolBar = 0; 248 filterToolBar = 0;
249 filterMenubar = 0; 249 filterMenubar = 0;
250 filterPopupMenu = 0; 250 filterPopupMenu = 0;
251 } 251 }
252 if ( p->mShowIconOnetoolbar ) { 252 if ( p->mShowIconOnetoolbar ) {
253 viewToolBar = iconToolBar ; 253 viewToolBar = iconToolBar ;
254 navigatorToolBar = iconToolBar ; 254 navigatorToolBar = iconToolBar ;
255 } else { 255 } else {
256#ifndef DESKTOP_VERSION 256#ifndef DESKTOP_VERSION
257 setToolBarsMovable( false ); 257 setToolBarsMovable( false );
258#endif 258#endif
259 if ( p->mToolBarHorV ) { 259 if ( p->mToolBarHorV ) {
260 if ( p->mToolBarUpV ) 260 if ( p->mToolBarUpV )
261 tbd = Bottom; 261 tbd = Bottom;
262 else 262 else
263 tbd = Top; 263 tbd = Top;
264 } 264 }
265 else { 265 else {
266 if ( p->mToolBarUpV ) 266 if ( p->mToolBarUpV )
267 tbd = Right; 267 tbd = Right;
268 else 268 else
269 tbd = Left; 269 tbd = Left;
270 } 270 }
271 viewToolBar = new QPEToolBar( this ); 271 viewToolBar = new QPEToolBar( this );
272 addToolBar (viewToolBar , tbd ); 272 addToolBar (viewToolBar , tbd );
273 if ( p->mToolBarHorN ) { 273 if ( p->mToolBarHorN ) {
274 if ( p->mToolBarUpN ) 274 if ( p->mToolBarUpN )
275 tbd = Bottom; 275 tbd = Bottom;
276 else 276 else
277 tbd = Top; 277 tbd = Top;
278 } 278 }
279 else { 279 else {
280 if ( p->mToolBarUpN ) 280 if ( p->mToolBarUpN )
281 tbd = Right; 281 tbd = Right;
282 else 282 else
283 tbd = Left; 283 tbd = Left;
284 } 284 }
285 navigatorToolBar = new QPEToolBar( this ); 285 navigatorToolBar = new QPEToolBar( this );
286 addToolBar (navigatorToolBar , tbd ); 286 addToolBar (navigatorToolBar , tbd );
287 } 287 }
288 288
289 289
290 290
291 mCalendarModifiedFlag = false; 291 mCalendarModifiedFlag = false;
292 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 292 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
293 splash->setAlignment ( AlignCenter ); 293 splash->setAlignment ( AlignCenter );
294 setCentralWidget( splash ); 294 setCentralWidget( splash );
295#ifndef DESKTOP_VERSION 295#ifndef DESKTOP_VERSION
296 showMaximized(); 296 showMaximized();
297#endif 297#endif
298 298
299 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 299 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
300 setDefaultPreferences(); 300 setDefaultPreferences();
301 mCalendar = new CalendarLocal(); 301 mCalendar = new CalendarLocal();
302 mView = new CalendarView( mCalendar, this,"mCalendar " ); 302 mView = new CalendarView( mCalendar, this,"mCalendar " );
303 mView->hide(); 303 mView->hide();
304 //mView->resize(splash->size() ); 304 //mView->resize(splash->size() );
305 initActions(); 305 initActions();
306 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); 306 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
307 mSyncManager->setBlockSave(false); 307 mSyncManager->setBlockSave(false);
308 mView->setSyncManager(mSyncManager); 308 mView->setSyncManager(mSyncManager);
309#ifndef DESKTOP_VERSION 309#ifndef DESKTOP_VERSION
310 iconToolBar->show(); 310 iconToolBar->show();
311 qApp->processEvents(); 311 qApp->processEvents();
312#endif 312#endif
313 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 313 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
314 int vh = height() ; 314 int vh = height() ;
315 int vw = width(); 315 int vw = width();
316 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 316 //qDebug("Toolbar hei %d ",iconToolBar->height() );
317 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 317 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
318 vh -= iconToolBar->height(); 318 vh -= iconToolBar->height();
319 } else { 319 } else {
320 vw -= iconToolBar->height(); 320 vw -= iconToolBar->height();
321 } 321 }
322 //mView->setMaximumSize( splash->size() ); 322 //mView->setMaximumSize( splash->size() );
323 //mView->resize( splash->size() ); 323 //mView->resize( splash->size() );
324 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 324 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
325 mView->readSettings(); 325 mView->readSettings();
326 bool newFile = false; 326 bool newFile = false;
327 if( !QFile::exists( defaultFileName() ) ) { 327 if( !QFile::exists( defaultFileName() ) ) {
328 QFileInfo finfo ( defaultFileName() ); 328 QFileInfo finfo ( defaultFileName() );
329 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); 329 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics");
330 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; 330 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n";
331 finfo.setFile( oldFile ); 331 finfo.setFile( oldFile );
332 if (finfo.exists() ) { 332 if (finfo.exists() ) {
333 KMessageBox::information( this, message); 333 KMessageBox::information( this, message);
334 mView->openCalendar( oldFile ); 334 mView->openCalendar( oldFile );
335 qApp->processEvents(); 335 qApp->processEvents();
@@ -744,403 +744,405 @@ void MainWindow::initActions()
744 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 744 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
745 745
746 746
747 mWeekBgColor = iconToolBar->backgroundColor(); 747 mWeekBgColor = iconToolBar->backgroundColor();
748 mWeekPixmap.resize( pixWid , pixHei ); 748 mWeekPixmap.resize( pixWid , pixHei );
749 mWeekPixmap.fill( mWeekBgColor ); 749 mWeekPixmap.fill( mWeekBgColor );
750 icon = mWeekPixmap; 750 icon = mWeekPixmap;
751 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 751 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
752 if ( p-> mShowIconWeekNum ) 752 if ( p-> mShowIconWeekNum )
753 mWeekAction->addTo( iconToolBar ); 753 mWeekAction->addTo( iconToolBar );
754 mWeekFont = font(); 754 mWeekFont = font();
755 755
756 int fontPoint = mWeekFont.pointSize(); 756 int fontPoint = mWeekFont.pointSize();
757 QFontMetrics f( mWeekFont ); 757 QFontMetrics f( mWeekFont );
758 int fontWid = f.width( "30" ); 758 int fontWid = f.width( "30" );
759 while ( fontWid > pixWid ) { 759 while ( fontWid > pixWid ) {
760 --fontPoint; 760 --fontPoint;
761 mWeekFont.setPointSize( fontPoint ); 761 mWeekFont.setPointSize( fontPoint );
762 QFontMetrics f( mWeekFont ); 762 QFontMetrics f( mWeekFont );
763 fontWid = f.width( "30" ); 763 fontWid = f.width( "30" );
764 //qDebug("dec-- "); 764 //qDebug("dec-- ");
765 } 765 }
766 766
767 connect( mWeekAction, SIGNAL( activated() ), 767 connect( mWeekAction, SIGNAL( activated() ),
768 this, SLOT( weekAction() ) ); 768 this, SLOT( weekAction() ) );
769 769
770 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 770 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
771 if ( p->mShowIconFilterview ) { 771 if ( p->mShowIconFilterview ) {
772 icon = loadPixmap( pathString + "filter" ); 772 icon = loadPixmap( pathString + "filter" );
773 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); 773 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
774 connect( actionFilterMenuTB, SIGNAL( activated() ), 774 connect( actionFilterMenuTB, SIGNAL( activated() ),
775 this, SLOT( fillFilterMenuTB() ) ); 775 this, SLOT( fillFilterMenuTB() ) );
776 actionFilterMenuTB->addTo( iconToolBar ); 776 actionFilterMenuTB->addTo( iconToolBar );
777 selectFilterMenuTB = new QPopupMenu( this ); 777 selectFilterMenuTB = new QPopupMenu( this );
778 selectFilterMenuTB->setCheckable( true ); 778 selectFilterMenuTB->setCheckable( true );
779 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 779 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
780 } 780 }
781 781
782 //#endif 782 //#endif
783 // ****************** 783 // ******************
784 QAction *action; 784 QAction *action;
785 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 785 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
786 configureToolBarMenu->setCheckable( true ); 786 configureToolBarMenu->setCheckable( true );
787 787
788 788
789 configureAgendaMenu->setCheckable( true ); 789 configureAgendaMenu->setCheckable( true );
790 int iii ; 790 int iii ;
791 for ( iii = 1;iii<= 10 ;++iii ){ 791 for ( iii = 1;iii<= 10 ;++iii ){
792 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 792 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
793 } 793 }
794 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 794 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
795 795
796 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 796 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
797 this, SLOT( showConfigureAgenda( ) ) ); 797 this, SLOT( showConfigureAgenda( ) ) );
798 icon = loadPixmap( pathString + "today" ); 798 icon = loadPixmap( pathString + "today" );
799 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 799 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
800 today_action->addTo( actionMenu ); 800 today_action->addTo( actionMenu );
801 connect( today_action, SIGNAL( activated() ), 801 connect( today_action, SIGNAL( activated() ),
802 mView, SLOT( goToday() ) ); 802 mView, SLOT( goToday() ) );
803 803
804 icon = loadPixmap( pathString + "picker" ); 804 icon = loadPixmap( pathString + "picker" );
805 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); 805 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this );
806 dPickerAction->addTo( actionMenu ); 806 dPickerAction->addTo( actionMenu );
807 connect( dPickerAction, SIGNAL( activated() ), 807 connect( dPickerAction, SIGNAL( activated() ),
808 mView, SLOT( showDatePicker() ) ); 808 mView, SLOT( showDatePicker() ) );
809 809
810 icon = loadPixmap( pathString + "search" ); 810 icon = loadPixmap( pathString + "search" );
811 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 811 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
812 search_action->addTo( actionMenu ); 812 search_action->addTo( actionMenu );
813 connect( search_action, SIGNAL( activated() ), 813 connect( search_action, SIGNAL( activated() ),
814 mView->dialogManager(), SLOT( showSearchDialog() ) ); 814 mView->dialogManager(), SLOT( showSearchDialog() ) );
815 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); 815 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu );
816 816
817 action = new QAction( "Undo Delete", i18n("All events"), 0, this ); 817 action = new QAction( "Undo Delete", i18n("All events"), 0, this );
818 action->addTo( nextConflictMenu ); 818 action->addTo( nextConflictMenu );
819 connect( action, SIGNAL( activated() ), 819 connect( action, SIGNAL( activated() ),
820 mView, SLOT( conflictAll() ) ); 820 mView, SLOT( conflictAll() ) );
821 821
822 action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); 822 action = new QAction( "Undo Delete", i18n("Allday events"), 0, this );
823 action->addTo( nextConflictMenu ); 823 action->addTo( nextConflictMenu );
824 connect( action, SIGNAL( activated() ), 824 connect( action, SIGNAL( activated() ),
825 mView, SLOT( conflictAllday() ) ); 825 mView, SLOT( conflictAllday() ) );
826 826
827 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); 827 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this );
828 action->addTo( nextConflictMenu ); 828 action->addTo( nextConflictMenu );
829 connect( action, SIGNAL( activated() ), 829 connect( action, SIGNAL( activated() ),
830 mView, SLOT( conflictNotAll() ) ); 830 mView, SLOT( conflictNotAll() ) );
831 831
832 actionMenu->insertSeparator(); 832 actionMenu->insertSeparator();
833 833
834 icon = loadPixmap( pathString + "newevent" ); 834 icon = loadPixmap( pathString + "newevent" );
835 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 835 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
836 ne_action->addTo( mCurrentItemMenu ); 836 ne_action->addTo( mCurrentItemMenu );
837 connect( ne_action, SIGNAL( activated() ), 837 connect( ne_action, SIGNAL( activated() ),
838 mView, SLOT( newEvent() ) ); 838 mView, SLOT( newEvent() ) );
839 icon = loadPixmap( pathString + "newtodo" ); 839 icon = loadPixmap( pathString + "newtodo" );
840 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
841 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 840 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
842 nt_action->addTo( mCurrentItemMenu ); 841 nt_action->addTo( mCurrentItemMenu );
843 connect( nt_action, SIGNAL( activated() ), 842 connect( nt_action, SIGNAL( activated() ),
844 mView, SLOT( newTodo() ) ); 843 mView, SLOT( newTodo() ) );
845 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 844 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
846 this ); 845 this );
847 mNewSubTodoAction->addTo( mCurrentItemMenu ); 846 mNewSubTodoAction->addTo( mCurrentItemMenu );
848 connect( mNewSubTodoAction, SIGNAL( activated() ), 847 connect( mNewSubTodoAction, SIGNAL( activated() ),
849 mView, SLOT( newSubTodo() ) ); 848 mView, SLOT( newSubTodo() ) );
850 849
851 mCurrentItemMenu->insertSeparator(); 850 mCurrentItemMenu->insertSeparator();
852 icon = loadPixmap( pathString + "newevent" ); 851 icon = loadPixmap( pathString + "newevent" );
853 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 852 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
854 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 853 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
855 configureToolBarMenu->insertSeparator(); 854 configureToolBarMenu->insertSeparator();
856 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 855 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
857 configureToolBarMenu->insertSeparator(); 856 configureToolBarMenu->insertSeparator();
858 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 857 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
859 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 858 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
859 icon = loadPixmap( pathString + "newtodo" );
860 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
860 861
861 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); 862 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
862 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); 863 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this );
863 mShowAction->addTo( mCurrentItemMenu ); 864 mShowAction->addTo( mCurrentItemMenu );
864 connect( mShowAction, SIGNAL( activated() ), 865 connect( mShowAction, SIGNAL( activated() ),
865 mView, SLOT( showIncidence() ) ); 866 mView, SLOT( showIncidence() ) );
866 867
867 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 868 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
868 mEditAction->addTo( mCurrentItemMenu ); 869 mEditAction->addTo( mCurrentItemMenu );
869 connect( mEditAction, SIGNAL( activated() ), 870 connect( mEditAction, SIGNAL( activated() ),
870 mView, SLOT( editIncidence() ) ); 871 mView, SLOT( editIncidence() ) );
871 872
872 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 873 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
873 mDeleteAction->addTo( mCurrentItemMenu ); 874 mDeleteAction->addTo( mCurrentItemMenu );
874 connect( mDeleteAction, SIGNAL( activated() ), 875 connect( mDeleteAction, SIGNAL( activated() ),
875 mView, SLOT( deleteIncidence() ) ); 876 mView, SLOT( deleteIncidence() ) );
876 877
877 878
878 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 879 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
879 mCloneAction->addTo( mCurrentItemMenu ); 880 mCloneAction->addTo( mCurrentItemMenu );
880 connect( mCloneAction, SIGNAL( activated() ), 881 connect( mCloneAction, SIGNAL( activated() ),
881 mView, SLOT( cloneIncidence() ) ); 882 mView, SLOT( cloneIncidence() ) );
882 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 883 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
883 mMoveAction->addTo( mCurrentItemMenu ); 884 mMoveAction->addTo( mCurrentItemMenu );
884 connect( mMoveAction, SIGNAL( activated() ), 885 connect( mMoveAction, SIGNAL( activated() ),
885 mView, SLOT( moveIncidence() ) ); 886 mView, SLOT( moveIncidence() ) );
886#ifndef DESKTOP_VERSION 887#ifndef DESKTOP_VERSION
887 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 888 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
888 mBeamAction->addTo(mCurrentItemMenu ); 889 mBeamAction->addTo(mCurrentItemMenu );
889 connect( mBeamAction, SIGNAL( activated() ), 890 connect( mBeamAction, SIGNAL( activated() ),
890 mView, SLOT( beamIncidence() ) ); 891 mView, SLOT( beamIncidence() ) );
891#endif 892#endif
892 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 893 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
893 mCancelAction->addTo( mCurrentItemMenu ); 894 mCancelAction->addTo( mCurrentItemMenu );
894 connect( mCancelAction, SIGNAL( activated() ), 895 connect( mCancelAction, SIGNAL( activated() ),
895 mView, SLOT( toggleCancelIncidence() ) ); 896 mView, SLOT( toggleCancelIncidence() ) );
896 897
897 898
898 mCurrentItemMenu->insertSeparator(); 899 mCurrentItemMenu->insertSeparator();
899 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 900 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
900 action->addTo( mCurrentItemMenu ); 901 action->addTo( mCurrentItemMenu );
901 connect( action, SIGNAL( activated() ), 902 connect( action, SIGNAL( activated() ),
902 mView, SLOT( undo_delete() ) ); 903 mView, SLOT( undo_delete() ) );
903 904
904 // *********************** 905 // ***********************
905 if ( KOPrefs::instance()->mVerticalScreen ) { 906 if ( KOPrefs::instance()->mVerticalScreen ) {
906 icon = SmallIcon( "1updownarrow" ); 907 icon = SmallIcon( "1updownarrow" );
907 } else { 908 } else {
908 icon = SmallIcon("1leftrightarrow" ); 909 icon = SmallIcon("1leftrightarrow" );
909 } 910 }
910 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 911 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
911 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 912 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
912 FSaction->addTo( viewMenu ); 913 FSaction->addTo( viewMenu );
913 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 914 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
914 915
915 916
916 icon = loadPixmap( pathString + "filter" ); 917 icon = loadPixmap( pathString + "filter" );
917 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 918 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
918 icon = loadPixmap( pathString + "configure" ); 919 icon = loadPixmap( pathString + "configure" );
919 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); 920 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this );
920 action->addTo( viewMenu ); 921 action->addTo( viewMenu );
921 connect( action, SIGNAL( activated() ), 922 connect( action, SIGNAL( activated() ),
922 mView, SLOT( toggleFilter() ) ); 923 mView, SLOT( toggleFilter() ) );
923 mToggleFilter = action; 924 mToggleFilter = action;
924 icon = loadPixmap( pathString + "navi" ); 925 icon = loadPixmap( pathString + "navi" );
925 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); 926 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
926 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 927 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
927 action->addTo( viewMenu ); 928 action->addTo( viewMenu );
928 connect( action, SIGNAL( activated() ), 929 connect( action, SIGNAL( activated() ),
929 mView, SLOT( toggleDateNavigatorWidget() ) ); 930 mView, SLOT( toggleDateNavigatorWidget() ) );
930 mToggleNav = action ; 931 mToggleNav = action ;
931 icon = loadPixmap( pathString + "allday" ); 932 icon = loadPixmap( pathString + "allday" );
932 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); 933 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
933 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 934 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
934 action->addTo( viewMenu ); 935 action->addTo( viewMenu );
935 connect( action, SIGNAL( activated() ), 936 connect( action, SIGNAL( activated() ),
936 mView, SLOT( toggleAllDaySize() ) ); 937 mView, SLOT( toggleAllDaySize() ) );
937 mToggleAllday = action; 938 mToggleAllday = action;
938 939
939 940
940 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 941 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
941 mToggleNav, SLOT( setEnabled ( bool ) ) ); 942 mToggleNav, SLOT( setEnabled ( bool ) ) );
942 //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 943 //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
943 // mToggleFilter, SLOT( setEnabled ( bool ) ) ); 944 // mToggleFilter, SLOT( setEnabled ( bool ) ) );
944 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 945 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
945 mToggleAllday, SLOT( setEnabled ( bool ) ) ); 946 mToggleAllday, SLOT( setEnabled ( bool ) ) );
946 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 947 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
947 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); 948 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) );
948 949
949 950
950 dPickerAction->addTo( iconToolBar ); 951 dPickerAction->addTo( iconToolBar );
951 viewMenu->insertSeparator(); 952 viewMenu->insertSeparator();
952 953
953 if ( p-> mShowIconToggleFull ) 954 if ( p-> mShowIconToggleFull )
954 FSaction->addTo( iconToolBar ); 955 FSaction->addTo( iconToolBar );
955 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); 956 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
956 957
957 //******************** 958 //********************
958 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); 959 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
959 960
960 961
961 icon = loadPixmap( pathString + "whatsnext" ); 962 icon = loadPixmap( pathString + "whatsnext" );
962 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); 963 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
963 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 964 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
964 whatsnext_action->addTo( viewMenu ); 965 whatsnext_action->addTo( viewMenu );
965 connect( whatsnext_action, SIGNAL( activated() ), 966 connect( whatsnext_action, SIGNAL( activated() ),
966 mView->viewManager(), SLOT( showWhatsNextView() ) ); 967 mView->viewManager(), SLOT( showWhatsNextView() ) );
967 968
968 icon = loadPixmap( pathString + "xdays" ); 969 icon = loadPixmap( pathString + "xdays" );
969 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); 970 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 );
970 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 971 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
971 xdays_action->addTo( viewMenu ); 972 xdays_action->addTo( viewMenu );
972 connect( xdays_action, SIGNAL( activated() ), 973 connect( xdays_action, SIGNAL( activated() ),
973 mView->viewManager(), SLOT( showNextXView() ) ); 974 mView->viewManager(), SLOT( showNextXView() ) );
974 975
975 976
976 icon = loadPixmap( pathString + "journal" ); 977 icon = loadPixmap( pathString + "journal" );
977 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 978 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
978 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 979 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
979 viewjournal_action->addTo( viewMenu ); 980 viewjournal_action->addTo( viewMenu );
980 connect( viewjournal_action, SIGNAL( activated() ), 981 connect( viewjournal_action, SIGNAL( activated() ),
981 mView->viewManager(), SLOT( showJournalView() ) ); 982 mView->viewManager(), SLOT( showJournalView() ) );
982 983
983 984
984 icon = loadPixmap( pathString + "day" ); 985 icon = loadPixmap( pathString + "day" );
985 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 986 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
986 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 987 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
987 day1_action->addTo( viewMenu ); 988 day1_action->addTo( viewMenu );
988 // action->addTo( toolBar ); 989 // action->addTo( toolBar );
989 connect( day1_action, SIGNAL( activated() ), 990 connect( day1_action, SIGNAL( activated() ),
990 mView->viewManager(), SLOT( showDayView() ) ); 991 mView->viewManager(), SLOT( showDayView() ) );
991 992
992 icon = loadPixmap( pathString + "workweek" ); 993 icon = loadPixmap( pathString + "workweek" );
993 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 994 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
994 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 995 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
995 day5_action->addTo( viewMenu ); 996 day5_action->addTo( viewMenu );
996 connect( day5_action, SIGNAL( activated() ), 997 connect( day5_action, SIGNAL( activated() ),
997 mView->viewManager(), SLOT( showWorkWeekView() ) ); 998 mView->viewManager(), SLOT( showWorkWeekView() ) );
998 999
999 icon = loadPixmap( pathString + "week" ); 1000 icon = loadPixmap( pathString + "week" );
1000 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 1001 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
1001 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 1002 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
1002 day7_action->addTo( viewMenu ); 1003 day7_action->addTo( viewMenu );
1003 connect( day7_action, SIGNAL( activated() ), 1004 connect( day7_action, SIGNAL( activated() ),
1004 mView->viewManager(), SLOT( showWeekView() ) ); 1005 mView->viewManager(), SLOT( showWeekView() ) );
1005 1006
1006 icon = loadPixmap( pathString + "workweek2" ); 1007 icon = loadPixmap( pathString + "workweek2" );
1007 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); 1008 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 );
1008 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); 1009 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this );
1009 day6_action->addTo( viewMenu ); 1010 day6_action->addTo( viewMenu );
1010 connect( day6_action, SIGNAL( activated() ), 1011 connect( day6_action, SIGNAL( activated() ),
1011 mView->viewManager(), SLOT( showMonthViewWeek() ) ); 1012 mView->viewManager(), SLOT( showMonthViewWeek() ) );
1012 1013
1013 icon = loadPixmap( pathString + "month" ); 1014 icon = loadPixmap( pathString + "month" );
1014 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); 1015 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
1015 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); 1016 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this );
1016 month_action->addTo( viewMenu ); 1017 month_action->addTo( viewMenu );
1017 connect( month_action, SIGNAL( activated() ), 1018 connect( month_action, SIGNAL( activated() ),
1018 mView->viewManager(), SLOT( showMonthView() ) ); 1019 mView->viewManager(), SLOT( showMonthView() ) );
1019 1020
1020 icon = loadPixmap( pathString + "list" ); 1021 icon = loadPixmap( pathString + "list" );
1021 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); 1022 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
1022 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); 1023 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
1023 showlist_action->addTo( viewMenu ); 1024 showlist_action->addTo( viewMenu );
1024 connect( showlist_action, SIGNAL( activated() ), 1025 connect( showlist_action, SIGNAL( activated() ),
1025 mView->viewManager(), SLOT( showListView() ) ); 1026 mView->viewManager(), SLOT( showListView() ) );
1026 1027
1027 icon = loadPixmap( pathString + "todo" ); 1028 icon = loadPixmap( pathString + "todo" );
1028 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 1029 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
1029 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); 1030 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
1030 todoview_action->addTo( viewMenu ); 1031 todoview_action->addTo( viewMenu );
1031 connect( todoview_action, SIGNAL( activated() ), 1032 connect( todoview_action, SIGNAL( activated() ),
1032 mView->viewManager(), SLOT( showTodoView() ) ); 1033 mView->viewManager(), SLOT( showTodoView() ) );
1033 1034
1034 1035
1035 1036
1036#if 0 1037#if 0
1037 action = new QAction( "view_timespan", "Time Span", 0, this ); 1038 action = new QAction( "view_timespan", "Time Span", 0, this );
1038 action->addTo( viewMenu ); 1039 action->addTo( viewMenu );
1039 connect( action, SIGNAL( activated() ), 1040 connect( action, SIGNAL( activated() ),
1040 mView->viewManager(), SLOT( showTimeSpanView() ) ); 1041 mView->viewManager(), SLOT( showTimeSpanView() ) );
1041#endif 1042#endif
1042 1043
1043 1044
1044 1045
1045 action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, 1046 action = new QAction( "purge_completed", i18n("Purge Completed..."), 0,
1046 this ); 1047 this );
1047 action->addTo( actionMenu ); 1048 action->addTo( actionMenu );
1048 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 1049 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
1049 1050
1050 1051
1052 icon = loadPixmap( pathString + "search" );
1051 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); 1053 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
1052 1054
1053 1055
1054 1056
1055 actionMenu->insertSeparator(); 1057 actionMenu->insertSeparator();
1056 action = new QAction( "manage cat", i18n("Edit category list..."), 0, 1058 action = new QAction( "manage cat", i18n("Edit category list..."), 0,
1057 this ); 1059 this );
1058 action->addTo( actionMenu ); 1060 action->addTo( actionMenu );
1059 connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); 1061 connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) );
1060 1062
1061 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 1063 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
1062 this ); 1064 this );
1063 action->addTo( actionMenu ); 1065 action->addTo( actionMenu );
1064 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 1066 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
1065 1067
1066 1068
1067 actionMenu->insertSeparator(); 1069 actionMenu->insertSeparator();
1068 icon = loadPixmap( pathString + "configure" ); 1070 icon = loadPixmap( pathString + "configure" );
1069 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); 1071 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this );
1070 action->addTo( actionMenu ); 1072 action->addTo( actionMenu );
1071 connect( action, SIGNAL( activated() ), 1073 connect( action, SIGNAL( activated() ),
1072 mView, SLOT( edit_options() ) ); 1074 mView, SLOT( edit_options() ) );
1073 action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); 1075 action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this );
1074 action->addTo( actionMenu ); 1076 action->addTo( actionMenu );
1075 connect( action, SIGNAL( activated() ), 1077 connect( action, SIGNAL( activated() ),
1076 this, SLOT( calHint() ) ); 1078 this, SLOT( calHint() ) );
1077 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); 1079 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this );
1078 action->addTo( actionMenu ); 1080 action->addTo( actionMenu );
1079 connect( action, SIGNAL( activated() ), 1081 connect( action, SIGNAL( activated() ),
1080 mView, SLOT( edit_global_options() ) ); 1082 mView, SLOT( edit_global_options() ) );
1081 if ( KOPrefs::instance()->mShowFullMenu ) { 1083 if ( KOPrefs::instance()->mShowFullMenu ) {
1082 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 1084 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
1083 1085
1084 } 1086 }
1085 // actionMenu->insertSeparator(); 1087 // actionMenu->insertSeparator();
1086 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 1088 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
1087 this ); 1089 this );
1088 action->addTo( importMenu_X ); 1090 action->addTo( importMenu_X );
1089 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 1091 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
1090 action = new QAction( "import_quick", i18n("Import last file"), 0, 1092 action = new QAction( "import_quick", i18n("Import last file"), 0,
1091 this ); 1093 this );
1092 action->addTo( importMenu_X ); 1094 action->addTo( importMenu_X );
1093 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 1095 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
1094 importMenu_X->insertSeparator(); 1096 importMenu_X->insertSeparator();
1095 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 1097 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
1096 this ); 1098 this );
1097 action->addTo( importMenu_X ); 1099 action->addTo( importMenu_X );
1098 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 1100 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
1099 //#ifndef DESKTOP_VERSION 1101 //#ifndef DESKTOP_VERSION
1100 importMenu_X->insertSeparator(); 1102 importMenu_X->insertSeparator();
1101 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 1103 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
1102 this ); 1104 this );
1103 action->addTo( importMenu_X ); 1105 action->addTo( importMenu_X );
1104 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 1106 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
1105 //#else 1107 //#else
1106#ifdef _OL_IMPORT_ 1108#ifdef _OL_IMPORT_
1107 importMenu_X->insertSeparator(); 1109 importMenu_X->insertSeparator();
1108 action = new QAction( "import_ol", i18n("Import from OL"), 0, 1110 action = new QAction( "import_ol", i18n("Import from OL"), 0,
1109 this ); 1111 this );
1110 action->addTo( importMenu_X ); 1112 action->addTo( importMenu_X );
1111 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 1113 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
1112#endif 1114#endif
1113 //#endif 1115 //#endif
1114 1116
1115 //importMenu->insertSeparator(); 1117 //importMenu->insertSeparator();
1116#if 0 1118#if 0
1117 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 1119 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
1118 this ); 1120 this );
1119 action->addTo( importMenu ); 1121 action->addTo( importMenu );
1120 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 1122 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
1121#endif 1123#endif
1122 action = new QAction( "save_cal", i18n("Save Backup..."), 0, 1124 action = new QAction( "save_cal", i18n("Save Backup..."), 0,
1123 this ); 1125 this );
1124 action->addTo( importMenu ); 1126 action->addTo( importMenu );
1125 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 1127 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
1126 importMenu->insertSeparator(); 1128 importMenu->insertSeparator();
1127 importMenu->insertItem( i18n("Import"), importMenu_X ); 1129 importMenu->insertItem( i18n("Import"), importMenu_X );
1128 //importMenu->insertSeparator(); 1130 //importMenu->insertSeparator();
1129 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 1131 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
1130 this ); 1132 this );
1131 action->addTo( exportMenu_X ); 1133 action->addTo( exportMenu_X );
1132 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 1134 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
1133 1135
1134 1136
1135 //LR 1137 //LR
1136 QPopupMenu *ex2phone = new QPopupMenu( this ); 1138 QPopupMenu *ex2phone = new QPopupMenu( this );
1137 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1139 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1138 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1140 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1139 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 1141 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
1140 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); 1142 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone );
1141 1143
1142 importMenu->insertItem( i18n("Export"), exportMenu_X ); 1144 importMenu->insertItem( i18n("Export"), exportMenu_X );
1143 mPrintSelAction = 0; 1145 mPrintSelAction = 0;
1144#ifndef DESKTOP_VERSION 1146#ifndef DESKTOP_VERSION
1145 //importMenu->insertSeparator(); 1147 //importMenu->insertSeparator();
1146 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 1148 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
@@ -2232,193 +2234,196 @@ void MainWindow::fillFilterMenuTB()
2232 ++iii; 2234 ++iii;
2233 } 2235 }
2234 if ( !checkitem ) 2236 if ( !checkitem )
2235 selectFilterMenuTB->setItemChecked( 1, true ); 2237 selectFilterMenuTB->setItemChecked( 1, true );
2236 2238
2237 int x = 0; 2239 int x = 0;
2238 int y = iconToolBar->height(); 2240 int y = iconToolBar->height();
2239 int dX = 0; 2241 int dX = 0;
2240 int dY = 0; 2242 int dY = 0;
2241 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2243 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2242 if ( iconToolBar->y() > height()/2 ) { 2244 if ( iconToolBar->y() > height()/2 ) {
2243 dY = selectFilterMenuTB->sizeHint().height()+8; 2245 dY = selectFilterMenuTB->sizeHint().height()+8;
2244 y = 0; 2246 y = 0;
2245 } 2247 }
2246 } else { 2248 } else {
2247 if ( iconToolBar->x() > width()/2 ) { // right side 2249 if ( iconToolBar->x() > width()/2 ) { // right side
2248 x=0; 2250 x=0;
2249 dX= selectFilterMenuTB->sizeHint().width()+8; 2251 dX= selectFilterMenuTB->sizeHint().width()+8;
2250 y = 0; 2252 y = 0;
2251 } else { 2253 } else {
2252 x= iconToolBar->width(); 2254 x= iconToolBar->width();
2253 y = 0; 2255 y = 0;
2254 } 2256 }
2255 } 2257 }
2256 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2258 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2257 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); 2259 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2258} 2260}
2259void MainWindow::fillFilterMenu() 2261void MainWindow::fillFilterMenu()
2260{ 2262{
2261 selectFilterMenu->clear(); 2263 selectFilterMenu->clear();
2262 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2264 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
2263 selectFilterMenu->insertSeparator(); 2265 selectFilterMenu->insertSeparator();
2264 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2266 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
2265 2267
2266 selectFilterMenu->insertSeparator(); 2268 selectFilterMenu->insertSeparator();
2267 QPtrList<CalFilter> fili = mView->filters(); 2269 QPtrList<CalFilter> fili = mView->filters();
2268 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2270 CalFilter *curfilter = mView->filterView()->selectedFilter();
2269 CalFilter *filter = fili.first(); 2271 CalFilter *filter = fili.first();
2270 int iii = 2; 2272 int iii = 2;
2271 bool checkitem = mView->filterView()->filtersEnabled(); 2273 bool checkitem = mView->filterView()->filtersEnabled();
2272 while(filter) { 2274 while(filter) {
2273 selectFilterMenu->insertItem( filter->name(), iii ); 2275 selectFilterMenu->insertItem( filter->name(), iii );
2274 if ( filter == curfilter) 2276 if ( filter == curfilter)
2275 selectFilterMenu->setItemChecked( iii, checkitem ); 2277 selectFilterMenu->setItemChecked( iii, checkitem );
2276 filter = fili.next(); 2278 filter = fili.next();
2277 ++iii; 2279 ++iii;
2278 } 2280 }
2279 if ( !checkitem ) 2281 if ( !checkitem )
2280 selectFilterMenu->setItemChecked( 1, true ); 2282 selectFilterMenu->setItemChecked( 1, true );
2281} 2283}
2282void MainWindow::fillFilterMenuPopup() 2284void MainWindow::fillFilterMenuPopup()
2283{ 2285{
2284 filterPopupMenu->clear(); 2286 filterPopupMenu->clear();
2285 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2287 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
2286 2288
2287 filterPopupMenu->insertSeparator(); 2289 filterPopupMenu->insertSeparator();
2288 QPtrList<CalFilter> fili = mView->filters(); 2290 QPtrList<CalFilter> fili = mView->filters();
2289 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2291 CalFilter *curfilter = mView->filterView()->selectedFilter();
2290 CalFilter *filter = fili.first(); 2292 CalFilter *filter = fili.first();
2291 int iii = 1; 2293 int iii = 1;
2292 bool checkitem = mView->filterView()->filtersEnabled(); 2294 bool checkitem = mView->filterView()->filtersEnabled();
2293 while(filter) { 2295 while(filter) {
2294 filterPopupMenu->insertItem( filter->name(), iii ); 2296 filterPopupMenu->insertItem( filter->name(), iii );
2295 if ( filter == curfilter) 2297 if ( filter == curfilter)
2296 filterPopupMenu->setItemChecked( iii, checkitem ); 2298 filterPopupMenu->setItemChecked( iii, checkitem );
2297 filter = fili.next(); 2299 filter = fili.next();
2298 ++iii; 2300 ++iii;
2299 } 2301 }
2300 if ( !checkitem ) 2302 if ( !checkitem )
2301 filterPopupMenu->setItemChecked( 0, true ); 2303 filterPopupMenu->setItemChecked( 0, true );
2302} 2304}
2303void MainWindow::selectFilter( int fil ) 2305void MainWindow::selectFilter( int fil )
2304{ 2306{
2305 2307
2306 if ( fil == 0 ) { 2308 if ( fil == 0 ) {
2307 mView->editFilters( ); 2309 mView->editFilters( );
2308 } else if ( fil == 1 ){ 2310 } else if ( fil == 1 ){
2309 if ( mView->filterView()->filtersEnabled() ) 2311 if ( mView->filterView()->filtersEnabled() )
2310 mView->toggleFilerEnabled( ); 2312 mView->toggleFilerEnabled( );
2311 } else { 2313 } else {
2312 if ( !mView->filterView()->filtersEnabled() ) { 2314 if ( !mView->filterView()->filtersEnabled() ) {
2313 mView->filterView()->blockSignals( true ); 2315 mView->filterView()->blockSignals( true );
2314 mView->toggleFilerEnabled( ); 2316 mView->toggleFilerEnabled( );
2315 mView->filterView()->blockSignals( false ); 2317 mView->filterView()->blockSignals( false );
2316 } 2318 }
2317 mView->selectFilter( fil-2 ); 2319 mView->selectFilter( fil-2 );
2318 } 2320 }
2319} 2321}
2320void MainWindow::updateFilterToolbar() 2322void MainWindow::updateFilterToolbar()
2321{ 2323{
2322 if ( filterMenubar ) { 2324 if ( filterMenubar ) {
2323 if ( !mView->filterView()->filtersEnabled() ) { 2325 if ( !mView->filterView()->filtersEnabled() ) {
2324 filterMenubar->changeItem( 0, i18n("No Filter") ); 2326 filterMenubar->changeItem( 0, i18n("No Filter") );
2325 } else { 2327 } else {
2326 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2328 CalFilter *curfilter = mView->filterView()->selectedFilter();
2327 if ( curfilter ) { 2329 if ( curfilter ) {
2328 filterMenubar->changeItem( 0, curfilter->name() ); 2330 QString name = curfilter->name();
2331 if ( name.length() > 12 )
2332 name = name.left(10)+"...";
2333 filterMenubar->changeItem( 0, name );
2329 } 2334 }
2330 } 2335 }
2331 } 2336 }
2332} 2337}
2333void MainWindow::selectFilterPopup( int fil ) 2338void MainWindow::selectFilterPopup( int fil )
2334{ 2339{
2335 selectFilter( fil + 1 ); 2340 selectFilter( fil + 1 );
2336 2341
2337} 2342}
2338void MainWindow::configureToolBar( int item ) 2343void MainWindow::configureToolBar( int item )
2339{ 2344{
2340 2345
2341 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 2346 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
2342 KOPrefs *p = KOPrefs::instance(); 2347 KOPrefs *p = KOPrefs::instance();
2343 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 2348 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
2344 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); 2349 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 );
2345 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); 2350 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
2346 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 2351 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
2347 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 2352 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
2348 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); 2353 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 );
2349 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); 2354 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 );
2350 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); 2355 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 );
2351 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); 2356 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 );
2352 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 2357 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
2353 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 2358 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
2354 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 2359 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
2355 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 2360 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
2356 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); 2361 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 );
2357 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 2362 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
2358 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 2363 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
2359 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 2364 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
2360 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 2365 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
2361 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 2366 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
2362 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 2367 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
2363 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 2368 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
2364 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 2369 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
2365 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 2370 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
2366 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 2371 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
2367 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 2372 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
2368 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 2373 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
2369 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); 2374 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 );
2370 // initActions(); 2375 // initActions();
2371 setCaption ( i18n("Toolbar changes needs a restart!") ); 2376 setCaption ( i18n("Toolbar changes needs a restart!") );
2372} 2377}
2373void MainWindow::setCaption ( const QString & c ) 2378void MainWindow::setCaption ( const QString & c )
2374{ 2379{
2375 QString cap = c; 2380 QString cap = c;
2376 cap.replace( QRegExp("\n"), " " ); 2381 cap.replace( QRegExp("\n"), " " );
2377 cap = cap.stripWhiteSpace(); 2382 cap = cap.stripWhiteSpace();
2378 if ( cap.isEmpty() ) 2383 if ( cap.isEmpty() )
2379 cap = "KO/Pi"; 2384 cap = "KO/Pi";
2380 QWidget::setCaption( cap ); 2385 QWidget::setCaption( cap );
2381} 2386}
2382void MainWindow::setCaptionToDates() 2387void MainWindow::setCaptionToDates()
2383{ 2388{
2384 QString selDates; 2389 QString selDates;
2385 QDate date = mView->startDate(); 2390 QDate date = mView->startDate();
2386 if ( ! date.isValid() ) { 2391 if ( ! date.isValid() ) {
2387 setCaption(""); 2392 setCaption("");
2388 return; 2393 return;
2389 } 2394 }
2390 selDates = KGlobal::locale()->formatDate( date, true); 2395 selDates = KGlobal::locale()->formatDate( date, true);
2391 if (mView->startDate() < mView->endDate() ) 2396 if (mView->startDate() < mView->endDate() )
2392 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 2397 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
2393 else { 2398 else {
2394 QString addString; 2399 QString addString;
2395 if ( date == QDateTime::currentDateTime().date() ) 2400 if ( date == QDateTime::currentDateTime().date() )
2396 addString = i18n("Today"); 2401 addString = i18n("Today");
2397 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 2402 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
2398 addString = i18n("Tomorrow"); 2403 addString = i18n("Tomorrow");
2399 if ( !addString.isEmpty() ) 2404 if ( !addString.isEmpty() )
2400 selDates = addString+", "+selDates ; 2405 selDates = addString+", "+selDates ;
2401 } 2406 }
2402 setCaption( i18n("Dates: ") + selDates ); 2407 setCaption( i18n("Dates: ") + selDates );
2403 2408
2404} 2409}
2405void MainWindow::showConfigureAgenda( ) 2410void MainWindow::showConfigureAgenda( )
2406{ 2411{
2407 int iii; 2412 int iii;
2408 for ( iii = 1;iii<= 10 ;++iii ){ 2413 for ( iii = 1;iii<= 10 ;++iii ){
2409 configureAgendaMenu->setItemChecked( (iii+1)*2, false ); 2414 configureAgendaMenu->setItemChecked( (iii+1)*2, false );
2410 } 2415 }
2411 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); 2416 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true );
2412} 2417}
2413void MainWindow::configureAgenda( int item ) 2418void MainWindow::configureAgenda( int item )
2414{ 2419{
2415 if ( KOPrefs::instance()->mHourSize == item ) 2420 if ( KOPrefs::instance()->mHourSize == item )
2416 return; 2421 return;
2417 KOPrefs::instance()->mHourSize=item; 2422 KOPrefs::instance()->mHourSize=item;
2418 mView->viewManager()->agendaView()->updateConfig(); 2423 mView->viewManager()->agendaView()->updateConfig();
2419} 2424}
2420 2425
2421void MainWindow::saveCalendar() 2426void MainWindow::saveCalendar()
2422{ 2427{
2423 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 2428 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
2424 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 2429 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
@@ -2569,105 +2574,107 @@ void MainWindow::syncFileRequest()
2569 mSyncManager->slotSyncMenu( 999 ); 2574 mSyncManager->slotSyncMenu( 999 );
2570 } 2575 }
2571 2576
2572 setCaption(i18n("Saving Data to temp file ..." )); 2577 setCaption(i18n("Saving Data to temp file ..." ));
2573 mView->saveCalendar( sentSyncFile() ); 2578 mView->saveCalendar( sentSyncFile() );
2574 setCaption(i18n("Data saved to temp file!" )); 2579 setCaption(i18n("Data saved to temp file!" ));
2575 mSyncManager->setBlockSave( false ); 2580 mSyncManager->setBlockSave( false );
2576 2581
2577} 2582}
2578void MainWindow::getFile( bool success ) 2583void MainWindow::getFile( bool success )
2579{ 2584{
2580 if ( ! success ) { 2585 if ( ! success ) {
2581 setCaption( i18n("Error receiving file. Nothing changed!") ); 2586 setCaption( i18n("Error receiving file. Nothing changed!") );
2582 return; 2587 return;
2583 } 2588 }
2584 mView->mergeFile( sentSyncFile() ); 2589 mView->mergeFile( sentSyncFile() );
2585 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2590 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2586 mSyncManager->slotSyncMenu( 999 ); 2591 mSyncManager->slotSyncMenu( 999 );
2587 } 2592 }
2588 setCaption( i18n("Pi-Sync successful!") ); 2593 setCaption( i18n("Pi-Sync successful!") );
2589} 2594}
2590void MainWindow::printListView() 2595void MainWindow::printListView()
2591{ 2596{
2592 2597
2593 QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items."); 2598 QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.");
2594 2599
2595 KMessageBox::information( this, message); 2600 KMessageBox::information( this, message);
2596} 2601}
2597void MainWindow::printSel( ) 2602void MainWindow::printSel( )
2598{ 2603{
2599 mView->viewManager()->agendaView()->agenda()->printSelection(); 2604 mView->viewManager()->agendaView()->agenda()->printSelection();
2600} 2605}
2601 2606
2602void MainWindow::printCal() 2607void MainWindow::printCal()
2603{ 2608{
2604 mView->print();//mCp->showDialog(); 2609 mView->print();//mCp->showDialog();
2605} 2610}
2606 2611
2607 2612
2608#include "libkdepim/kdatepicker.h" 2613#include "libkdepim/kdatepicker.h"
2609#include <kdatetbl.h> 2614#include <kdatetbl.h>
2610 2615
2611void MainWindow::weekAction() 2616void MainWindow::weekAction()
2612{ 2617{
2613 int month; 2618 int month;
2614 KPopupFrame* popup = new KPopupFrame(this); 2619 KPopupFrame* popup = new KPopupFrame(this);
2615 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); 2620 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup);
2616 // ----- 2621 // -----
2617 picker->resize(picker->sizeHint()); 2622 picker->resize(picker->sizeHint());
2618 popup->setMainWidget(picker); 2623 popup->setMainWidget(picker);
2619 picker->setFocus(); 2624 picker->setFocus();
2620 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 2625 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
2621 int x = 0; 2626 int x = 0;
2622 int y = iconToolBar->height(); 2627 int y = iconToolBar->height();
2623 int dX = 0; 2628 int dX = 0;
2624 int dY = 0; 2629 int dY = 0;
2625 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2630 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2626 if ( iconToolBar->y() > height()/2 ) { 2631 if ( iconToolBar->y() > height()/2 ) {
2627 dY = picker->sizeHint().height()+8; 2632 dY = picker->sizeHint().height()+8;
2628 y = 0; 2633 y = 0;
2629 } 2634 }
2630 } else { 2635 } else {
2631 if ( iconToolBar->x() > width()/2 ) { // right side 2636 if ( iconToolBar->x() > width()/2 ) { // right side
2632 x=0; 2637 x=0;
2633 dX= picker->sizeHint().width()+8; 2638 dX= picker->sizeHint().width()+8;
2634 y = 0; 2639 y = 0;
2635 } else { 2640 } else {
2636 x= iconToolBar->width(); 2641 x= iconToolBar->width();
2637 y = 0; 2642 y = 0;
2638 } 2643 }
2639 } 2644 }
2640 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2645 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2641 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) 2646 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))))
2642 { 2647 {
2643 month = picker->getResult(); 2648 month = picker->getResult();
2644 emit selectWeek ( month ); 2649 emit selectWeek ( month );
2645 //qDebug("weekSelected %d ", month); 2650 //qDebug("weekSelected %d ", month);
2646 } 2651 }
2647 delete popup; 2652 delete popup;
2648} 2653}
2649 2654
2650void MainWindow::hideEvent ( QHideEvent * ) 2655void MainWindow::hideEvent ( QHideEvent * )
2651{ 2656{
2652 QString message; 2657 QString message;
2653 QDateTime nextA = mCalendar->nextAlarmEventDateTime(); 2658 QDateTime nextA = mCalendar->nextAlarmEventDateTime();
2654 if ( nextA.isValid() ) { 2659 if ( nextA.isValid() ) {
2655 QString sum = mCalendar->nextSummary(); 2660 QString sum = mCalendar->nextSummary();
2656 2661
2657 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); 2662 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false));
2658 setCaption( message ); 2663 setCaption( message );
2659 } 2664 }
2660} 2665}
2661 2666
2662void MainWindow::resizeEvent( QResizeEvent* e) 2667void MainWindow::resizeEvent( QResizeEvent* e)
2663{ 2668{
2664#ifndef DESKTOP_VERSION 2669#ifndef DESKTOP_VERSION
2665 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) { 2670 if ( filterToolBar ) {
2666 if (QApplication::desktop()->width() > QApplication::desktop()->height() ) 2671 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) {
2667 filterToolBar->hide(); 2672 if (QApplication::desktop()->width() > QApplication::desktop()->height() )
2668 else 2673 filterToolBar->hide();
2669 filterToolBar->show(); 2674 else
2675 filterToolBar->show();
2676 }
2670 } 2677 }
2671#endif 2678#endif
2672 QMainWindow::resizeEvent( e); 2679 QMainWindow::resizeEvent( e);
2673} 2680}