Skip to content

Commit

Permalink
Client UI: Autoselect first server from master
Browse files Browse the repository at this point in the history
After the list has been retrieved, the first found server
is selected in the list.
  • Loading branch information
skyjake committed Aug 8, 2011
1 parent 2f29d8f commit da66af3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions doomsday/engine/portable/src/ui_mpi.c
Expand Up @@ -338,8 +338,7 @@ void MPIUpdateServerInfo(ui_object_t *ob)
str, myCrc);

// Show IWAD warning?
if(!
(lst_found.count >= 1 && lst_found.selection >= 0 &&
if(!(lst_found.count >= 1 && lst_found.selection >= 0 &&
lstit_found[lst_found.selection].data != -1 &&
lstit_found[lst_found.selection].data != (int) myCrc))
{
Expand Down Expand Up @@ -507,6 +506,10 @@ void MPIUpdateServerList(void)
UI_FlagGroup(ob_client, UIG_CONNECT, UIF_DISABLED, !k);
}

// Auto-select.
if(lst_found.selection < 0 && lst_found.count)
lst_found.selection = 0;

// Make sure the current selection isn't past the end of the list.
if(lst_found.selection >= lst_found.count)
lst_found.selection = -1;
Expand Down Expand Up @@ -559,7 +562,6 @@ void MPIRetrieveServersFromMaster()
// Get the list.
N_MAPost(MAC_REQUEST);
N_MAPost(MAC_WAIT);

}

void MPIRetrieve(ui_object_t *ob)
Expand Down

0 comments on commit da66af3

Please sign in to comment.