1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2025-01-10 05:08:18 -05:00

Disable menu items that cannot be used while disconnected

This commit is contained in:
Sebastian Kaspari 2010-04-12 00:55:34 +02:00
parent e6411b4747
commit a79794ba1d

View File

@ -225,6 +225,19 @@ public class ConversationActivity extends Activity implements ServiceConnection,
return true; return true;
} }
/**
* On prepare options menu
*/
@Override
public boolean onPrepareOptionsMenu(Menu menu)
{
menu.getItem(0).setEnabled(server.isConnected()); // join
menu.getItem(1).setEnabled(server.isConnected()); // users
menu.getItem(2).setEnabled(server.isConnected()); // close
return true;
}
/** /**
* On menu item selected * On menu item selected
*/ */