示例#1
0
void PreviewDlg::SaveSettings(CatalystWrapper& cw) const {
	cxLOCK_WRITE(cw)
		catalyst.SetSettingBool(wxT("prvw_showoptions"), m_showOptions->IsChecked());
		catalyst.SetSettingBool(wxT("prvw_dopipe"), m_pipeCheck->IsChecked());
		catalyst.SetSettingString(wxT("prvw_pipecmd"), m_cmdText->GetValue());
	cxENDLOCK
}
示例#2
0
文件: DiffBar.cpp 项目: sapient/e
void DiffBar::SetDiff() {
	// Clean up
	m_matchlist.clear();

	// Get the diff
	DocumentWrapper& doc1 = m_leftEditor->GetDocument();
	DocumentWrapper& doc2 = m_rightEditor->GetDocument();
	cxLOCK_WRITE(m_catalyst)
		Document& d1 = doc1.GetDoc();
		Document& d2 = doc2.GetDoc();
		catalyst.GetDiff(d1, d2, m_matchlist);

		// Set callbacks
		d1.SetChangeCallback(OnLeftDocumentChanged, this);
		d2.SetChangeCallback(OnRightDocumentChanged, this);
	cxENDLOCK

	m_needTransform = true;
}
示例#3
0
void SettingsDlg::OnButtonOk(wxCommandEvent& WXUNUSED(event)) {
	// Check if name & profile pic changed.
	wxString name = m_ctrlUserName->GetLabel();
	cxLOCK_READ(m_catalyst)
		if (name == catalyst.GetUserName(0)) name.clear(); // empty string means no change
	cxENDLOCK

	if (!name.empty() || m_ctUserPic) {
		if (!m_ctUserPic) m_userImage = wxImage(); // make invalid

		cxLOCK_WRITE(m_catalyst)
			catalyst.SetProfile(name, m_userImage);
		cxENDLOCK
	}

	if (m_envPage->VarsChanged()) {
		m_settings.env.clear();
		m_envPage->GetVars(m_settings.env);
	}

	EndModal(wxID_OK);
}