예제 #1
0
LRESULT MsgViewConfigNotify(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam)
{
  HWND hwndPSheet = ((NMHDR FAR *) lparam)->hwndFrom;

  switch (((NMHDR FAR *) lparam)->code) {
  case PSN_APPLY:
    if (ViewConfigImport(hdlg)) {
      SendMessage(hwndPSheet, PSM_UNCHANGED, (WPARAM)hdlg, 0);
      SetWindowLong(hwndPSheet, DWL_MSGRESULT, PSNRET_NOERROR);
      UpdateConfiguration();
    } else
      SetWindowLong(hwndPSheet, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE);
    break;
  case PSN_HELP:            
    {
      /* char szBuf[PATH_MAX];	/* buffer for name of help file */
      /* Display help for the View Page options. */
    }
    break;
  case PSN_KILLACTIVE:
    if (ViewConfigValidate(hdlg)) {
      SetWindowLong(hwndPSheet, DWL_MSGRESULT, TRUE);
    }
    else {
      SetWindowLong(hwndPSheet, DWL_MSGRESULT, FALSE);
    }
    break;
  case PSN_QUERYCANCEL:
    /* Accept cancelation */
    break;
  default:
    break;
  }
  return 0;
}
// ---------------------------------------------------------------------------
// Start download
// ---------------------------------------------------------------------------
//	
TInt CCatalogsHttpTransaction::Start( TResumeStartInformation /*aResumeOrigin*/ )
    {
    DLTRACEIN(( "" ));    
    
    if ( !iEncodedUri || !iEncodedUri->Length() ) 
        {
        DLTRACEOUT(( "No URI, return KErrNotReady" ));
        return KErrNotReady;
        }

    DASSERT( iConfig );
    
    // Update the member variable
    iObserver = iConfig->Observer();
    
    if ( !iObserver ) 
        {
        DLTRACEOUT(( "iObserver = NULL, return KErrNotReady" ));
        return KErrNotReady;
        }
    
    TInt err = KErrNone;
    if ( iState.iOperationState == ECatalogsHttpOpCreated 
        || iState.iOperationState == ECatalogsHttpOpQueued )
        {        
        UpdateConfiguration();
        
        TInt err = iOwner.StartOperation( this );

        if ( err == KErrNone ) 
            {
            TRAP( err, DoStartL() );
            }
        else if ( err == KCatalogsHttpOperationQueued ) 
            {
            DLTRACE(( "Transaction queued" ));
            err = KErrNone;
            
            // Set as queued and notify observer if any
            iState.iOperationState = ECatalogsHttpOpQueued;            
            if ( iObserver ) 
                {
                // Start errors are returned so no NotifyObserver
                TRAP( err, iObserver->HandleHttpEventL( *this, iState ) );
                }
            }
        }
    DLTRACEOUT(("err: %d", err));
    return err;
    }
예제 #3
0
void FarPlugin::Create()
{
    InitLang();

    if (!dialogs.Load(GetDLLPath() + L"\\resource\\dialogs.objd"))
    {
        FWError(L"Could not load dialogs.objd");
        exit(0);
    }
    InitOptions();
    LoadOptions();

    descs.AddString(L"Descript.ion");
    descs.AddString(L"Files.bbs");
    UpdateConfiguration();
}
예제 #4
0
/** Constructor
  * \param parent    a pointer to the parent window
  * \param title     the title which will appear in the tab
  * \param bitmap    a pointer to the Bitmap to display. Can be NULL
  * \param sFileName the filename associated to the editor. Can be empty
  */
