source: src/UIElements/Qt4/QtDialog.cpp@ bd81f9

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 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
Last change on this file since bd81f9 was bd81f9, checked in by Frederik Heber <heber@…>, 13 years ago

Merge branch 'Candidate_v1.3.0' into stable

Conflicts:

src/Actions/unittests/stubs/DummyUI.hpp
src/UIElements/CommandLineUI/CommandLineDialog.cpp
src/UIElements/CommandLineUI/CommandLineDialog.hpp
src/UIElements/Dialog.cpp
src/UIElements/Dialog.hpp
src/UIElements/Makefile.am
src/UIElements/Qt4/QtDialog.cpp
src/UIElements/Qt4/QtDialog.hpp
src/UIElements/TextUI/TextDialog.cpp
src/UIElements/TextUI/TextDialog.hpp

  • Property mode set to 100644
File size: 5.9 KB
RevLine 
[bcf653]1/*
2 * Project: MoleCuilder
3 * Description: creates and alters molecular systems
[0aa122]4 * Copyright (C) 2010-2012 University of Bonn. All rights reserved.
[bcf653]5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
6 */
7
[d3a5ea]8/*
[4cf323d]9 * QtDialog.cpp
[d3a5ea]10 *
11 * Created on: Jan 18, 2010
12 * Author: crueger
13 */
14
[bf3817]15// include config.h
16#ifdef HAVE_CONFIG_H
17#include <config.h>
18#endif
[bbbad5]19
[4cf323d]20#include "UIElements/Qt4/QtDialog.hpp"
[308aa4]21#include "UIElements/Qt4/Query/QtQuery.hpp"
[d3a5ea]22
[8df74d]23#include <QtGui/QDialogButtonBox>
[d3a5ea]24#include <Qt/qpushbutton.h>
[8df74d]25#include <Qt/qboxlayout.h>
[4c9a97]26
[ad011c]27#include "CodePatterns/MemDebug.hpp"
[257c77]28
[d3a5ea]29
30using namespace std;
31
[4cf323d]32QtDialog::QtDialog() :
[d3a5ea]33 QDialog(0)
34{
35 // creating and filling of the Dialog window
36 mainLayout = new QVBoxLayout();
37 inputLayout = new QVBoxLayout();
38 buttonLayout = new QVBoxLayout();
39 setLayout(mainLayout);
40 mainLayout->addLayout(inputLayout);
41 mainLayout->addLayout(buttonLayout);
42 buttons = new QDialogButtonBox(QDialogButtonBox::Ok| QDialogButtonBox::Cancel);
43 buttonLayout->addWidget(buttons);
44
45 // Disable the ok button until something was entered
46 buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
47
48 // connect the buttons to their appropriate slots
49 connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
50 connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
51}
52
[4cf323d]53QtDialog::~QtDialog()
[d3a5ea]54{
55}
56
[4cf323d]57bool QtDialog::display(){
[d3a5ea]58 // Button state might have changed by some update that
59 // was done during query construction. To make sure
60 // the state is correct, we just call update one more time.
61 update();
62 if(exec()) {
63 setAll();
64 return true;
65 }
66 else {
67 return false;
68 }
69}
70
[4cf323d]71void QtDialog::update(){
[d3a5ea]72 buttons->button(QDialogButtonBox::Ok)->setEnabled(checkAll());
73}
74
75/************************** Query Infrastructure ************************/
76
[4cf323d]77void QtDialog::queryEmpty(const char* title, std::string)
[9d457d]78{
[4cf323d]79 registerQuery(new EmptyQtQuery(title,inputLayout,this));
[257c77]80}
81
[f10b0c]82void QtDialog::queryBoolean(Parameter<bool> &param, const char* title,string)
[ee62e4]83{
[f10b0c]84 registerQuery(new BooleanQtQuery(param,title,inputLayout,this));
[257c77]85}
86
[f10b0c]87void QtDialog::queryAtom(Parameter<const atom *> &param, const char* title, std::string)
[c96c66]88{
[f10b0c]89 registerQuery(new AtomQtQuery(param,title,inputLayout,this));
[257c77]90}
91
[f10b0c]92void QtDialog::queryAtoms(Parameter<std::vector<const atom *> > &param, const char* title, std::string)
[c96c66]93{
[f10b0c]94 registerQuery(new AtomsQtQuery(param,title,inputLayout,this));
[7cd6e7]95}
96
[7d9416]97void QtDialog::queryRealSpaceMatrix(Parameter<RealSpaceMatrix> &param, const char* title, std::string)
[41167c]98{
[7d9416]99 registerQuery(new RealSpaceMatrixQtQuery(param,title,inputLayout,this));
[257c77]100}
101
[f10b0c]102void QtDialog::queryInt(Parameter<int> &param, const char *title,string)
[d3a5ea]103{
[f10b0c]104 registerQuery(new IntQtQuery(param,title,inputLayout,this));
[d3a5ea]105}
106
[f10b0c]107void QtDialog::queryInts(Parameter<std::vector<int> > &param, const char *title,string)
[7cd6e7]108{
[f10b0c]109 registerQuery(new IntsQtQuery(param,title,inputLayout,this));
[7cd6e7]110}
111
[f10b0c]112void QtDialog::queryUnsignedInt(Parameter<unsigned int> &param, const char *title,string)
[838cd0]113{
[f10b0c]114 registerQuery(new UnsignedIntQtQuery(param,title,inputLayout,this));
[838cd0]115}
116
[f10b0c]117void QtDialog::queryUnsignedInts(Parameter<std::vector<unsigned int> > &param, const char *title,string)
[12948c]118{
[f10b0c]119 registerQuery(new UnsignedIntsQtQuery(param,title,inputLayout,this));
[12948c]120}
121
[f10b0c]122void QtDialog::queryDouble(Parameter<double> &param, const char* title,string)
[9d457d]123{
[f10b0c]124 registerQuery(new DoubleQtQuery(param,title,inputLayout,this));
[b8d1aeb]125}
126
[f10b0c]127void QtDialog::queryDoubles(Parameter<std::vector<double> > &param, const char* title,string)
[9d457d]128{
[f10b0c]129 registerQuery(new DoublesQtQuery(param,title,inputLayout,this));
[7cd6e7]130}
131
[f10b0c]132void QtDialog::queryString(Parameter<std::string> &param, const char* title,string)
[d3a5ea]133{
[f10b0c]134 registerQuery(new StringQtQuery(param,title,inputLayout,this));
[d3a5ea]135}
136
[f10b0c]137void QtDialog::queryStrings(Parameter<std::vector<std::string> > &param, const char* title,string)
[cd8e55]138{
[f10b0c]139 registerQuery(new StringsQtQuery(param, title,inputLayout,this));
[cd8e55]140}
141
[f10b0c]142void QtDialog::queryMolecule(Parameter<const molecule *> &param, const char *title,string)
[d3a5ea]143{
[f10b0c]144 registerQuery(new MoleculeQtQuery(param,title,inputLayout,this));
[d3a5ea]145}
146
[f10b0c]147void QtDialog::queryMolecules(Parameter<std::vector<const molecule *> > &param, const char *title,string)
[7cd6e7]148{
[f10b0c]149 registerQuery(new MoleculesQtQuery(param, title,inputLayout,this));
[7cd6e7]150}
151
[f10b0c]152void QtDialog::queryVector(Parameter<Vector> &param, const char* title, bool check,string)
[9d457d]153{
[f10b0c]154 registerQuery(new VectorQtQuery(param,title,check,inputLayout,this));
[b8d1aeb]155}
156
[f10b0c]157void QtDialog::queryVectors(Parameter<std::vector<Vector> > &param, const char* title, bool check,string)
[9d457d]158{
[f10b0c]159 registerQuery(new VectorsQtQuery(param, title,check,inputLayout,this));
[7cd6e7]160}
161
[f10b0c]162void QtDialog::queryElement(Parameter<const element *> &param, const char* title, std::string)
[9d457d]163{
[f10b0c]164 registerQuery(new ElementQtQuery(param,title,inputLayout,this));
[cbf01e]165}
166
[f10b0c]167void QtDialog::queryElements(Parameter<std::vector<const element *> > &param, const char* title, std::string)
[9d457d]168{
[f10b0c]169 registerQuery(new ElementsQtQuery(param,title,inputLayout,this));
[7cd6e7]170}
171
[f10b0c]172void QtDialog::queryFile(Parameter<boost::filesystem::path> &param, const char* title, std::string)
[9d457d]173{
[f10b0c]174 registerQuery(new FileQtQuery(param,title,inputLayout,this));
[6f5dfe]175}
176
[bd81f9]177void QtDialog::queryFiles(Parameter<std::vector< boost::filesystem::path> >&param, const char* title, std::string)
[2c5765]178{
[bd81f9]179 registerQuery(new FilesQtQuery(param, title,inputLayout,this));
[2c5765]180}
181
[f10b0c]182void QtDialog::queryRandomNumberDistribution_Parameters(Parameter<RandomNumberDistribution_Parameters> &param, const char* title, std::string)
[0275ad]183{
[f10b0c]184 registerQuery(new RandomNumberDistribution_ParametersQtQuery(param,title,inputLayout,this));
[0275ad]185}
186
[8df74d]187/************************** Query Infrastructure ************************/
188/* ---> shifted to folder Query */
189/************************************************************************/
[7cd6e7]190
[8df74d]191/*************************** Pipe Infrastructure ************************/
192/* ---> shifted to folder Pipe */
193/************************************************************************/
Note: See TracBrowser for help on using the repository browser.