Welcome to the boards.
I agree with atchoum that your current itinerary is pretty zig-zaggy, which tends to waste travel time. If you have to fly in and out of the same city, then a vaguely circular route is generally an efficient choice. Spain is kinda out of the way, but if you went from western France down into Spain and then back out along the southern French coast and into Italy you might find that a little less time consuming.
A good tool for working out the times and distances involved for the actual train journeys is the German national rail site, www.diebahn.de
, which has schedule info throughout most of Europe, and has an English icon if your German isn't so hot!
I'm a big fan of Eastern Europe, and Gdansk is one of my favourite cities ever, so I'm always a proponent of fitting it in, but it is good to know in advance that Poland is a fairly substantial country, and it takes a good long time to get from Krakow to Gdansk. If you can find an overnight train, that would be a good option to save you some valuable time. I've been to Krakow twice, about 4 days each time, and never feel like it's long enough, that city has SOOO much to see.
A day for Vimy Ridge is good - it's a bit of a haul getting there - I walked for what seemed like hours through the woods to get there, and then spent the whole rest of the day there. Loved it - in fact, I'm thinking about taking my kids there this year for Remembrance Day. It's either there or Verdun (my hometown's sister city), I think.
I don't know when you actually plan to do this trip, but if it's in winter, you might want to factor in some bad weather delays here and there. Usually it takes a lot to stop the trains from running, but if you're planning on going through mountain passes, a heavy snow or landslide might mess with your schedule a little. I'm not suggesting you don't travel in winter (we are crazy and go to places like Sweden, Denmark and Estonia in the depths of winter) but it is good to consider these things in advance.
Hope that's a bit helpful, fire away more questions as needed!