QTfrontend/ui/widget/about.cpp
changeset 12218 b532cc42ebd4
parent 11830 6078cf0e4944
child 12219 072ece492a65
equal deleted inserted replaced
12217:a6cd48b8ef61 12218:b532cc42ebd4
    92     mainLayout->addWidget(lbl2, 1, 1);
    92     mainLayout->addWidget(lbl2, 1, 1);
    93 
    93 
    94     /* Library information */
    94     /* Library information */
    95 
    95 
    96     QString libinfo = "<style type=text/css>a:link { color: #FFFF6E; }</style>";
    96     QString libinfo = "<style type=text/css>a:link { color: #FFFF6E; }</style>";
       
    97     libinfo.append(QString(tr("Dependency versions:") + QString("<br>")));
    97 
    98 
    98 #ifdef __GNUC__
    99 #ifdef __GNUC__
    99     libinfo.append(QString("<a href=\"http://gcc.gnu.org\">GCC</a> %1<br>").arg(__VERSION__));
   100     libinfo.append(QString(tr("<a href=\"http://gcc.gnu.org\">GCC</a>: %1")).arg(__VERSION__));
       
   101     libinfo.append(QString("<br>"));
   100 #else
   102 #else
   101     libinfo.append(QString(tr("Unknown Compiler")).arg(__VERSION__) + QString("<br>"));
   103     libinfo.append(QString(tr("Unknown Compiler")).arg(__VERSION__) + QString("<br>"));
   102 #endif
   104 #endif
   103 
   105 
   104     const SDL_version *sdl_ver;
   106     const SDL_version *sdl_ver;
   105     SDL_version sdl_version;
   107     SDL_version sdl_version;
   106     SDL_GetVersion(&sdl_version);
   108     SDL_GetVersion(&sdl_version);
   107     sdl_ver = &sdl_version;
   109     sdl_ver = &sdl_version;
   108     libinfo.append(QString("<a href=\"http://www.libsdl.org/\">SDL2</a> version: %1.%2.%3<br>")
   110     libinfo.append(QString(tr("<a href=\"http://www.libsdl.org/\">SDL2</a>: %1.%2.%3"))
   109         .arg(sdl_ver->major)
   111         .arg(sdl_ver->major)
   110         .arg(sdl_ver->minor)
   112         .arg(sdl_ver->minor)
   111         .arg(sdl_ver->patch));
   113         .arg(sdl_ver->patch));
       
   114     libinfo.append(QString("<br>"));
   112 
   115 
   113     const SDL_version *sdlmixer_ver = Mix_Linked_Version();
   116     const SDL_version *sdlmixer_ver = Mix_Linked_Version();
   114     libinfo.append(QString("<a href=\"http://www.libsdl.org/\">SDL2_mixer</a> version: %1.%2.%3<br>")
   117     libinfo.append(QString(tr("<a href=\"http://www.libsdl.org/\">SDL2_mixer</a>: %1.%2.%3"))
   115         .arg(sdlmixer_ver->major)
   118         .arg(sdlmixer_ver->major)
   116         .arg(sdlmixer_ver->minor)
   119         .arg(sdlmixer_ver->minor)
   117         .arg(sdlmixer_ver->patch));
   120         .arg(sdlmixer_ver->patch));
       
   121     libinfo.append(QString("<br>"));
   118 
   122 
   119     // the remaining sdl modules used only in engine, so instead of needlessly linking them here
   123     // the remaining sdl modules used only in engine, so instead of needlessly linking them here
   120     // we dynamically call the function returning the linked version
   124     // we dynamically call the function returning the linked version
   121     void *sdlnet_handle = SDL_LoadObject(sopath("SDL_net"));
   125     void *sdlnet_handle = SDL_LoadObject(sopath("SDL_net"));
   122     if (sdlnet_handle != NULL) {
   126     if (sdlnet_handle != NULL) {
   123         SDL_version *(*sdlnet_ver_get)(void) = NULL;
   127         SDL_version *(*sdlnet_ver_get)(void) = NULL;
   124         sdlnet_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlnet_handle, "SDLNet_Linked_Version");
   128         sdlnet_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlnet_handle, "SDLNet_Linked_Version");
   125         if (sdlnet_ver_get != NULL) {
   129         if (sdlnet_ver_get != NULL) {
   126             SDL_version *sdlnet_ver = sdlnet_ver_get();
   130             SDL_version *sdlnet_ver = sdlnet_ver_get();
   127             libinfo.append(QString("<a href=\"http://www.libsdl.org/\">SDL_net</a> version: %1.%2.%3<br>")
   131             libinfo.append(QString(tr("<a href=\"http://www.libsdl.org/\">SDL_net</a>: %1.%2.%3"))
   128                 .arg(sdlnet_ver->major)
   132                 .arg(sdlnet_ver->major)
   129                 .arg(sdlnet_ver->minor)
   133                 .arg(sdlnet_ver->minor)
   130                 .arg(sdlnet_ver->patch));
   134                 .arg(sdlnet_ver->patch));
       
   135             libinfo.append(QString("<br>"));
   131         }
   136         }
   132         SDL_UnloadObject(sdlnet_handle);
   137         SDL_UnloadObject(sdlnet_handle);
   133     }
   138     }
   134 
   139 
   135     void *sdlimage_handle = SDL_LoadObject(sopath("SDL_image"));
   140     void *sdlimage_handle = SDL_LoadObject(sopath("SDL_image"));
   136     if (sdlimage_handle != NULL) {
   141     if (sdlimage_handle != NULL) {
   137         SDL_version *(*sdlimage_ver_get)(void) = NULL;
   142         SDL_version *(*sdlimage_ver_get)(void) = NULL;
   138         sdlimage_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlimage_handle, "IMG_Linked_Version");
   143         sdlimage_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlimage_handle, "IMG_Linked_Version");
   139         if (sdlimage_ver_get != NULL) {
   144         if (sdlimage_ver_get != NULL) {
   140             SDL_version *sdlimage_ver = sdlimage_ver_get();
   145             SDL_version *sdlimage_ver = sdlimage_ver_get();
   141             libinfo.append(QString("<a href=\"http://www.libsdl.org/\">SDL_image</a> version: %1.%2.%3<br>")
   146             libinfo.append(QString(tr("<a href=\"http://www.libsdl.org/\">SDL_image</a>: %1.%2.%3"))
   142                 .arg(sdlimage_ver->major)
   147                 .arg(sdlimage_ver->major)
   143                 .arg(sdlimage_ver->minor)
   148                 .arg(sdlimage_ver->minor)
   144                 .arg(sdlimage_ver->patch));
   149                 .arg(sdlimage_ver->patch));
       
   150             libinfo.append(QString("<br>"));
   145         }
   151         }
   146         SDL_UnloadObject(sdlnet_handle);
   152         SDL_UnloadObject(sdlnet_handle);
   147     }
   153     }
   148 
   154 
   149     void *sdlttf_handle = SDL_LoadObject(sopath("SDL_ttf"));
   155     void *sdlttf_handle = SDL_LoadObject(sopath("SDL_ttf"));
   150     if (sdlttf_handle != NULL) {
   156     if (sdlttf_handle != NULL) {
   151         SDL_version *(*sdlttf_ver_get)(void) = NULL;
   157         SDL_version *(*sdlttf_ver_get)(void) = NULL;
   152         sdlttf_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlttf_handle, "TTF_Linked_Version");
   158         sdlttf_ver_get = (SDL_version *(*)(void)) SDL_LoadFunction(sdlttf_handle, "TTF_Linked_Version");
   153         if (sdlttf_ver_get != NULL) {
   159         if (sdlttf_ver_get != NULL) {
   154             SDL_version *sdlttf_ver = sdlttf_ver_get();
   160             SDL_version *sdlttf_ver = sdlttf_ver_get();
   155             libinfo.append(QString("<a href=\"http://www.libsdl.org/\">SDL_ttf</a> version: %1.%2.%3<br>")
   161             libinfo.append(QString(tr("<a href=\"http://www.libsdl.org/\">SDL_ttf</a>: %1.%2.%3"))
   156                 .arg(sdlttf_ver->major)
   162                 .arg(sdlttf_ver->major)
   157                 .arg(sdlttf_ver->minor)
   163                 .arg(sdlttf_ver->minor)
   158                 .arg(sdlttf_ver->patch));
   164                 .arg(sdlttf_ver->patch));
       
   165             libinfo.append(QString("<br>"));
   159         }
   166         }
   160         SDL_UnloadObject(sdlnet_handle);
   167         SDL_UnloadObject(sdlnet_handle);
   161     }
   168     }
   162 
   169 
   163 
   170 
   164     libinfo.append(QString("<a href=\"http://qt-project.org/\">Qt</a> version: %1<br>").arg(QT_VERSION_STR));
   171     libinfo.append(QString(tr("<a href=\"http://qt-project.org/\">Qt</a>: %1")).arg(QT_VERSION_STR));
       
   172     libinfo.append(QString("<br>"));
   165 
   173 
   166 #ifdef VIDEOREC
   174 #ifdef VIDEOREC
   167     libinfo.append(QString("<a href=\"http://libav.org\">libavcodec</a> version: %1.%2.%3<br>")
   175     libinfo.append(QString(tr("<a href=\"http://libav.org\">libavcodec</a>: %1.%2.%3"))
   168         .arg(LIBAVCODEC_VERSION_MAJOR)
   176         .arg(LIBAVCODEC_VERSION_MAJOR)
   169         .arg(LIBAVCODEC_VERSION_MINOR)
   177         .arg(LIBAVCODEC_VERSION_MINOR)
   170         .arg(LIBAVCODEC_VERSION_MICRO));
   178         .arg(LIBAVCODEC_VERSION_MICRO));
   171     libinfo.append(QString("<a href=\"http://libav.org\">libavformat</a> version: %1.%2.%3<br>")
   179     libinfo.append(QString("<br>"));
       
   180     libinfo.append(QString(tr("<a href=\"http://libav.org\">libavformat</a>: %1.%2.%3"))
   172         .arg(LIBAVFORMAT_VERSION_MAJOR)
   181         .arg(LIBAVFORMAT_VERSION_MAJOR)
   173         .arg(LIBAVFORMAT_VERSION_MINOR)
   182         .arg(LIBAVFORMAT_VERSION_MINOR)
   174         .arg(LIBAVFORMAT_VERSION_MICRO));
   183         .arg(LIBAVFORMAT_VERSION_MICRO));
   175     libinfo.append(QString("<a href=\"http://libav.org\">libavutil</a> version: %1.%2.%3<br>")
   184     libinfo.append(QString("<br>"));
       
   185     libinfo.append(QString(tr("<a href=\"http://libav.org\">libavutil</a>: %1.%2.%3"))
   176         .arg(LIBAVUTIL_VERSION_MAJOR)
   186         .arg(LIBAVUTIL_VERSION_MAJOR)
   177         .arg(LIBAVUTIL_VERSION_MINOR)
   187         .arg(LIBAVUTIL_VERSION_MINOR)
   178         .arg(LIBAVUTIL_VERSION_MICRO));
   188         .arg(LIBAVUTIL_VERSION_MICRO));
   179 #endif
   189     libinfo.append(QString("<br>"));
   180 
   190 #endif
   181     libinfo.append(QString("<a href=\"http://icculus.org/physfs/\">PhysFS</a> version: %1.%2.%3<br>")
   191 
       
   192     libinfo.append(QString(tr("<a href=\"http://icculus.org/physfs/\">PhysFS</a>: %1.%2.%3"))
   182         .arg(PHYSFS_VER_MAJOR)
   193         .arg(PHYSFS_VER_MAJOR)
   183         .arg(PHYSFS_VER_MINOR)
   194         .arg(PHYSFS_VER_MINOR)
   184         .arg(PHYSFS_VER_PATCH));
   195         .arg(PHYSFS_VER_PATCH));
       
   196     libinfo.append(QString("<br>"));
   185 
   197 
   186     // TODO: how to add Lua information?
   198     // TODO: how to add Lua information?
   187 
   199 
   188     QLabel * lblLibInfo = new QLabel();
   200     QLabel * lblLibInfo = new QLabel();
   189     lblLibInfo->setOpenExternalLinks(true);
   201     lblLibInfo->setOpenExternalLinks(true);