Ejemplo n.º 1
0
int DownloadListCtrl::CompareOneCrit( DataType u1, DataType u2, int col, int dir ) const
{
    switch ( col ) {
        case 0: return dir * compareSimple(boost::to_lower_copy(std::string(u1.name.mb_str())), boost::to_lower_copy(std::string(u2.name.mb_str())));
        //case 1: return dir * compareSimple( u1.numcopies, u2.numcopies );
		//case 2: return dir * compareSimple( u1.downloadstatus, u2.downloadstatus );
		case 3: return dir * compareSimple( u1.progress, u2.progress );
		//case 4: return dir * compareSimple( u1.inspeed, u2.inspeed );
		//case 5: return dir * compareSimple( u1.eta, u2.eta );
		case 6: return dir * compareSimple( u1.size, u2.size );
        default: return 0;
    }
}
Ejemplo n.º 2
0
int PlaybackListCtrl<PlaybackType>::CompareOneCrit( DataType u1, DataType u2, int col, int dir ) const
{
    switch ( col ) {
        case 0: return dir * compareSimple( u1->date, u2->date );
        case 1: return dir * u1->battle.GetHostModName().CmpNoCase( u2->battle.GetHostModName() );
        case 2: return dir * u1->battle.GetHostMapName().CmpNoCase( u2->battle.GetHostMapName() );
        case 3: return dir * compareSimple( u1->battle.GetNumUsers() - u1->battle.GetSpectators(), u2->battle.GetNumUsers() - u2->battle.GetSpectators() );
        case 4: return dir * compareSimple( u1->duration,u2->duration );
        case 5: return dir * u1->SpringVersion.CmpNoCase( u2->SpringVersion ) ;
        case 6: return dir * compareSimple( u1->size, u2->size ) ;
        case 7: return dir * u1->Filename.AfterLast( wxFileName::GetPathSeparator() ).CmpNoCase( u2->Filename.AfterLast( wxFileName::GetPathSeparator() ) );
        default: return 0;
    }
}
Ejemplo n.º 3
0
int ChannelListctrl::CompareOneCrit( DataType u1, DataType u2, int col, int dir ) const
{
    switch ( col ) {
        case 0: return dir * u1.name.CmpNoCase( u2.name );
        case 1: return dir * compareSimple( u1.usercount, u2.usercount );
        case 2: return dir * u1.topic.CmpNoCase( u2.topic );
        default: return 0;
    }
}
Ejemplo n.º 4
0
int BattleListCtrl::ComparePlayer( DataType u1, DataType u2 )
{
    const IBattle& battle1 = *u1;
    const IBattle& battle2 = *u2;

    int n1 = battle1.GetNumUsers() - battle1.GetSpectators();
    int n2 = battle2.GetNumUsers() - battle2.GetSpectators();
    return compareSimple( n1, n2 );
}
Ejemplo n.º 5
0
int BattleroomListCtrl::CompareOneCrit(DataType u1, DataType u2, int col, int dir) const
{
	if ( col == m_status_column_index ) return dir * CompareStatus( u1, u2, m_battle );
	if ( col == m_ingame_column_index ) return dir * CompareLobbyStatus( u1, u2 );
	if ( col == m_faction_column_index ) return dir * CompareSide( u1, u2 );
	if ( col == m_colour_column_index ) return dir * CompareColor( u1, u2 );
	if ( col == m_country_column_index ) return dir * compareSimple( u1, u2 );
	if ( col == m_rank_column_index ) return dir * CompareRank( u1, u2 );
	if ( col == m_nick_column_index ) return dir * u1->GetNick().CmpNoCase( u2->GetNick() );
	if ( col == m_team_column_index ) return dir * CompareTeam( u1, u2 );
	if ( col == m_ally_column_index ) return dir * CompareAlly( u1, u2 );
	if ( col == m_resourcebonus_column_index ) return dir * CompareHandicap( u1, u2 );
	return 0;
}
Ejemplo n.º 6
0
int NickListCtrl::CompareOneCrit(DataType u1, DataType u2, int col, int dir) const
{
	if (!(u1 && u2))
		return 0;
	switch (col) {
		case 0:
			return dir * CompareUserStatus(u1, u2);
		case 1:
			return dir * TowxString(u2->GetCountry()).CmpNoCase(TowxString(u1->GetCountry()));
		case 2:
			return dir * compareSimple(TowxString(u2->GetStatus().rank), TowxString(u1->GetStatus().rank));
		case 3:
			return dir * TowxString(u2->GetNick()).CmpNoCase(TowxString(u1->GetNick()));
		default:
			return 0;
	}
}
Ejemplo n.º 7
0
int TorrentListCtrl::CompareOneCrit( DataType u1, DataType u2, int col, int dir ) const
{
    switch ( col ) {
        case 0: return dir * u1.name.CmpNoCase( u2.name );
        case 1: return dir * compareSimple( u1.numcopies, u2.numcopies );
		case 2: return dir * compareSimple( u1.downloadstatus, u2.downloadstatus );
		case 3: return dir * compareSimple( u1.progress, u2.progress );
		case 4: return dir * compareSimple( u1.inspeed, u2.inspeed );
		case 5: return dir * compareSimple( u1.eta, u2.eta );
		case 6: return dir * compareSimple( u1.filesize, u2.filesize );
        default: return 0;
    }
}