A Ugandan official says a prominent opposition figure facing military trial will be charged before a civilian court instead.