XPMEditorBase::XPMEditorBase(wxWindow* parent, const wxString& title,wxImage *img, wxString sFileName, wxBitmapType bt)
    :EditorBase(parent,title)
{
    //constructor
    Freeze();

    //initialisation code
    m_bModified = false;
    m_bReadOnly = false;
    SetFilename(sFileName);
    if (m_Filename == wxEmptyString) m_bIsFileNameOK = false; else m_bIsFileNameOK = true;

    m_DrawArea = new XPMEditorPanel(this);

    //project file
    m_pProjectFile = NULL;

    //sizing & refreshing
    wxSize s;
    s = GetClientSize();
    m_DrawArea->SetSize(0,0,s.GetWidth(),s.GetHeight(), 0);
    Refresh();
    Update();

    Connect(wxEVT_SIZE,(wxObjectEventFunction)&XPMEditorBase::OnResize);

    //editors set
    m_AllEditors.insert( this );

    //get the configuration
    UpdateConfiguration();
    if (m_DrawArea)
    {
        m_DrawArea->SetImage(img);
        m_DrawArea->SetImageFormat(bt); //default behaviour : autodetection using file extension
    }

    Thaw();

}
예제 #5
0
/*! \class TorcNetwork
 *  \brief Subclass of QNetworkAccessManager for sending network requests and monitoring the network state.
 *
 * \todo Check whether authenticationRequired signal is being emitted.
*/
TorcNetwork::TorcNetwork()
  : QNetworkAccessManager(),
    m_online(false),
    m_manager(new QNetworkConfigurationManager(this))
{
    LOG(VB_GENERAL, LOG_INFO, "Opening network access manager");

    // create settings and establish correct behaviour
    m_networkGroup   = new TorcSettingGroup(gRootSetting, tr("Network"));
    m_networkAllowed = new TorcSetting(m_networkGroup, SETTING_NETWORKALLOWED,
                                       tr("Enable network access"), TorcSetting::Checkbox,
                                       true, QVariant((bool)true));
    m_networkAllowedInbound = new TorcSetting(m_networkAllowed, SETTING_NETWORKALLOWEDINBOUND,
                                       tr("Allow other devices to connect to Torc"), TorcSetting::Checkbox,
                                       true, QVariant((bool)true));
    m_networkAllowedOutbound = new TorcSetting(m_networkAllowed, SETTING_NETWORKALLOWEDOUTBOUND,
                                       tr("Allow Torc to connect to other devices"), TorcSetting::Checkbox,
                                       true, QVariant((bool)true));

    m_networkAllowed->SetActive(gLocalContext->FlagIsSet(Torc::Network));
    m_networkAllowedInbound->SetActiveThreshold(2);
    m_networkAllowedOutbound->SetActiveThreshold(2);
    if (m_networkAllowed->IsActive())
    {
        m_networkAllowedInbound->SetActive(true);
        m_networkAllowedOutbound->SetActive(true);
    }
    if (m_networkAllowed->GetValue().toBool())
    {
        m_networkAllowedInbound->SetActive(true);
        m_networkAllowedOutbound->SetActive(true);
    }

    connect(m_networkAllowed, SIGNAL(ValueChanged(bool)),  this,                     SLOT(SetAllowed(bool)));
    connect(m_networkAllowed, SIGNAL(ValueChanged(bool)),  m_networkAllowedInbound,  SLOT(SetActive(bool)));
    connect(m_networkAllowed, SIGNAL(ActiveChanged(bool)), m_networkAllowedInbound,  SLOT(SetActive(bool)));
    connect(m_networkAllowed, SIGNAL(ValueChanged(bool)),  m_networkAllowedOutbound, SLOT(SetActive(bool)));
    connect(m_networkAllowed, SIGNAL(ActiveChanged(bool)), m_networkAllowedOutbound, SLOT(SetActive(bool)));

    connect(m_manager, SIGNAL(configurationAdded(const QNetworkConfiguration&)),
            this,      SLOT(ConfigurationAdded(const QNetworkConfiguration&)));
    connect(m_manager, SIGNAL(configurationChanged(const QNetworkConfiguration&)),
            this,      SLOT(ConfigurationChanged(const QNetworkConfiguration&)));
    connect(m_manager, SIGNAL(configurationRemoved(const QNetworkConfiguration&)),
            this,      SLOT(ConfigurationRemoved(const QNetworkConfiguration&)));
    connect(m_manager, SIGNAL(onlineStateChanged(bool)),
            this,      SLOT(OnlineStateChanged(bool)));
    connect(m_manager, SIGNAL(updateCompleted()),
            this,      SLOT(UpdateCompleted()));

    connect(this, SIGNAL(NewRequest(TorcNetworkRequest*)),    this, SLOT(GetSafe(TorcNetworkRequest*)));
    connect(this, SIGNAL(CancelRequest(TorcNetworkRequest*)), this, SLOT(CancelSafe(TorcNetworkRequest*)));
    connect(this, SIGNAL(PokeRequest(TorcNetworkRequest*)),   this, SLOT(PokeSafe(TorcNetworkRequest*)));
    connect(this, SIGNAL(NewAsyncRequest(TorcNetworkRequest*,QObject*)), this, SLOT(GetAsynchronousSafe(TorcNetworkRequest*,QObject*)));

    // direct connection for authentication requests
    connect(this, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(Authenticate(QNetworkReply*,QAuthenticator*)), Qt::DirectConnection);

    // hide the network group if there is nothing to change
    m_networkGroup->SetActive(gLocalContext->FlagIsSet(Torc::Network));

    // set initial state
    setConfiguration(m_manager->defaultConfiguration());
    SetAllowed(m_networkAllowed->IsActive() && m_networkAllowed->GetValue().toBool());
    UpdateConfiguration(true);
}