This patch adds an option for graphical settings of sort style for accounts, groups and contacts in roster. Original version comes from psi-devel mailing and adds options only for contacts sorting. I modified it to fit for roster-nr and adds ability to set group and account sorting style as well. Przemysław 'Troll' Maciąg diff --exclude='*orig' -Naur psi-0.10-test3-orig/src/options/opt_roster.cpp psi-0.10-test3/src/options/opt_roster.cpp --- psi-0.10-test3-orig/src/options/opt_roster.cpp 2005-12-17 14:51:18.000000000 +0000 +++ psi-0.10-test3/src/options/opt_roster.cpp 2005-12-17 15:47:14.000000000 +0000 @@ -3,6 +3,7 @@ #include "iconwidget.h" #include +#include #include #include #include @@ -40,6 +41,18 @@ tr("Makes Psi scroll the main window automatically so you can see new incoming events.")); QWhatsThis::add(d->ck_statusIndicator, tr("Displays an indicator by the contact name if the contact entered a descriptive text status line.")); + QWhatsThis::add(d->cb_accountOrderType, + tr("

Set order of sorting account items in roster:

" + "

Status - sort by status first of all.

" + "

Alphabetic order - ignore status.

")); + QWhatsThis::add(d->cb_groupOrderType, + tr("

Set order of sorting group items in roster:

" + "

Status - sort by status first of all.

" + "

Alphabetic order - ignore status.

")); + QWhatsThis::add(d->cb_contactOrderType, + tr("

Set order of sorting contact items in roster:

" + "

Status - sort by status first of all.

" + "

Alphabetic order - ignore status.

")); QWhatsThis::add(d->ck_useStatusLinebreak, tr("Use new lines characters in shown statuses (shown statuses will be a bit bigger with this).")); @@ -69,6 +82,9 @@ opt->scrollTo = d->ck_scrollTo->isChecked(); opt->clStIndicator = d->ck_statusIndicator->isChecked(); opt->clIconsAtTop = d->ck_iconsAtTop->isChecked(); + opt->rosterAccountSortStyle = static_cast(d->cb_accountOrderType->currentItem()); + opt->rosterGroupSortStyle = static_cast(d->cb_groupOrderType->currentItem()); + opt->rosterContactSortStyle = static_cast(d->cb_contactOrderType->currentItem()); opt->smSingleLine = d->ck_useSingleLineStatus->isChecked(); opt->useStatusLinebreak = d->ck_useStatusLinebreak->isChecked(); opt->clTransportStatus = d->ck_transportStatus->isChecked(); @@ -90,6 +106,9 @@ d->ck_scrollTo->setChecked( opt->scrollTo ); d->ck_statusIndicator->setChecked( opt->clStIndicator ); d->ck_iconsAtTop->setChecked( opt->clIconsAtTop ); + d->cb_accountOrderType->setCurrentItem ( static_cast (opt->rosterAccountSortStyle) ); + d->cb_groupOrderType->setCurrentItem ( static_cast (opt->rosterGroupSortStyle) ); + d->cb_contactOrderType->setCurrentItem ( static_cast (opt->rosterContactSortStyle) ); d->ck_useSingleLineStatus->setChecked( opt->smSingleLine ); d->ck_useStatusLinebreak->setChecked( opt->useStatusLinebreak ); d->ck_transportStatus->setChecked( opt->clTransportStatus ); diff --exclude='*orig' -Naur psi-0.10-test3-orig/src/options/opt_roster-ui.ui psi-0.10-test3/src/options/opt_roster-ui.ui --- psi-0.10-test3-orig/src/options/opt_roster-ui.ui 2005-12-17 14:51:18.000000000 +0000 +++ psi-0.10-test3/src/options/opt_roster-ui.ui 2005-12-17 15:42:35.000000000 +0000 @@ -204,6 +204,75 @@ + + + TextLabel3 + + + Sort accounts by: + + + + + + Alphabetic order + + + + + Rank order + + + + cb_accountOrderType + + + + + TextLabel4 + + + Sort groups by: + + + + + + Alphabetic order + + + + + Rank + + + + cb_groupOrderType + + + + + TextLabel5 + + + Sort contacts by: + + + + + + Status + + + + + Alphabetic order + + + + cb_contactOrderType + +