예제 #1
0
파일: sftp.cpp 프로젝트: Jactry/codelite
void SFTP::OnReplaceInFiles(clFileSystemEvent& e)
{
    e.Skip();
    const wxArrayString& files = e.GetStrings();
    for(size_t i = 0; i < files.size(); ++i) {
        DoFileSaved(files.Item(i));
    }
}
예제 #2
0
void PhpPlugin::OnReplaceInFiles(clFileSystemEvent& e)
{
    e.Skip();
    if(PHPWorkspace::Get()->IsOpen()) {
        const wxArrayString& files = e.GetStrings();
        for(size_t i = 0; i < files.size(); ++i) {
            DoSyncFileWithRemote(files.Item(i));
        }
    }
}
예제 #3
0
void PhpSFTPHandler::OnReplaceInFiles(clFileSystemEvent& e)
{
    e.Skip();
    if(!PHPWorkspace::Get()->IsOpen()) { return; }
    
    SSHWorkspaceSettings settings;
    settings.Load();
    
    if(!EnsureAccountExists(settings)) { return; }
    
    const wxArrayString& files = e.GetStrings();
    for(size_t i = 0; i < files.size(); ++i) {
        DoSyncFileWithRemote(files.Item(i));
    }
}
예제 #4
0
void PhpPlugin::OnFileSysetmUpdated(clFileSystemEvent& event)
{
    event.Skip();
    if(PHPWorkspace::Get()->IsOpen()) {
        // Sync the workspace view, notify the view when its done
        PHPWorkspace::Get()->SyncWithFileSystemAsync(m_workspaceView);
    }
}
예제 #5
0
파일: php.cpp 프로젝트: 292388900/codelite
void PhpPlugin::OnFileSysetmUpdated(clFileSystemEvent& event)
{
    event.Skip();
    if(PHPWorkspace::Get()->IsOpen()) {
        PHPWorkspace::Get()->SyncWithFileSystem();
        m_workspaceView->LoadWorkspace();
    }
}
예제 #6
0
void PhpSFTPHandler::OnFileRenamed(clFileSystemEvent& e)
{
    e.Skip();
    if(!PHPWorkspace::Get()->IsOpen()) { return; }

    SSHWorkspaceSettings settings;
    settings.Load();
    
    if(!EnsureAccountExists(settings)) { return; }
    
    wxString oldPath = GetRemotePath(settings, e.GetPath());
    wxString newPath = GetRemotePath(settings, e.GetNewpath());
    if(oldPath.IsEmpty() || newPath.IsEmpty()) { return; }

    clDEBUG() << "PHP SFTP: Renaming:" << oldPath << "->" << newPath;

    // Fire this event, if the sftp plugin is ON, it will handle it
    clSFTPEvent eventRename(wxEVT_SFTP_RENAME_FILE);
    eventRename.SetAccount(settings.GetAccount());
    eventRename.SetRemoteFile(oldPath);
    eventRename.SetNewRemoteFile(newPath);
    EventNotifier::Get()->AddPendingEvent(eventRename);
}
예제 #7
0
void PhpSFTPHandler::OnFileDeleted(clFileSystemEvent& e)
{
    e.Skip();
    if(!PHPWorkspace::Get()->IsOpen()) { return; }

    SSHWorkspaceSettings settings;
    settings.Load();
    
    if(!EnsureAccountExists(settings)) { return; }
    
    const wxArrayString& paths = e.GetPaths();
    if(paths.IsEmpty()) { return; }
    
    for(size_t i = 0; i < paths.size(); ++i) {
        wxString remotePath = GetRemotePath(settings, paths.Item(i));
        if(remotePath.IsEmpty()) { return; }
        
        // Fire this event, if the sftp plugin is ON, it will handle it
        clSFTPEvent eventDelete(wxEVT_SFTP_DELETE_FILE);
        eventDelete.SetAccount(settings.GetAccount());
        eventDelete.SetRemoteFile(remotePath);
        EventNotifier::Get()->AddPendingEvent(eventDelete);
    }
}