Loop in the current folder when searching for unread messages.

Make this feature configurable, but default to on.
Hope Don and the others can live with it like this ;-)

svn path=/trunk/kdenetwork/kmail/; revision=127774
wilder-work
Marc Mutz 25 years ago
parent 70992c9ed6
commit dc3d0ec73f
  1. 21
      configuredialog.cpp
  2. 1
      configuredialog_p.h
  3. 14
      kmheaders.cpp
  4. 2
      kmheaders.h
  5. 70
      profiles/profile-default-rc.desktop
  6. 17
      profiles/profile-html-rc.desktop

@ -3495,11 +3495,15 @@ MiscPageFoldersTab::MiscPageFoldersTab( QWidget * parent, const char * name )
// "confirm before emptying folder" check box: stretch 0
mEmptyFolderConfirmCheck =
new QCheckBox(i18n("Co&nfirm before emptying folders"), this );
new QCheckBox( i18n("Co&nfirm before emptying folders"), this );
vlay->addWidget( mEmptyFolderConfirmCheck );
mWarnBeforeExpire =
new QCheckBox( i18n("&Warn before expiring messages"), this );
vlay->addWidget( mWarnBeforeExpire );
mLoopOnGotoUnread =
new QCheckBox( i18n("&Loop in the current folder when trying to find "
"unread mail"), this );
vlay->addWidget( mLoopOnGotoUnread );
// "default mailbox format" combo + label: stretch 0
hlay = new QHBoxLayout( vlay ); // inherits spacing
@ -3544,16 +3548,28 @@ MiscPageFoldersTab::MiscPageFoldersTab( QWidget * parent, const char * name )
"mails between folders.</p></qt>");
QWhatsThis::add( mMailboxPrefCombo, msg );
QWhatsThis::add( label, msg );
msg = i18n( "what's this help",
"<qt><p>When jumping to the next unread message, it may occur "
"that no more unread messages are below the current message.</p>"
"<p>When this option is checked, the search will start at the "
"top of the message list. Otherwise, it will do nothing.</p>"
"<p>Similarly, when searching for the previous unread message, "
"the search will start from the bottom of the message list if "
"this option is checked.</p></qt>" );
QWhatsThis::add( mLoopOnGotoUnread, msg );
}
void MiscPage::FoldersTab::setup() {
KConfigGroup general( kapp->config(), "General" );
KConfigGroup behaviour( kapp->config(), "Behaviour" );
mEmptyTrashCheck->setChecked( general.readBoolEntry( "empty-trash-on-exit", false ) );
mExpireAtExit->setChecked( general.readNumEntry( "when-to-expire", 0 ) ); // set if non-zero
mWarnBeforeExpire->setChecked( general.readBoolEntry( "warn-before-expire", true ) );
mCompactOnExitCheck->setChecked( general.readBoolEntry( "compact-all-on-exit", true ) );
mEmptyFolderConfirmCheck->setChecked( general.readBoolEntry( "confirm-before-empty", true ) );
mLoopOnGotoUnread->setChecked( behaviour.readBoolEntry( "LoopOnGotoUnread", true ) );
int num = general.readNumEntry("default-mailbox-format", 1 );
if ( num < 0 || num > 1 ) num = 1;
@ -3562,13 +3578,14 @@ void MiscPage::FoldersTab::setup() {
void MiscPage::FoldersTab::apply() {
KConfigGroup general( kapp->config(), "General" );
KConfigGroup behaviour( kapp->config(), "Behaviour" );
general.writeEntry( "empty-trash-on-exit", mEmptyTrashCheck->isChecked() );
general.writeEntry( "compact-all-on-exit", mCompactOnExitCheck->isChecked() );
general.writeEntry( "confirm-before-empty", mEmptyFolderConfirmCheck->isChecked() );
general.writeEntry( "default-mailbox-format", mMailboxPrefCombo->currentItem() );
general.writeEntry( "warn-before-expire", mWarnBeforeExpire->isChecked() );
behaviour.writeEntry( "LoopOnGotoUnread", mLoopOnGotoUnread->isChecked() );
if ( mExpireAtExit->isChecked() )
general.writeEntry( "when-to-expire", expireAtExit );
else

@ -892,6 +892,7 @@ public:
protected:
QCheckBox *mEmptyFolderConfirmCheck;
QCheckBox *mWarnBeforeExpire;
QCheckBox *mLoopOnGotoUnread;
QComboBox *mMailboxPrefCombo;
QCheckBox *mCompactOnExitCheck;
QCheckBox *mEmptyTrashCheck;

@ -599,6 +599,12 @@ void KMHeaders::readConfig (void)
setFont(KGlobalSettings::generalFont());
}
// Behavior
{
KConfigGroupSaver saver(config, "Behaviour");
mLoopOnGotoUnread = config->readBoolEntry( "LoopOnGotoUnread", true );
}
}
@ -1960,6 +1966,9 @@ int KMHeaders::findUnread(bool aDirNext, int aStartAt, bool onlyNew, bool accept
void KMHeaders::nextUnreadMessage(bool acceptCurrent)
{
int i = findUnread(TRUE, -1, false, acceptCurrent);
if ( i < 0 && mLoopOnGotoUnread )
// this assumes that (0 == firstChild()->msgId()) !
i = findUnread(TRUE, 0, false, acceptCurrent); // from top
setCurrentMsg(i);
ensureCurrentItemVisible();
}
@ -1975,6 +1984,11 @@ void KMHeaders::ensureCurrentItemVisible()
void KMHeaders::prevUnreadMessage()
{
int i = findUnread(FALSE);
if ( i < 0 && mLoopOnGotoUnread ) {
KMHeaderItem * lastItem = static_cast<KMHeaderItem*>(lastChild());
if ( lastItem )
i = findUnread(FALSE, lastItem->msgId() ); // from bottom
}
setCurrentMsg(i);
ensureCurrentItemVisible();
}

@ -368,6 +368,8 @@ private:
static QDateTime *now;
static time_t now_time;
/** value of config key Behaviour/LoopOnGotoUnread */
bool mLoopOnGotoUnread;
};
#endif

@ -1,8 +1,71 @@
[KMail Profile]
Name=Default
Name[af]=verstek
Name[ar]=افتراضي
Name[az]=Əsas
Name[bg]=По подразбиране
Name[br]=Dre ziouer
Name[bs]=Uobičajeno
Name[ca]=Omissió
Name[cs]=Implicitní
Name[da]=Standard
Name[de]=Standard
Name[el]=Προκαθορισμένο
Name[eo]=Apriora
Name[es]=Predeterminado
Name[et]=Vaikimisi
Name[eu]=Aurremugatua
Name[fi]=Oletus
Name[fr]=Défaut
Name[gl]=Por Omisión
Name[he]=ברירת מחדל
Name[hr]=Uobičajeno
Name[hu]=Alapértelmezett
Name[id]=Standar
Name[is]=Sjálfgefið
Name[it]=Predefinito
Name[ja]=標準
Name[ko]=기본
Name[lt]=Nutylimos
Name[lv]=Noklusētais
Name[mi]=Hapa
Name[mk]=Вообичаено
Name[mt]=Normali
Name[nb]=Standard
Name[nl]=Standaard
Name[nn]=Standard
Name[oc]=Omission
Name[pl]=Domyślnie
Name[pt]=Por Omissão
Name[pt_BR]=Padrão
Name[ro]=Implicit
Name[ru]=По умолчанию
Name[sk]=Štandardný
Name[sl]=Privzeto
Name[sr]=Predefinisano
Name[sv]=Förval
Name[ta]=¦¸¡¼¡¿¢¨Ä
Name[th]=คาปรยาย
Name[tr]=Öntanımlı
Name[uk]=Типовий
Name[vi]=Mặc định
Name[wa]=Prémetou
Name[xh]=Engagqibekanga
Name[xx]=xx
Name[zh_CN]=默认
Name[zh_TW]=預設
Name[zu]=Engaqedekanga
Comment=Standard profile
Comment[xx]=xx
Comment[az]=Standard profil
Comment[da]=Standard-profil
Comment[es]=Pérfil de estandár
Comment[fr]=Profil standard
Comment[he]=פרופיל סטנדרטי
Comment[lv]=Standarta profils
Comment[pt]=Perfil predefinido
Comment[pt_BR]=Perfil predefinido
Comment[sk]=Štandardný profil
Comment[sv]=Standardprofil
[Reader]
BackgroundColor=255,255,255
@ -44,4 +107,7 @@ longFolderList=true
[General]
dateDisplay=fancyDate
showMessageSize=true
showMessageSize=true
[Behaviour]
LoopOnGotoUnread=true

@ -1,8 +1,16 @@
[KMail Profile]
Name=HTML
Name[xx]=xx
Comment=Standard profile with HTML preview enabled - less secure!
Comment[xx]=xx
Comment[az]=HTML nümayişli standard - ən az etibarlı!
Comment[da]=Standard-profil med HTML-forhåndsvisning aktiveret - mindre sikkert!
Comment[es]=Perfil estándar con previsualizaión HTML activada - menos seguro
Comment[fr]=Profil standard avec l'aperçu HTML activé - Moins sécurisé !
Comment[he]=הפרופיל הסטנדרטי עם תצוגה מקדימה של HTML - פחות בטוח
Comment[lv]=Standarta profils ar atļautu HTML apskati - nedrošāks!
Comment[pt]=Perfil padrão com antevisão de HTML activada - menos segura!
Comment[pt_BR]=Perfil padrão com antevisão de HTML activada - menos segura!
Comment[sk]=Štandardný profil pre povolený náhlad HTML - menej bezpečné!
Comment[sv]=Standardprofil med HTML-förhandsgranskning aktiverad - mindre säker!
[Reader]
BackgroundColor=255,255,255
@ -45,4 +53,7 @@ longFolderList=true
[General]
dateDisplay=fancyDate
showMessageSize=true
showMessageSize=true
[Behaviour]
LoopOnGotoUnread=true

Loading…
Cancel
Save