Changeset 7f1b51 for src/UIElements/Qt4
- Timestamp:
- Sep 15, 2014, 3:05:28 PM (11 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, Candidate_v1.7.0, Candidate_v1.7.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 7e1a88
- Parents:
- b73545 (diff), 8859b5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src/UIElements/Qt4
- Files:
-
- 17 edited
-
QtDialog.cpp (modified) (1 diff)
-
QtDialog.hpp (modified) (1 diff)
-
QtMainWindow.cpp (modified) (1 diff)
-
QtUIFactory.cpp (modified) (1 diff)
-
QtUIFactory.hpp (modified) (1 diff)
-
Query/AtomsQtQuery.cpp (modified) (1 diff)
-
Query/DoublesQtQuery.cpp (modified) (1 diff)
-
Query/ElementsQtQuery.cpp (modified) (1 diff)
-
Query/FileQtQuery.cpp (modified) (5 diffs)
-
Query/FilesQtQuery.cpp (modified) (1 diff)
-
Query/IntsQtQuery.cpp (modified) (1 diff)
-
Query/MoleculesQtQuery.cpp (modified) (1 diff)
-
Query/QtQuery.hpp (modified) (1 diff)
-
Query/QtQueryList.hpp (modified) (1 diff)
-
Query/StringsQtQuery.cpp (modified) (1 diff)
-
Query/UnsignedIntsQtQuery.cpp (modified) (1 diff)
-
Query/VectorsQtQuery.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Qt4/QtDialog.cpp
rb73545 r7f1b51 45 45 using namespace std; 46 46 47 QtDialog::QtDialog() : 48 QDialog(0) 49 { 47 QtDialog::QtDialog(const std::string &_title) : 48 QDialog(0), 49 Dialog(_title) 50 { 51 setWindowTitle(QString(_title.c_str())); 50 52 // creating and filling of the Dialog window 51 53 mainLayout = new QVBoxLayout(); -
src/UIElements/Qt4/QtDialog.hpp
rb73545 r7f1b51 30 30 Q_OBJECT 31 31 public: 32 QtDialog( );32 QtDialog(const std::string &_title); 33 33 virtual ~QtDialog(); 34 34 -
src/UIElements/Qt4/QtMainWindow.cpp
rb73545 r7f1b51 116 116 toolbar = new QtToolBar(this); 117 117 glWorldView->addToolBarActions(toolbar); 118 toolbar->addFavoriteActionItems(20); 118 119 addToolBar(toolbar); 119 120 -
src/UIElements/Qt4/QtUIFactory.cpp
rb73545 r7f1b51 67 67 } 68 68 69 Dialog* QtUIFactory::makeDialog( ) {70 return new QtDialog( );69 Dialog* QtUIFactory::makeDialog(const std::string &_title) { 70 return new QtDialog(_title); 71 71 } 72 72 -
src/UIElements/Qt4/QtUIFactory.hpp
rb73545 r7f1b51 26 26 virtual ~QtUIFactory(); 27 27 28 virtual Dialog* makeDialog( );28 virtual Dialog* makeDialog(const std::string &_title); 29 29 virtual MainWindow* makeMainWindow(); 30 30 -
src/UIElements/Qt4/Query/AtomsQtQuery.cpp
rb73545 r7f1b51 47 47 QtQueryList<const atom *>(_param, _parent, _dialog, temp) 48 48 { 49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 50 50 subQuery = new AtomQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 51 51 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/DoublesQtQuery.cpp
rb73545 r7f1b51 47 47 QtQueryList<double>(_param, _parent, _dialog, temp) 48 48 { 49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 50 50 subQuery = new DoubleQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 51 51 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/ElementsQtQuery.cpp
rb73545 r7f1b51 48 48 QtQueryList<const element *>(_param, _parent, _dialog, temp) 49 49 { 50 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );50 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 51 51 subQuery = new ElementQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 52 52 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/FileQtQuery.cpp
rb73545 r7f1b51 45 45 #include "UIElements/Qt4/Query/QtQuery.hpp" 46 46 47 #include <algorithm> 48 #include <boost/filesystem.hpp> 49 50 #include "Parameters/Validators/getFlatListFromHierarchyOfValidators.hpp" 51 #include "Parameters/Validators/Validator.hpp" 52 #include "Parameters/Validators/Specific/FilePresentValidator.hpp" 53 #include "Parameters/Validators/Specific/FileSuffixValidator.hpp" 54 #include "Parameters/Validators/Specific/ParserFileValidator.hpp" 47 55 #include "Parser/ParserTypes.hpp" 48 56 #include "Parser/FormatParserStorage.hpp" … … 51 59 QtQuery<boost::filesystem::path>(_param, _title, _description), 52 60 parent(_parent), 53 dialog(_dialog) 61 dialog(_dialog), 62 mustBePresent(false) 54 63 { 55 64 filenameLineEdit = new QLineEdit(); … … 57 66 filenameLineEdit->setReadOnly(true); 58 67 59 filenameLabel = new QLabel(QString( "Input file:"));68 filenameLabel = new QLabel(QString(_title.c_str())); 60 69 filenameLabel->setBuddy(filenameLineEdit); 61 70 filenameLabel->setToolTip(QString(getDescription().c_str())); … … 71 80 72 81 QObject::connect(filedialogButton,SIGNAL(clicked()),this,SLOT(showFileDialog())); 82 83 // fill list of suffixes 84 const Validator<boost::filesystem::path> &validator = 85 _param.getValidator(); 86 typedef std::vector<std::pair<const Validator<boost::filesystem::path> *, bool> > validators_t; 87 const validators_t validators = 88 getFlatListFromHierarchyOfValidators<boost::filesystem::path>(validator); 89 for (validators_t::const_iterator iter = validators.begin(); 90 iter != validators.end(); ++iter) { 91 const Validator< boost::filesystem::path > ¤tvalidator = *iter->first; 92 if (dynamic_cast<const FileSuffixValidator * const>(¤tvalidator) != NULL) 93 suffixes.push_back(dynamic_cast<const FileSuffixValidator &>(currentvalidator).getSuffix()); 94 if (dynamic_cast<const ParserFileValidator * const>(¤tvalidator) != NULL) { 95 const std::vector<std::string> moresuffixes = 96 dynamic_cast<const ParserFileValidator &>(currentvalidator).getSuffixes(); 97 suffixes.insert(suffixes.end(), moresuffixes.begin(), moresuffixes.end()); 98 } 99 if (dynamic_cast<const FilePresentValidator * const>(¤tvalidator) != NULL) 100 mustBePresent = iter->second; 101 } 102 std::sort(suffixes.begin(), suffixes.end()); 73 103 } 74 104 … … 93 123 // gather all possible suffixes 94 124 QStringList filters; 95 std::stringstream parsersuffixes; 96 parsersuffixes << std::string("Config files ("); 97 for (ParserTypes t = ParserTypes_begin; t < ParserTypes_end; ++t){ 98 if (t != ParserTypes_begin) 99 parsersuffixes << std::string(" "); 100 parsersuffixes << std::string("*.") << 101 FormatParserStorage::getInstance().getSuffixFromType(t); 125 std::stringstream filter_string; 126 if (!suffixes.empty()) { 127 filter_string << "Valid files ("; 128 for (std::vector<std::string>::const_iterator iter = suffixes.begin(); 129 iter != suffixes.end(); ++iter) 130 filter_string << (iter == suffixes.begin() ? "*." : " *.") << *iter << " "; 131 filter_string << ")"; 132 filters << tr(filter_string.str().c_str()); 102 133 } 103 parsersuffixes << std::string(")");104 filters << tr(parsersuffixes.str().c_str());105 filters << tr("Data files (*.dat)");106 134 filters << tr("Any files (*)"); 107 135 theFileDialog->setNameFilters(filters); -
src/UIElements/Qt4/Query/FilesQtQuery.cpp
rb73545 r7f1b51 48 48 QtQueryList<boost::filesystem::path>(_param, _parent, _dialog, temp) 49 49 { 50 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );50 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 51 51 subQuery = new FileQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 52 52 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/IntsQtQuery.cpp
rb73545 r7f1b51 47 47 QtQueryList<int>(_param, _parent, _dialog, temp) 48 48 { 49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 50 50 subQuery = new IntQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 51 51 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/MoleculesQtQuery.cpp
rb73545 r7f1b51 47 47 QtQueryList<const molecule *>(_param, _parent, _dialog, temp) 48 48 { 49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 50 50 subQuery = new MoleculeQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 51 51 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/QtQuery.hpp
rb73545 r7f1b51 211 211 QFileDialog *theFileDialog; 212 212 Dialog *dialog; 213 std::vector<std::string> suffixes; 214 bool mustBePresent; 213 215 }; 214 216 -
src/UIElements/Qt4/Query/QtQueryList.hpp
rb73545 r7f1b51 107 107 { 108 108 public: 109 ListQuerySubDialog(QtQueryListUntyped *_parent) : parent(_parent), sub(NULL){} 109 ListQuerySubDialog(QtQueryListUntyped *_parent, const std::string &_title) : 110 Dialog(_title), 111 parent(_parent), 112 sub(NULL) 113 {} 110 114 virtual void update() 111 115 { -
src/UIElements/Qt4/Query/StringsQtQuery.cpp
rb73545 r7f1b51 47 47 QtQueryList<std::string>(_param, _parent, _dialog, temp) 48 48 { 49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 50 50 subQuery = new StringQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 51 51 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/UnsignedIntsQtQuery.cpp
rb73545 r7f1b51 47 47 QtQueryList<unsigned int>(_param, _parent, _dialog, temp) 48 48 { 49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );49 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 50 50 subQuery = new UnsignedIntQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 51 51 subDialog->setSubQuery(subQuery); -
src/UIElements/Qt4/Query/VectorsQtQuery.cpp
rb73545 r7f1b51 48 48 QtQueryList<Vector>(_param, _parent, _dialog, temp) 49 49 { 50 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this );50 ListQuerySubDialog *subDialog = new ListQuerySubDialog(this, _title); 51 51 subQuery = new VectorQtQuery(*subParam, _title, _description, thisVLayout, subDialog); 52 52 subDialog->setSubQuery(subQuery);
Note:
See TracChangeset
for help on using the changeset viewer.
