예제 #1
0
파일: PreviewDlg.cpp 프로젝트: baguatuzi/e
void PreviewDlg::OnIdle(wxIdleEvent& WXUNUSED(event)) {
	if (!IsShown() || m_idleTimer.Time() < 100) return;

	// Check if we have changed source document
	EditorCtrl* activeEditor = m_parent.GetEditorCtrl();
	if (!activeEditor) return;

	if (m_editorCtrl != activeEditor) {
		m_editorCtrl = activeEditor;

		// Always reload on new source
		if (!m_pinnedEditor) {
			UpdateBrowser(cxUPDATE_RELOAD);
			return;
		}
	}

	// No need to refresh if user has clicked away from preview page
	if (!m_isOnPreview) return;

	// Check if document has changed
	if (m_pinnedEditor) {
		if (((m_pinnedEditor == m_editorCtrl || m_editorCtrl->GetName().EndsWith(wxT(".css")))
			&& m_editorCtrl->GetChangeToken() != m_editorChangeToken)
			|| m_editorCtrl->IsSavedForPreview() ) {

			UpdateBrowser(cxUPDATE_REFRESH);
		}
	}
	else if (m_editorCtrl->GetChangeToken() != m_editorChangeToken) {
		UpdateBrowser(cxUPDATE_REFRESH);
	}
}
예제 #2
0
파일: PreviewDlg.cpp 프로젝트: baguatuzi/e
void PreviewDlg::OnButtonReload(wxCommandEvent& WXUNUSED(event)) {
	if (m_pipeCheck->GetValue()) {
		m_pipeCmd = m_cmdText->GetValue();
	}
	else m_pipeCmd.clear();

	UpdateBrowser(cxUPDATE_RELOAD);
}
예제 #3
0
파일: PreviewDlg.cpp 프로젝트: baguatuzi/e
void PreviewDlg::OnPipeCmdEnter(wxCommandEvent& WXUNUSED(event)) {
	if (m_pipeCheck->IsChecked()) {
		m_pipeCmd = m_cmdText->GetValue();
	}
	else m_pipeCmd.clear();

	UpdateBrowser(cxUPDATE_REFRESH);
}
예제 #4
0
파일: PreviewDlg.cpp 프로젝트: baguatuzi/e
void PreviewDlg::OnDoPipe(wxCommandEvent& event) {
	if (event.IsChecked()) {
		m_pipeCmd = m_cmdText->GetValue();
	}
	else m_pipeCmd.clear();

	UpdateBrowser(cxUPDATE_REFRESH);
}
예제 #5
0
void BrowserSource::UpdateSettings(obs_data_t *settings)
{
	isLocalFile = obs_data_get_bool(settings, "is_local_file");
	url = obs_data_get_string(settings, isLocalFile ? "local_file" : "url");
	css = obs_data_get_string(settings, "css");
	width = (uint32_t)obs_data_get_int(settings, "width");
	height = (uint32_t)obs_data_get_int(settings, "height");
	fps = (uint32_t)obs_data_get_int(settings, "fps");
	shutdown = obs_data_get_bool(settings, "shutdown");

	UpdateBrowser();
}
예제 #6
0
파일: PreviewDlg.cpp 프로젝트: baguatuzi/e
void PreviewDlg::OnLocationEnter(wxCommandEvent& WXUNUSED(event)) {
	const wxString location = m_locationText->GetValue();
	if (location.empty()) return;

	if (location == m_uncPath) {
		UpdateBrowser(cxUPDATE_RELOAD);
	}
	else {
#ifdef FEAT_BROWSER
		m_browser->LoadUrl(location, wxEmptyString, true);
#endif
	}
}
예제 #7
0
파일: PreviewDlg.cpp 프로젝트: baguatuzi/e
void PreviewDlg::OnButtonPin(wxCommandEvent& WXUNUSED(event)) {
	if (m_pinnedEditor) {
		m_pinnedEditor = NULL;
		m_pinButton->SetBitmapLabel(wxBitmap(pin1_xpm));
		m_pinButton->SetBitmapHover(wxBitmap(pin1_over_xpm));

		// Remove temp preview files
		if (!m_tempCssPath.empty() && wxFileExists(m_tempCssPath)) {
			wxRemoveFile(m_tempCssPath);
			m_tempCssPath.clear();
		}

		UpdateBrowser(cxUPDATE_REFRESH);
	}
	else {
		m_pinnedEditor = m_parent.GetEditorCtrl();
		m_pinButton->SetBitmapLabel(wxBitmap(pin2_xpm));
		m_pinButton->SetBitmapHover(wxBitmap(pin2_over_xpm));
	}
}