summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-09 16:17:14 (UTC)
committer zautrix <zautrix>2005-06-09 16:17:14 (UTC)
commit89c5159208fd982f527117e49d67ea1f90553dbe (patch) (side-by-side diff)
treeb6b72ca9e0668e871a6969b25654945747015d0f /korganizer
parentad88eadf0bdb34cb4a93639b50a5566a06470c22 (diff)
downloadkdepimpi-89c5159208fd982f527117e49d67ea1f90553dbe.zip
kdepimpi-89c5159208fd982f527117e49d67ea1f90553dbe.tar.gz
kdepimpi-89c5159208fd982f527117e49d67ea1f90553dbe.tar.bz2
dialog fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp10
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/kodialogmanager.cpp28
-rw-r--r--korganizer/kodialogmanager.h1
-rw-r--r--korganizer/koprefsdialog.cpp28
-rw-r--r--korganizer/mainwindow.cpp9
6 files changed, 54 insertions, 23 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 7c7466b..4794414 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2511,45 +2511,47 @@ void CalendarView::edit_copy()
factory.copyIncidence(anEvent);
}
void CalendarView::edit_paste()
{
QDate date = mNavigator->selectedDates().first();
DndFactory factory( mCalendar );
Event *pastedEvent = (Event *)factory.pasteIncidence( date );
changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
}
-
-void CalendarView::edit_options()
+void CalendarView::edit_global_options()
{
QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
emit save();
emit saveStopTimer();
- mDialogManager->showOptionsDialog();
+ mDialogManager->showGlobalOptionsDialog();
if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
emit saveStopTimer();
if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"),
i18n("Timezone settings"),i18n("Reload"))) {
qDebug("KO: TZ reload cancelled ");
return;
}
qDebug("KO: Timezone change ");
openCalendar( MainWindow::defaultFileName() );
setModified(true);
}
else
qDebug("KO: No tz change ");
-
+}
+void CalendarView::edit_options()
+{
+ mDialogManager->showOptionsDialog();
}
void CalendarView::slotSelectPickerDate( QDate d)
{
mDateFrame->hide();
if ( mDatePickerMode == 1 ) {
mNavigator->slotDaySelect( d );
} else if ( mDatePickerMode == 2 ) {
if ( mMoveIncidence->typeID() == todoID ) {
Todo * to = (Todo *) mMoveIncidence;
QTime tim;
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 4600090..1215a99 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -340,24 +340,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
/** cut the current appointment to the clipboard */
void edit_cut();
/** copy the current appointment(s) to the clipboard */
void edit_copy();
/** paste the current vobject(s) in the clipboard buffer into calendar */
void edit_paste();
/** edit viewing and configuration options. */
void edit_options();
+ void edit_global_options();
/**
Functions for printing, previewing a print, and setting up printing
parameters.
*/
void print();
void printSetup();
void printPreview();
/** Export as iCalendar file */
void exportICalendar();
/** Export as vCalendar file */
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index c927b37..aa30c52 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -79,50 +79,66 @@ OutgoingDialog *KODialogManager::outgoingDialog()
}
void KODialogManager::createOutgoingDialog()
{
if (!mOutgoingDialog) {
mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView);
if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog);
connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)),
mMainView,SIGNAL(numOutgoingChanged(int)));
}
}
+void KODialogManager::showGlobalOptionsDialog( bool showSync )
+{
+ if (!mOptionsDialog) {
+ mOptionsDialog = new KOPrefsDialog(0);
+ connect(mOptionsDialog,SIGNAL(configChanged()),
+ mMainView,SLOT(updateConfig()));
+ }
+ mOptionsDialog->readConfig();
+#ifndef DESKTOP_VERSION
+ mOptionsDialog->showMaximized();
+#else
+ mOptionsDialog->show();
+#endif
+ if ( showSync )
+ mOptionsDialog->showSyncPage();
+ mOptionsDialog->exec();
+ delete mOptionsDialog;
+ mOptionsDialog = 0;
+}
void KODialogManager::showOptionsDialog( bool showSync )
{
if (!mOptionsDialog) {
mOptionsDialog = new KOPrefsDialog(mMainView);
- //mOptionsDialog->readConfig();
connect(mOptionsDialog,SIGNAL(configChanged()),
mMainView,SLOT(updateConfig()));
- //connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()),
- // mOptionsDialog,SLOT(updateCategories()));
-
}
mOptionsDialog->readConfig();
#ifndef DESKTOP_VERSION
mOptionsDialog->showMaximized();
#else
mOptionsDialog->show();
#endif
if ( showSync )
mOptionsDialog->showSyncPage();
mOptionsDialog->exec();
-
+ delete mOptionsDialog;
+ mOptionsDialog = 0;
}
void KODialogManager::showSyncOptions()
{
- showOptionsDialog( true );
+ showGlobalOptionsDialog( true );
}
void KODialogManager::showOutgoingDialog()
{
createOutgoingDialog();
mOutgoingDialog->show();
mOutgoingDialog->raise();
}
IncomingDialog *KODialogManager::incomingDialog()
{
createOutgoingDialog();
diff --git a/korganizer/kodialogmanager.h b/korganizer/kodialogmanager.h
index a6cc621..b68ddc2 100644
--- a/korganizer/kodialogmanager.h
+++ b/korganizer/kodialogmanager.h
@@ -62,24 +62,25 @@ class KODialogManager : public QObject
KOTodoEditor *getTodoEditor();
OutgoingDialog *outgoingDialog();
IncomingDialog *incomingDialog();
void writeSettings( KConfig *config);
void updateSearchDialog();
SearchDialog * getSearchDialog();
void setDocumentId( const QString &id );
public slots:
void showOptionsDialog( bool showSync = false);
+ void showGlobalOptionsDialog(bool showSync = false);
void showSyncOptions();
void showIncomingDialog();
void showOutgoingDialog();
// void showCategoryEditDialog();
void showSearchDialog();
void showArchiveDialog();
void showFilterEditDialog(QPtrList<CalFilter> *filters);
void showPluginDialog();
void hideSearchDialog();
private:
void createOutgoingDialog();
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index c9477e3..4b5b66a 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -77,53 +77,55 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
setFont( KGlobalSettings::generalMaxFont() );
setCaption( i18n("Preferences - some settings need a restart (nr)"));
mCategoryDict.setAutoDelete(true);
KGlobal::locale()->insertCatalogue("timezones");
mSpacingHint = spacingHintSmall();
mMarginHint = marginHintSmall();
#ifndef DESKTOP_VERSION
if ( QApplication::desktop()->height() == 480 )
hideButtons();
#endif
-
+ kdelibcfg = 0;
+ if ( !parent )
setupGlobalTab();
+ else {
setupMainTab();
// setupLocaleTab();
//setupTimeZoneTab();
setupTimeTab();
//setupLocaleDateTab();
setupFontsTab();
setupColorsTab();
setupViewsTab();
//setupSyncTab();
//setupSyncAlgTab();
//setupPrinterTab();
//setupGroupSchedulingTab();
//setupGroupAutomationTab();
-
+ }
}
KOPrefsDialog::~KOPrefsDialog()
{
}
void KOPrefsDialog::setupGlobalTab()
{
- QFrame *topFrame = addPage(i18n("Global"),0,0);
- kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" );
- QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
- topLayout->addWidget( kdelibcfg );
+ //QFrame *topFrame = addPage(i18n("Global"),0,0);
+ kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), this, "KCMKdeLibConfig" );
+ setMainWidget( kdelibcfg );
+ setCaption( i18n("KDE-Pim Global Settings"));
}
void KOPrefsDialog::setupLocaleDateTab()
{
#if 0
QFrame *topFrame = addPage(i18n("Date Format"),0,0);
QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
int iii = 0;
@@ -231,25 +233,25 @@ void KOPrefsDialog::setupLocaleTab()
// KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
#if 0
++iii;
sb =
addWidBool(i18n("Quick load/save (w/o Unicode)"),
&(KOPrefs::instance()->mUseQuicksave),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
#endif
#endif
}
void KOPrefsDialog::showSyncPage()
{
- showPage ( 0 ) ;
+ // showPage ( 0 ) ;
kdelibcfg->showTimeZoneTab() ;
}
void KOPrefsDialog::setupSyncAlgTab()
{
#if 0
QLabel * lab;
QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
mSetupSyncAlgTab = topFrame;
QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
@@ -1449,25 +1451,27 @@ void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
} else {
for(int i=0;i<combo->count();++i) {
if (combo->text(i) == text) {
combo->setCurrentItem(i);
break;
}
}
}
}
void KOPrefsDialog::usrReadConfig()
{
- kdelibcfg->readConfig();
+ if ( kdelibcfg )
+ kdelibcfg->readConfig();
+ else {
mNameEdit->setText(KOPrefs::instance()->fullName());
mEmailEdit->setText(KOPrefs::instance()->email());
mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
// QDate current ( 2001, 1,1);
//mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
//mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
//setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
//mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
@@ -1493,31 +1497,33 @@ void KOPrefsDialog::usrReadConfig()
//that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
//QString dummy = KOPrefs::instance()->mUserDateFormatLong;
//mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
//dummy = KOPrefs::instance()->mUserDateFormatShort;
//mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
updateCategories();
mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
+ }
}
void KOPrefsDialog::usrWriteConfig()
{
-
- kdelibcfg->writeConfig();
+ if ( kdelibcfg )
+ kdelibcfg->writeConfig();
+ else {
// KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text();
//KOPrefs::instance()->mRemoteUser = mRemoteUser->text();
//KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text();
//KOPrefs::instance()->mRemoteFile= mRemoteFile->text();
//KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text();
KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
//KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
//KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
KOPrefs::instance()->setFullName(mNameEdit->text());
KOPrefs::instance()->setEmail(mEmailEdit->text());
@@ -1557,25 +1563,25 @@ void KOPrefsDialog::usrWriteConfig()
KOPrefs::instance()->mAdditionalMails.clear();
// QListViewItem *item;
// item = mAMails->firstChild();
// while (item)
// {
// KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
// item = item->nextSibling();
// }
KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
-
+ }
}
void KOPrefsDialog::updateCategories()
{
mCategoryCombo->clear();
mCategoryDict.clear();
mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
updateCategoryColor();
}
void KOPrefsDialog::warningGroupScheduling()
{
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 25e76ee..2c04852 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -715,28 +715,33 @@ void MainWindow::initActions()
configureAgendaMenu->setCheckable( true );
int iii ;
for ( iii = 1;iii<= 10 ;++iii ){
configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
}
//configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
connect( configureAgendaMenu, SIGNAL( aboutToShow()),
this, SLOT( showConfigureAgenda( ) ) );
icon = loadPixmap( pathString + "configure" );
- action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this );
+ action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ),
- mView, SLOT( edit_options() ) );
+ mView, SLOT( edit_options() ) );
+ icon = loadPixmap( pathString + "configure" );
+ action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this );
+ action->addTo( actionMenu );
+ connect( action, SIGNAL( activated() ),
+ mView, SLOT( edit_global_options() ) );
actionMenu->insertSeparator();
action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( undo_delete() ) );
actionMenu->insertSeparator();
icon = loadPixmap( pathString + "newevent" );
configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
configureToolBarMenu->insertSeparator();