Move all GUI specific code to the same if
Move all GUI specific code to the same if

SergiySW/raiblocks,clemahieu/raiblocks,SergiySW/raiblocks,clemahieu/raiblocks,clemahieu/raiblocks,SergiySW/raiblocks,SergiySW/raiblocks,clemahieu/raiblocks,SergiySW/raiblocks,clemahieu/raiblocks,clemahieu/raiblocks