Exemplo n.º 1
0
        void AppInfoPanel::createGui() {
            const wxBitmap appIconImage = IO::loadImageResource("AppIcon.png");
            wxStaticBitmap* appIcon = new wxStaticBitmap(this, wxID_ANY, appIconImage);
            wxStaticText* appName = new wxStaticText(this, wxID_ANY, "TrenchBroom");
            appName->SetFont(appName->GetFont().Larger().Larger().Larger().Larger().Bold());
            wxStaticLine* appLine = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL);
            wxStaticText* appClaim = new wxStaticText(this, wxID_ANY, "Level Editor");
            
            wxString versionStr("Version ");
            versionStr << getBuildVersion() << " " << getBuildChannel();
            
            wxString buildStr("Build ");
            buildStr << getBuildId() << " " << getBuildType();
            
            wxStaticText* version = new wxStaticText(this, wxID_ANY, versionStr);
            wxStaticText* build = new wxStaticText(this, wxID_ANY, buildStr);
#if !defined(_WIN32)
            version->SetFont(version->GetFont().Smaller());
            build->SetFont(build->GetFont().Smaller());
#endif
            version->SetForegroundColour(wxColor(128, 128, 128));
            build->SetForegroundColour(wxColor(128, 128, 128));
            
            SetBackgroundColour(*wxWHITE);
            
            wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
            sizer->Add(appIcon, 0, wxALIGN_CENTER_HORIZONTAL);
            sizer->Add(appName, 0, wxALIGN_CENTER_HORIZONTAL);
            sizer->Add(appLine, 0, wxEXPAND);
            sizer->Add(appClaim, 0, wxALIGN_CENTER_HORIZONTAL);
            sizer->Add(version, 0, wxALIGN_CENTER_HORIZONTAL);
            sizer->Add(build, 0, wxALIGN_CENTER_HORIZONTAL);
            sizer->AddStretchSpacer();
            SetSizerAndFit(sizer);
        }
Exemplo n.º 2
0
CEspApplicationPort::CEspApplicationPort(bool viewcfg) : bindingCount(0), defBinding(-1), viewConfig(viewcfg), rootAuth(false), navWidth(165), navResize(false), navScroll(false)
{
    build_ver = getBuildVersion();

    hxsl = LoadSharedObject(SharedObjectPrefix "xmllib" SharedObjectExtension, true, false);
    if (!hxsl)
        DBGLOG("Loading xmllib shared library failed!");
    else
    {
        getXslProcessor_func xslfactory = (getXslProcessor_func) GetSharedProcedure(hxsl, "getXslProcessor");
        if (!xslfactory)
            DBGLOG("Loading procedure from xmllib shared library failed!");
        else
            xslp.setown(xslfactory());
    }
}
Exemplo n.º 3
0
bool Cws_accountEx::onVerifyUser(IEspContext &context, IEspVerifyUserRequest &req, IEspVerifyUserResponse &resp)
{
    try
    {
        ISecUser* usr = context.queryUser();
        if(!usr || usr->getAuthenticateStatus() != AS_AUTHENTICATED)
        {
            resp.setRetcode(-1);
            return false;
        }

        const char* ver = req.getVersion();
        if (!ver || !*ver)
        {
            throw MakeStringException(ECLWATCH_OLD_CLIENT_VERSION, "Client version not found");
        }

        int minor = 0;
        int major = 0;
        const char* dot1 = strrchr(ver, '.');
        if (!dot1)
            minor = atoi(ver);
        else if (strlen(dot1) > 1)
        {
            minor = atoi(dot1 + 1);
            if(dot1 > ver)
            {
                const char* dot2 = dot1 - 1;

                while(dot2 > ver && *dot2 != '.')
                    dot2--;
                if(*dot2 == '.')
                    dot2++;
                if(dot2 < dot1)
                {
                    StringBuffer majorstr;
                    majorstr.append(dot1 - dot2, dot2);
                    major = atoi(majorstr.str());
                }
            }
        }

        if(major > CUTOFF_MAJOR || (major == CUTOFF_MAJOR && minor >= CUTOFF_MINOR))
        {
            resp.setRetcode(0);
            return true;
        }

        const char* build_ver = getBuildVersion();
        if (build_ver && *build_ver)
            throw MakeStringException(ECLWATCH_OLD_CLIENT_VERSION, "Client version %s (server %s) is out of date.", ver, build_ver);
        else
            throw MakeStringException(ECLWATCH_OLD_CLIENT_VERSION, "Client version %s is out of date.", ver);
    }
    catch(IException* e)
    {
        FORWARDEXCEPTION(context, e, ECLWATCH_INTERNAL_ERROR);
    }

    return true;
}