bool LLUIColorTable::loadFromSettings() { bool result = false; std::string default_filename = gDirUtilp->getExpandedFilename(LL_PATH_DEFAULT_SKIN, "colors.xml"); result |= loadFromFilename(default_filename, mLoadedColors); std::string current_filename = gDirUtilp->getExpandedFilename(LL_PATH_TOP_SKIN, "colors.xml"); if(current_filename != default_filename) { result |= loadFromFilename(current_filename, mLoadedColors); } //[SL:KB] - Catznip Viewer-Skins std::string theme_filename = gDirUtilp->getExpandedFilename(LL_PATH_TOP_SKINTHEME, "colors.xml"); if (gDirUtilp->fileExists(theme_filename)) { result |= loadFromFilename(theme_filename, mLoadedColors); } std::string user_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colors.xml"); loadFromFilename(user_filename, mUserSetColors); return result; }
/** * Open a prompt to allow the user to select a document to load. * If there are some unsaved changes, a prompt is showed to allow * the user to save the file. */ void MEdiText::openExistingDocument() { if (this->changesCanBeSaved()) { QString fileName = QFileDialog::getOpenFileName(this, "Open file", QString(), "Text files (*.txt);;All files (*)"); if (!fileName.isEmpty()) { loadFromFilename(fileName); } } }
bool LLUIColorTable::loadFromSettings() { bool result = false; std::string default_filename = gDirUtilp->getExpandedFilename(LL_PATH_DEFAULT_SKIN, "colors.xml"); result |= loadFromFilename(default_filename, mLoadedColors); std::string current_filename = gDirUtilp->getExpandedFilename(LL_PATH_TOP_SKIN, "colors.xml"); if(current_filename != default_filename) { result |= loadFromFilename(current_filename, mLoadedColors); } current_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SKIN, "colors.xml"); if(current_filename != default_filename) { result |= loadFromFilename(current_filename, mLoadedColors); } std::string user_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colors.xml"); loadFromFilename(user_filename, mUserSetColors); return result; }