Exemplo n.º 1
0
HFWebEngineProfile::HFWebEngineProfile(QObject* parent) :
    QQuickWebEngineProfile(parent)
{
    setStorageName(QML_WEB_ENGINE_STORAGE_NAME);

    // we use the HFWebEngineRequestInterceptor to make sure that web requests are authenticated for the interface user
    auto requestInterceptor = new HFWebEngineRequestInterceptor(this);
    setRequestInterceptor(requestInterceptor);
}
Exemplo n.º 2
0
HFTabletWebEngineProfile::HFTabletWebEngineProfile(QObject* parent) : QQuickWebEngineProfile(parent) {

    static const QString WEB_ENGINE_USER_AGENT = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36";

    setHttpUserAgent(WEB_ENGINE_USER_AGENT);
    setStorageName(QML_WEB_ENGINE_NAME);

    auto requestInterceptor = new HFTabletWebEngineRequestInterceptor(this);
    setRequestInterceptor(requestInterceptor);
}
//! MetadataItemPropertiesFrame class
MetadataItemPropertiesFrame::MetadataItemPropertiesFrame(wxWindow* parent,
        MetadataItem* object)
    : BaseFrame(parent, wxID_ANY, wxEmptyString)
{
    // we need to store this right now, since we might lose the object later
    setStorageName(object);

    wxStatusBar* sb = CreateStatusBar();

    DatabasePtr db = object->getDatabase();
    if (db)  // server property page doesn't have a database, so don't crash
        sb->SetStatusText(db->getConnectionInfoString());
    else
        sb->SetStatusText(object->getName_());

    if (db && config().get("linksOpenInTabs", true))
    {
        SetIcon(wxArtProvider::GetIcon(ART_DatabaseConnected,
                                       wxART_FRAME_ICON));
        databaseNameM = db->getName_();
    }
    else  // when linksOpenInTabs, only the server node
    {
        SetIcon(getMetadataItemIcon(object->getType()));
    }

    notebookM = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition,
                                  wxDefaultSize, wxAUI_NB_DEFAULT_STYLE | wxAUI_NB_WINDOWLIST_BUTTON
                                  | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER);

    auiManagerM.SetManagedWindow(this);
    auiManagerM.AddPane(notebookM,
                        wxAuiPaneInfo().CenterPane().PaneBorder(false));
    auiManagerM.Update();

    Connect(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEventHandler(
                MetadataItemPropertiesFrame::OnNotebookPageClose), NULL, this);
    Connect(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler(
                MetadataItemPropertiesFrame::OnNotebookPageChanged), NULL, this);
}