diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ConfigService.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ConfigService.h index cef9730d1089b0b4b6e7bb9fbb0cbbcadbaef45a..a3dc2b22ed283bd6a03a7bebf976b432934fcce6 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ConfigService.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ConfigService.h @@ -116,10 +116,18 @@ namespace Mantid void updateConfig(const std::string& filename, const bool append=false, const bool update_caches=true); /// Save the configuration to the user file void saveConfig(const std::string &filename) const; + /// Trims a string by removing the leading and trailing white spaces + std::string trimLeadingAndTrailing(std::string& toTrim); /// Searches for a configuration property std::string getString(const std::string& keyName, bool use_cache=true) const; /// Searches for a key in the configuration property std::vector<std::string> getKeys(const std::string& keyName) const; + /// Removes the value from a selected keyName + void remove(const std::string& rootName) const; + /// Checks to see whether a key has a value assigned to it + bool hasProperty(const std::string& rootName) const; + /// Checks to see whether the target passed is an executable file + bool isExecutable(const std::string& target) const; /// Launches a process i.e opening a program void launchProcess(const std::string& programFilePath, const std::vector<std::string>& programArguments) const; /// Sets a configuration property diff --git a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp index da2ebe3cb02cc51b66404fe8d219b591dff843dc..281c1e66a1541b2945162cbed3245420c294f53b 100644 --- a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp +++ b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp @@ -24,6 +24,7 @@ #include <Poco/Notification.h> #include <Poco/Environment.h> #include <Poco/Process.h> +#include <Poco/String.h> #include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/join.hpp> @@ -727,32 +728,63 @@ void ConfigServiceImpl::saveConfig(const std::string & filename) const output = ""; updated_file += "\n"; continue; + } //end if-else + + // Output is the current line in the file + + // Extract the key from the current line + std::string key; + std::string::size_type pos = output.find('='); + if( pos == std::string::npos ) + { + key = output; //If no equals then the entire thing is the key } - std::set<std::string>::iterator iend = m_changed_keys.end(); - std::set<std::string>::iterator itr = m_changed_keys.begin(); - for (; itr != iend; ++itr) + else { - if (output.find(*itr) != std::string::npos) - { - break; - } + key = output.substr(0,pos); //Strip the equals to get only the key } - - if (itr == iend) + //Now deal with trimming (removes spaces) + Poco::trimInPlace(key); + + //Find the comments + std::string::size_type comment = key.find('#'); + + //Check if it exists in the service using hasProperty and make sure it isn't a comment + if( comment != 0 && !hasProperty(key) ) { - updated_file += output; + //Remove the key from the changed key list + m_changed_keys.erase(key); + continue; } else { - std::string key = *itr; - std::string value = getString(*itr, false); - updated_file += key + "=" + value; - //Remove the key from the changed key list - m_changed_keys.erase(itr); - } - updated_file += "\n"; + //If it does exist perform the current actions below + std::set<std::string>::iterator iend = m_changed_keys.end(); + std::set<std::string>::iterator itr = m_changed_keys.begin(); - } + for (; itr != iend; ++itr) + { + if (output.find(*itr) != std::string::npos) + { + break; + } + } + + if (itr == iend) + { + updated_file += output; + } + else + { + std::string key = *itr; + std::string value = getString(*itr, false); + updated_file += key + "=" + value; + //Remove the key from the changed key list + m_changed_keys.erase(itr); + } + updated_file += "\n"; + } + } // End while-loop // Any remaining keys within the changed key store weren't present in the current user properties so append them if (!m_changed_keys.empty()) @@ -785,7 +817,21 @@ void ConfigServiceImpl::saveConfig(const std::string & filename) const writer.close(); } +/** Removes the leading and trailing white spaces from a given string and returns the value + * as a string. + * + * @param toTrim :: The string value to be trimmed left and right. + * @returns The string value of toTrim without the white spaces at the beginning and end. + */ +std::string ConfigServiceImpl::trimLeadingAndTrailing(std::string& toTrim) +{ + std::string tempValue; + std::string rtValue; + tempValue = Poco::trimRight(toTrim); + rtValue = Poco::trimLeft(tempValue); + return rtValue; +} /** Searches for a string within the currently loaded configuaration values and * returns the value as a string. If the key is one of those that was a possible relative path @@ -839,6 +885,63 @@ std::vector<std::string> ConfigServiceImpl::getKeys(const std::string& keyName) return keyVector; } +/** Removes a key from the memory stored properties file and inserts the key into the + * changed key list so that when the program calls saveConfig the properties file will + * be the same and not contain the key no more + * + * @param keyName :: The key that is to be deleted + */ +void ConfigServiceImpl::remove(const std::string& rootName) const +{ + try + { + m_pConf->remove(rootName); + } + catch (Poco::NotFoundException&) + { + g_log.debug() << "Unable to find " << rootName << " in the properties file" << std::endl; + } + m_changed_keys.insert(rootName); +} + +/** Checks to see whether the given key exists. + * + * @param keyName :: The case sensitive key that you are looking to see if exists. + * @returns Boolean value denoting whether the exists or not. + */ +bool ConfigServiceImpl::hasProperty(const std::string& rootName) const +{ + return m_pConf->hasProperty(rootName); +} + +/** Checks to see whether the given file target is an executable one and it exists + * + * @param keyName :: The path to the file you wish to see whether it's an executable. + * @returns Boolean value denoting whether the file is an executable or not. + */ +bool ConfigServiceImpl::isExecutable(const std::string& target) const +{ + try + { + Poco::File tempFile = Poco::File(target); + + if (tempFile.exists()) + { + if(tempFile.canExecute()) + return true; + else + return false; + } + else + return false; + } + catch(Poco::Exception&) + { + return false; + } + +} + /** Runs a command line string to open a program. The function can take program arguments. * i.e it can load in a file to the program on startup. * diff --git a/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h b/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h index d48aec68fe625d077950d99e280fca439d851cc3..3957bd6a18866100005596baed504b1a032e4419 100644 --- a/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h +++ b/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h @@ -258,6 +258,7 @@ public: void testSaveConfigExistingSettings() { + const std::string filename("user.settings"); Poco::File prop_file(filename); if( prop_file.exists() ) prop_file.remove(); @@ -269,8 +270,77 @@ public: runSaveTest(filename,"13"); } + void testTrimLeadingAndTrailing() + { + std::string toTrim(" Input Workspace "); + std::string trimmedValue = ConfigService::Instance().trimLeadingAndTrailing(toTrim); + TS_ASSERT_EQUALS(trimmedValue, "Input Workspace"); + toTrim = (""); + trimmedValue = ConfigService::Instance().trimLeadingAndTrailing(toTrim); + TS_ASSERT_EQUALS(trimmedValue, ""); + toTrim = (" "); + trimmedValue = ConfigService::Instance().trimLeadingAndTrailing(toTrim); + TS_ASSERT_EQUALS(trimmedValue, ""); + } + + void testSaveConfigWithPropertyRemoved() + { + const std::string filename("user.settings.testSaveConfigWithPropertyRemoved"); + Poco::File prop_file(filename); + if( prop_file.exists() ) prop_file.remove(); + + std::ofstream writer(filename.c_str(),std::ios_base::trunc); + writer << "mantid.legs = 6" << "\n"; + writer << "\n"; + writer << "mantid.thorax = 10\n"; + writer << "# This comment line\n"; + writer << "key.withnospace=5\n"; + writer << "key.withnovalue"; + writer.close(); + + ConfigService::Instance().updateConfig(filename); + + std::string rootName = "mantid.thorax"; + ConfigService::Instance().remove(rootName); + TS_ASSERT_EQUALS(ConfigService::Instance().hasProperty(rootName), false); + rootName = "key.withnovalue"; + ConfigService::Instance().remove(rootName); + TS_ASSERT_EQUALS(ConfigService::Instance().hasProperty(rootName), false); + + ConfigService::Instance().saveConfig(filename); + + // Test the entry + std::ifstream reader(filename.c_str(), std::ios::in); + if( reader.bad() ) + { + TS_FAIL("Unable to open config file for saving"); + } + std::string line(""); + std::map<int, std::string> prop_lines; + int line_index(0); + while(getline(reader, line)) + { + prop_lines.insert(std::make_pair(line_index, line)); + ++line_index; + } + reader.close(); + + TS_ASSERT_EQUALS(prop_lines.size(), 4); + TS_ASSERT_EQUALS(prop_lines[0], "mantid.legs = 6"); + TS_ASSERT_EQUALS(prop_lines[1], ""); + TS_ASSERT_EQUALS(prop_lines[2], "# This comment line"); + TS_ASSERT_EQUALS(prop_lines[3], "key.withnospace=5"); + + // Clean up + prop_file.remove(); + } + void testSaveConfigWithLineContinuation() { + /*const std::string propfile = ConfigService::Instance().getDirectoryOfExecutable() + + "MantidTest.properties"; + ConfigService::Instance().updateConfig(propfile);*/ + const std::string filename("user.settings"); Poco::File prop_file(filename); if( prop_file.exists() ) prop_file.remove(); @@ -285,6 +355,8 @@ public: "/test4\n"; writer.close(); + ConfigService::Instance().updateConfig(filename); + TS_ASSERT_THROWS_NOTHING(settings.setString("mantid.legs", "15")); TS_ASSERT_THROWS_NOTHING(settings.saveConfig(filename)); @@ -339,6 +411,10 @@ public: void testGetKeysWithValidInput() { + const std::string propfile = ConfigService::Instance().getDirectoryOfExecutable() + + "MantidTest.properties"; + ConfigService::Instance().updateConfig(propfile); + // Returns all subkeys with the given root key std::vector<std::string> keyVector = ConfigService::Instance().getKeys("workspace.sendto"); TS_ASSERT_EQUALS(keyVector.size(), 4); @@ -350,6 +426,10 @@ public: void testGetKeysWithZeroSubKeys() { + const std::string propfile = ConfigService::Instance().getDirectoryOfExecutable() + + "MantidTest.properties"; + ConfigService::Instance().updateConfig(propfile); + std::vector<std::string> keyVector = ConfigService::Instance().getKeys("mantid.legs"); TS_ASSERT_EQUALS(keyVector.size(), 0); std::vector<std::string> keyVector2 = ConfigService::Instance().getKeys("mantidlegs"); @@ -358,9 +438,30 @@ public: void testGetKeysWithEmptyPrefix() { + const std::string propfile = ConfigService::Instance().getDirectoryOfExecutable() + + "MantidTest.properties"; + ConfigService::Instance().updateConfig(propfile); + //Returns all *root* keys, i.e. unique keys left of the first period std::vector<std::string> keyVector = ConfigService::Instance().getKeys(""); - TS_ASSERT_EQUALS(keyVector.size(), 5); + TS_ASSERT_EQUALS(keyVector.size(), 4); + } + + void testRemovingProperty() + { + const std::string propfile = ConfigService::Instance().getDirectoryOfExecutable() + + "MantidTest.properties"; + ConfigService::Instance().updateConfig(propfile); + + std::string rootName = "mantid.legs"; + bool mantidLegs = ConfigService::Instance().hasProperty(rootName); + TS_ASSERT_EQUALS(mantidLegs, true); + + //Remove the value from the key and test again + ConfigService::Instance().remove(rootName); + mantidLegs = ConfigService::Instance().hasProperty(rootName); + TS_ASSERT_EQUALS(mantidLegs, false); + } protected: diff --git a/Code/Mantid/MantidPlot/CMakeLists.txt b/Code/Mantid/MantidPlot/CMakeLists.txt index 3c0c4b8e4b02f4a181cdbed56dadb855483973e8..ce9636e0ef2cf4eb6d025e416172fb90de122877 100644 --- a/Code/Mantid/MantidPlot/CMakeLists.txt +++ b/Code/Mantid/MantidPlot/CMakeLists.txt @@ -107,6 +107,7 @@ set ( QTIPLOT_SRCS src/ApplicationWindow.cpp src/ScriptingWindow.cpp src/ScriptManagerWidget.cpp src/SelectionMoveResizer.cpp + src/SendToProgramDialog.cpp src/SetColValuesDialog.cpp src/SigmoidalFit.cpp src/SmoothCurveDialog.cpp @@ -324,6 +325,7 @@ set ( QTIPLOT_HDRS src/ApplicationWindow.h src/ScriptingWindow.h src/ScriptManagerWidget.h src/SelectionMoveResizer.h + src/SendToProgramDialog.h src/SetColValuesDialog.h src/SigmoidalFit.h src/SmoothCurveDialog.h @@ -592,6 +594,7 @@ set ( QTIPLOT_MOC_FILES src/ApplicationWindow.h src/ScriptingWindow.h src/ScriptManagerWidget.h src/SelectionMoveResizer.h + src/SendToProgramDialog.h src/SetColValuesDialog.h src/SigmoidalFit.h src/SmoothCurveDialog.h @@ -659,7 +662,8 @@ set ( MANTID_MOC_FILES src/Mantid/AlgMonitor.h src/Mantid/InstrumentWidget/Shape2DCollection.h ) -set ( UI_FILES src/Mantid/FirstTimeSetup.ui +set ( UI_FILES src/SendToProgramDialog.ui + src/Mantid/FirstTimeSetup.ui src/Mantid/UserFitFunctionDialog.ui src/Mantid/MantidAbout.ui src/Mantid/RemoveErrorsDialog.ui diff --git a/Code/Mantid/MantidPlot/src/ConfigDialog.cpp b/Code/Mantid/MantidPlot/src/ConfigDialog.cpp index c19b0721eaa1cce28c7199252435a13bfbc9c4a6..3dc12339cf73d19fc21758d60c31f5771e8e9cbe 100644 --- a/Code/Mantid/MantidPlot/src/ConfigDialog.cpp +++ b/Code/Mantid/MantidPlot/src/ConfigDialog.cpp @@ -35,6 +35,7 @@ #include "ColorBox.h" #include "pixmaps.h" #include "DoubleSpinBox.h" +#include "SendToProgramDialog.h" #include "Mantid/MantidUI.h" #include "MantidQtMantidWidgets/FitPropertyBrowser.h" @@ -641,6 +642,7 @@ void ConfigDialog::initMantidPage() initDirSearchTab(); initCurveFittingTab(); + initSendToProgramTab(); initMantidOptionsTab(); } @@ -684,6 +686,262 @@ void ConfigDialog::initMantidOptionsTab() refreshTreeCategories(); } + +void ConfigDialog::initSendToProgramTab() +{ + + //std::vector<std::string> programNames = Mantid::Kernel::ConfigService::Instance().getKeys("workspace.sendto.name"); + // + // for(size_t i = 0; i<programNames.size(); i++) + // { + // //Create a map for the keys and details to go into + // std::map<std::string,std::string> programKeysAndDetails; + + // //Get a list of the program detail keys (mandatory - target, saveusing) (optional - arguments, save parameters, workspace type) + // std::vector<std::string> programKeys = (Mantid::Kernel::ConfigService::Instance().getKeys("workspace.sendto." + programNames[i])); + // + // m_sendToSettings[programNames[i]] = "0"; + + // for(int j(0); j<programKeys.size(); j++) + // { + // m_sendToSettings[programKeys[i] + // } + + // } + + + + + mantidSendToPage = new QWidget(); + mtdTabWidget->addTab(mantidSendToPage, tr("Send To")); + QVBoxLayout *widgetLayout = new QVBoxLayout(mantidSendToPage); + QGroupBox *frame = new QGroupBox(); + widgetLayout ->addWidget(frame); + QGridLayout *grid = new QGridLayout(frame); + + //create tree diagram for all known programs that can be saved to + treePrograms = new QTreeWidget(frame); + treePrograms->setColumnCount(1); + treePrograms->setSortingEnabled(false); + treePrograms->setHeaderLabel(tr("List of Current Programs")); + + //connect(treePrograms, SIGNAL(itemClicked()), this, SLOT(treeClicked())); + + grid->addWidget(treePrograms, 0,0); + + connect(treePrograms,SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(treeClicked())); + populateProgramTree(); + + //Add buttons to the bottom of the widget + deleteButton = new QPushButton(tr("Delete")); + deleteButton->setEnabled(false); + connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteDialog())); + editButton = new QPushButton(tr("Edit...")); + editButton->setEnabled(false); + connect(editButton, SIGNAL(clicked()), this, SLOT(editDialog())); + addButton = new QPushButton(tr("Add...")); + connect(addButton, SIGNAL(clicked()), this, SLOT(addDialog())); + + QHBoxLayout *buttons = new QHBoxLayout; + buttons->addStretch(); + buttons->addWidget(deleteButton); + buttons->addWidget(editButton); + buttons->addWidget(addButton); + + widgetLayout->addLayout(buttons); +} + +void ConfigDialog::treeClicked() +{ + QStringList checkedItems = treeChecking(); + //Set the buttons on whether the conditions are met. Reducing the amount of user errors + if (checkedItems.size() == 0) + { + deleteButton->setEnabled(false); + editButton->setEnabled(false); + } + else if (checkedItems.size() == 1) + { + deleteButton->setEnabled(true); + editButton->setEnabled(true); + } + else + { + deleteButton->setEnabled(true); + editButton->setEnabled(false); + } +} + + +//Add a program +void ConfigDialog::addDialog() +{ + SendToProgramDialog* addProgram = new SendToProgramDialog(this); + addProgram->setModal(true); + addProgram->exec(); + + //Get the settings of the program the user just added + std::pair<std::string, std::map<std::string,std::string> > tempSettings = addProgram->getSettings(); + m_sendToSettings[tempSettings.first] = tempSettings.second; + + //clear the tree and repopulate it without the programs that have just been deleted + treePrograms->clear(); + updateProgramTree(); + treeClicked(); +} + +//Edit a program +void ConfigDialog::editDialog() +{ + QStringList checkedItems = treeChecking(); + + std::map<std::string,std::string> programKeysAndDetails = m_sendToSettings.find(checkedItems[0].toStdString())->second; + + SendToProgramDialog* editProgram = new SendToProgramDialog(this, checkedItems[0], programKeysAndDetails); + + editProgram->setWindowTitle(tr("Edit a Program")); + editProgram->setModal(true); + editProgram->exec(); + + //Get the settings of the program the user just edited + std::pair<std::string, std::map<std::string,std::string> > tempSettings = editProgram->getSettings(); + m_sendToSettings[tempSettings.first] = tempSettings.second; + + //clear the tree and repopulate it without the programs that have just been deleted + treePrograms->clear(); + updateProgramTree(); + treeClicked(); +} + + +//Deleting send to options. Deletes them off the mantid.user.properties +void ConfigDialog::deleteDialog() +{ + QStringList checkedItems = treeChecking(); + if(checkedItems.size() > 0) + { + //Question box asking to continue to avoid accidental deletion of program options + int status = QMessageBox::question(this, tr("Delete save options?"), tr("Are you sure you want to delete \nthe (%1) selected save option(s)?").arg(checkedItems.size()), + QMessageBox::Yes|QMessageBox::Default, + QMessageBox::No|QMessageBox::Escape, + QMessageBox::NoButton); + + if(status == QMessageBox::Yes) + { + //For each program selected, remove all details from the user.properties file; + for (size_t i = 0; i<checkedItems.size(); i++) + { + m_sendToSettings.erase(checkedItems[i].toStdString()); + } + //clear the tree and repopulate it without the programs that have just been deleted + treePrograms->clear(); + updateProgramTree(); + } + } +} + + +void ConfigDialog::populateProgramTree() +{ + std::vector<std::string> programNames = Mantid::Kernel::ConfigService::Instance().getKeys("workspace.sendto.name"); + + for(size_t i = 0; i<programNames.size(); i++) + { + //Create a map for the keys and details to go into + std::map<std::string,std::string> programKeysAndDetails; + + //Get a list of the program detail keys (mandatory - target, saveusing) (optional - arguments, save parameters, workspace type) + std::vector<std::string> programKeys = (Mantid::Kernel::ConfigService::Instance().getKeys("workspace.sendto." + programNames[i])); + + for (int j(0); j<programKeys.size(); j++) + { + //Assign a key to its value using the map + programKeysAndDetails[programKeys[j]] = (Mantid::Kernel::ConfigService::Instance().getString(("workspace.sendto." + programNames[i] + "." + programKeys[j]))); + } + + m_sendToSettings.insert(std::make_pair(programNames[i], programKeysAndDetails)); + } + updateProgramTree(); +} + +void ConfigDialog::updateProgramTree() +{ + //Store into a map ready to go into config service when apply is clicked + std::map<std::string, std::map<std::string,std::string> >::const_iterator itr = m_sendToSettings.begin(); + for( ; itr != m_sendToSettings.end(); ++itr) + { + //Populate list + QTreeWidgetItem *program = createCheckedTreeItem(QString::fromStdString(itr->first), true); + treePrograms->addTopLevelItem(program); + + //Check to see whether invisible. If so then change of colour is needed. + std::map<std::string, std::string> programKeysAndDetails = itr->second; + bool invisible = (programKeysAndDetails.find("visible")->second == "No"); + + //get the current program's (itr) keys and values (pItr) + std::map<std::string,std::string>::const_iterator pItr = programKeysAndDetails.begin(); + for( ; pItr != programKeysAndDetails.end(); ++pItr) + { + QTreeWidgetItem *item = new QTreeWidgetItem(program); + item->setText(0, tr(" " + QString::fromStdString(pItr->first) + " --- " + QString::fromStdString(pItr->second))); + if (invisible) + { + item->setTextColor(0,QColor(150,150,150)); + program->setTextColor(0,QColor(150,150,150)); + } + program->addChild(item); + } + } +} + +void ConfigDialog::updateSendToTab() +{ + Mantid::Kernel::ConfigServiceImpl& mantid_config = Mantid::Kernel::ConfigService::Instance(); + + //Add new values to the config service + std::map<std::string, std::map<std::string,std::string> >::const_iterator itr = m_sendToSettings.begin(); + std::vector<std::string> programNames = mantid_config.getKeys("workspace.sendto.name"); + + for( ; itr != m_sendToSettings.end(); ++itr) + { + for (size_t i = 0; i<programNames.size(); ++i) + { + if (programNames[i] == itr->first) + { + //The selected program hasn't been deleted so set to blank string (all those left without blank strings are to be deleted + programNames[i] = ""; + } + } + + mantid_config.setString("workspace.sendto.name." + itr->first , "0"); + + std::map<std::string, std::string> programKeysAndDetails = itr->second; + + std::map<std::string, std::string>::const_iterator pItr = programKeysAndDetails.begin(); + + for( ; pItr != programKeysAndDetails.end(); ++pItr) + { + if(pItr->second != "") + mantid_config.setString("workspace.sendto." + itr->first + "." + pItr->first, pItr->second); + } + } + + //Delete the keys that are in the config but not in the temporary m_sendToSettings map + for (size_t i = 0; i<programNames.size(); ++i) + { + if (programNames[i] != "") + { + mantid_config.remove("workspace.sendto.name." + programNames[i]); + std::vector<std::string> programKeys = mantid_config.getKeys("workspace.sendto." + programNames[i]); + for (int j(0); j<programKeys.size(); ++j) + // for ( ; pItr != programKeysAndDetails.end(); ++pItr) + { + mantid_config.remove("workspace.sendto." + programNames[i] + "." + programKeys[j]); + } + } + } +} + void ConfigDialog::refreshTreeCategories() { treeCategories->clear(); @@ -1615,6 +1873,7 @@ void ConfigDialog::apply() sep.replace(tr("SPACE"), " "); sep.replace("\\s", " "); + if (sep.contains(QRegExp("[0-9.eE+-]"))!=0){ QMessageBox::warning(0, tr("MantidPlot - Import options error"), tr("The separator must not contain the following characters: 0-9eE.+-")); @@ -1777,6 +2036,7 @@ void ConfigDialog::apply() updateDirSearchSettings(); updateCurveFitSettings(); updateMantidOptionsTab(); + updateSendToTab(); try { @@ -1879,6 +2139,27 @@ void ConfigDialog::updateMantidOptionsTab() } } +QStringList ConfigDialog::treeChecking(QTreeWidgetItem *parent) +{ + QStringList results; + //how many children at this level + int count = parent ? parent->childCount() : treePrograms->topLevelItemCount(); + + for (size_t i = 0; i<count; i++) + { + //get the child + QTreeWidgetItem *item = parent ? parent->child(i) : treePrograms->topLevelItem(i); + + if (item->checkState(0) == Qt::Checked) + { + results.append(item->text(0)); + } + } + + return results; + +} + QStringList ConfigDialog::buildHiddenCategoryString(QTreeWidgetItem *parent) { QStringList results; diff --git a/Code/Mantid/MantidPlot/src/ConfigDialog.h b/Code/Mantid/MantidPlot/src/ConfigDialog.h index a51a7f45a8399a1073b505603bac04c3335f32ea..5ee3daf15bf5a9d4598a15af4e4037e43c86cda6 100644 --- a/Code/Mantid/MantidPlot/src/ConfigDialog.h +++ b/Code/Mantid/MantidPlot/src/ConfigDialog.h @@ -31,6 +31,7 @@ #include <QDialog> #include <QCheckBox> +#include <map> class QLineEdit; class QGroupBox; @@ -121,10 +122,15 @@ private slots: void addPythonAlgorithmsDirs(); void addInstrumentDir(); void addParameterDir(); + void treeClicked(); + void addDialog(); + void editDialog(); + void deleteDialog(); private: void initPlotsPage(); void initOptionsPage(); + void initAxesPage(); void initAppPage(); // Mantid @@ -142,10 +148,19 @@ private: void updateDirSearchSettings(); void updateCurveFitSettings(); void updateMantidOptionsTab(); - QStringList buildHiddenCategoryString(QTreeWidgetItem *parent = 0); - void initMantidOptionsTab(); + void updateSendToTab(); + + void initMantidOptionsTab(); + void initSendToProgramTab(); void refreshTreeCategories(); + void populateProgramTree(); + void updateProgramTree(); + QTreeWidgetItem* createCheckedTreeItem(QString name,bool checkBoxState); + QStringList buildHiddenCategoryString(QTreeWidgetItem *parent = 0); + QStringList treeChecking(QTreeWidgetItem *parent = 0); + + std::map<std::string,std::map<std::string,std::string> > m_sendToSettings; QFont textFont, headerFont, axesFont, numbersFont, legendFont, titleFont, appFont; QFont plot3DTitleFont, plot3DNumbersFont, plot3DAxesFont; @@ -155,6 +170,7 @@ private: ColorButton *btnBackground3D, *btnMesh, *btnAxes, *btnLabels, *btnNumbers; ColorButton *btnFromColor, *btnToColor, *btnGrid; QPushButton *btnTitleFnt, *btnLabelsFnt, *btnNumFnt; + QPushButton *deleteButton, *editButton, *addButton; ColorButton *buttonBackground, *buttonText, *buttonHeader; QPushButton *buttonOk, *buttonCancel, *buttonApply; QPushButton* buttonTextFont, *buttonHeaderFont; @@ -182,8 +198,11 @@ private: QSpinBox *decimals; /// mantid options page QWidget* mantidOptionsPage; + QWidget* mantidSendToPage; QCheckBox *m_invisibleWorkspaces; + QCheckBox *m_sendToPrograms; QTreeWidget *treeCategories; + QTreeWidget *treePrograms; QPushButton* buttonAxesFont, *buttonNumbersFont, *buttonLegendFont, *buttonTitleFont, *fontsBtn; @@ -223,6 +242,8 @@ private: QComboBox *boxEndLine; QCheckBox* cbApplyToMantid; + + #ifdef SCRIPTING_PYTHON QLabel *lblPythonConfigDir; QLineEdit *pythonConfigDirLine; diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp index 749cecaf414bf8ec9690edbf731e11cdff43a6a4..38a41ef7b83da067de464d64c0bfa8a9e02d3d14 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp @@ -805,7 +805,6 @@ void MantidDockWidget::saveToProgram(const QString & name) std::map<std::string,std::string> programKeysAndDetails; programKeysAndDetails["name"] = name.toStdString(); - //Could use a standard vector but no #include <vector> //Get a list of the program detail keys (mandatory - target, saveusing) (optional - arguments, save parameters, workspace type) std::vector<std::string> programKeys = (Mantid::Kernel::ConfigService::Instance().getKeys(("workspace.sendto." + programKeysAndDetails.find("name")->second))); @@ -852,18 +851,19 @@ void MantidDockWidget::saveToProgram(const QString & name) QStringList saveParameters = saveParametersGrouped.split(','); //For each one found split it up and assign the parameter - for (int i(0); i<saveParameters.size(); i++) + for (size_t i = 0; i<saveParameters.size(); i++) { - QStringList saveParameterDetails = saveParameters[i].split('='); - std::string saveParameterName = saveParameterDetails[0].toStdString(); - - if(saveParameterDetails[1] == "True") + //would string array be better to use here ? ////////////////////////////////////////// + QStringList sPNameAndDetail = saveParameters[i].split('='); + std::string saveParameterName = Mantid::Kernel::ConfigService::Instance().trimLeadingAndTrailing(sPNameAndDetail[0].toStdString()); + std::string saveParameterDetail = Mantid::Kernel::ConfigService::Instance().trimLeadingAndTrailing(sPNameAndDetail[1].toStdString()); + if(saveParameterDetail == "True") alg->setProperty(saveParameterName, true); - else if(saveParameterDetails[1] == "False") + else if(saveParameterDetail == "False") alg->setProperty(saveParameterName, false); else //if not true or false then must be a value { - alg->setPropertyValue(saveParameterName, saveParameterDetails[1].toStdString()); + alg->setPropertyValue(saveParameterName, saveParameterDetail); } } } @@ -881,8 +881,8 @@ void MantidDockWidget::saveToProgram(const QString & name) if (programKeysAndDetails.count("arguments") != 0) { QString temp = QString::fromStdString(programKeysAndDetails.find("arguments")->second); - temp.replace(QString("[File]"), savedFile); - //temp.replace(QString("[User]"), user; + temp.replace(QString("[file]"), savedFile); + //temp.replace(QString("[user]"), user; arguments = temp.split(","); } else @@ -891,7 +891,7 @@ void MantidDockWidget::saveToProgram(const QString & name) //convert the list into a standard vector for compatibility with Poco std::vector<std::string> argumentsV; - for (int i(0); i<arguments.size(); i++) + for (size_t i = 0; i<arguments.size(); i++) { argumentsV.assign(1, (arguments[i].toStdString())); } @@ -907,7 +907,7 @@ void MantidDockWidget::saveToProgram(const QString & name) } } else - QMessageBox::information(this, "Target Path Error", "User tried to open program from: " + QString::fromStdString(programKeysAndDetails.find("target")->second) + " The target file path for the program can't be found. Please check that the full path is correct"); + QMessageBox::information(this, "Target Path Error", "User tried to open program from: " + QString::fromStdString(programKeysAndDetails.find("target")->second) + " The target file path for the program can't be found. Please check that the full path is correct"); } } @@ -986,26 +986,45 @@ void MantidDockWidget::popupMenu(const QPoint & pos) //Get the names of the programs for the send to option std::vector<std::string> programNames = (Mantid::Kernel::ConfigService::Instance().getKeys("workspace.sendto.name")); - if (programNames.size() > 0) + + //Check to see if any options aren't visible + std::map<std::string,std::string> programVisible; + bool allVisible(false); + for (size_t i = 0; i<programNames.size(); i++) + { + programVisible[programNames[i]] = Mantid::Kernel::ConfigService::Instance().getString("workspace.sendto." + programNames[i] + ".visible"); + if(programVisible.find(programNames[i])->second == "Yes") + allVisible = true; + } + + if(allVisible == true) { m_saveToProgram = new QMenu(tr("Send to"),this); menu->addMenu(m_saveToProgram); //Sub-menu for program list - m_programMapper = new QSignalMapper(this); - - for (size_t i=0; i<programNames.size(); i++) - { - //Convert name from std string to QString for use with QAction menu entry - QString name = QString::fromStdString(programNames[i]); - //Setup new menu option for the program - m_program = new QAction(tr(name),this); - connect(m_program,SIGNAL(activated()),m_programMapper,SLOT(map())); - //Send name of program when clicked - m_programMapper->setMapping(m_program, name); - m_saveToProgram->addAction(m_program); - } - + m_programMapper = new QSignalMapper(this); + + + + for (size_t i = 0; i<programNames.size(); i++) + { + //Find out if visible is selected for any of the programs + std::string visible = Mantid::Kernel::ConfigService::Instance().getString("workspace.sendto." + programNames[i] + ".visible"); + + if(visible == "Yes") + { + //Convert name from std string to QString for use with QAction menu entry + QString name = QString::fromStdString(programNames[i]); + //Setup new menu option for the program + m_program = new QAction(tr(name),this); + connect(m_program,SIGNAL(activated()),m_programMapper,SLOT(map())); + //Send name of program when clicked + m_programMapper->setMapping(m_program, name); + m_saveToProgram->addAction(m_program); + } + } + //Tell the button what to listen for and what to do once clicked connect(m_programMapper, SIGNAL(mapped(const QString &)), this, SLOT(saveToProgram(const QString &))); } //Rename is valid for all workspace types @@ -1543,4 +1562,4 @@ void AlgorithmTreeWidget::mouseDoubleClickEvent(QMouseEvent *e) } QTreeWidget::mouseDoubleClickEvent(e); -} +} \ No newline at end of file diff --git a/Code/Mantid/MantidPlot/src/SendToProgramDialog.cpp b/Code/Mantid/MantidPlot/src/SendToProgramDialog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e691122fe827d244faa88006994db28f81b20294 --- /dev/null +++ b/Code/Mantid/MantidPlot/src/SendToProgramDialog.cpp @@ -0,0 +1,219 @@ +#include "SendToProgramDialog.h" +#include "ConfigDialog.h" +#include "pixmaps.h" +#include "MantidKernel/ConfigService.h" +#include "MantidAPI/AlgorithmManager.h" + +#include <QPushButton> +#include <QGridLayout> +#include <QGroupBox> +#include <QWidget> +#include <QComboBox> +#include <QHBoxLayout> +#include <QVBoxLayout> +#include <QMessageBox> +#include <QStringList> +#include <QTextEdit> +#include <QFileDialog> +#include <QPixmap> +#include <QVector> + +#include <map> + + +//Constructor when adding a new program to the send to list +SendToProgramDialog::SendToProgramDialog(QWidget* parent, Qt::WFlags fl) + : QDialog( parent, fl ), validName(false), validTarget(false), validSaveUsing(false) +{ + m_uiform.setupUi(this); + + //Adding new information is disabled until selected fields have been validated and passed + m_uiform.buttonBox->button(QDialogButtonBox::Save)->setEnabled(false); + + //Icon image for the browse button + m_uiform.browseButton->setIcon(QIcon(getQPixmap("choose_folder_xpm"))); + + //Setup save and browse button, cancel does nothing but closes the current dialog (does this by default) + connect(m_uiform.browseButton, SIGNAL(clicked()), this, SLOT(browse())); + connect(m_uiform.buttonBox, SIGNAL(accepted()), this, SLOT(save())); + + //Setup Validation for the mandatory information + connect(m_uiform.nameText, SIGNAL(textChanged(const QString&)), this, SLOT(validateName())); + connect(m_uiform.targetText, SIGNAL(textChanged(const QString&)), this, SLOT(validateTarget())); + connect(m_uiform.saveUsingText, SIGNAL(textChanged(const QString&)), this, SLOT(validateSaveUsing())); +} + + +//Constructor when editing a program settings +SendToProgramDialog::SendToProgramDialog(QWidget* parent, QString& programName, std::map<std::string, std::string> programKeysAndDetails, Qt::WFlags fl) + : QDialog(parent, fl), validName(true), validTarget(true), validSaveUsing(true) +{ + m_uiform.setupUi(this); + + //Set the name of the program you wish to edit and make it so that the user can't change it + m_uiform.nameText->setText(programName); + m_uiform.nameText->setBackgroundColor(QColor(230,230,230)); + m_uiform.nameText->setReadOnly(true); + + //Assign the collected data on the program to the form boxes + if (programKeysAndDetails.count("target") != 0) + m_uiform.targetText->setText(QString::fromStdString(programKeysAndDetails.find("target")->second)); + if (programKeysAndDetails.count("arguments") != 0) + m_uiform.argumentsText->setText(QString::fromStdString(programKeysAndDetails.find("arguments")->second)); + if (programKeysAndDetails.count("saveparameters") != 0) + m_uiform.saveParametersText->setText(QString::fromStdString(programKeysAndDetails.find("saveparameters")->second)); + + if (programKeysAndDetails.count("saveusing") != 0) + + m_uiform.saveUsingText->setText(QString::fromStdString(programKeysAndDetails.find("saveusing")->second)); + + if (programKeysAndDetails.count("visible") != 0) + { + if (programKeysAndDetails.find("visible")->second == "Yes") + m_uiform.visibleCheck->setCheckState(Qt::Checked); + else + m_uiform.visibleCheck->setCheckState(Qt::Unchecked); + } + + //Validation correct on startup + validateName(); + validateTarget(); + validateSaveUsing(); + + //Icon image for the browse button + m_uiform.browseButton->setIcon(QIcon(getQPixmap("choose_folder_xpm"))); + + //Setup save and browse button, cancel does nothing but closes the current dialog (does this by default) + connect(m_uiform.browseButton, SIGNAL(clicked()), this, SLOT(browse())); + connect(m_uiform.buttonBox, SIGNAL(accepted()), this, SLOT(save())); + + //Setup Validation for the mandatory information + connect(m_uiform.nameText, SIGNAL(textChanged(const QString&)), this, SLOT(validateName())); + connect(m_uiform.targetText, SIGNAL(textChanged(const QString&)), this, SLOT(validateTarget())); + connect(m_uiform.saveUsingText, SIGNAL(textChanged(const QString&)), this, SLOT(validateSaveUsing())); +} + +//Open up a new file browsing window +void SendToProgramDialog::browse() +{ + // (*) Will let all files be selected + QFileDialog *dialog = new QFileDialog; + QString fileName = dialog->getOpenFileName(this, tr("Select Program Location"), "C:/", tr("All Files (*)")); + + //Sets the file target that the user selected to be the file path for the program + m_uiform.targetText->setText(fileName); +} + + +void SendToProgramDialog::validateName() +{ + if (m_uiform.nameText->text() == "") + { + m_uiform.validateName->setVisible(true); + validName = false; + } + else + { + m_uiform.validateName->setVisible(false); + validName = true; + } + validateAll(); +} + + +void SendToProgramDialog::validateTarget() +{ + QString filePath = m_uiform.targetText->text(); + filePath.replace(QString("\\"), QString("/")); + + if (filePath != ""){ + if (Mantid::Kernel::ConfigService::Instance().isExecutable(filePath.toStdString())) + { + m_uiform.validateTarget->setVisible(false); + validTarget = true; + } + else + { + m_uiform.validateTarget->setVisible(true); + validTarget = false; + } + } + else + { + m_uiform.validateTarget->setVisible(true); + validTarget = false; + } + validateAll(); + +} + + +void SendToProgramDialog::validateSaveUsing() +{ + validSaveUsing = true; + try + { + Mantid::API::AlgorithmManager::Instance().createUnmanaged(m_uiform.saveUsingText->text().toStdString(),-1); + } + catch(std::runtime_error&) + { + m_uiform.validateSaveUsing->setVisible(true); + validSaveUsing = false; + } + + if (validSaveUsing == true) + { + m_uiform.validateSaveUsing->setVisible(false); + } + validateAll(); +} + + +//If a validation passes or fails then a validation of the entire dialog needs to be done to enable or disable the save button. +void SendToProgramDialog::validateAll() +{ + //If validation passes on name, target and the save algorithm the save button becomes available for the user to press. + if(validName == true && validTarget == true && validSaveUsing == true) + m_uiform.buttonBox->button(QDialogButtonBox::Save)->setEnabled(true); + else + m_uiform.buttonBox->button(QDialogButtonBox::Save)->setEnabled(false); +} + + +//Save the new program or changes to a program +void SendToProgramDialog::save() +{ + //Collect mandatory information and then check to see if it has been collected (visible will always be true or false and is therefore not collected yet) + std::map<std::string,std::string> programKeysAndDetails; + + std::string name = m_uiform.nameText->text().toStdString(); + + QString filePath = m_uiform.targetText->text(); + filePath.replace(QString("\\"), QString("/")); + + programKeysAndDetails["target"] = filePath.toStdString(); + + programKeysAndDetails["saveusing"] = m_uiform.saveUsingText->text().toStdString(); + + //No need to check that mandatory data is here due to validation that has been implemented above + //Collect the rest of the information if there is any (visible will always be true or false) + if(m_uiform.argumentsText->text() != "") + programKeysAndDetails["arguments"] = m_uiform.argumentsText->text().toStdString(); + if(m_uiform.saveParametersText->text() != "") + programKeysAndDetails["saveparameters"] = m_uiform.saveParametersText->text().toStdString(); + + if( m_uiform.visibleCheck->checkState() == 0) + programKeysAndDetails["visible"] = "No"; + else + programKeysAndDetails["visible"] = "Yes"; + + m_settings.first = name; + m_settings.second = programKeysAndDetails; +} + + +//Get the settings (key and detail of what is to go in the config service) +std::pair<std::string, std::map<std::string, std::string>> SendToProgramDialog::getSettings() const +{ + return m_settings; +} diff --git a/Code/Mantid/MantidPlot/src/SendToProgramDialog.h b/Code/Mantid/MantidPlot/src/SendToProgramDialog.h new file mode 100644 index 0000000000000000000000000000000000000000..8be51782f0ce2ebeb7e7dddb220cd457b7160b28 --- /dev/null +++ b/Code/Mantid/MantidPlot/src/SendToProgramDialog.h @@ -0,0 +1,45 @@ +#ifndef SendToProgramDialog_H +#define SendToProgramDialog_H + +#include "ui_SendToProgramDialog.h" +#include <QDialog> + +class QLineEdit; +class QGroupBox; +class QPushButton; +class QStackedWidget; +class QWidget; +class QComboBox; +class QLabel; +class QListWidget; +class QMouseEvent; +class QStringList; + +//SendToProgramDialog + +class SendToProgramDialog : public QDialog +{ + Q_OBJECT + +public: + SendToProgramDialog(QWidget* parent, Qt::WFlags fl = 0 ); + SendToProgramDialog(QWidget* parent, QString& programName, std::map<std::string, std::string> programKeysAndDetails, Qt::WFlags fl = 0 ); + std::pair<std::string,std::map<std::string,std::string> > getSettings() const; + +private slots: + void browse(); + void validateAll(); + void validateName(); + void validateTarget(); + void validateSaveUsing(); + void save(); + +private: + bool validName, validTarget, validSaveUsing; + Ui::SendToProgramDialog m_uiform; + //MantidUI * const m_mantidUI; + std::pair<std::string,std::map<std::string,std::string> > m_settings; +}; + + +#endif // SendToProgram_H diff --git a/Code/Mantid/MantidPlot/src/SendToProgramDialog.ui b/Code/Mantid/MantidPlot/src/SendToProgramDialog.ui new file mode 100644 index 0000000000000000000000000000000000000000..eb54b7fb3eb63707ce8f3e98339247a0c03371b4 --- /dev/null +++ b/Code/Mantid/MantidPlot/src/SendToProgramDialog.ui @@ -0,0 +1,2175 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>SendToProgramDialog</class> + <widget class="QDialog" name="SendToProgramDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>494</width> + <height>351</height> + </rect> + </property> + <property name="maximumSize"> + <size> + <width>494</width> + <height>398</height> + </size> + </property> + <property name="windowTitle"> + <string>Add Program</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="4" column="1"> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QGroupBox" name="groupBox"> + <property name="autoFillBackground"> + <bool>true</bool> + </property> + <property name="title"> + <string/> + </property> + <widget class="QLineEdit" name="nameText"> + <property name="geometry"> + <rect> + <x>140</x> + <y>20</y> + <width>281</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="echoMode"> + <enum>QLineEdit::Normal</enum> + </property> + <property name="readOnly"> + <bool>false</bool> + </property> + </widget> + <widget class="QLabel" name="label"> + <property name="geometry"> + <rect> + <x>20</x> + <y>20</y> + <width>46</width> + <height>13</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Name:</string> + </property> + </widget> + <widget class="QLabel" name="label_2"> + <property name="geometry"> + <rect> + <x>20</x> + <y>60</y> + <width>46</width> + <height>21</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Target:</string> + </property> + </widget> + <widget class="QLabel" name="label_3"> + <property name="geometry"> + <rect> + <x>20</x> + <y>110</y> + <width>81</width> + <height>16</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Arguments:</string> + </property> + </widget> + <widget class="QLabel" name="label_4"> + <property name="geometry"> + <rect> + <x>20</x> + <y>160</y> + <width>81</width> + <height>16</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Save Using:</string> + </property> + </widget> + <widget class="QLabel" name="label_5"> + <property name="geometry"> + <rect> + <x>20</x> + <y>210</y> + <width>111</width> + <height>16</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Save Parameters:</string> + </property> + </widget> + <widget class="QLineEdit" name="targetText"> + <property name="geometry"> + <rect> + <x>140</x> + <y>60</y> + <width>281</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="echoMode"> + <enum>QLineEdit::Normal</enum> + </property> + <property name="readOnly"> + <bool>false</bool> + </property> + </widget> + <widget class="QLineEdit" name="argumentsText"> + <property name="geometry"> + <rect> + <x>140</x> + <y>110</y> + <width>281</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="echoMode"> + <enum>QLineEdit::Normal</enum> + </property> + <property name="readOnly"> + <bool>false</bool> + </property> + </widget> + <widget class="QLineEdit" name="saveParametersText"> + <property name="geometry"> + <rect> + <x>140</x> + <y>210</y> + <width>281</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="echoMode"> + <enum>QLineEdit::Normal</enum> + </property> + <property name="readOnly"> + <bool>false</bool> + </property> + </widget> + <widget class="QCheckBox" name="visibleCheck"> + <property name="geometry"> + <rect> + <x>350</x> + <y>250</y> + <width>70</width> + <height>17</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="text"> + <string>Visible</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + <widget class="QLabel" name="label_7"> + <property name="geometry"> + <rect> + <x>20</x> + <y>280</y> + <width>171</width> + <height>16</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>7</pointsize> + </font> + </property> + <property name="text"> + <string>Indicates mandatory information</string> + </property> + </widget> + <widget class="QLabel" name="validateTarget"> + <property name="geometry"> + <rect> + <x>460</x> + <y>55</y> + <width>20</width> + <height>31</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>7</pointsize> + </font> + </property> + <property name="text"> + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; color:#ff0000;">*</span></p></body></html></string> + </property> + </widget> + <widget class="QLabel" name="validateSaveUsing"> + <property name="geometry"> + <rect> + <x>460</x> + <y>165</y> + <width>20</width> + <height>21</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>7</pointsize> + </font> + </property> + <property name="text"> + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; color:#ff0000;">*</span></p></body></html></string> + </property> + </widget> + <widget class="QLabel" name="validateName"> + <property name="geometry"> + <rect> + <x>460</x> + <y>21</y> + <width>20</width> + <height>21</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>7</pointsize> + </font> + </property> + <property name="text"> + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; color:#ff0000;">*</span></p></body></html></string> + </property> + </widget> + <widget class="QLabel" name="label_12"> + <property name="geometry"> + <rect> + <x>160</x> + <y>130</y> + <width>171</width> + <height>16</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>149</red> + <green>149</green> + <blue>149</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>141</red> + <green>141</green> + <blue>141</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>172</red> + <green>172</green> + <blue>172</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>149</red> + <green>149</green> + <blue>149</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>141</red> + <green>141</green> + <blue>141</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>172</red> + <green>172</green> + <blue>172</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>141</red> + <green>141</green> + <blue>141</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <property name="text"> + <string>eg. -f [file] </string> + </property> + </widget> + <widget class="QLabel" name="label_13"> + <property name="geometry"> + <rect> + <x>160</x> + <y>80</y> + <width>251</width> + <height>16</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>149</red> + <green>149</green> + <blue>149</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>141</red> + <green>141</green> + <blue>141</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>172</red> + <green>172</green> + <blue>172</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>149</red> + <green>149</green> + <blue>149</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>141</red> + <green>141</green> + <blue>141</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>172</red> + <green>172</green> + <blue>172</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>141</red> + <green>141</green> + <blue>141</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <property name="text"> + <string>eg. C:/Program Files/hdfview/hdfview.2.7.exe</string> + </property> + </widget> + <widget class="QLabel" name="label_14"> + <property name="geometry"> + <rect> + <x>160</x> + <y>230</y> + <width>171</width> + <height>16</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>149</red> + <green>149</green> + <blue>149</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>141</red> + <green>141</green> + <blue>141</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>172</red> + <green>172</green> + <blue>172</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>149</red> + <green>149</green> + <blue>149</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>141</red> + <green>141</green> + <blue>141</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>172</red> + <green>172</green> + <blue>172</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>141</red> + <green>141</green> + <blue>141</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <property name="text"> + <string>eg. Append = True, Precision = 20</string> + </property> + </widget> + <widget class="QPushButton" name="browseButton"> + <property name="geometry"> + <rect> + <x>425</x> + <y>60</y> + <width>20</width> + <height>21</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + </widget> + <widget class="QLineEdit" name="saveUsingText"> + <property name="geometry"> + <rect> + <x>140</x> + <y>160</y> + <width>281</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="echoMode"> + <enum>QLineEdit::Normal</enum> + </property> + <property name="readOnly"> + <bool>false</bool> + </property> + </widget> + <widget class="QLabel" name="label_15"> + <property name="geometry"> + <rect> + <x>160</x> + <y>180</y> + <width>171</width> + <height>16</height> + </rect> + </property> + <property name="palette"> + <palette> + <active> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>149</red> + <green>149</green> + <blue>149</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>141</red> + <green>141</green> + <blue>141</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>172</red> + <green>172</green> + <blue>172</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>149</red> + <green>149</green> + <blue>149</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>141</red> + <green>141</green> + <blue>141</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>172</red> + <green>172</green> + <blue>172</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </brush> + </colorrole> + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>141</red> + <green>141</green> + <blue>141</blue> + </color> + </brush> + </colorrole> + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </brush> + </colorrole> + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>106</red> + <green>106</green> + <blue>106</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>212</red> + <green>212</green> + <blue>212</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>255</red> + <green>255</green> + <blue>220</blue> + </color> + </brush> + </colorrole> + <colorrole role="ToolTipText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <property name="text"> + <string>eg. SaveNexus</string> + </property> + </widget> + <widget class="QLabel" name="validateSaveUsing_2"> + <property name="geometry"> + <rect> + <x>10</x> + <y>270</y> + <width>20</width> + <height>31</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>7</pointsize> + </font> + </property> + <property name="text"> + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; color:#ff0000;">*</span></p></body></html></string> + </property> + </widget> + </widget> + </item> + </layout> + </widget> + <tabstops> + <tabstop>nameText</tabstop> + <tabstop>targetText</tabstop> + <tabstop>browseButton</tabstop> + <tabstop>argumentsText</tabstop> + <tabstop>saveUsingText</tabstop> + <tabstop>saveParametersText</tabstop> + <tabstop>visibleCheck</tabstop> + <tabstop>buttonBox</tabstop> + </tabstops> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>SendToProgramDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>257</x> + <y>388</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>SendToProgramDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>325</x> + <y>388</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/RebinningCutterOperator/vtkRebinningCutter.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/RebinningCutterOperator/vtkRebinningCutter.cxx index 83b5dfcf78d6de30b3390173bb5e12249b5c38a3..9722a6c944e329272014fdef813f8a3b65e69cdf 100755 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/RebinningCutterOperator/vtkRebinningCutter.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/RebinningCutterOperator/vtkRebinningCutter.cxx @@ -293,7 +293,6 @@ void vtkRebinningCutter::SetApplyClip(int applyClip) void vtkRebinningCutter::SetClipFunction(vtkImplicitFunction * func) { vtkBox* box = dynamic_cast<vtkBox*>(func); - if (box != m_clipFunction) { this->m_clipFunction = box; diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/vtkEventNexusReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/vtkEventNexusReader.cxx index f24c0c72739b93ade58ce97bebb6c9abfe3b51d0..76c887f3a277fd2bf5784155f1ede306f1d52f02 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/vtkEventNexusReader.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/vtkEventNexusReader.cxx @@ -330,7 +330,8 @@ void vtkEventNexusReader::doRebinning() if(true == m_applyClip) { - vtkPlane* plane = dynamic_cast<vtkPlane*>(this->m_clipFunction); + vtkPlane* plane = dynamic_cast<vtkPlane*>(this->m_clipFunction); + vtkAbstractTransform* transform = plane->GetTransform(); if(NULL != plane) { //user has requested the use of implicit functions as part of rebinning. only planes understood for time being. diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewWidgets/RebinningCutterObjectPanel/RebinningCutterObjectPanel.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewWidgets/RebinningCutterObjectPanel/RebinningCutterObjectPanel.cxx index c45ba22577fa7f5346c28f1fed077d849a1c2d45..61049ca8cada33114e98a0d0e98b5a4bc8bfd1f2 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewWidgets/RebinningCutterObjectPanel/RebinningCutterObjectPanel.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewWidgets/RebinningCutterObjectPanel/RebinningCutterObjectPanel.cxx @@ -12,7 +12,7 @@ #include "ThresholdRangeWidget.h" #include "MantidGeometry/MDGeometry/MDGeometryXMLParser.h" #include "MantidVatesAPI/SynchronisingGeometryPresenter.h" - +#include "vtkSMProxyProperty.h" using namespace Mantid::VATES; using namespace Mantid::Geometry; @@ -89,6 +89,10 @@ void RebinningCutterObjectPanel::constructThresholdRanges(QGridLayout* gLayout) this->proxy()->GetProperty("InputMinThreshold")); double inputMinThreshold = inputMinThresholdProperty->GetElement(0); + vtkSMProperty* prop = this->proxy()->GetProperty("ClipFunction"); + vtkSMProxyProperty* clipFunc = vtkSMProxyProperty::SafeDownCast(this->proxy()->GetProperty("ClipFunction")); + + if(inputMaxThreshold != m_cachedMaxThreshold || inputMinThreshold != m_cachedMinThreshold) {