summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 09a0880..d98915b 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1058,1253 +1058,1255 @@ void MainWindow::initActions()
1058 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 1058 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
1059 importMenu->insertSeparator(); 1059 importMenu->insertSeparator();
1060 action = new QAction( "beam all", i18n("Save"), 0, 1060 action = new QAction( "beam all", i18n("Save"), 0,
1061 this ); 1061 this );
1062 action->addTo( importMenu ); 1062 action->addTo( importMenu );
1063 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 1063 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
1064 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 1064 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
1065 this ); 1065 this );
1066 action->addTo( importMenu ); 1066 action->addTo( importMenu );
1067 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 1067 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
1068 1068
1069 //menuBar->insertItem( "Configure",configureMenu ); 1069 //menuBar->insertItem( "Configure",configureMenu );
1070 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 1070 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
1071 icon = loadPixmap( "korganizer/korganizer" ); 1071 icon = loadPixmap( "korganizer/korganizer" );
1072 1072
1073 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 1073 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
1074 action->addTo( helpMenu ); 1074 action->addTo( helpMenu );
1075 connect( action, SIGNAL( activated() ), 1075 connect( action, SIGNAL( activated() ),
1076 SLOT( whatsNew() ) ); 1076 SLOT( whatsNew() ) );
1077 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 1077 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
1078 action->addTo( helpMenu ); 1078 action->addTo( helpMenu );
1079 connect( action, SIGNAL( activated() ), 1079 connect( action, SIGNAL( activated() ),
1080 SLOT( features() ) ); 1080 SLOT( features() ) );
1081 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 1081 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
1082 action->addTo( helpMenu ); 1082 action->addTo( helpMenu );
1083 connect( action, SIGNAL( activated() ), 1083 connect( action, SIGNAL( activated() ),
1084 SLOT( keyBindings() ) ); 1084 SLOT( keyBindings() ) );
1085 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 1085 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
1086 action->addTo( helpMenu ); 1086 action->addTo( helpMenu );
1087 connect( action, SIGNAL( activated() ), 1087 connect( action, SIGNAL( activated() ),
1088 SLOT( synchowto() ) ); 1088 SLOT( synchowto() ) );
1089 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 1089 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
1090 action->addTo( helpMenu ); 1090 action->addTo( helpMenu );
1091 connect( action, SIGNAL( activated() ), 1091 connect( action, SIGNAL( activated() ),
1092 SLOT( kdesynchowto() ) ); 1092 SLOT( kdesynchowto() ) );
1093 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 1093 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
1094 action->addTo( helpMenu ); 1094 action->addTo( helpMenu );
1095 connect( action, SIGNAL( activated() ), 1095 connect( action, SIGNAL( activated() ),
1096 SLOT( multisynchowto() ) ); 1096 SLOT( multisynchowto() ) );
1097 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 1097 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
1098 action->addTo( helpMenu ); 1098 action->addTo( helpMenu );
1099 connect( action, SIGNAL( activated() ), 1099 connect( action, SIGNAL( activated() ),
1100 SLOT( aboutAutoSaving() ) ); 1100 SLOT( aboutAutoSaving() ) );
1101 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 1101 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
1102 action->addTo( helpMenu ); 1102 action->addTo( helpMenu );
1103 connect( action, SIGNAL( activated() ), 1103 connect( action, SIGNAL( activated() ),
1104 SLOT( aboutKnownBugs() ) ); 1104 SLOT( aboutKnownBugs() ) );
1105 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 1105 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
1106 action->addTo( helpMenu ); 1106 action->addTo( helpMenu );
1107 connect( action, SIGNAL( activated() ), 1107 connect( action, SIGNAL( activated() ),
1108 SLOT( usertrans() ) ); 1108 SLOT( usertrans() ) );
1109 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 1109 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
1110 action->addTo( helpMenu ); 1110 action->addTo( helpMenu );
1111 connect( action, SIGNAL( activated() ), 1111 connect( action, SIGNAL( activated() ),
1112 SLOT( faq() ) ); 1112 SLOT( faq() ) );
1113 action = new QAction( "licence", i18n("Licence..."), 0, this ); 1113 action = new QAction( "licence", i18n("Licence..."), 0, this );
1114 action->addTo( helpMenu ); 1114 action->addTo( helpMenu );
1115 connect( action, SIGNAL( activated() ), 1115 connect( action, SIGNAL( activated() ),
1116 SLOT( licence() ) ); 1116 SLOT( licence() ) );
1117 action = new QAction( "about", i18n("About..."), 0, this ); 1117 action = new QAction( "about", i18n("About..."), 0, this );
1118 action->addTo( helpMenu ); 1118 action->addTo( helpMenu );
1119 connect( action, SIGNAL( activated() ), 1119 connect( action, SIGNAL( activated() ),
1120 SLOT( about() ) ); 1120 SLOT( about() ) );
1121 //menuBar->insertSeparator(); 1121 //menuBar->insertSeparator();
1122 1122
1123 // ****************************************************** 1123 // ******************************************************
1124 // menubar icons 1124 // menubar icons
1125 1125
1126 1126
1127 1127
1128 //menuBar->insertItem( iconToolBar ); 1128 //menuBar->insertItem( iconToolBar );
1129 //xdays_action 1129 //xdays_action
1130 if (p-> mShowIconNewEvent) 1130 if (p-> mShowIconNewEvent)
1131 ne_action->addTo( iconToolBar ); 1131 ne_action->addTo( iconToolBar );
1132 if (p->mShowIconNewTodo ) 1132 if (p->mShowIconNewTodo )
1133 nt_action->addTo( iconToolBar ); 1133 nt_action->addTo( iconToolBar );
1134 if (p-> mShowIconSearch) 1134 if (p-> mShowIconSearch)
1135 search_action->addTo( iconToolBar ); 1135 search_action->addTo( iconToolBar );
1136 if (p-> mShowIconWhatsThis) 1136 if (p-> mShowIconWhatsThis)
1137 QWhatsThis::whatsThisButton ( iconToolBar ); 1137 QWhatsThis::whatsThisButton ( iconToolBar );
1138 if (p-> mShowIconNext) 1138 if (p-> mShowIconNext)
1139 whatsnext_action->addTo( viewToolBar ); 1139 whatsnext_action->addTo( viewToolBar );
1140 if (p-> mShowIconNextDays) 1140 if (p-> mShowIconNextDays)
1141 xdays_action->addTo( viewToolBar ); 1141 xdays_action->addTo( viewToolBar );
1142 if (p-> mShowIconJournal) 1142 if (p-> mShowIconJournal)
1143 viewjournal_action->addTo( viewToolBar ); 1143 viewjournal_action->addTo( viewToolBar );
1144 if (p-> mShowIconDay1) 1144 if (p-> mShowIconDay1)
1145 day1_action->addTo( viewToolBar ); 1145 day1_action->addTo( viewToolBar );
1146 if (p-> mShowIconDay5) 1146 if (p-> mShowIconDay5)
1147 day5_action->addTo( viewToolBar ); 1147 day5_action->addTo( viewToolBar );
1148 if (p-> mShowIconDay7) 1148 if (p-> mShowIconDay7)
1149 day7_action->addTo( viewToolBar ); 1149 day7_action->addTo( viewToolBar );
1150 if (p-> mShowIconDay6) 1150 if (p-> mShowIconDay6)
1151 day6_action->addTo( viewToolBar ); 1151 day6_action->addTo( viewToolBar );
1152 if (p-> mShowIconMonth) 1152 if (p-> mShowIconMonth)
1153 month_action->addTo( viewToolBar ); 1153 month_action->addTo( viewToolBar );
1154 if (p-> mShowIconList) 1154 if (p-> mShowIconList)
1155 showlist_action->addTo( viewToolBar ); 1155 showlist_action->addTo( viewToolBar );
1156 if (p-> mShowIconTodoview) 1156 if (p-> mShowIconTodoview)
1157 todoview_action->addTo( viewToolBar ); 1157 todoview_action->addTo( viewToolBar );
1158 1158
1159 icon = loadPixmap( pathString + "2leftarrowB" ); 1159 icon = loadPixmap( pathString + "2leftarrowB" );
1160 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); 1160 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200);
1161 if (p-> mShowIconBackFast) { 1161 if (p-> mShowIconBackFast) {
1162 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 1162 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
1163 connect( action, SIGNAL( activated() ), 1163 connect( action, SIGNAL( activated() ),
1164 mView, SLOT( goPreviousMonth() ) ); 1164 mView, SLOT( goPreviousMonth() ) );
1165 action->addTo( navigatorToolBar ); 1165 action->addTo( navigatorToolBar );
1166 } 1166 }
1167 icon = loadPixmap( pathString + "1leftarrowB" ); 1167 icon = loadPixmap( pathString + "1leftarrowB" );
1168 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); 1168 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210);
1169 if (p-> mShowIconBack) { 1169 if (p-> mShowIconBack) {
1170 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 1170 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
1171 connect( action, SIGNAL( activated() ), 1171 connect( action, SIGNAL( activated() ),
1172 mView, SLOT( goPrevious() ) ); 1172 mView, SLOT( goPrevious() ) );
1173 action->addTo( navigatorToolBar ); 1173 action->addTo( navigatorToolBar );
1174 } 1174 }
1175 icon = loadPixmap( pathString + "today" ); 1175 icon = loadPixmap( pathString + "today" );
1176 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 1176 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
1177 if (p-> mShowIconToday) 1177 if (p-> mShowIconToday)
1178 today_action->addTo( navigatorToolBar ); 1178 today_action->addTo( navigatorToolBar );
1179 icon = loadPixmap( pathString + "1rightarrowB" ); 1179 icon = loadPixmap( pathString + "1rightarrowB" );
1180 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 1180 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
1181 if (p-> mShowIconForward) { 1181 if (p-> mShowIconForward) {
1182 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 1182 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
1183 connect( action, SIGNAL( activated() ), 1183 connect( action, SIGNAL( activated() ),
1184 mView, SLOT( goNext() ) ); 1184 mView, SLOT( goNext() ) );
1185 action->addTo( navigatorToolBar ); 1185 action->addTo( navigatorToolBar );
1186 } 1186 }
1187 icon = loadPixmap( pathString + "2rightarrowB" ); 1187 icon = loadPixmap( pathString + "2rightarrowB" );
1188 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 1188 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
1189 if (p-> mShowIconForwardFast) { 1189 if (p-> mShowIconForwardFast) {
1190 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 1190 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
1191 connect( action, SIGNAL( activated() ), 1191 connect( action, SIGNAL( activated() ),
1192 mView, SLOT( goNextMonth() ) ); 1192 mView, SLOT( goNextMonth() ) );
1193 action->addTo( navigatorToolBar ); 1193 action->addTo( navigatorToolBar );
1194 } 1194 }
1195 1195
1196 1196
1197 configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); 1197 configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6);
1198 1198
1199 1199
1200 if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); 1200 if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true);
1201 if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); 1201 if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true);
1202 if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); 1202 if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true);
1203 if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); 1203 if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true);
1204 1204
1205 if (p-> mShowIconNewEvent) 1205 if (p-> mShowIconNewEvent)
1206 configureToolBarMenu->setItemChecked( 10, true ); 1206 configureToolBarMenu->setItemChecked( 10, true );
1207 if (p->mShowIconNewTodo ) 1207 if (p->mShowIconNewTodo )
1208 configureToolBarMenu->setItemChecked( 20, true ); 1208 configureToolBarMenu->setItemChecked( 20, true );
1209 if (p-> mShowIconSearch) 1209 if (p-> mShowIconSearch)
1210 configureToolBarMenu->setItemChecked( 120, true ); 1210 configureToolBarMenu->setItemChecked( 120, true );
1211 if (p-> mShowIconList) 1211 if (p-> mShowIconList)
1212 configureToolBarMenu->setItemChecked( 30, true ); 1212 configureToolBarMenu->setItemChecked( 30, true );
1213 if (p-> mShowIconDay1) 1213 if (p-> mShowIconDay1)
1214 configureToolBarMenu->setItemChecked( 40, true ); 1214 configureToolBarMenu->setItemChecked( 40, true );
1215 if (p-> mShowIconDay5) 1215 if (p-> mShowIconDay5)
1216 configureToolBarMenu->setItemChecked( 50, true ); 1216 configureToolBarMenu->setItemChecked( 50, true );
1217 if (p-> mShowIconDay6) 1217 if (p-> mShowIconDay6)
1218 configureToolBarMenu->setItemChecked( 75, true ); 1218 configureToolBarMenu->setItemChecked( 75, true );
1219 if (p-> mShowIconDay7) 1219 if (p-> mShowIconDay7)
1220 configureToolBarMenu->setItemChecked( 60, true ); 1220 configureToolBarMenu->setItemChecked( 60, true );
1221 if (p-> mShowIconMonth) 1221 if (p-> mShowIconMonth)
1222 configureToolBarMenu->setItemChecked( 70, true ); 1222 configureToolBarMenu->setItemChecked( 70, true );
1223 if (p-> mShowIconTodoview) 1223 if (p-> mShowIconTodoview)
1224 configureToolBarMenu->setItemChecked( 80, true ); 1224 configureToolBarMenu->setItemChecked( 80, true );
1225 if (p-> mShowIconBackFast) 1225 if (p-> mShowIconBackFast)
1226 configureToolBarMenu->setItemChecked( 200, true ); 1226 configureToolBarMenu->setItemChecked( 200, true );
1227 if (p-> mShowIconBack) 1227 if (p-> mShowIconBack)
1228 configureToolBarMenu->setItemChecked( 210, true ); 1228 configureToolBarMenu->setItemChecked( 210, true );
1229 if (p-> mShowIconToday) 1229 if (p-> mShowIconToday)
1230 configureToolBarMenu->setItemChecked( 130, true ); 1230 configureToolBarMenu->setItemChecked( 130, true );
1231 if (p-> mShowIconForward) 1231 if (p-> mShowIconForward)
1232 configureToolBarMenu->setItemChecked( 220, true ); 1232 configureToolBarMenu->setItemChecked( 220, true );
1233 if (p-> mShowIconForwardFast) 1233 if (p-> mShowIconForwardFast)
1234 configureToolBarMenu->setItemChecked( 230, true ); 1234 configureToolBarMenu->setItemChecked( 230, true );
1235 if (p-> mShowIconNextDays) 1235 if (p-> mShowIconNextDays)
1236 configureToolBarMenu->setItemChecked( 100, true ); 1236 configureToolBarMenu->setItemChecked( 100, true );
1237 if (p-> mShowIconNext) 1237 if (p-> mShowIconNext)
1238 configureToolBarMenu->setItemChecked( 110, true ); 1238 configureToolBarMenu->setItemChecked( 110, true );
1239 if (p-> mShowIconJournal) 1239 if (p-> mShowIconJournal)
1240 configureToolBarMenu->setItemChecked( 90, true ); 1240 configureToolBarMenu->setItemChecked( 90, true );
1241 if (p-> mShowIconWhatsThis) 1241 if (p-> mShowIconWhatsThis)
1242 configureToolBarMenu->setItemChecked( 300, true ); 1242 configureToolBarMenu->setItemChecked( 300, true );
1243 if (p-> mShowIconWeekNum) 1243 if (p-> mShowIconWeekNum)
1244 configureToolBarMenu->setItemChecked( 400, true ); 1244 configureToolBarMenu->setItemChecked( 400, true );
1245 if (!p-> mShowIconStretch) { 1245 if (!p-> mShowIconStretch) {
1246 QLabel* dummy = new QLabel( iconToolBar ); 1246 QLabel* dummy = new QLabel( iconToolBar );
1247 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1247 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1248 dummy->setMinimumWidth( 0 ); 1248 dummy->setMinimumWidth( 0 );
1249 iconToolBar->setStretchableWidget ( dummy ) ; 1249 iconToolBar->setStretchableWidget ( dummy ) ;
1250 } 1250 }
1251 else { 1251 else {
1252 iconToolBar->setHorizontalStretchable (true ); 1252 iconToolBar->setHorizontalStretchable (true );
1253 viewToolBar->setHorizontalStretchable (true ); 1253 viewToolBar->setHorizontalStretchable (true );
1254 navigatorToolBar->setHorizontalStretchable (true ); 1254 navigatorToolBar->setHorizontalStretchable (true );
1255 iconToolBar->setVerticalStretchable (true ); 1255 iconToolBar->setVerticalStretchable (true );
1256 viewToolBar->setVerticalStretchable (true ); 1256 viewToolBar->setVerticalStretchable (true );
1257 navigatorToolBar->setVerticalStretchable (true ); 1257 navigatorToolBar->setVerticalStretchable (true );
1258 configureToolBarMenu->setItemChecked( 5, true ); 1258 configureToolBarMenu->setItemChecked( 5, true );
1259 } 1259 }
1260 if (p-> mShowIconFilter) 1260 if (p-> mShowIconFilter)
1261 configureToolBarMenu->setItemChecked( 7, true ); 1261 configureToolBarMenu->setItemChecked( 7, true );
1262 if (p-> mShowIconOnetoolbar) 1262 if (p-> mShowIconOnetoolbar)
1263 configureToolBarMenu->setItemChecked( 6, true ); 1263 configureToolBarMenu->setItemChecked( 6, true );
1264 1264
1265 1265
1266 if ( filterMenubar ) 1266 if ( filterMenubar )
1267 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); 1267 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) );
1268 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1268 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1269 configureAgenda( p->mHourSize ); 1269 configureAgenda( p->mHourSize );
1270 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1270 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1271} 1271}
1272 1272
1273void MainWindow::exportToPhone( int mode ) 1273void MainWindow::exportToPhone( int mode )
1274{ 1274{
1275 1275
1276 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1276 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1277 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1277 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1278 KOex2phonePrefs ex2phone; 1278 KOex2phonePrefs ex2phone;
1279 1279
1280 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1280 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1281 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 1281 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1282 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1282 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1283 if ( mode == 1 ) 1283 if ( mode == 1 )
1284 ex2phone.setCaption(i18n("Export complete calendar")); 1284 ex2phone.setCaption(i18n("Export complete calendar"));
1285 if ( mode == 2 ) 1285 if ( mode == 2 )
1286 ex2phone.setCaption(i18n("Export filtered calendar")); 1286 ex2phone.setCaption(i18n("Export filtered calendar"));
1287 1287
1288 if ( !ex2phone.exec() ) { 1288 if ( !ex2phone.exec() ) {
1289 return; 1289 return;
1290 } 1290 }
1291 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1291 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1292 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1292 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1293 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1293 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1294 1294
1295 int inFuture = 0; 1295 int inFuture = 0;
1296 if ( ex2phone.mWriteBackFuture->isChecked() ) 1296 if ( ex2phone.mWriteBackFuture->isChecked() )
1297 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1297 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1298 QPtrList<Incidence> delSel; 1298 QPtrList<Incidence> delSel;
1299 if ( mode == 1 ) 1299 if ( mode == 1 )
1300 delSel = mCalendar->rawIncidences(); 1300 delSel = mCalendar->rawIncidences();
1301 if ( mode == 2 ) 1301 if ( mode == 2 )
1302 delSel = mCalendar->incidences(); 1302 delSel = mCalendar->incidences();
1303 CalendarLocal* cal = new CalendarLocal(); 1303 CalendarLocal* cal = new CalendarLocal();
1304 cal->setLocalTime(); 1304 cal->setLocalTime();
1305 Incidence *incidence = delSel.first(); 1305 Incidence *incidence = delSel.first();
1306 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1306 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1307 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1307 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1308 while ( incidence ) { 1308 while ( incidence ) {
1309 if ( incidence->type() != "Journal" ) { 1309 if ( incidence->type() != "Journal" ) {
1310 bool add = true; 1310 bool add = true;
1311 if ( inFuture ) { 1311 if ( inFuture ) {
1312 QDateTime dt; 1312 QDateTime dt;
1313 if ( incidence->type() == "Todo" ) { 1313 if ( incidence->type() == "Todo" ) {
1314 Todo * t = (Todo*)incidence; 1314 Todo * t = (Todo*)incidence;
1315 if ( t->hasDueDate() ) 1315 if ( t->hasDueDate() )
1316 dt = t->dtDue(); 1316 dt = t->dtDue();
1317 else 1317 else
1318 dt = cur.addSecs( 62 ); 1318 dt = cur.addSecs( 62 );
1319 } 1319 }
1320 else { 1320 else {
1321 bool ok; 1321 bool ok;
1322 dt = incidence->getNextOccurence( cur, &ok ); 1322 dt = incidence->getNextOccurence( cur, &ok );
1323 if ( !ok ) 1323 if ( !ok )
1324 dt = cur.addSecs( -62 ); 1324 dt = cur.addSecs( -62 );
1325 } 1325 }
1326 if ( dt < cur || dt > end ) { 1326 if ( dt < cur || dt > end ) {
1327 add = false; 1327 add = false;
1328 } 1328 }
1329 } 1329 }
1330 if ( add ) { 1330 if ( add ) {
1331 Incidence *in = incidence->clone(); 1331 Incidence *in = incidence->clone();
1332 cal->addIncidence( in ); 1332 cal->addIncidence( in );
1333 } 1333 }
1334 } 1334 }
1335 incidence = delSel.next(); 1335 incidence = delSel.next();
1336 } 1336 }
1337 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 1337 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1338 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 1338 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1339 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1339 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1340 1340
1341 setCaption( i18n("Writing to phone...")); 1341 setCaption( i18n("Writing to phone..."));
1342 if ( PhoneFormat::writeToPhone( cal ) ) 1342 if ( PhoneFormat::writeToPhone( cal ) )
1343 setCaption( i18n("Export to phone successful!")); 1343 setCaption( i18n("Export to phone successful!"));
1344 else 1344 else
1345 setCaption( i18n("Error exporting to phone!")); 1345 setCaption( i18n("Error exporting to phone!"));
1346 delete cal; 1346 delete cal;
1347} 1347}
1348 1348
1349 1349
1350void MainWindow::setDefaultPreferences() 1350void MainWindow::setDefaultPreferences()
1351{ 1351{
1352 KOPrefs *p = KOPrefs::instance(); 1352 KOPrefs *p = KOPrefs::instance();
1353 1353
1354 p->mCompactDialogs = true; 1354 p->mCompactDialogs = true;
1355 p->mConfirm = true; 1355 p->mConfirm = true;
1356 // p->mEnableQuickTodo = false; 1356 // p->mEnableQuickTodo = false;
1357 1357
1358} 1358}
1359 1359
1360QString MainWindow::resourcePath() 1360QString MainWindow::resourcePath()
1361{ 1361{
1362 return KGlobal::iconLoader()->iconPath(); 1362 return KGlobal::iconLoader()->iconPath();
1363} 1363}
1364 1364
1365void MainWindow::displayText( QString text ,QString cap ) 1365void MainWindow::displayText( QString text ,QString cap )
1366{ 1366{
1367 QDialog dia( this, "name", true ); ; 1367 QDialog dia( this, "name", true ); ;
1368 dia.setCaption( cap ); 1368 dia.setCaption( cap );
1369 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1369 QVBoxLayout* lay = new QVBoxLayout( &dia );
1370 lay->setSpacing( 3 ); 1370 lay->setSpacing( 3 );
1371 lay->setMargin( 3 ); 1371 lay->setMargin( 3 );
1372 QTextBrowser tb ( &dia ); 1372 QTextBrowser tb ( &dia );
1373 lay->addWidget( &tb ); 1373 lay->addWidget( &tb );
1374 tb.setText( text ); 1374 tb.setText( text );
1375#ifdef DESKTOP_VERSION 1375#ifdef DESKTOP_VERSION
1376 dia.resize( 640, 480); 1376 dia.resize( 640, 480);
1377#else 1377#else
1378 dia.showMaximized(); 1378 dia.showMaximized();
1379#endif 1379#endif
1380 dia.exec(); 1380 dia.exec();
1381} 1381}
1382 1382
1383void MainWindow::features() 1383void MainWindow::features()
1384{ 1384{
1385 1385
1386 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); 1386 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" );
1387} 1387}
1388 1388
1389void MainWindow::usertrans() 1389void MainWindow::usertrans()
1390{ 1390{
1391 1391
1392 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); 1392 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" );
1393} 1393}
1394 1394
1395void MainWindow::kdesynchowto() 1395void MainWindow::kdesynchowto()
1396{ 1396{
1397 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 1397 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
1398} 1398}
1399void MainWindow::multisynchowto() 1399void MainWindow::multisynchowto()
1400{ 1400{
1401 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 1401 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
1402} 1402}
1403void MainWindow::synchowto() 1403void MainWindow::synchowto()
1404{ 1404{
1405 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1405 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1406} 1406}
1407void MainWindow::faq() 1407void MainWindow::faq()
1408{ 1408{
1409 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); 1409 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" );
1410 1410
1411} 1411}
1412void MainWindow::whatsNew() 1412void MainWindow::whatsNew()
1413{ 1413{
1414 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 1414 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1415 1415
1416} 1416}
1417void MainWindow::licence() 1417void MainWindow::licence()
1418{ 1418{
1419 KApplication::showLicence(); 1419 KApplication::showLicence();
1420 1420
1421} 1421}
1422void MainWindow::about() 1422void MainWindow::about()
1423{ 1423{
1424 QString version; 1424 QString version;
1425#include <../version> 1425#include <../version>
1426 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1426 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1427 i18n("KOrganizer/Platform-independent\n") + 1427 i18n("KOrganizer/Platform-independent\n") +
1428 "(KO/Pi) " + version + " - " + 1428 "(KO/Pi) " + version + " - " +
1429 1429
1430#ifdef DESKTOP_VERSION 1430#ifdef DESKTOP_VERSION
1431 i18n("Desktop Edition\n") + 1431 i18n("Desktop Edition\n") +
1432#else 1432#else
1433 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + 1433 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") +
1434#endif 1434#endif
1435 i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); 1435 i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") );
1436} 1436}
1437void MainWindow::keyBindings() 1437void MainWindow::keyBindings()
1438{ 1438{
1439 QString cap = i18n("KO/Pi Keys + Colors"); 1439 QString cap = i18n("KO/Pi Keys + Colors");
1440 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1440 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1441 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1441 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1442 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") +
1443 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") +
1442 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1444 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1443 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1445 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1444 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ 1446 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+
1445 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1447 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1446 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1448 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1447 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ 1449 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+
1448 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1450 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1449 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1451 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1450 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1452 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1451 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ 1453 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
1452 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1454 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1453 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1455 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1454 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ 1456 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+
1455 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1457 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1456 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1458 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1457 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1459 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1458 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1460 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1459 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1461 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1460 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1462 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1461 i18n("<p><h3>In agenda view:</h3></p>\n") + 1463 i18n("<p><h3>In agenda view:</h3></p>\n") +
1462 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1464 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1463 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1465 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1464 i18n("<p><h3>In todo view:</h3></p>\n") + 1466 i18n("<p><h3>In todo view:</h3></p>\n") +
1465 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1467 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1466 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1468 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1467 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1469 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1468 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1470 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1469 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1471 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1470 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1472 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1471 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1473 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1472 i18n("<p><h3>In list view:</h3></p>\n") + 1474 i18n("<p><h3>In list view:</h3></p>\n") +
1473 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1475 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1474 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1476 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1475 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1477 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1476 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1478 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1477 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1479 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1478 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1480 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1479 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1481 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1480 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1482 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1481 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1483 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1482 i18n("<p><b>E</b>: Edit item</p>\n") + 1484 i18n("<p><b>E</b>: Edit item</p>\n") +
1483 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1485 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1484 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1486 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1485 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1487 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1486 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1488 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1487 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1489 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1488 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1490 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1489 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1491 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1490 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1492 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1491 i18n("<p><b>White</b>: Item readonly</p>\n"); 1493 i18n("<p><b>White</b>: Item readonly</p>\n");
1492 displayText( text, cap); 1494 displayText( text, cap);
1493} 1495}
1494void MainWindow::aboutAutoSaving() 1496void MainWindow::aboutAutoSaving()
1495{ 1497{
1496 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); 1498 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n");
1497 1499
1498 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1500 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1499 1501
1500} 1502}
1501void MainWindow::aboutKnownBugs() 1503void MainWindow::aboutKnownBugs()
1502{ 1504{
1503 QMessageBox* msg; 1505 QMessageBox* msg;
1504 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1506 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1505 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ 1507 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
1506 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1508 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1507 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1509 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1508 i18n("\nor report them in the bugtracker on\n") + 1510 i18n("\nor report them in the bugtracker on\n") +
1509 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1511 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1510 QMessageBox::NoIcon, 1512 QMessageBox::NoIcon,
1511 QMessageBox::Ok, 1513 QMessageBox::Ok,
1512 QMessageBox::NoButton, 1514 QMessageBox::NoButton,
1513 QMessageBox::NoButton); 1515 QMessageBox::NoButton);
1514 msg->exec(); 1516 msg->exec();
1515 delete msg; 1517 delete msg;
1516 1518
1517} 1519}
1518 1520
1519QString MainWindow::defaultFileName() 1521QString MainWindow::defaultFileName()
1520{ 1522{
1521 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1523 return locateLocal( "data", "korganizer/mycalendar.ics" );
1522} 1524}
1523QString MainWindow::syncFileName() 1525QString MainWindow::syncFileName()
1524{ 1526{
1525#ifdef DESKTOP_VERSION 1527#ifdef DESKTOP_VERSION
1526 return locateLocal( "tmp", "synccalendar.ics" ); 1528 return locateLocal( "tmp", "synccalendar.ics" );
1527#else 1529#else
1528 return QString( "/tmp/synccalendar.ics" ); 1530 return QString( "/tmp/synccalendar.ics" );
1529#endif 1531#endif
1530} 1532}
1531#include "koglobals.h" 1533#include "koglobals.h"
1532#include <kcalendarsystem.h> 1534#include <kcalendarsystem.h>
1533void MainWindow::updateWeek(QDate seda) 1535void MainWindow::updateWeek(QDate seda)
1534{ 1536{
1535 int weekNum = KGlobal::locale()->weekNum ( seda ); 1537 int weekNum = KGlobal::locale()->weekNum ( seda );
1536 mWeekPixmap.fill( mWeekBgColor ); 1538 mWeekPixmap.fill( mWeekBgColor );
1537 QPainter p ( &mWeekPixmap ); 1539 QPainter p ( &mWeekPixmap );
1538 p.setFont( mWeekFont ); 1540 p.setFont( mWeekFont );
1539 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1541 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1540 p.end(); 1542 p.end();
1541 QIconSet icon3 ( mWeekPixmap ); 1543 QIconSet icon3 ( mWeekPixmap );
1542 mWeekAction->setIconSet ( icon3 ); 1544 mWeekAction->setIconSet ( icon3 );
1543 1545
1544} 1546}
1545void MainWindow::updateWeekNum(const DateList &selectedDates) 1547void MainWindow::updateWeekNum(const DateList &selectedDates)
1546{ 1548{
1547 updateWeek( selectedDates.first() ); 1549 updateWeek( selectedDates.first() );
1548} 1550}
1549void MainWindow::processIncidenceSelection( Incidence *incidence ) 1551void MainWindow::processIncidenceSelection( Incidence *incidence )
1550{ 1552{
1551 1553
1552 if ( !incidence ) { 1554 if ( !incidence ) {
1553 enableIncidenceActions( false ); 1555 enableIncidenceActions( false );
1554 1556
1555 mNewSubTodoAction->setEnabled( false ); 1557 mNewSubTodoAction->setEnabled( false );
1556 setCaptionToDates(); 1558 setCaptionToDates();
1557 return; 1559 return;
1558 1560
1559 } 1561 }
1560 1562
1561 //KGlobal::locale()->formatDateTime(nextA, true); 1563 //KGlobal::locale()->formatDateTime(nextA, true);
1562 QString startString = ""; 1564 QString startString = "";
1563 if ( incidence->type() != "Todo" ) { 1565 if ( incidence->type() != "Todo" ) {
1564 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1566 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1565 if ( incidence->doesFloat() ) { 1567 if ( incidence->doesFloat() ) {
1566 startString += ": "+incidence->dtStartDateStr( true ); 1568 startString += ": "+incidence->dtStartDateStr( true );
1567 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1569 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1568 1570
1569 } else { 1571 } else {
1570 startString = ": "+incidence->dtStartStr(true); 1572 startString = ": "+incidence->dtStartStr(true);
1571 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1573 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1572 1574
1573 } 1575 }
1574 1576
1575 } else { 1577 } else {
1576 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1578 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1577 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1579 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1578 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1580 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1579 if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) { 1581 if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) {
1580 bool ok; 1582 bool ok;
1581 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1583 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1582 if ( ok ) { 1584 if ( ok ) {
1583 int years = noc.date().year() - incidence->dtStart().date().year(); 1585 int years = noc.date().year() - incidence->dtStart().date().year();
1584 startString += i18n(" (%1 y.)"). arg( years ); 1586 startString += i18n(" (%1 y.)"). arg( years );
1585 } 1587 }
1586 } 1588 }
1587 else 1589 else
1588 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1590 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1589 } 1591 }
1590 1592
1591 } 1593 }
1592 else 1594 else
1593 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1595 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1594 if ( !incidence->location().isEmpty() ) 1596 if ( !incidence->location().isEmpty() )
1595 startString += " (" +incidence->location()+")"; 1597 startString += " (" +incidence->location()+")";
1596 setCaption( incidence->summary()+startString); 1598 setCaption( incidence->summary()+startString);
1597 1599
1598 enableIncidenceActions( true ); 1600 enableIncidenceActions( true );
1599 1601
1600 if ( incidence->type() == "Event" ) { 1602 if ( incidence->type() == "Event" ) {
1601 mShowAction->setText( i18n("Show Event...") ); 1603 mShowAction->setText( i18n("Show Event...") );
1602 mEditAction->setText( i18n("Edit Event...") ); 1604 mEditAction->setText( i18n("Edit Event...") );
1603 mDeleteAction->setText( i18n("Delete Event...") ); 1605 mDeleteAction->setText( i18n("Delete Event...") );
1604 1606
1605 mNewSubTodoAction->setEnabled( false ); 1607 mNewSubTodoAction->setEnabled( false );
1606 } else if ( incidence->type() == "Todo" ) { 1608 } else if ( incidence->type() == "Todo" ) {
1607 mShowAction->setText( i18n("Show Todo...") ); 1609 mShowAction->setText( i18n("Show Todo...") );
1608 mEditAction->setText( i18n("Edit Todo...") ); 1610 mEditAction->setText( i18n("Edit Todo...") );
1609 mDeleteAction->setText( i18n("Delete Todo...") ); 1611 mDeleteAction->setText( i18n("Delete Todo...") );
1610 1612
1611 mNewSubTodoAction->setEnabled( true ); 1613 mNewSubTodoAction->setEnabled( true );
1612 } else { 1614 } else {
1613 mShowAction->setText( i18n("Show...") ); 1615 mShowAction->setText( i18n("Show...") );
1614 mShowAction->setText( i18n("Edit...") ); 1616 mShowAction->setText( i18n("Edit...") );
1615 mShowAction->setText( i18n("Delete...") ); 1617 mShowAction->setText( i18n("Delete...") );
1616 1618
1617 mNewSubTodoAction->setEnabled( false ); 1619 mNewSubTodoAction->setEnabled( false );
1618 } 1620 }
1619} 1621}
1620 1622
1621void MainWindow::enableIncidenceActions( bool enabled ) 1623void MainWindow::enableIncidenceActions( bool enabled )
1622{ 1624{
1623 mShowAction->setEnabled( enabled ); 1625 mShowAction->setEnabled( enabled );
1624 mEditAction->setEnabled( enabled ); 1626 mEditAction->setEnabled( enabled );
1625 mDeleteAction->setEnabled( enabled ); 1627 mDeleteAction->setEnabled( enabled );
1626 1628
1627 mCloneAction->setEnabled( enabled ); 1629 mCloneAction->setEnabled( enabled );
1628 mMoveAction->setEnabled( enabled ); 1630 mMoveAction->setEnabled( enabled );
1629 mBeamAction->setEnabled( enabled ); 1631 mBeamAction->setEnabled( enabled );
1630 mCancelAction->setEnabled( enabled ); 1632 mCancelAction->setEnabled( enabled );
1631} 1633}
1632 1634
1633void MainWindow::importOL() 1635void MainWindow::importOL()
1634{ 1636{
1635#ifdef _OL_IMPORT_ 1637#ifdef _OL_IMPORT_
1636 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1638 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1637 id->exec(); 1639 id->exec();
1638 delete id; 1640 delete id;
1639 mView->updateView(); 1641 mView->updateView();
1640#endif 1642#endif
1641} 1643}
1642void MainWindow::importBday() 1644void MainWindow::importBday()
1643{ 1645{
1644 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1646 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1645 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1647 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1646 i18n("Import!"), i18n("Cancel"), 0, 1648 i18n("Import!"), i18n("Cancel"), 0,
1647 0, 1 ); 1649 0, 1 );
1648 if ( result == 0 ) { 1650 if ( result == 0 ) {
1649 mView->importBday(); 1651 mView->importBday();
1650 1652
1651 } 1653 }
1652 1654
1653 1655
1654} 1656}
1655void MainWindow::importQtopia() 1657void MainWindow::importQtopia()
1656{ 1658{
1657 //#ifndef DESKTOP_VERSION 1659 //#ifndef DESKTOP_VERSION
1658 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); 1660 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing");
1659#ifdef DESKTOP_VERSION 1661#ifdef DESKTOP_VERSION
1660 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); 1662 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml");
1661#endif 1663#endif
1662 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, 1664 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
1663 i18n("Import!"), i18n("Cancel"), 0, 1665 i18n("Import!"), i18n("Cancel"), 0,
1664 0, 1 ); 1666 0, 1 );
1665 if ( result == 0 ) { 1667 if ( result == 0 ) {
1666#ifndef DESKTOP_VERSION 1668#ifndef DESKTOP_VERSION
1667 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1669 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1668 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1670 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1669 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1671 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1670#else 1672#else
1671 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; 1673 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml";
1672 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; 1674 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml";
1673 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; 1675 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml";
1674#endif 1676#endif
1675 mView->importQtopia( categories, datebook, todolist ); 1677 mView->importQtopia( categories, datebook, todolist );
1676 } 1678 }
1677#if 0 1679#if 0
1678 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1680 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1679 i18n("Not supported \non desktop!\n"), 1681 i18n("Not supported \non desktop!\n"),
1680 i18n("Ok"), i18n("Cancel"), 0, 1682 i18n("Ok"), i18n("Cancel"), 0,
1681 0, 1 ); 1683 0, 1 );
1682 1684
1683#endif 1685#endif
1684} 1686}
1685 1687
1686void MainWindow::saveOnClose() 1688void MainWindow::saveOnClose()
1687{ 1689{
1688 KOPrefs *p = KOPrefs::instance(); 1690 KOPrefs *p = KOPrefs::instance();
1689 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1691 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1690 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); 1692 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal );
1691 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); 1693 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal );
1692 if ( filterToolBar ) { 1694 if ( filterToolBar ) {
1693 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); 1695 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal );
1694 } 1696 }
1695#ifdef DESKTOP_VERSION 1697#ifdef DESKTOP_VERSION
1696 1698
1697 QPoint myP; 1699 QPoint myP;
1698 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); 1700 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) );
1699 if ( p->mToolBarHor ) 1701 if ( p->mToolBarHor )
1700 p->mToolBarUp = myP.y() > height()/2; 1702 p->mToolBarUp = myP.y() > height()/2;
1701 else 1703 else
1702 p->mToolBarUp = myP.x() > width()/2; 1704 p->mToolBarUp = myP.x() > width()/2;
1703 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); 1705 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) );
1704 if ( p->mToolBarHorV ) 1706 if ( p->mToolBarHorV )
1705 p->mToolBarUpV = myP.y() > height()/2; 1707 p->mToolBarUpV = myP.y() > height()/2;
1706 else 1708 else
1707 p->mToolBarUpV = myP.x() > width()/2 ; 1709 p->mToolBarUpV = myP.x() > width()/2 ;
1708 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); 1710 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) );
1709 if ( p->mToolBarHorN ) 1711 if ( p->mToolBarHorN )
1710 p->mToolBarUpN = myP.y() > height()/2; 1712 p->mToolBarUpN = myP.y() > height()/2;
1711 else 1713 else
1712 p->mToolBarUpN = myP.x() > width()/2 ; 1714 p->mToolBarUpN = myP.x() > width()/2 ;
1713 if ( filterToolBar ) { 1715 if ( filterToolBar ) {
1714 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); 1716 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) );
1715 if ( p->mToolBarHorF ) 1717 if ( p->mToolBarHorF )
1716 p->mToolBarUpF = myP.y() > height()/2; 1718 p->mToolBarUpF = myP.y() > height()/2;
1717 else 1719 else
1718 p->mToolBarUpF = myP.x() > width()/2 ; 1720 p->mToolBarUpF = myP.x() > width()/2 ;
1719 } 1721 }
1720#else 1722#else
1721 if ( p->mToolBarHor ) 1723 if ( p->mToolBarHor )
1722 p->mToolBarUp = iconToolBar->y() > height()/2; 1724 p->mToolBarUp = iconToolBar->y() > height()/2;
1723 else 1725 else
1724 p->mToolBarUp = iconToolBar->x() > width()/2; 1726 p->mToolBarUp = iconToolBar->x() > width()/2;
1725 if ( p->mToolBarHorV ) 1727 if ( p->mToolBarHorV )
1726 p->mToolBarUpV = viewToolBar->y() > height()/2; 1728 p->mToolBarUpV = viewToolBar->y() > height()/2;
1727 else 1729 else
1728 p->mToolBarUpV = viewToolBar->x() > width()/2 ; 1730 p->mToolBarUpV = viewToolBar->x() > width()/2 ;
1729 1731
1730 if ( p->mToolBarHorN ) 1732 if ( p->mToolBarHorN )
1731 p->mToolBarUpN = navigatorToolBar->y() > height()/2; 1733 p->mToolBarUpN = navigatorToolBar->y() > height()/2;
1732 else 1734 else
1733 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; 1735 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ;
1734 if ( filterToolBar ) { 1736 if ( filterToolBar ) {
1735 if ( p->mToolBarHorF ) 1737 if ( p->mToolBarHorF )
1736 p->mToolBarUpF = filterToolBar->y() > height()/2; 1738 p->mToolBarUpF = filterToolBar->y() > height()/2;
1737 else 1739 else
1738 p->mToolBarUpF = filterToolBar->x() > width()/2 ; 1740 p->mToolBarUpF = filterToolBar->x() > width()/2 ;
1739 } 1741 }
1740#endif 1742#endif
1741 1743
1742 1744
1743 mView->writeSettings(); 1745 mView->writeSettings();
1744 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) 1746 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName()))
1745 save(); 1747 save();
1746} 1748}
1747void MainWindow::slotModifiedChanged( bool changed ) 1749void MainWindow::slotModifiedChanged( bool changed )
1748{ 1750{
1749 if ( mBlockAtStartup ) 1751 if ( mBlockAtStartup )
1750 return; 1752 return;
1751 1753
1752 int msec; 1754 int msec;
1753 // we store the changes after 1 minute, 1755 // we store the changes after 1 minute,
1754 // and for safety reasons after 10 minutes again 1756 // and for safety reasons after 10 minutes again
1755 if ( !mSyncManager->blockSave() ) 1757 if ( !mSyncManager->blockSave() )
1756 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; 1758 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
1757 else 1759 else
1758 msec = 1000 * 600; 1760 msec = 1000 * 600;
1759 mSaveTimer.start( msec, true ); // 1 minute 1761 mSaveTimer.start( msec, true ); // 1 minute
1760 qDebug("KO: Saving File in %d secs!", msec/1000); 1762 qDebug("KO: Saving File in %d secs!", msec/1000);
1761 mCalendarModifiedFlag = true; 1763 mCalendarModifiedFlag = true;
1762} 1764}
1763void MainWindow::saveStopTimer() 1765void MainWindow::saveStopTimer()
1764{ 1766{
1765 mSaveTimer.stop(); 1767 mSaveTimer.stop();
1766 if (mSaveTimer.isActive() ) 1768 if (mSaveTimer.isActive() )
1767 qDebug("ti active "); 1769 qDebug("ti active ");
1768 else 1770 else
1769 qDebug("KO: Save timer stopped"); 1771 qDebug("KO: Save timer stopped");
1770} 1772}
1771void MainWindow::save() 1773void MainWindow::save()
1772{ 1774{
1773 if ( !mCalendarModifiedFlag ) { 1775 if ( !mCalendarModifiedFlag ) {
1774 qDebug("KO: Calendar not modified. Nothing saved."); 1776 qDebug("KO: Calendar not modified. Nothing saved.");
1775 return; 1777 return;
1776 } 1778 }
1777 if ( mSyncManager->blockSave() ) 1779 if ( mSyncManager->blockSave() )
1778 return; 1780 return;
1779 mSyncManager->setBlockSave(true); 1781 mSyncManager->setBlockSave(true);
1780 if ( mView->checkFileVersion( defaultFileName()) ) { 1782 if ( mView->checkFileVersion( defaultFileName()) ) {
1781 QTime neededSaveTime = QDateTime::currentDateTime().time(); 1783 QTime neededSaveTime = QDateTime::currentDateTime().time();
1782 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 1784 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
1783 qDebug("KO: Start saving data to file!"); 1785 qDebug("KO: Start saving data to file!");
1784 mView->saveCalendar( defaultFileName() ); 1786 mView->saveCalendar( defaultFileName() );
1785 mCalendarModifiedFlag = false; 1787 mCalendarModifiedFlag = false;
1786 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 1788 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
1787 qDebug("KO: Needed %d ms for saving.",msNeeded ); 1789 qDebug("KO: Needed %d ms for saving.",msNeeded );
1788 QString savemes; 1790 QString savemes;
1789 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 1791 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
1790 setCaption(savemes); 1792 setCaption(savemes);
1791 } else 1793 } else
1792 setCaption(i18n("Saving cancelled!")); 1794 setCaption(i18n("Saving cancelled!"));
1793 mSyncManager->setBlockSave( false ); 1795 mSyncManager->setBlockSave( false );
1794} 1796}
1795 1797
1796void MainWindow::keyReleaseEvent ( QKeyEvent * e) 1798void MainWindow::keyReleaseEvent ( QKeyEvent * e)
1797{ 1799{
1798 if ( !e->isAutoRepeat() ) { 1800 if ( !e->isAutoRepeat() ) {
1799 mFlagKeyPressed = false; 1801 mFlagKeyPressed = false;
1800 } 1802 }
1801} 1803}
1802void MainWindow::keyPressEvent ( QKeyEvent * e ) 1804void MainWindow::keyPressEvent ( QKeyEvent * e )
1803{ 1805{
1804 qApp->processEvents(); 1806 qApp->processEvents();
1805 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 1807 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
1806 e->ignore(); 1808 e->ignore();
1807 // qDebug(" ignore %d",e->isAutoRepeat() ); 1809 // qDebug(" ignore %d",e->isAutoRepeat() );
1808 return; 1810 return;
1809 } 1811 }
1810 if (! e->isAutoRepeat() ) 1812 if (! e->isAutoRepeat() )
1811 mFlagKeyPressed = true; 1813 mFlagKeyPressed = true;
1812 KOPrefs *p = KOPrefs::instance(); 1814 KOPrefs *p = KOPrefs::instance();
1813 bool showSelectedDates = false; 1815 bool showSelectedDates = false;
1814 int size; 1816 int size;
1815 int pro = 0; 1817 int pro = 0;
1816 //qDebug("MainWindow::keyPressEvent "); 1818 //qDebug("MainWindow::keyPressEvent ");
1817 switch ( e->key() ) { 1819 switch ( e->key() ) {
1818 case Qt::Key_Right: 1820 case Qt::Key_Right:
1819 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1821 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1820 mView->goNextMonth(); 1822 mView->goNextMonth();
1821 else 1823 else
1822 mView->goNext(); 1824 mView->goNext();
1823 showSelectedDates = true; 1825 showSelectedDates = true;
1824 break; 1826 break;
1825 case Qt::Key_Left: 1827 case Qt::Key_Left:
1826 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1828 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1827 mView->goPreviousMonth(); 1829 mView->goPreviousMonth();
1828 else 1830 else
1829 mView->goPrevious(); 1831 mView->goPrevious();
1830 showSelectedDates = true; 1832 showSelectedDates = true;
1831 break; 1833 break;
1832 case Qt::Key_Down: 1834 case Qt::Key_Down:
1833 mView->viewManager()->agendaView()->scrollOneHourDown(); 1835 mView->viewManager()->agendaView()->scrollOneHourDown();
1834 break; 1836 break;
1835 case Qt::Key_Up: 1837 case Qt::Key_Up:
1836 mView->viewManager()->agendaView()->scrollOneHourUp(); 1838 mView->viewManager()->agendaView()->scrollOneHourUp();
1837 break; 1839 break;
1838 case Qt::Key_K: 1840 case Qt::Key_K:
1839 mView->viewManager()->showMonthViewWeek(); 1841 mView->viewManager()->showMonthViewWeek();
1840 break; 1842 break;
1841 case Qt::Key_I: 1843 case Qt::Key_I:
1842 mView->showIncidence(); 1844 mView->showIncidence();
1843 break; 1845 break;
1844 case Qt::Key_Delete: 1846 case Qt::Key_Delete:
1845 case Qt::Key_Backspace: 1847 case Qt::Key_Backspace:
1846 mView->deleteIncidence(); 1848 mView->deleteIncidence();
1847 break; 1849 break;
1848 case Qt::Key_D: 1850 case Qt::Key_D:
1849 mView->viewManager()->showDayView(); 1851 mView->viewManager()->showDayView();
1850 showSelectedDates = true; 1852 showSelectedDates = true;
1851 break; 1853 break;
1852 case Qt::Key_O: 1854 case Qt::Key_O:
1853 mView->toggleFilerEnabled( ); 1855 mView->toggleFilerEnabled( );
1854 break; 1856 break;
1855 case Qt::Key_0: 1857 case Qt::Key_0:
1856 case Qt::Key_1: 1858 case Qt::Key_1:
1857 case Qt::Key_2: 1859 case Qt::Key_2:
1858 case Qt::Key_3: 1860 case Qt::Key_3:
1859 case Qt::Key_4: 1861 case Qt::Key_4:
1860 case Qt::Key_5: 1862 case Qt::Key_5:
1861 case Qt::Key_6: 1863 case Qt::Key_6:
1862 case Qt::Key_7: 1864 case Qt::Key_7:
1863 case Qt::Key_8: 1865 case Qt::Key_8:
1864 case Qt::Key_9: 1866 case Qt::Key_9:
1865 pro = e->key()-48; 1867 pro = e->key()-48;
1866 if ( pro == 0 ) 1868 if ( pro == 0 )
1867 pro = 10; 1869 pro = 10;
1868 if ( e->state() == Qt::ControlButton) 1870 if ( e->state() == Qt::ControlButton)
1869 pro += 10; 1871 pro += 10;
1870 break; 1872 break;
1871 case Qt::Key_M: 1873 case Qt::Key_M:
1872 mView->viewManager()->showMonthView(); 1874 mView->viewManager()->showMonthView();
1873 showSelectedDates = true; 1875 showSelectedDates = true;
1874 break; 1876 break;
1875 case Qt::Key_Insert: 1877 case Qt::Key_Insert:
1876 mView->newEvent(); 1878 mView->newEvent();
1877 break; 1879 break;
1878 case Qt::Key_S : 1880 case Qt::Key_S :
1879 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1881 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1880 mView->newSubTodo(); 1882 mView->newSubTodo();
1881 else 1883 else
1882 mView->dialogManager()->showSearchDialog(); 1884 mView->dialogManager()->showSearchDialog();
1883 break; 1885 break;
1884 case Qt::Key_Y : 1886 case Qt::Key_Y :
1885 case Qt::Key_Z : 1887 case Qt::Key_Z :
1886 mView->viewManager()->showWorkWeekView(); 1888 mView->viewManager()->showWorkWeekView();
1887 showSelectedDates = true; 1889 showSelectedDates = true;
1888 break; 1890 break;
1889 case Qt::Key_U : 1891 case Qt::Key_U :
1890 mView->viewManager()->showWeekView(); 1892 mView->viewManager()->showWeekView();
1891 showSelectedDates = true; 1893 showSelectedDates = true;
1892 break; 1894 break;
1893 case Qt::Key_H : 1895 case Qt::Key_H :
1894 keyBindings(); 1896 keyBindings();
1895 break; 1897 break;
1896 case Qt::Key_W: 1898 case Qt::Key_W:
1897 mView->viewManager()->showWhatsNextView(); 1899 mView->viewManager()->showWhatsNextView();
1898 break; 1900 break;
1899 case Qt::Key_L: 1901 case Qt::Key_L:
1900 mView->viewManager()->showListView(); 1902 mView->viewManager()->showListView();
1901 break; 1903 break;
1902 case Qt::Key_N: 1904 case Qt::Key_N:
1903 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1905 mView->viewManager()->showNextView();
1904 mView->viewManager()->showNextView();
1905 else {
1906 mView->viewManager()->showNextXView();
1907 showSelectedDates = true;
1908 }
1909 break; 1906 break;
1910 case Qt::Key_V: 1907 case Qt::Key_V:
1911 mView->viewManager()->showTodoView(); 1908 mView->viewManager()->showTodoView();
1912 break; 1909 break;
1913 case Qt::Key_C: 1910 case Qt::Key_C:
1914 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 1911 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
1915 break; 1912 break;
1916 case Qt::Key_P: 1913 case Qt::Key_P:
1917 mView->showDatePicker( ); 1914 mView->showDatePicker( );
1918 break; 1915 break;
1919 case Qt::Key_F: 1916 case Qt::Key_F:
1920 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1917 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1921 mView->editFilters(); 1918 mView->editFilters();
1922 else 1919 else
1923 mView->toggleFilter(); 1920 mView->toggleFilter();
1924 break; 1921 break;
1925 case Qt::Key_X: 1922 case Qt::Key_X:
1926 mView->toggleDateNavigatorWidget(); 1923 if ( e->state() == Qt::ControlButton )
1924 mView->toggleDateNavigatorWidget();
1925 else {
1926 mView->viewManager()->showNextXView();
1927 showSelectedDates = true;
1928 }
1927 break; 1929 break;
1928 case Qt::Key_Space: 1930 case Qt::Key_Space:
1929 mView->toggleExpand(); 1931 mView->toggleExpand();
1930 break; 1932 break;
1931 case Qt::Key_A: 1933 case Qt::Key_A:
1932 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) 1934 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
1933 mView->showNextAlarms(); 1935 mView->showNextAlarms();
1934 else 1936 else
1935 mView->toggleAllDaySize(); 1937 mView->toggleAllDaySize();
1936 break; 1938 break;
1937 case Qt::Key_T: 1939 case Qt::Key_T:
1938 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1940 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1939 mView->newTodo(); 1941 mView->newTodo();
1940 else { 1942 else {
1941 mView->goToday(); 1943 mView->goToday();
1942 showSelectedDates = true; 1944 showSelectedDates = true;
1943 } 1945 }
1944 break; 1946 break;
1945 case Qt::Key_J: 1947 case Qt::Key_J:
1946 mView->viewManager()->showJournalView(); 1948 mView->viewManager()->showJournalView();
1947 break; 1949 break;
1948 case Qt::Key_B: 1950 case Qt::Key_B:
1949 mView->editIncidenceDescription();; 1951 mView->editIncidenceDescription();;
1950 break; 1952 break;
1951 // case Qt::Key_Return: 1953 // case Qt::Key_Return:
1952 case Qt::Key_E: 1954 case Qt::Key_E:
1953 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1955 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1954 mView->newEvent(); 1956 mView->newEvent();
1955 else 1957 else
1956 mView->editIncidence(); 1958 mView->editIncidence();
1957 break; 1959 break;
1958 case Qt::Key_Plus: 1960 case Qt::Key_Plus:
1959 size = p->mHourSize +2; 1961 size = p->mHourSize +2;
1960 if ( size <= 22 ) 1962 if ( size <= 22 )
1961 configureAgenda( size ); 1963 configureAgenda( size );
1962 break; 1964 break;
1963 case Qt::Key_Minus: 1965 case Qt::Key_Minus:
1964 size = p->mHourSize - 2; 1966 size = p->mHourSize - 2;
1965 if ( size >= 4 ) 1967 if ( size >= 4 )
1966 configureAgenda( size ); 1968 configureAgenda( size );
1967 break; 1969 break;
1968 1970
1969 1971
1970 default: 1972 default:
1971 e->ignore(); 1973 e->ignore();
1972 } 1974 }
1973 if ( pro > 0 ) { 1975 if ( pro > 0 ) {
1974 mView->selectFilter( pro-1 ); 1976 mView->selectFilter( pro-1 );
1975 } 1977 }
1976 if ( showSelectedDates ) { 1978 if ( showSelectedDates ) {
1977 ;// setCaptionToDates(); 1979 ;// setCaptionToDates();
1978 } 1980 }
1979 1981
1980} 1982}
1981void MainWindow::fillFilterMenuTB() 1983void MainWindow::fillFilterMenuTB()
1982{ 1984{
1983 selectFilterMenuTB->clear(); 1985 selectFilterMenuTB->clear();
1984 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); 1986 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
1985 selectFilterMenuTB->insertSeparator(); 1987 selectFilterMenuTB->insertSeparator();
1986 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); 1988 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
1987 1989
1988 selectFilterMenuTB->insertSeparator(); 1990 selectFilterMenuTB->insertSeparator();
1989 QPtrList<CalFilter> fili = mView->filters(); 1991 QPtrList<CalFilter> fili = mView->filters();
1990 CalFilter *curfilter = mView->filterView()->selectedFilter(); 1992 CalFilter *curfilter = mView->filterView()->selectedFilter();
1991 CalFilter *filter = fili.first(); 1993 CalFilter *filter = fili.first();
1992 int iii = 2; 1994 int iii = 2;
1993 bool checkitem = mView->filterView()->filtersEnabled(); 1995 bool checkitem = mView->filterView()->filtersEnabled();
1994 while(filter) { 1996 while(filter) {
1995 selectFilterMenuTB->insertItem( filter->name(), iii ); 1997 selectFilterMenuTB->insertItem( filter->name(), iii );
1996 if ( filter == curfilter) 1998 if ( filter == curfilter)
1997 selectFilterMenuTB->setItemChecked( iii, checkitem ); 1999 selectFilterMenuTB->setItemChecked( iii, checkitem );
1998 filter = fili.next(); 2000 filter = fili.next();
1999 ++iii; 2001 ++iii;
2000 } 2002 }
2001 if ( !checkitem ) 2003 if ( !checkitem )
2002 selectFilterMenuTB->setItemChecked( 1, true ); 2004 selectFilterMenuTB->setItemChecked( 1, true );
2003 2005
2004 int x = 0; 2006 int x = 0;
2005 int y = iconToolBar->height(); 2007 int y = iconToolBar->height();
2006 int dX = 0; 2008 int dX = 0;
2007 int dY = 0; 2009 int dY = 0;
2008 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2010 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2009 if ( iconToolBar->y() > height()/2 ) { 2011 if ( iconToolBar->y() > height()/2 ) {
2010 dY = selectFilterMenuTB->sizeHint().height()+8; 2012 dY = selectFilterMenuTB->sizeHint().height()+8;
2011 y = 0; 2013 y = 0;
2012 } 2014 }
2013 } else { 2015 } else {
2014 if ( iconToolBar->x() > width()/2 ) { // right side 2016 if ( iconToolBar->x() > width()/2 ) { // right side
2015 x=0; 2017 x=0;
2016 dX= selectFilterMenuTB->sizeHint().width()+8; 2018 dX= selectFilterMenuTB->sizeHint().width()+8;
2017 y = 0; 2019 y = 0;
2018 } else { 2020 } else {
2019 x= iconToolBar->width(); 2021 x= iconToolBar->width();
2020 y = 0; 2022 y = 0;
2021 } 2023 }
2022 } 2024 }
2023 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2025 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2024 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); 2026 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2025} 2027}
2026void MainWindow::fillFilterMenu() 2028void MainWindow::fillFilterMenu()
2027{ 2029{
2028 selectFilterMenu->clear(); 2030 selectFilterMenu->clear();
2029 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2031 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
2030 selectFilterMenu->insertSeparator(); 2032 selectFilterMenu->insertSeparator();
2031 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2033 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
2032 2034
2033 selectFilterMenu->insertSeparator(); 2035 selectFilterMenu->insertSeparator();
2034 QPtrList<CalFilter> fili = mView->filters(); 2036 QPtrList<CalFilter> fili = mView->filters();
2035 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2037 CalFilter *curfilter = mView->filterView()->selectedFilter();
2036 CalFilter *filter = fili.first(); 2038 CalFilter *filter = fili.first();
2037 int iii = 2; 2039 int iii = 2;
2038 bool checkitem = mView->filterView()->filtersEnabled(); 2040 bool checkitem = mView->filterView()->filtersEnabled();
2039 while(filter) { 2041 while(filter) {
2040 selectFilterMenu->insertItem( filter->name(), iii ); 2042 selectFilterMenu->insertItem( filter->name(), iii );
2041 if ( filter == curfilter) 2043 if ( filter == curfilter)
2042 selectFilterMenu->setItemChecked( iii, checkitem ); 2044 selectFilterMenu->setItemChecked( iii, checkitem );
2043 filter = fili.next(); 2045 filter = fili.next();
2044 ++iii; 2046 ++iii;
2045 } 2047 }
2046 if ( !checkitem ) 2048 if ( !checkitem )
2047 selectFilterMenu->setItemChecked( 1, true ); 2049 selectFilterMenu->setItemChecked( 1, true );
2048} 2050}
2049void MainWindow::fillFilterMenuPopup() 2051void MainWindow::fillFilterMenuPopup()
2050{ 2052{
2051 filterPopupMenu->clear(); 2053 filterPopupMenu->clear();
2052 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2054 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
2053 2055
2054 filterPopupMenu->insertSeparator(); 2056 filterPopupMenu->insertSeparator();
2055 QPtrList<CalFilter> fili = mView->filters(); 2057 QPtrList<CalFilter> fili = mView->filters();
2056 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2058 CalFilter *curfilter = mView->filterView()->selectedFilter();
2057 CalFilter *filter = fili.first(); 2059 CalFilter *filter = fili.first();
2058 int iii = 1; 2060 int iii = 1;
2059 bool checkitem = mView->filterView()->filtersEnabled(); 2061 bool checkitem = mView->filterView()->filtersEnabled();
2060 while(filter) { 2062 while(filter) {
2061 filterPopupMenu->insertItem( filter->name(), iii ); 2063 filterPopupMenu->insertItem( filter->name(), iii );
2062 if ( filter == curfilter) 2064 if ( filter == curfilter)
2063 filterPopupMenu->setItemChecked( iii, checkitem ); 2065 filterPopupMenu->setItemChecked( iii, checkitem );
2064 filter = fili.next(); 2066 filter = fili.next();
2065 ++iii; 2067 ++iii;
2066 } 2068 }
2067 if ( !checkitem ) 2069 if ( !checkitem )
2068 filterPopupMenu->setItemChecked( 0, true ); 2070 filterPopupMenu->setItemChecked( 0, true );
2069} 2071}
2070void MainWindow::selectFilter( int fil ) 2072void MainWindow::selectFilter( int fil )
2071{ 2073{
2072 2074
2073 if ( fil == 0 ) { 2075 if ( fil == 0 ) {
2074 mView->editFilters( ); 2076 mView->editFilters( );
2075 } else if ( fil == 1 ){ 2077 } else if ( fil == 1 ){
2076 if ( mView->filterView()->filtersEnabled() ) 2078 if ( mView->filterView()->filtersEnabled() )
2077 mView->toggleFilerEnabled( ); 2079 mView->toggleFilerEnabled( );
2078 } else { 2080 } else {
2079 if ( !mView->filterView()->filtersEnabled() ) { 2081 if ( !mView->filterView()->filtersEnabled() ) {
2080 mView->filterView()->blockSignals( true ); 2082 mView->filterView()->blockSignals( true );
2081 mView->toggleFilerEnabled( ); 2083 mView->toggleFilerEnabled( );
2082 mView->filterView()->blockSignals( false ); 2084 mView->filterView()->blockSignals( false );
2083 } 2085 }
2084 mView->selectFilter( fil-2 ); 2086 mView->selectFilter( fil-2 );
2085 } 2087 }
2086} 2088}
2087void MainWindow::updateFilterToolbar() 2089void MainWindow::updateFilterToolbar()
2088{ 2090{
2089 if ( filterMenubar ) { 2091 if ( filterMenubar ) {
2090 if ( !mView->filterView()->filtersEnabled() ) { 2092 if ( !mView->filterView()->filtersEnabled() ) {
2091 filterMenubar->changeItem( 0, i18n("No Filter") ); 2093 filterMenubar->changeItem( 0, i18n("No Filter") );
2092 } else { 2094 } else {
2093 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2095 CalFilter *curfilter = mView->filterView()->selectedFilter();
2094 if ( curfilter ) { 2096 if ( curfilter ) {
2095 filterMenubar->changeItem( 0, curfilter->name() ); 2097 filterMenubar->changeItem( 0, curfilter->name() );
2096 } 2098 }
2097 } 2099 }
2098 } 2100 }
2099} 2101}
2100void MainWindow::selectFilterPopup( int fil ) 2102void MainWindow::selectFilterPopup( int fil )
2101{ 2103{
2102 selectFilter( fil + 1 ); 2104 selectFilter( fil + 1 );
2103 2105
2104} 2106}
2105void MainWindow::configureToolBar( int item ) 2107void MainWindow::configureToolBar( int item )
2106{ 2108{
2107 2109
2108 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 2110 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
2109 KOPrefs *p = KOPrefs::instance(); 2111 KOPrefs *p = KOPrefs::instance();
2110 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 2112 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
2111 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); 2113 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 );
2112 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); 2114 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
2113 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 2115 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
2114 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 2116 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
2115 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); 2117 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 );
2116 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); 2118 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 );
2117 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); 2119 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 );
2118 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); 2120 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 );
2119 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 2121 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
2120 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 2122 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
2121 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 2123 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
2122 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 2124 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
2123 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); 2125 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 );
2124 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 2126 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
2125 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 2127 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
2126 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 2128 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
2127 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 2129 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
2128 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 2130 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
2129 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 2131 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
2130 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 2132 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
2131 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 2133 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
2132 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 2134 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
2133 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 2135 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
2134 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 2136 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
2135 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 2137 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
2136 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); 2138 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 );
2137 // initActions(); 2139 // initActions();
2138} 2140}
2139void MainWindow::setCaption ( const QString & c ) 2141void MainWindow::setCaption ( const QString & c )
2140{ 2142{
2141 QString cap = c; 2143 QString cap = c;
2142 cap.replace( QRegExp("\n"), " " ); 2144 cap.replace( QRegExp("\n"), " " );
2143 cap = cap.stripWhiteSpace(); 2145 cap = cap.stripWhiteSpace();
2144 if ( cap.isEmpty() ) 2146 if ( cap.isEmpty() )
2145 cap = "KO/Pi"; 2147 cap = "KO/Pi";
2146 QWidget::setCaption( cap ); 2148 QWidget::setCaption( cap );
2147} 2149}
2148void MainWindow::setCaptionToDates() 2150void MainWindow::setCaptionToDates()
2149{ 2151{
2150 QString selDates; 2152 QString selDates;
2151 QDate date = mView->startDate(); 2153 QDate date = mView->startDate();
2152 if ( ! date.isValid() ) { 2154 if ( ! date.isValid() ) {
2153 setCaption(""); 2155 setCaption("");
2154 return; 2156 return;
2155 } 2157 }
2156 selDates = KGlobal::locale()->formatDate( date, true); 2158 selDates = KGlobal::locale()->formatDate( date, true);
2157 if (mView->startDate() < mView->endDate() ) 2159 if (mView->startDate() < mView->endDate() )
2158 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 2160 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
2159 else { 2161 else {
2160 QString addString; 2162 QString addString;
2161 if ( date == QDateTime::currentDateTime().date() ) 2163 if ( date == QDateTime::currentDateTime().date() )
2162 addString = i18n("Today"); 2164 addString = i18n("Today");
2163 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 2165 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
2164 addString = i18n("Tomorrow"); 2166 addString = i18n("Tomorrow");
2165 if ( !addString.isEmpty() ) 2167 if ( !addString.isEmpty() )
2166 selDates = addString+", "+selDates ; 2168 selDates = addString+", "+selDates ;
2167 } 2169 }
2168 setCaption( i18n("Dates: ") + selDates ); 2170 setCaption( i18n("Dates: ") + selDates );
2169 2171
2170} 2172}
2171void MainWindow::showConfigureAgenda( ) 2173void MainWindow::showConfigureAgenda( )
2172{ 2174{
2173 int iii; 2175 int iii;
2174 for ( iii = 1;iii<= 10 ;++iii ){ 2176 for ( iii = 1;iii<= 10 ;++iii ){
2175 configureAgendaMenu->setItemChecked( (iii+1)*2, false ); 2177 configureAgendaMenu->setItemChecked( (iii+1)*2, false );
2176 } 2178 }
2177 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); 2179 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true );
2178} 2180}
2179void MainWindow::configureAgenda( int item ) 2181void MainWindow::configureAgenda( int item )
2180{ 2182{
2181 if ( KOPrefs::instance()->mHourSize == item ) 2183 if ( KOPrefs::instance()->mHourSize == item )
2182 return; 2184 return;
2183 KOPrefs::instance()->mHourSize=item; 2185 KOPrefs::instance()->mHourSize=item;
2184 mView->viewManager()->agendaView()->updateConfig(); 2186 mView->viewManager()->agendaView()->updateConfig();
2185} 2187}
2186 2188
2187void MainWindow::saveCalendar() 2189void MainWindow::saveCalendar()
2188{ 2190{
2189 QString fn = KOPrefs::instance()->mLastSaveFile; 2191 QString fn = KOPrefs::instance()->mLastSaveFile;
2190 fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); 2192 fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this );
2191 2193
2192 if ( fn == "" ) 2194 if ( fn == "" )
2193 return; 2195 return;
2194 QFileInfo info; 2196 QFileInfo info;
2195 info.setFile( fn ); 2197 info.setFile( fn );
2196 QString mes; 2198 QString mes;
2197 bool createbup = true; 2199 bool createbup = true;
2198 if ( info. exists() ) { 2200 if ( info. exists() ) {
2199 mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; 2201 mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ;
2200 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 2202 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
2201 i18n("Overwrite!"), i18n("Cancel"), 0, 2203 i18n("Overwrite!"), i18n("Cancel"), 0,
2202 0, 1 ); 2204 0, 1 );
2203 if ( result != 0 ) { 2205 if ( result != 0 ) {
2204 createbup = false; 2206 createbup = false;
2205 } 2207 }
2206 } 2208 }
2207 if ( createbup ) { 2209 if ( createbup ) {
2208 mView->saveCalendar( fn ); 2210 mView->saveCalendar( fn );
2209 mes = i18n("KO/Pi:Saved %1").arg(fn); 2211 mes = i18n("KO/Pi:Saved %1").arg(fn);
2210 KOPrefs::instance()->mLastSaveFile = fn; 2212 KOPrefs::instance()->mLastSaveFile = fn;
2211 setCaption(mes); 2213 setCaption(mes);
2212 } 2214 }
2213} 2215}
2214void MainWindow::loadCalendar() 2216void MainWindow::loadCalendar()
2215{ 2217{
2216 2218
2217 QString fn = KOPrefs::instance()->mLastLoadFile; 2219 QString fn = KOPrefs::instance()->mLastLoadFile;
2218 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); 2220 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this );
2219 2221
2220 if ( fn == "" ) 2222 if ( fn == "" )
2221 return; 2223 return;
2222 QFileInfo info; 2224 QFileInfo info;
2223 info.setFile( fn ); 2225 info.setFile( fn );
2224 QString mess; 2226 QString mess;
2225 bool loadbup = true; 2227 bool loadbup = true;
2226 if ( info. exists() ) { 2228 if ( info. exists() ) {
2227 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 2229 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
2228 int result = QMessageBox::warning( this, "KO/Pi: Warning!", 2230 int result = QMessageBox::warning( this, "KO/Pi: Warning!",
2229 mess, 2231 mess,
2230 i18n("Load!"), i18n("Cancel"), 0, 2232 i18n("Load!"), i18n("Cancel"), 0,
2231 0, 1 ); 2233 0, 1 );
2232 if ( result != 0 ) { 2234 if ( result != 0 ) {
2233 loadbup = false; 2235 loadbup = false;
2234 } 2236 }
2235 } else { 2237 } else {
2236 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2238 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2237 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, 2239 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0,
2238 0, 1 ); 2240 0, 1 );
2239 2241
2240 return; 2242 return;
2241 } 2243 }
2242 if ( loadbup ) { 2244 if ( loadbup ) {
2243 mView->openCalendar( fn ); 2245 mView->openCalendar( fn );
2244 KOPrefs::instance()->mLastLoadFile = fn; 2246 KOPrefs::instance()->mLastLoadFile = fn;
2245 mess = i18n("KO/Pi:Loaded %1").arg(fn) ; 2247 mess = i18n("KO/Pi:Loaded %1").arg(fn) ;
2246 setCaption(mess); 2248 setCaption(mess);
2247 } 2249 }
2248 2250
2249} 2251}
2250void MainWindow::quickImportIcal() 2252void MainWindow::quickImportIcal()
2251{ 2253{
2252 importFile( KOPrefs::instance()->mLastImportFile, false ); 2254 importFile( KOPrefs::instance()->mLastImportFile, false );
2253} 2255}
2254void MainWindow::importFile( QString fn, bool quick ) 2256void MainWindow::importFile( QString fn, bool quick )
2255{ 2257{
2256 QFileInfo info; 2258 QFileInfo info;
2257 info.setFile( fn ); 2259 info.setFile( fn );
2258 QString mess; 2260 QString mess;
2259 bool loadbup = true; 2261 bool loadbup = true;
2260 if ( !info. exists() ) { 2262 if ( !info. exists() ) {
2261 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); 2263 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30));
2262 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2264 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2263 mess ); 2265 mess );
2264 return; 2266 return;
2265 } 2267 }
2266 int result = 0; 2268 int result = 0;
2267 if ( !quick ) { 2269 if ( !quick ) {
2268 mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 2270 mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
2269 result = QMessageBox::warning( this, "KO/Pi: Warning!", 2271 result = QMessageBox::warning( this, "KO/Pi: Warning!",
2270 mess, 2272 mess,
2271 "Import", "Cancel", 0, 2273 "Import", "Cancel", 0,
2272 0, 1 ); 2274 0, 1 );
2273 } 2275 }
2274 if ( result == 0 ) { 2276 if ( result == 0 ) {
2275 if ( mView->openCalendar( fn, true )) { 2277 if ( mView->openCalendar( fn, true )) {
2276 KOPrefs::instance()->mLastImportFile = fn; 2278 KOPrefs::instance()->mLastImportFile = fn;
2277 setCaption(i18n("Imported file successfully")); 2279 setCaption(i18n("Imported file successfully"));
2278 } else { 2280 } else {
2279 setCaption(i18n("Error importing file")); 2281 setCaption(i18n("Error importing file"));
2280 } 2282 }
2281 } 2283 }
2282} 2284}
2283 2285
2284void MainWindow::importIcal() 2286void MainWindow::importIcal()
2285{ 2287{
2286 2288
2287 QString fn =KOPrefs::instance()->mLastImportFile; 2289 QString fn =KOPrefs::instance()->mLastImportFile;
2288 2290
2289 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); 2291 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this );
2290 if ( fn == "" ) 2292 if ( fn == "" )
2291 return; 2293 return;
2292 importFile( fn, true ); 2294 importFile( fn, true );
2293 2295
2294} 2296}
2295 2297
2296void MainWindow::exportVCalendar() 2298void MainWindow::exportVCalendar()
2297{ 2299{
2298 QString fn = KOPrefs::instance()->mLastVcalFile; 2300 QString fn = KOPrefs::instance()->mLastVcalFile;
2299 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); 2301 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this );
2300 if ( fn == "" ) 2302 if ( fn == "" )
2301 return; 2303 return;
2302 QFileInfo info; 2304 QFileInfo info;
2303 info.setFile( fn ); 2305 info.setFile( fn );
2304 QString mes; 2306 QString mes;
2305 bool createbup = true; 2307 bool createbup = true;
2306 if ( info. exists() ) { 2308 if ( info. exists() ) {
2307 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 2309 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
2308 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 2310 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
2309 i18n("Overwrite!"), i18n("Cancel"), 0, 2311 i18n("Overwrite!"), i18n("Cancel"), 0,
2310 0, 1 ); 2312 0, 1 );