Ejemplo n.º 1
0
bool Configuration::set_windowlevel(const WindowLevel& w) {
	Glib::ustring base = "/apps/aeskulap/presets/windowlevel/"+w.modality+"/"+w.description;

	if(!m_conf_client->dir_exists(base)) {
		m_conf_client->add_dir(base);
	}

	m_conf_client->set(base+"/center", w.center);
	m_conf_client->set(base+"/width", w.width);
	
	return true;
}
Ejemplo n.º 2
0
Configuration::Configuration() {
	if(!m_conf_client) {
		std::cout << "Gnome::Conf::init()" << std::endl;
		Gnome::Conf::init();
		m_conf_client = Gnome::Conf::Client::get_default_client();
	}

	m_conf_client->add_dir("/apps/aeskulap/preferences");
	m_conf_client->add_dir("/apps/aeskulap/presets");
	m_conf_client->add_dir("/apps/aeskulap/presets/windowlevel");

	if(!m_conf_client->dir_exists("/apps/aeskulap/presets/windowlevel/CT")) {
		add_default_presets_ct();
	}
}
Ejemplo n.º 3
0
bool Configuration::get_windowlevel(const Glib::ustring& modality, const Glib::ustring& desc, WindowLevel& w) {
	Glib::ustring base = "/apps/aeskulap/presets/windowlevel/"+modality+"/"+desc;

	if(!m_conf_client->dir_exists(base)) {
		return false;
	}

	if(m_conf_client->get_without_default(base+"/center").get_type() == Gnome::Conf::VALUE_INVALID) {
		return false;
	}

	w.modality = modality;
	w.description = desc;
	w.center = m_conf_client->get_int(base+"/center");
	w.width = m_conf_client->get_int(base+"/width");

	return true;
}