Reorganized layout and appearance of rooms list page.
Creating a new room uses a dialog prompt for the room name, which is preset to whatever your last room name was.
Removed dotted rectangle around selected cell in rooms list.
Removed bug where gamecfgwidget would be in master mode when joining a game as a slave.
Can now join selected room when return is pressed. Can also move room selection while room search box has focus.
module HandlerUtils whereimport Control.Monad.Readerimport qualified Data.ByteString.Char8 as Bimport Data.Listimport RoomsAndClientsimport CoreTypesimport ActionsthisClient :: Reader (ClientIndex, IRnC) ClientInfothisClient = do (ci, rnc) <- ask return $ rnc `client` cithisRoom :: Reader (ClientIndex, IRnC) RoomInfothisRoom = do (ci, rnc) <- ask let ri = clientRoom rnc ci return $ rnc `room` riclientNick :: Reader (ClientIndex, IRnC) B.ByteStringclientNick = liftM nick thisClientroomOthersChans :: Reader (ClientIndex, IRnC) [ClientChan]roomOthersChans = do (ci, rnc) <- ask let ri = clientRoom rnc ci return $ map (sendChan . client rnc) $ filter (/= ci) (roomClients rnc ri)roomSameClanChans :: Reader (ClientIndex, IRnC) [ClientChan]roomSameClanChans = do (ci, rnc) <- ask let ri = clientRoom rnc ci let otherRoomClients = map (client rnc) . filter (/= ci) $ roomClients rnc ri let cl = rnc `client` ci let sameClanClients = Prelude.filter (\c -> clientClan c == clientClan cl) otherRoomClients return $ map sendChan sameClanClientsroomClientsChans :: Reader (ClientIndex, IRnC) [ClientChan]roomClientsChans = do (ci, rnc) <- ask let ri = clientRoom rnc ci return $ map (sendChan . client rnc) (roomClients rnc ri)thisClientChans :: Reader (ClientIndex, IRnC) [ClientChan]thisClientChans = do (ci, rnc) <- ask return [sendChan (rnc `client` ci)]sameProtoChans :: Reader (ClientIndex, IRnC) [ClientChan]sameProtoChans = do (ci, rnc) <- ask let p = clientProto (rnc `client` ci) return . map sendChan . filter (\c -> clientProto c == p) . map (client rnc) $ allClients rncanswerClient :: [B.ByteString] -> Reader (ClientIndex, IRnC) [Action]answerClient msg = liftM ((: []) . flip AnswerClients msg) thisClientChansallRoomInfos :: Reader (a, IRnC) [RoomInfo]allRoomInfos = liftM ((\irnc -> map (room irnc) $ allRooms irnc) . snd) askclientByNick :: B.ByteString -> Reader (ClientIndex, IRnC) (Maybe ClientIndex)clientByNick n = do (_, rnc) <- ask let allClientIDs = allClients rnc return $ find (\clId -> n == nick (client rnc clId)) allClientIDs