Boss Dougie Freedman said: "His quality on the ball will help the squad. He brings a desire to do well.
"I want players who want to come here. Gary expressed a real strong interest."
Freedman added: "He said no to a few other clubs. I think Leeds were interested but he knocked them back to come to a club where he is loved and wanted."