1054
1053
mFile = tmpFile;
1056
1055
kDebug() << "-- Add recent URL:" << url.prettyUrl();
1057
showStatusMessageOpen( url, merge );
1056
showStatusMessageOpen( merge );
1060
1059
return success;
1063
msg = i18n( "Cannot download calendar from '%1'.", url.prettyUrl() );
1064
KMessageBox::error( dialogParent(), msg );
1060
} else { // download failed
1061
KMessageBox::error( dialogParent(), KIO::NetAccess::lastErrorString() );
1108
1105
instance.reconfigure();
1111
void ActionManager::showStatusMessageOpen( const KUrl &url, bool merge )
1108
void ActionManager::showStatusMessageOpen( bool merge )
1114
mMainWindow->showStatusMessage( i18n( "Merged calendar '%1'.", url.prettyUrl() ) );
1111
mMainWindow->showStatusMessage( i18n( "Calendar Item successfully merged" ) );
1116
mMainWindow->showStatusMessage( i18n( "Opened calendar '%1'.", url.prettyUrl() ) );
1113
mMainWindow->showStatusMessage( i18n( "Calendar Item successfully created" ) );
1205
1202
if ( settings->outputFile().isEmpty() ) {
1207
//uncomment when new strings permitted
1208
// int result = KMessageBox::questionYesNo(
1210
// i18n( "The HTML calendar export file has not been specified yet.\n"
1211
// "Do you want to set it now?\n\n"
1212
// "If you answer \"no\" then this export operation will be canceled" ),
1214
// if ( result == KMessageBox::No ) {
1215
// mMainWindow->showStatusMessage(
1216
// i18nc( "@info:status",
1217
// "Calendar HTML operation canceled due to unspecified output file name" ) );
1203
int result = KMessageBox::questionYesNo(
1205
i18n( "The HTML calendar export file has not been specified yet.\n"
1206
"Do you want to set it now?\n\n"
1207
"If you answer \"no\" then this export operation will be canceled" ),
1209
if ( result == KMessageBox::No ) {
1210
mMainWindow->showStatusMessage(
1211
i18nc( "@info:status",
1212
"Calendar HTML operation canceled due to unspecified output file name" ) );
1221
// const QString fileName =
1222
// KFileDialog::getSaveFileName(
1223
// KGlobalSettings::documentPath(),
1224
// i18n( "*.html|HTML Files" ),
1226
// i18n( "Select path for HTML calendar export" ) );
1227
// settings->setOutputFile( fileName );
1228
// settings->writeConfig();
1216
const QString fileName =
1217
KFileDialog::getSaveFileName(
1218
KGlobalSettings::documentPath(),
1219
i18n( "*.html|HTML Files" ),
1221
i18n( "Select path for HTML calendar export" ) );
1222
settings->setOutputFile( fileName );
1223
settings->writeConfig();
1231
1226
if ( !autoMode && QFileInfo( settings->outputFile() ).exists() ) {
1235
1230
settings->outputFile() ),
1237
1232
KStandardGuiItem::overwrite() ) == KMessageBox::Cancel ) {
1238
//uncomment when new strings allowed
1239
// mMainWindow->showStatusMessage(
1240
// i18nc( "@info:status",
1241
// "Calendar HTML operation canceled due to output file overwrite" ) );
1233
mMainWindow->showStatusMessage(
1234
i18nc( "@info:status",
1235
"Calendar HTML operation canceled due to output file overwrite" ) );
2055
ImportDialog *dialog;
2056
dialog = new ImportDialog( url, mMainWindow->topLevelWidget() );
2057
connect( dialog, SIGNAL(dialogFinished(ImportDialog*)),
2058
SLOT(slotImportDialogFinished(ImportDialog*)) );
2059
connect( dialog, SIGNAL(openURL(KUrl,bool)),
2060
SLOT(openURL(KUrl,bool)) );
2061
connect( dialog, SIGNAL(addResource(KUrl)),
2062
SLOT(addResource(KUrl)) );
2067
void ActionManager::slotImportDialogFinished( ImportDialog *dlg )
2070
mCalendarView->updateView();
2049
const QString questionText =
2051
"<p>Would you like to merge this calendar item into an existing calendar "
2052
"or use it to create a brand new calendar?</p>"
2053
"<p>If you select merge, then you will be given the opportunity to select "
2054
"the destination calendar.</p>"
2055
"<p>If you select add, then a new calendar will be created for you automatically.</p>" );
2059
KMessageBox::questionYesNoCancel(
2062
i18nc( "@title:window", "Import Calendar" ),
2063
KGuiItem( i18n( "Merge into existing calendar" ) ),
2064
KGuiItem( i18n( "Add as new calendar" ) ) );
2068
case KMessageBox::Yes: //merge
2069
status = openURL( url, true );
2071
case KMessageBox::No: //import
2072
status = addResource( url );
2080
KMessageBox::questionYesNo(
2083
"<p>An error occurred importing calendar item from %1.</p>"
2084
"<p>Would you like to try again?</p>", url.prettyUrl() ) );
2085
if ( answer == KMessageBox::Yes ) {
2089
KMessageBox::information(
2092
"The calendar item from %1 was successfully imported.",
2093
url.prettyUrl() ) );
2073
2097
void ActionManager::slotAutoArchivingSettingsModified()