To make the pickles, thickly slice the cucumber and onion into 3-mm slices, place together in a colander and sprinkle with the salt. Set the colander over a bowl and drain for 2 hours. Taste the cucumber – if it is too salty, rinse thoroughly in cold water and then drain again. Pat dry with paper towels.
Place the remaining pickle ingredients in a saucepan with 75 ml water and bring to the boil, stirring to dissolve the sugar, then simmer for 10 minutes. Add the cucumber and onion and return to the boil. Immediately remove the pan from the heat and ladle the vegetables and liquid into a sterilized 1-litre jar. Seal the jar with a vinegar-safe lid and leave to cool.
To make the toasties, preheat the oven to 190°C/fan 170°C/375°F/Gas 5. In a bowl combine the Gruyère, wine, crème fraîche and some pepper to make a paste. Spread one side of each piece of bread with butter followed by a little mustard and place 2 of the slices mustard side up on a board. Spread half of the cheese paste over the mustard and top with the ham, then the remaining cheese paste. Pop the remaining slices of bread mustard side down over the cheese layer and press firmly together.
Melt the remaining butter in a large ovenproof frying pan over a medium-low heat and, as soon as it melts, add the sandwiches and cook for 1 minute on each side until lightly golden. Transfer the pan to the preheated oven and bake for 10 minutes until all is golden, gooey and yummy. Serve with the pickles and a crisp green salad.