author | zautrix <zautrix> | 2005-07-02 05:23:23 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-02 05:23:23 (UTC) |
commit | b51bfb06293b34b77c46954253ab1b5220c8dd03 (patch) (side-by-side diff) | |
tree | 63caa6a4df764e14b49440800c8744b42ce94d82 | |
parent | 36a9df18a9789d0f44d0485b5f47c4f0329abb22 (diff) | |
download | kdepimpi-b51bfb06293b34b77c46954253ab1b5220c8dd03.zip kdepimpi-b51bfb06293b34b77c46954253ab1b5220c8dd03.tar.gz kdepimpi-b51bfb06293b34b77c46954253ab1b5220c8dd03.tar.bz2 |
fixxx
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 8 | ||||
-rw-r--r-- | korganizer/kofilterview.cpp | 89 | ||||
-rw-r--r-- | korganizer/kofilterview.h | 14 |
3 files changed, 64 insertions, 47 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 350d6b1..9c22730 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -365,3 +365,3 @@ { "Small","Klein" }, -{ "Sorry","Entschuldigung" }, +{ "Sorry","Tut mir leid" }, {"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"}, @@ -1487,5 +1487,5 @@ { "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" }, -{ "","" }, -{ "","" }, -{ "","" }, +{ "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, +{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, +{ "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" }, { "","" }, diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index 20118aa..1335d7e 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp @@ -134,26 +134,9 @@ void KOCalEditView::selectCal(int id ,bool b) } -void KOCalEditView::selectStdCal( int id, bool b ) +void KOCalEditView::selectStdCal( int id ) { - - if ( !b ) { - KOCalCheckButton* it = (KOCalCheckButton*) sender(); - if ( it ) { - it->blockSignals( true ); - it->setChecked( true ); - it->blockSignals( false ); - return; - } - return; - } - KOCalRadioButton* sen = (KOCalRadioButton*) sender(); KOCalRadioButton* it = mStdandardB.first(); while ( it ) { - if ( it->isChecked() ) { - if ( it != sen ) { it->blockSignals( true ); - it->setChecked( false ); + it->setChecked( it->num() == id ); it->blockSignals( false ); - break; - } - } it = mStdandardB.next(); @@ -162,6 +145,5 @@ void KOCalEditView::selectStdCal( int id, bool b ) while ( kkf ) { - kkf->isStandard = false; + kkf->isStandard = (kkf->mCalNumber == id ); kkf = KOPrefs::instance()->mCalendars.next(); } - KOPrefs::instance()->getCalendar( id )->isStandard = true; emit setCalendarDefault ( id ); @@ -179,8 +161,15 @@ void KOCalEditView::selectReadOnly(int id ,bool b ) emit calendarReadonly ( id , b ); - if ( KOPrefs::instance()->getCalendar( id )->isStandard && b && id > 1 ) { - KOPrefs::instance()->getCalendar( id )->isStandard = false; - KOPrefs::instance()->getCalendar( 1 )->isStandard = true; - mStdandardB.at(0)->setChecked( true ); - mStdandardB.at(id-1)->setChecked( false ); - emit setCalendarDefault ( 1 ); + if ( KOPrefs::instance()->getCalendar( id )->isStandard && b ) { + findNewStandard(); + } else { + if ( !b ){ + KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); + while ( kkf ) { + if (kkf->isReadOnly && kkf->isStandard ) { + selectStdCal( id ); + break; + } + kkf = KOPrefs::instance()->mCalendars.next(); + } + } } @@ -190,2 +179,21 @@ void KOCalEditView::selectReadOnly(int id ,bool b ) } +void KOCalEditView::findNewStandard() +{ + bool found = false; + KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); + while ( kkf ) { + if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) { + found = true; + selectStdCal( kkf->mCalNumber ); + break; + } + kkf = KOPrefs::instance()->mCalendars.next(); + } + if ( !found ) { + KMessageBox::error( this,i18n("\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n"), + i18n("Houston, we have a problem!") ); + + } +} + void KOCalEditView::setColor( const QColor& c, int id ) @@ -201,6 +209,6 @@ void KOCalEditView::deleteCal( int id ) if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; - if ( kkf->isStandard ) - selectStdCal( 1, true ); + bool findnewstd = kkf->isStandard; emit removeCalendar ( id ); KOPrefs::instance()->mCalendars.remove ( kkf ); + if ( findnewstd ) findNewStandard(); emit needsUpdate(); @@ -286,2 +294,3 @@ void KOCalEditView::readConfig() int row = 1; + bool errorLoadStandard = false; while ( kkf ) { @@ -291,4 +300,6 @@ void KOCalEditView::readConfig() rb->setChecked( kkf->isStandard ); + if ( kkf->isStandard && ( kkf->mErrorOnLoad || kkf->isReadOnly ) ) + errorLoadStandard = true; rb->setNum( kkf->mCalNumber ); - connect (rb, SIGNAL (selectNum(int,bool)), SLOT ( selectStdCal(int,bool) ) ); + connect (rb, SIGNAL (selectNum(int)), SLOT ( selectStdCal(int) ) ); if ( kkf->mErrorOnLoad || kkf->isReadOnly ) @@ -297,3 +308,3 @@ void KOCalEditView::readConfig() mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb ); - cb->setChecked( kkf->isEnabled ); + cb->setChecked( kkf->isEnabled && !kkf->mErrorOnLoad ); cb->setNum( kkf->mCalNumber ); @@ -311,3 +322,3 @@ void KOCalEditView::readConfig() mainLayout->addWidget( cb,row,++iii );mAlarmB.append( cb ); - cb->setChecked( kkf->isAlarmEnabled ); + cb->setChecked( kkf->isAlarmEnabled && !kkf->mErrorOnLoad); cb->setNum( kkf->mCalNumber ); @@ -340,2 +351,4 @@ void KOCalEditView::readConfig() } + if ( errorLoadStandard ) + findNewStandard(); lab = new QLabel ( "", mw ); @@ -346,3 +359,2 @@ void KOCalEditView::readConfig() - void KOCalEditView::defaultInfo() @@ -433,11 +445,11 @@ void KOCalEditView::disableRO() { - toggleList( mROB ); + toggleList( mROB, false ); } -void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list ) +void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list , bool enable ) { - bool dis = false; + bool dis = !enable; KOCalCheckButton* it = list.first(); while ( it ) { - if ( !it->isChecked() ) { - dis = true; + if ( !it->isChecked() == enable && it->isEnabled() ) { + dis = !dis; break; @@ -448,2 +460,3 @@ void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list ) while ( it ) { + if ( it->isEnabled() ) it->setChecked(dis); diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index 02107cf..874fc6a 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h @@ -72,3 +72,5 @@ class KONewCalPrefs : public QDialog connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); - setMinimumWidth( 220 ); + int minwid = 220; + if ( QApplication::desktop()->width() >= 320 ) minwid = 300; + setMinimumWidth( minwid ); resize(sizeHint() ); @@ -165,5 +167,6 @@ class KOCalRadioButton : public QRadioButton } + int num() { return mNumber;} void setNum ( int num ) {mNumber = num; } signals: - void selectNum ( int, bool ); + void selectNum ( int ); private: @@ -176,3 +179,3 @@ private: private slots : - void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } + void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber); } }; @@ -218,3 +221,3 @@ class KOCalEditView : public QScrollView void deleteAll(); - void selectStdCal(int,bool ); + void selectStdCal(int); void selectCal(int,bool ); @@ -227,2 +230,3 @@ class KOCalEditView : public QScrollView void defaultInfo(); + void findNewStandard(); signals: @@ -239,3 +243,3 @@ class KOCalEditView : public QScrollView QWidget *mw; - void toggleList ( QPtrList<KOCalCheckButton> ); + void toggleList ( QPtrList<KOCalCheckButton> , bool b = true ); QPtrList<KOCalRadioButton> mStdandardB; |