Changes in / [41e15b:5d4b73]


Ignore:
Location:
src
Files:
25 added
2 deleted
84 edited

Legend:

Unmodified
Added
Removed
  • src/Makefile.am

    r41e15b r5d4b73  
    124124  Thermostats/Thermostat.hpp \
    125125  Thermostats/Woodcock.hpp
    126 
    127 QTUIMOC_HEADER = UIElements/Qt4/QtDialog.hpp \
    128         UIElements/Qt4/QtMainWindow.hpp \
    129         UIElements/Menu/Qt4/QtMenu.hpp \
    130         UIElements/Menu/Qt4/QtMenuPipe.hpp \
    131         UIElements/Views/Qt4/QtWorldView.hpp \
    132         UIElements/Views/Qt4/GLMoleculeView.hpp \
    133         UIElements/Views/Qt4/QtMoleculeView.hpp \
    134         UIElements/Views/Qt4/QtStatusBar.hpp
    135                                  
    136 QTUISOURCE = allmocs.moc.cpp \
    137   UIElements/Qt4/Pipe/AtomQtQueryPipe.cpp \
    138   UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp \
    139   UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp \
    140   UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp \
    141   UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp \
    142   UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp \
    143   UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp \
    144   UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp \
    145   UIElements/Qt4/Pipe/FileQtQueryPipe.cpp \
    146   UIElements/Qt4/Pipe/IntQtQueryPipe.cpp \
    147   UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp \
    148   UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp \
    149   UIElements/Qt4/Pipe/StringQtQueryPipe.cpp \
    150   UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp \
    151   UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp \
    152   UIElements/Qt4/Query/AtomQtQuery.cpp \
    153   UIElements/Qt4/Query/AtomsQtQuery.cpp \
    154   UIElements/Qt4/Query/BooleanQtQuery.cpp \
    155   UIElements/Qt4/Query/BoxQtQuery.cpp \
    156   UIElements/Qt4/Query/DoubleQtQuery.cpp \
    157   UIElements/Qt4/Query/DoublesQtQuery.cpp \
    158   UIElements/Qt4/Query/ElementQtQuery.cpp \
    159   UIElements/Qt4/Query/ElementsQtQuery.cpp \
    160   UIElements/Qt4/Query/EmptyQtQuery.cpp \
    161   UIElements/Qt4/Query/FileQtQuery.cpp \
    162   UIElements/Qt4/Query/IntQtQuery.cpp \
    163   UIElements/Qt4/Query/IntsQtQuery.cpp \
    164   UIElements/Qt4/Query/MoleculeQtQuery.cpp \
    165   UIElements/Qt4/Query/MoleculesQtQuery.cpp \
    166   UIElements/Qt4/Query/StringQtQuery.cpp \
    167   UIElements/Qt4/Query/StringsQtQuery.cpp \
    168   UIElements/Qt4/Query/VectorQtQuery.cpp \
    169   UIElements/Qt4/Query/VectorsQtQuery.cpp \
    170         UIElements/Qt4/QtMainWindow.cpp \
    171         UIElements/Qt4/QtDialog.cpp \
    172         UIElements/Qt4/QtUIFactory.cpp \
    173         UIElements/Menu/Qt4/QtMenuPipe.cpp \
    174         UIElements/Views/Qt4/QtWorldView.cpp \
    175         UIElements/Views/Qt4/GLMoleculeView.cpp \
    176         UIElements/Views/Qt4/QtMoleculeView.cpp \
    177         UIElements/Views/Qt4/QtStatusBar.cpp
    178              
    179 QTUIHEADER = \
    180   ${QTUIMOC_HEADER} \
    181   UIElements/Qt4/Pipe/QtQueryListPipe.hpp \
    182   UIElements/Qt4/QtUIFactory.hpp
    183 
    184 QTUI_DEFS =
    185126
    186127TESSELATIONSOURCE = \
     
    358299
    359300#Stuff for building the GUI using Qt
    360 molecuildergui_SOURCES = ${QTUISOURCE} builder.cpp
     301molecuildergui_SOURCES = builder.cpp
    361302molecuildergui_CXXFLAGS = ${QT_CXXFLAGS} ${GLU_CXXFLAGS} -DUSE_GUI_QT
    362303molecuildergui_LDFLAGS = $(BOOST_LIB) ${QT_LDFLAGS} ${GLU_LDFLAGS}
     
    367308molecuildergui_LDADD = \
    368309        UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \
     310        UIElements/libMolecuilderQtUI-@MOLECUILDER_API_VERSION@.la \
    369311        Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
    370312        libMolecuilder-@MOLECUILDER_API_VERSION@.la \
     
    397339        Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
    398340        $(BOOST_LIB)
    399 
    400 #Rules needed for Qt4
    401 # UI-Files are scattered throughout several subdirectories
    402 # Therfore `%'-rules do not seem to work
    403 #Quick fix to get it done otherwise
    404 allmocs.moc.cpp: ${QTUIMOC_HEADER}
    405         echo "" > allmocs.moc.cpp;\
    406         list='$(QTUIMOC_HEADER)'; for header in $$list; do \
    407         echo "Making mocfile for $$header"; \
    408         target=`basename $$header | sed "s/\(.*\)\..*/\1.moc.cpp/"`;\
    409         $(MOC) $(srcdir)/$$header -o $$target \
    410         || eval $$failcom; \
    411         echo "#include \"$$target\"" >> allmocs.moc.cpp; \
    412         done;
    413341
    414342#EXTRA_DIST = ${molecuilder_DATA}
  • src/UIElements/CommandLineUI/CommandLineDialog.cpp

    r41e15b r5d4b73  
    2121
    2222#include "CommandLineUI/CommandLineDialog.hpp"
     23#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2324
    2425
  • src/UIElements/CommandLineUI/CommandLineDialog.hpp

    r41e15b r5d4b73  
    4848protected:
    4949  // specialized stuff for text queries
    50   class EmptyCommandLineQuery : public Dialog::EmptyQuery {
    51   public:
    52     EmptyCommandLineQuery(std::string title, std::string _description = "");
    53     virtual ~EmptyCommandLineQuery();
    54     virtual bool handle();
    55   };
    56 
    57   class IntCommandLineQuery : public Dialog::IntQuery {
    58   public:
    59     IntCommandLineQuery(std::string title, std::string _description = "");
    60     virtual ~IntCommandLineQuery();
    61     virtual bool handle();
    62   };
    63 
    64   class IntsCommandLineQuery : public Dialog::IntsQuery {
    65   public:
    66     IntsCommandLineQuery(std::string title, std::string _description = "");
    67     virtual ~IntsCommandLineQuery();
    68     virtual bool handle();
    69   };
    70 
    71   class BooleanCommandLineQuery : public Dialog::BooleanQuery {
    72   public:
    73     BooleanCommandLineQuery(std::string title, std::string _description = "");
    74     virtual ~BooleanCommandLineQuery();
    75     virtual bool handle();
    76   };
    77 
    78   class DoubleCommandLineQuery : public Dialog::DoubleQuery {
    79   public:
    80     DoubleCommandLineQuery(std::string title, std::string _description = "");
    81     virtual ~DoubleCommandLineQuery();
    82     virtual bool handle();
    83   };
    84 
    85   class DoublesCommandLineQuery : public Dialog::DoublesQuery {
    86   public:
    87     DoublesCommandLineQuery(std::string title, std::string _description = "");
    88     virtual ~DoublesCommandLineQuery();
    89     virtual bool handle();
    90   };
    91 
    92   class StringCommandLineQuery : public Dialog::StringQuery {
    93   public:
    94     StringCommandLineQuery(std::string title, std::string _description = "");
    95     virtual ~StringCommandLineQuery();
    96     virtual bool handle();
    97   };
    98 
    99   class StringsCommandLineQuery : public Dialog::StringsQuery {
    100   public:
    101     StringsCommandLineQuery(std::string title, std::string _description = "");
    102     virtual ~StringsCommandLineQuery();
    103     virtual bool handle();
    104   };
    105 
    106   class AtomCommandLineQuery : public Dialog::AtomQuery {
    107   public:
    108     AtomCommandLineQuery(std::string title, std::string _description = "");
    109     virtual ~AtomCommandLineQuery();
    110     virtual bool handle();
    111   };
    112 
    113   class AtomsCommandLineQuery : public Dialog::AtomsQuery {
    114   public:
    115     AtomsCommandLineQuery(std::string title, std::string _description = "");
    116     virtual ~AtomsCommandLineQuery();
    117     virtual bool handle();
    118   };
    119 
    120   class MoleculeCommandLineQuery : public Dialog::MoleculeQuery {
    121   public:
    122     MoleculeCommandLineQuery(std::string title, std::string _description = "");
    123     virtual ~MoleculeCommandLineQuery();
    124     virtual bool handle();
    125   };
    126 
    127   class MoleculesCommandLineQuery : public Dialog::MoleculesQuery {
    128   public:
    129     MoleculesCommandLineQuery(std::string title, std::string _description = "");
    130     virtual ~MoleculesCommandLineQuery();
    131     virtual bool handle();
    132   };
    133 
    134   class VectorCommandLineQuery : public Dialog::VectorQuery {
    135   public:
    136     VectorCommandLineQuery(std::string title,bool _check, std::string _description = "");
    137     virtual ~VectorCommandLineQuery();
    138     virtual bool handle();
    139   };
    140 
    141   class VectorsCommandLineQuery : public Dialog::VectorsQuery {
    142   public:
    143     VectorsCommandLineQuery(std::string title,bool _check, std::string _description = "");
    144     virtual ~VectorsCommandLineQuery();
    145     virtual bool handle();
    146   };
    147 
    148   class BoxCommandLineQuery : public Dialog::BoxQuery {
    149   public:
    150     BoxCommandLineQuery(std::string title, std::string _description = "");
    151     virtual ~BoxCommandLineQuery();
    152     virtual bool handle();
    153   };
    154 
    155   class ElementCommandLineQuery : public Dialog::ElementQuery {
    156   public:
    157     ElementCommandLineQuery(std::string title, std::string _description = "");
    158     virtual ~ElementCommandLineQuery();
    159     virtual bool handle();
    160   };
    161 
    162   class ElementsCommandLineQuery : public Dialog::ElementsQuery {
    163   public:
    164     ElementsCommandLineQuery(std::string title, std::string _description = "");
    165     virtual ~ElementsCommandLineQuery();
    166     virtual bool handle();
    167   };
    168 
    169   class FileCommandLineQuery : public Dialog::FileQuery {
    170   public:
    171     FileCommandLineQuery(std::string title, std::string _description = "");
    172     virtual ~FileCommandLineQuery();
    173     virtual bool handle();
    174   };
     50  class AtomCommandLineQuery;
     51  class AtomsCommandLineQuery;
     52  class BooleanCommandLineQuery;
     53  class BoxCommandLineQuery;
     54  class DoubleCommandLineQuery;
     55  class DoublesCommandLineQuery;
     56  class ElementCommandLineQuery;
     57  class ElementsCommandLineQuery;
     58  class EmptyCommandLineQuery;
     59  class FileCommandLineQuery;
     60  class IntCommandLineQuery;
     61  class IntsCommandLineQuery;
     62  class MoleculeCommandLineQuery;
     63  class MoleculesCommandLineQuery;
     64  class StringCommandLineQuery;
     65  class StringsCommandLineQuery;
     66  class VectorCommandLineQuery;
     67  class VectorsCommandLineQuery;
    17568};
    17669
  • src/UIElements/CommandLineUI/CommandLineParser.cpp

    r41e15b r5d4b73  
    2121
    2222#include <boost/filesystem.hpp>
    23 #include <boost/lexical_cast.hpp>
    2423#include <boost/program_options.hpp>
    2524#include <fstream>
    2625#include <iostream>
    2726#include <map>
    28 #include <vector>
    2927
    3028#include "Actions/Action.hpp"
     
    3432#include "Actions/OptionTrait.hpp"
    3533#include "Actions/Values.hpp"
    36 #include "Helpers/Assert.hpp"
    3734#include "Helpers/Log.hpp"
    3835#include "Helpers/Verbose.hpp"
    3936#include "CommandLineParser.hpp"
     37#include "CommandLineParser_validate.hpp"
    4038
    4139#include "Patterns/Singleton_impl.hpp"
    4240
    4341class element;
    44 
    45 using namespace std;
    46 
    47 /** boost::program_options validator specialization for VectorValue.
    48  * \param &v  reference for return value
    49  * \param &values string vector of scanned options
    50  * \param *
    51  * \param
    52  *
    53  */
    54 void validate(boost::any& v, const std::vector<std::string>& values, VectorValue *, int)
    55 {
    56   VectorValue VV;
    57   std::vector<std::string> components;
    58 
    59   // split comma-separated values
    60   if (values.size() != 1) {
    61     cerr <<  "Not one vector but " << values.size() << " given " << endl;
    62     throw boost::program_options::validation_error("Unequal to one vector given");
    63   }
    64   std::string argument(values.at(0));
    65   std::string::iterator Aiter = argument.begin();
    66   std::string::iterator Biter = argument.begin();
    67   for (; Aiter != argument.end(); ++Aiter) {
    68     if (*Aiter == ',') {
    69       components.push_back(string(Biter,Aiter));
    70       do {
    71         Aiter++;
    72       } while (*Aiter == ' ' || *Aiter == '\t');
    73       Biter = Aiter;
    74     }
    75   }
    76   components.push_back(string(Biter,argument.end()));
    77 
    78   if (components.size() != 3) {
    79     cerr <<  "Specified vector does not have three components but " << components.size() << endl;
    80     throw boost::program_options::validation_error("Specified vector does not have three components");
    81   }
    82   VV.x = boost::lexical_cast<double>(components.at(0));
    83   VV.y = boost::lexical_cast<double>(components.at(1));
    84   VV.z = boost::lexical_cast<double>(components.at(2));
    85   v = boost::any(VectorValue(VV));
    86 }
    87 
    88 void validate(boost::any& v, const std::vector<std::string>& values, BoxValue *, int)
    89 {
    90   BoxValue BV;
    91   std::vector<std::string> components;
    92 
    93   // split comma-separated values
    94   if (values.size() != 1) {
    95     cerr <<  "Not one vector but " << values.size() << " given " << endl;
    96     throw boost::program_options::validation_error("Unequal to one vector given");
    97   }
    98   std::string argument(values.at(0));
    99   std::string::iterator Aiter = argument.begin();
    100   std::string::iterator Biter = argument.begin();
    101   for (; Aiter != argument.end(); ++Aiter) {
    102     if (*Aiter == ',') {
    103       components.push_back(string(Biter,Aiter));
    104       do {
    105         Aiter++;
    106       } while (*Aiter == ' ' || *Aiter == '\t');
    107       Biter = Aiter;
    108     }
    109   }
    110   components.push_back(string(Biter,argument.end()));
    111 
    112   if (components.size() != 6) {
    113     cerr <<  "Specified vector does not have three components but " << components.size() << endl;
    114     throw boost::program_options::validation_error("Specified symmetric box matrix does not have six components");
    115   }
    116   BV.xx = boost::lexical_cast<double>(components.at(0));
    117   BV.yx = boost::lexical_cast<double>(components.at(1));
    118   BV.yy = boost::lexical_cast<double>(components.at(2));
    119   BV.zx = boost::lexical_cast<double>(components.at(3));
    120   BV.zy = boost::lexical_cast<double>(components.at(4));
    121   BV.zz = boost::lexical_cast<double>(components.at(5));
    122   v = boost::any(BoxValue(BV));
    123 }
    124 
    125 /** boost::program_options validator specialization for boost::filesystem::path.
    126  * \param &v  reference for return value
    127  * \param &values string vector of scanned options
    128  * \param *
    129  * \param
    130  *
    131  */
    132 void validate(boost::any& v, const std::vector<std::string>& values, boost::filesystem::path *, int)
    133 {
    134   boost::filesystem::path filename;
    135 
    136   std::cout << "boost::filesystem::path validator used." << std::endl;
    137 
    138   // split comma-separated values
    139   if (values.size() != 1) {
    140     cerr <<  "Not one file but " << values.size() << " given " << endl;
    141     throw boost::program_options::validation_error("Unequal to one file given");
    142   }
    143   filename = values.at(0);
    144   v = boost::any(boost::filesystem::path(filename));
    145 }
    146 
    14742
    14843/** Constructor of class CommandLineParser.
     
    461356{
    462357  po::store(po::command_line_parser(argc,argv).options(cmdline_options).run(), vm);
    463   ifstream input;
     358  std::ifstream input;
    464359  input.open("example.cfg");
    465360  if (!input.fail())
     
    473368void CommandLineParser::scanforSequenceOfArguments()
    474369{
    475   map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap();
     370  std::map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap();
    476371  // go through all arguments
    477372  for (int i=1;i<argc;i++) {
    478     (cout << Verbose(1) << "Checking on " << argv[i] << endl);
     373    (std::cout << Verbose(1) << "Checking on " << argv[i] << std::endl);
    479374    // check whether they
    480375    if (argv[i][0] == '-') { // .. begin with -
     
    485380        //  .. and check that next letter is not numeric, if so insert
    486381      } else if (((argv[i][1] < '0') || (argv[i][1] > '9')) && ((argv[i][1] != '.'))) {
    487         map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1]));
     382        std::map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1]));
    488383        if (iter != ShortFormToActionMap.end()) {
    489384          (cout << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl);
     
    511406std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap()
    512407{
    513   map <std::string, std::string> result;
     408  std::map <std::string, std::string> result;
    514409
    515410  ActionRegistry &AR = ActionRegistry::getInstance();
  • src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp

    r41e15b r5d4b73  
    2424#include <Descriptors/AtomDescriptor.hpp>
    2525#include <Descriptors/AtomIdDescriptor.hpp>
    26 #include "CommandLineUI/CommandLineDialog.hpp"
    2726
     27#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2828#include "CommandLineUI/CommandLineParser.hpp"
    2929#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp

    r41e15b r5d4b73  
    2222#include <Descriptors/AtomDescriptor.hpp>
    2323#include <Descriptors/AtomIdDescriptor.hpp>
    24 #include "CommandLineUI/CommandLineDialog.hpp"
    25 
     24#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2625#include "CommandLineUI/CommandLineParser.hpp"
    2726#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp

    r41e15b r5d4b73  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "CommandLineUI/CommandLineDialog.hpp"
    23 
     22#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2423#include "CommandLineUI/CommandLineParser.hpp"
    2524#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp

    r41e15b r5d4b73  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "CommandLineUI/CommandLineDialog.hpp"
    23 
    2422#include "Actions/Values.hpp"
     23#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2524#include "CommandLineUI/CommandLineParser.hpp"
    2625#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp

    r41e15b r5d4b73  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "CommandLineUI/CommandLineDialog.hpp"
    23 
     22#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2423#include "CommandLineUI/CommandLineParser.hpp"
    2524#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp

    r41e15b r5d4b73  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "CommandLineUI/CommandLineDialog.hpp"
    23 
     22#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2423#include "CommandLineUI/CommandLineParser.hpp"
    2524#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp

    r41e15b r5d4b73  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "CommandLineUI/CommandLineDialog.hpp"
    23 
     22#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2423#include "CommandLineUI/CommandLineParser.hpp"
    2524#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp

    r41e15b r5d4b73  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "CommandLineUI/CommandLineDialog.hpp"
    23 
     22#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2423#include "CommandLineUI/CommandLineParser.hpp"
    2524#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "CommandLineUI/CommandLineDialog.hpp"
    25 
     24#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2625#include "CommandLineUI/CommandLineParser.hpp"
    2726#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp

    r41e15b r5d4b73  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "CommandLineUI/CommandLineDialog.hpp"
    23 
     22#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2423#include "CommandLineUI/CommandLineParser.hpp"
    2524#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp

    r41e15b r5d4b73  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "CommandLineUI/CommandLineDialog.hpp"
    23 
     22#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2423#include "CommandLineUI/CommandLineParser.hpp"
    2524#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp

    r41e15b r5d4b73  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "CommandLineUI/CommandLineDialog.hpp"
    23 
     22#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2423#include "CommandLineUI/CommandLineParser.hpp"
    2524#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp

    r41e15b r5d4b73  
    2222#include <Descriptors/MoleculeDescriptor.hpp>
    2323#include <Descriptors/MoleculeIdDescriptor.hpp>
    24 #include "CommandLineUI/CommandLineDialog.hpp"
    2524
     25#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2626#include "CommandLineUI/CommandLineParser.hpp"
    2727#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp

    r41e15b r5d4b73  
    2222#include <Descriptors/MoleculeDescriptor.hpp>
    2323#include <Descriptors/MoleculeIdDescriptor.hpp>
    24 #include "CommandLineUI/CommandLineDialog.hpp"
    2524
     25#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2626#include "CommandLineUI/CommandLineParser.hpp"
    2727#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp

    r41e15b r5d4b73  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "CommandLineUI/CommandLineDialog.hpp"
    23 
     22#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2423#include "CommandLineUI/CommandLineParser.hpp"
    2524#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp

    r41e15b r5d4b73  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "CommandLineUI/CommandLineDialog.hpp"
    23 
     22#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2423#include "CommandLineUI/CommandLineParser.hpp"
    2524#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp

    r41e15b r5d4b73  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "CommandLineUI/CommandLineDialog.hpp"
    23 
    2422#include "Actions/Values.hpp"
     23#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2524#include "CommandLineUI/CommandLineParser.hpp"
    2625#include "Helpers/Log.hpp"
  • src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp

    r41e15b r5d4b73  
    2222#include <vector>
    2323
    24 #include "CommandLineUI/CommandLineDialog.hpp"
    25 
    2624#include "Actions/Values.hpp"
     25#include "CommandLineUI/Query/CommandLineQuery.hpp"
    2726#include "CommandLineUI/CommandLineParser.hpp"
    2827#include "Helpers/Log.hpp"
  • src/UIElements/Makefile.am

    r41e15b r5d4b73  
    33INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/UIElements
    44
    5 AM_LDFLAGS = $(CPPUNIT_LIBS) -ldl
    6 AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
     5AM_LDFLAGS = -ldl
     6AM_CXXFLAGS = ${QT_CXXFLAGS} ${GLU_CXXFLAGS}
    77
    88VIEWSOURCE = \
     
    2828 
    2929TEXTMENUSOURCE = \
     30  Menu/TextMenu/TxMenuLeaveAction.cpp \
    3031  Menu/TextMenu/TxMenu.cpp \
    3132  Menu/TextMenu/MenuItem.cpp \
    3233  Menu/TextMenu/SubMenuItem.cpp \
    3334  Menu/TextMenu/ActionMenuItem.cpp \
    34   Menu/TextMenu/SeperatorItem.cpp \
     35  Menu/TextMenu/SeparatorMenuItem.cpp \
    3536  Menu/TextMenu/DisplayMenuItem.cpp
    3637 
     
    4142  Menu/TextMenu/SubMenuItem.hpp \
    4243  Menu/TextMenu/ActionMenuItem.hpp \
    43   Menu/TextMenu/SeperatorItem.hpp \
     44  Menu/TextMenu/SeparatorMenuItem.hpp \
    4445  Menu/TextMenu/DisplayMenuItem.hpp
    4546
     
    107108  TextUI/TextWindow.cpp
    108109TEXTUIHEADER = \
     110  TextUI/Query/TextQuery.hpp \
    109111  TextUI/TextDialog.hpp \
    110112  TextUI/TextStatusIndicator.hpp \
     
    133135  CommandLineUI/CommandLineDialog.cpp \
    134136  CommandLineUI/CommandLineParser.cpp \
     137  CommandLineUI/CommandLineParser_validate.cpp \
    135138  CommandLineUI/CommandLineStatusIndicator.cpp \
    136139  CommandLineUI/CommandLineUIFactory.cpp \
     
    139142 
    140143COMMANDLINEUIHEADER = \
     144  CommandLineUI/Query/CommandLineQuery.hpp \
    141145  CommandLineUI/CommandLineDialog.hpp \
    142146  CommandLineUI/CommandLineParser.hpp \
     147  CommandLineUI/CommandLineParser_validate.hpp \
    143148  CommandLineUI/CommandLineStatusIndicator.hpp \
    144149  CommandLineUI/CommandLineUIFactory.hpp \
     
    146151  CommandLineUI/TypeEnumContainer.cpp
    147152
    148 lib_LTLIBRARIES = libMolecuilderUI-@MOLECUILDER_API_VERSION@.la
     153QTUIMOC_HEADER = \
     154        Qt4/QtDialog.hpp \
     155        Qt4/QtMainWindow.hpp \
     156  Qt4/Pipe/AtomQtQueryPipe.hpp \
     157  Qt4/Pipe/AtomsQtQueryPipe.hpp \
     158  Qt4/Pipe/BooleanQtQueryPipe.hpp \
     159  Qt4/Pipe/BoxQtQueryPipe.hpp \
     160  Qt4/Pipe/DoubleQtQueryPipe.hpp \
     161  Qt4/Pipe/ElementsQtQueryPipe.hpp \
     162  Qt4/Pipe/EmptyQtQueryPipe.hpp \
     163  Qt4/Pipe/ElementQtQueryPipe.hpp \
     164  Qt4/Pipe/FileQtQueryPipe.hpp \
     165  Qt4/Pipe/IntQtQueryPipe.hpp \
     166  Qt4/Pipe/MoleculeQtQueryPipe.hpp \
     167  Qt4/Pipe/MoleculesQtQueryPipe.hpp \
     168  Qt4/Pipe/StringQtQueryPipe.hpp \
     169  Qt4/Pipe/VectorQtQueryPipe.hpp \
     170  Qt4/Pipe/VectorsQtQueryPipe.hpp \
     171        Menu/Qt4/QtMenuPipe.hpp \
     172        Views/Qt4/QtWorldView.hpp \
     173        Views/Qt4/GLMoleculeView.hpp \
     174        Views/Qt4/QtMoleculeView.hpp \
     175        Views/Qt4/QtStatusBar.hpp
     176                                 
     177QTUISOURCE = allmocs.moc.cpp \
     178  Qt4/Pipe/AtomQtQueryPipe.cpp \
     179  Qt4/Pipe/AtomsQtQueryPipe.cpp \
     180  Qt4/Pipe/BooleanQtQueryPipe.cpp \
     181  Qt4/Pipe/BoxQtQueryPipe.cpp \
     182  Qt4/Pipe/DoubleQtQueryPipe.cpp \
     183  Qt4/Pipe/ElementsQtQueryPipe.cpp \
     184  Qt4/Pipe/EmptyQtQueryPipe.cpp \
     185  Qt4/Pipe/ElementQtQueryPipe.cpp \
     186  Qt4/Pipe/FileQtQueryPipe.cpp \
     187  Qt4/Pipe/IntQtQueryPipe.cpp \
     188  Qt4/Pipe/MoleculeQtQueryPipe.cpp \
     189  Qt4/Pipe/MoleculesQtQueryPipe.cpp \
     190  Qt4/Pipe/StringQtQueryPipe.cpp \
     191  Qt4/Pipe/VectorQtQueryPipe.cpp \
     192  Qt4/Pipe/VectorsQtQueryPipe.cpp \
     193  Qt4/Query/AtomQtQuery.cpp \
     194  Qt4/Query/AtomsQtQuery.cpp \
     195  Qt4/Query/BooleanQtQuery.cpp \
     196  Qt4/Query/BoxQtQuery.cpp \
     197  Qt4/Query/DoubleQtQuery.cpp \
     198  Qt4/Query/DoublesQtQuery.cpp \
     199  Qt4/Query/ElementQtQuery.cpp \
     200  Qt4/Query/ElementsQtQuery.cpp \
     201  Qt4/Query/EmptyQtQuery.cpp \
     202  Qt4/Query/FileQtQuery.cpp \
     203  Qt4/Query/IntQtQuery.cpp \
     204  Qt4/Query/IntsQtQuery.cpp \
     205  Qt4/Query/MoleculeQtQuery.cpp \
     206  Qt4/Query/MoleculesQtQuery.cpp \
     207  Qt4/Query/StringQtQuery.cpp \
     208  Qt4/Query/StringsQtQuery.cpp \
     209  Qt4/Query/VectorQtQuery.cpp \
     210  Qt4/Query/VectorsQtQuery.cpp \
     211        Qt4/QtMainWindow.cpp \
     212        Qt4/QtDialog.cpp \
     213        Qt4/QtUIFactory.cpp \
     214        Menu/Qt4/QtMenuPipe.cpp \
     215        Views/Qt4/QtWorldView.cpp \
     216        Views/Qt4/GLMoleculeView.cpp \
     217        Views/Qt4/QtMoleculeView.cpp \
     218        Views/Qt4/QtStatusBar.cpp
     219             
     220QTUIHEADER = \
     221  ${QTUIMOC_HEADER} \
     222        Menu/Qt4/QtMenu.hpp \
     223        Qt4/Query/QtQuery.hpp \
     224  Qt4/QtUIFactory.hpp \
     225  Qt4/Pipe/QtQueryListPipe.hpp
     226
     227QTUI_DEFS =
     228
     229
     230
     231lib_LTLIBRARIES = libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \
     232        libMolecuilderQtUI-@MOLECUILDER_API_VERSION@.la
    149233libMolecuilderUI_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/
     234libMolecuilderQtUI_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/
    150235libMolecuilderUI_LIBS = \
    151236        Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la
     237libMolecuilderQtUI_LIBS = \
     238        Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la
    152239
    153240nobase_libMolecuilderUI_include_HEADERS = ${UIHEADER}
     241nobase_libMolecuilderQtUI_include_HEADERS = ${QTUIHEADER}
    154242
    155243## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la"
     
    162250## which are already listed elsewhere in a _HEADERS variable assignment.
    163251libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_SOURCES = ${UISOURCE}
     252libMolecuilderQtUI_@MOLECUILDER_API_VERSION@_la_SOURCES = ${QTUISOURCE}
    164253
    165254## Instruct libtool to include ABI version information in the generated shared
     
    167256## that all version information is kept in one place.
    168257libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION)
     258libMolecuilderQtUI_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION)
    169259
    170260## The generated configuration header is installed in its own subdirectory of
     
    180270## shipped with the source tarball.
    181271libMolecuilderUI_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include
     272libMolecuilderQtUI_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include
    182273nodist_libMolecuilderUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h
     274nodist_libMolecuilderQtUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h
    183275
    184276## Install the generated pkg-config file (.pc) into the expected location for
     
    195287        done;
    196288       
     289#Rules needed for Qt4
     290# UI-Files are scattered throughout several subdirectories
     291# Therfore `%'-rules do not seem to work
     292#Quick fix to get it done otherwise
     293allmocs.moc.cpp: ${QTUIMOC_HEADER}
     294        echo "" > allmocs.moc.cpp;\
     295        list='$(QTUIMOC_HEADER)'; for header in $$list; do \
     296        echo "Making mocfile for $$header"; \
     297        target=`basename $$header | sed "s/\(.*\)\..*/\1.moc.cpp/"`;\
     298        $(MOC) $(srcdir)/$$header -o $$target \
     299        || eval $$failcom; \
     300        echo "#include \"$$target\"" >> allmocs.moc.cpp; \
     301        done;
     302
     303       
    197304MOSTLYCLEANFILES = unity.cpp
  • src/UIElements/Menu/Menu.hpp

    r41e15b r5d4b73  
    2121 * Note that this Class is never to be used directly but only via derived
    2222 * specializations.
     23 *
     24 * Note that we do not call member function init() directly in the constructor
     25 * to allow for something to be add to the menu beforehand which is necessary
     26 * for the TextMenu for example.
     27 *
     28 * <h1>Howto</h1>
     29 *
     30 * First, derive your own menu class, see QtMenu or TextMenu for example. These
     31 * have been templated because of the two Qt classes QMenu and QMenuBar to be
     32 * addressable in a unified manner. TextMenu does not actually need to be a
     33 * template but it does not hurt either.
     34 *
     35 * Basically, the structure is as follows:
     36 *  -# Menu implements the initialization: it goes through MenuDescription's and
     37 *     ActionRegistry's contents and adds MenuItem's and Action's as requested.
     38 *  -# It does so by calling virtual functions defined in MenuInterface. These
     39 *     allow for adding of specific type of items: separators, Actions, menus
     40 *  -# Your derived Menu implements add these specific adders, basically just as
     41 *     wrappers. If you really have another UI type, implement its Menu
     42 *     functionality separately, such as TxMenu does.
     43 *  -# It also inherits both Menu and virtually MenuInterface such that it
     44 *     contains initializing and adding functionality
     45 *
     46 *  Note that MenuInterface is inherited by both Menu and your class and hence has
     47 *  to be declared as a "virtual" base class for both.
    2348 */
    2449class Menu : virtual public MenuInterface
  • src/UIElements/Menu/TextMenu/TextMenu.hpp

    r41e15b r5d4b73  
    1212#include <string>
    1313
     14#include "Helpers/MemDebug.hpp"
     15
    1416#include "Helpers/Log.hpp"
    1517#include "Helpers/Verbose.hpp"
     
    1921#include "Actions/ActionRegistry.hpp"
    2022#include "Actions/ActionTraits.hpp"
    21 #include "Menu/TextMenu/TxMenu.hpp"
     23#include "Menu/TextMenu/TxMenuLeaveAction.hpp"
    2224#include "Menu/TextMenu/ActionMenuItem.hpp"
    23 #include "Menu/TextMenu/SeperatorItem.hpp"
     25#include "Menu/TextMenu/SeparatorMenuItem.hpp"
    2426#include "Menu/TextMenu/SubMenuItem.hpp"
    2527
    2628/** TextMenu is a specialization of MenuInterface to access TxMenu-like menus.
     29 *
     30 * Basically, this class is to be used in the MainWindow class of the TextUI.
     31 * There, we simply instantiate the class and call init() in order to add all
     32 * MenuItem's from MenuDescriptions and Action's ActionRegistry.
     33 *
    2734 * \sa QtMenu.
    2835 */
     
    3138{
    3239public:
     40  /** Constructor for class TextMenu.
     41   * Initializes outputter and token and takes note whether to delete the
     42   * MenuInstance or not.
     43   */
    3344  TextMenu(std::ostream &_outputter, const std::string &_token) :
    3445    MenuInterface(_token),
     
    4657  {}
    4758
     59  /** Destructor of MenuInstance.
     60   *
     61   */
    4862  virtual ~TextMenu()
    4963  {
     
    5266  }
    5367
     68  /** Display this MenuInstance.
     69   *
     70   */
    5471  void display()
    5572  {
     
    5774  }
    5875
     76  /** Returns a pointer to the contained/wrapped MenuInstance.
     77   * \return pointer to template class pointer
     78   */
    5979  T * const getMenuInstance()
    6080  {
     
    6282  }
    6383
     84  /** Reserves a specific trigger key such that it is not used during init().
     85   * \param trigger trigger key
     86   * \param &name token given for reference.
     87   */
    6488  void reserveShortcut(char trigger, const std::string &name)
    6589  {
     
    78102  MenuShortcutMap ShortcutMap;
    79103
     104  /** Adds an ActionItem by simply creating a new one.
     105   * \param &token token of Action (token in ActionRegistry)
     106   * \param &description descriptive text to be shown
     107   */
    80108  virtual void addActionItem(const std::string &token, const std::string &description)
    81109  {
     
    83111  }
    84112
     113  /** Adds a (dead) separator item.
     114   *
     115   */
    85116  virtual void addSeparatorItem()
    86117  {
    87     new SeperatorItem(MenuInstance);
     118    new SeparatorMenuItem(MenuInstance);
    88119  }
    89120
     121  /** Adds a Menu to this current Menu.
     122   * We also create here a leave action for this submenu to be able to return
     123   * to the current one again
     124   * \param &token token of the menu
     125   * \param &description descriptive text
     126   */
    90127  virtual void addSubmenuItem(const std::string &token, const std::string &description)
    91128  {
     
    102139  }
    103140
     141  /** Return the next available trigger key suitable to this name.
     142   * This function is used internally to make sure that each key is unique to
     143   * each Action/Menu. The chosen trigger key is also stored in an internal ShortcutMap.
     144   * \param &name text shown in menu
     145   * \return trigger key
     146   */
    104147  char getSuitableShortForm(const std::string &name)
    105148  {
  • src/UIElements/Menu/TextMenu/TxMenu.cpp

    r41e15b r5d4b73  
    2424#include <iostream>
    2525#include <cmath>
    26 #include "Actions/Action.hpp"
    27 #include "Actions/ActionTraits.hpp"
    2826#include "Menu/TextMenu/TxMenu.hpp"
    2927#include "Menu/TextMenu/MenuItem.hpp"
    30 #include "Helpers/Assert.hpp"
    3128
    3229
    33 /**
     30/** Constructor for class TxMenu.
     31 *
    3432 * produce a text menu with a given title.
    3533 * The text will later be displayed using the stream passed to the constructor.
     34 * \param &_outputter output stream to use for displaying the text
     35 * \param _title title of this menu
     36 * \param _spacer key to separate trigger key from descriptive text shown
     37 * \param _length maximum length of the descriptive text
    3638 */
    3739TxMenu::TxMenu(std::ostream& _outputter, const std::string _title, char _spacer,int _length) :
     
    4547}
    4648
     49/** Destructor for class TxMenu.
     50 *
     51 */
    4752TxMenu::~TxMenu()
    4853{
     
    5156}
    5257
     58/** Adds an MenuItem to the internal list.
     59 * \param *item item to add
     60 */
    5361void TxMenu::addItem(MenuItem* item) {
    5462  items.push_back(item);
    5563}
    5664
     65/** Removes an MenuItem to the internal list.
     66 * \param *item item to remove
     67 */
    5768void TxMenu::removeItem(MenuItem* item) {
    5869  items.remove(item);
    5970}
    6071
     72/** Function to quit this TxMenu.
     73 */
    6174void TxMenu::doQuit(){
    6275  quit = true;
    6376}
    6477
     78/** Return the current state of quitting.
     79 * \return quit boolean
     80 */
    6581bool TxMenu::hasQuit(){
    6682  return quit;
    6783}
    6884
     85/** Display in a formatted manner a given entry of this menu.
     86 * \param *entry MenuItem to show
     87 */
    6988void TxMenu::showEntry(MenuItem* entry){
    7089  if(entry->isActive()==false){
     
    7897}
    7998
     99/** Display this menu.
     100 *
     101 */
    80102void TxMenu::display() {
    81103  char choice;
     
    114136}
    115137
     138/**  Return the internally stored title of the menu.
     139 * \return title string
     140 */
    116141std::string TxMenu::getTitle(){
    117142  return title;
    118143}
    119144
     145/**  Return the internally stored outputter of the menu.
     146 * \return output stream reference
     147 */
    120148std::ostream& TxMenu::getOutputter()
    121149{
     
    123151}
    124152
    125 
     153/** Add a default item to the menu.
     154 * \param *_defaultItem MenuItem to act as default item.
     155 */
    126156void TxMenu::addDefault(MenuItem* _defaultItem) {
    127157  defaultItem = _defaultItem;
    128158}
    129159
    130 /****************************** Contained Actions ****************/
    131 
    132 TxMenu::LeaveAction::LeaveAction(TxMenu* const _menu, const ActionTraits & LeaveActionTrait) :
    133   Action(LeaveActionTrait, true),
    134   menu(_menu)
    135 {}
    136 
    137 TxMenu::LeaveAction::~LeaveAction(){}
    138 
    139 bool TxMenu::LeaveAction::canUndo(){
    140   return false;
    141 }
    142 
    143 bool TxMenu::LeaveAction::shouldUndo(){
    144   return false;
    145 }
    146 
    147 void TxMenu::LeaveAction::getParametersfromValueStorage()
    148 {}
    149 
    150 Dialog* TxMenu::LeaveAction::fillDialog(Dialog *dialog){
    151   ASSERT(dialog,"No Dialog given when filling action dialog");
    152   return dialog;
    153 }
    154 
    155 
    156 Action::state_ptr TxMenu::LeaveAction::performCall(){
    157   menu->doQuit();
    158   return Action::success;
    159 }
    160 
    161 
    162 Action::state_ptr TxMenu::LeaveAction::performUndo(Action::state_ptr){
    163   ASSERT(0,"Cannot undo leaving a menu");
    164   return Action::success;
    165 }
    166 
    167 Action::state_ptr TxMenu::LeaveAction::performRedo(Action::state_ptr){
    168   ASSERT(0,"Cannot redo leaving a menu");
    169   return Action::success;
    170 }
  • src/UIElements/Menu/TextMenu/TxMenu.hpp

    r41e15b r5d4b73  
    1414
    1515#include "Menu/Menu.hpp"
    16 #include "Actions/Action.hpp"
    17 #include "Actions/ActionTraits.hpp"
    1816#include "defs.hpp"
    1917
    2018class MenuItem;
    2119
    22 /**
    23  * Used to produce any kind of text menu
     20/** Menu for the TextUI.
    2421 *
    25  * All Items are displayed and user is prompted for a key. The item corresponding to that key is then activated.
     22 * Used to produce any kind of text menu. This is a generic text menu user
     23 * interface, i.e. we have a list of MenuItem's, which can either be
     24 * -# Action's
     25 * -# Displayers
     26 * -# Separators
     27 * -# other Menu's
     28 *
     29 * In this manner we have a tree structure, the (sub)menus generating new
     30 * branches, the rest making up the leaves.
     31 *
     32 * All Items are displayed via a given output stream and user is prompted
     33 * for a key. The item corresponding to that key is then activated.
    2634 */
    2735class TxMenu
    2836{
    2937public:
    30   class LeaveAction : public Action {
    31   public:
    32     LeaveAction(TxMenu* const, const ActionTraits &_trait);
    33     virtual ~LeaveAction();
    34 
    35     bool canUndo();
    36     bool shouldUndo();
    37 
    38   protected:
    39     virtual Dialog* fillDialog(Dialog *dialog);
    40   private:
    41     virtual void getParametersfromValueStorage();
    42     virtual Action::state_ptr performCall();
    43     virtual Action::state_ptr performUndo(Action::state_ptr);
    44     virtual Action::state_ptr performRedo(Action::state_ptr);
    45 
    46     TxMenu* const menu;
    47   };
     38  class LeaveAction;
    4839
    4940  TxMenu(std::ostream& _outputter, const std::string _title, char _spacer=STD_MENU_TITLE_SPACER,int _length=STD_MENU_LENGTH);
  • src/UIElements/Qt4/Pipe/AtomQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/AtomQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
  • src/UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/AtomsQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
  • src/UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/BooleanQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
    2223#include <Qt/qcombobox.h>
    2324
     25#include "Helpers/MemDebug.hpp"
    2426
    2527BooleanQtQueryPipe::BooleanQtQueryPipe(const bool *_content, QtDialog *_dialog, QComboBox *_booleanComboBox) :
  • src/UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/BoxQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
     
    2324#include <Qt/qtablewidget.h>
    2425
     26#include "Helpers/MemDebug.hpp"
    2527#include "LinearAlgebra/Matrix.hpp"
    2628#include "Box.hpp"
  • src/UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/DoubleQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
    22 #include <Qt/qcombobox.h>
    23 
     23#include "Helpers/MemDebug.hpp"
    2424
    2525DoubleQtQueryPipe::DoubleQtQueryPipe(double *_content, QtDialog *_dialog) :
  • src/UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/ElementQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
    2223#include <Qt/qcombobox.h>
    2324
     25#include "Helpers/MemDebug.hpp"
    2426#include "element.hpp"
    2527#include "periodentafel.hpp"
  • src/UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/ElementsQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
     
    2425#include <Qt/qcombobox.h>
    2526
     27#include "Helpers/MemDebug.hpp"
    2628#include "element.hpp"
    2729#include "periodentafel.hpp"
  • src/UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/EmptyQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
    22 #include <Qt/qcombobox.h>
    23 
     23#include "Helpers/MemDebug.hpp"
    2424
    2525EmptyQtQueryPipe::EmptyQtQueryPipe(QtDialog *_dialog, QLabel *_textLabel) :
  • src/UIElements/Qt4/Pipe/FileQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
    20 #include "UIElements/Qt4/QtDialog.hpp"
     20#include <QtGui/QFileDialog>
     21#include <Qt/qcombobox.h>
     22#include <Qt/qlineedit.h>
     23#include <Qt/qpushbutton.h>
     24
     25#include "Helpers/MemDebug.hpp"
    2126
    2227#include <iostream>
    2328#include <boost/filesystem.hpp>
    2429
    25 #include <Qt/qcombobox.h>
    26 #include <Qt/qlineedit.h>
    27 #include <Qt/qpushbutton.h>
    28 
     30#include "UIElements/Qt4/Pipe/FileQtQueryPipe.hpp"
     31#include "UIElements/Qt4/QtDialog.hpp"
    2932
    3033FileQtQueryPipe::FileQtQueryPipe(boost::filesystem::path *_content, QtDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton) :
  • src/UIElements/Qt4/Pipe/IntQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/IntQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
    22 #include <Qt/qcombobox.h>
     23#include "Helpers/MemDebug.hpp"
    2324
    2425
  • src/UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/MoleculeQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
    2223#include <Qt/qcombobox.h>
     24
     25#include "Helpers/MemDebug.hpp"
    2326
    2427#include "Descriptors/MoleculeIdDescriptor.hpp"
  • src/UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/MoleculesQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
     
    2324
    2425#include <Qt/qcombobox.h>
     26
     27#include "Helpers/MemDebug.hpp"
    2528
    2629#include "Descriptors/MoleculeIdDescriptor.hpp"
  • src/UIElements/Qt4/Pipe/QtQueryListPipe.hpp

    r41e15b r5d4b73  
    99#define QTQUERYLISTPIPE_HPP_
    1010
     11#include "QtQueryPipe.hpp"
     12
    1113#include <boost/lexical_cast.hpp>
    1214
    1315using boost::lexical_cast;
    1416using boost::bad_lexical_cast;
     17
    1518
    1619template<typename T> QtQueryListPipe<T>::QtQueryListPipe(std::vector<T> *_content, QtDialog *_dialog, QLineEdit *_inputBox, QListWidget *_inputList, QPushButton *_AddButton, QPushButton *_RemoveButton) :
  • src/UIElements/Qt4/Pipe/StringQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/StringQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
     23#include "Helpers/MemDebug.hpp"
     24
    2225#include <string>
    23 
    24 #include <Qt/qcombobox.h>
    2526
    2627
  • src/UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/VectorQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
    2223#include <Qt/qcombobox.h>
     24
     25#include "Helpers/MemDebug.hpp"
    2326
    2427
  • src/UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp

    r41e15b r5d4b73  
    1818#endif
    1919
     20#include "UIElements/Qt4/Pipe/VectorsQtQueryPipe.hpp"
    2021#include "UIElements/Qt4/QtDialog.hpp"
    2122
     23#include <Qt/qcombobox.h>
     24
     25#include "Helpers/MemDebug.hpp"
     26
    2227#include <vector>
    23 
    24 #include <Qt/qcombobox.h>
    2528
    2629
  • src/UIElements/Qt4/QtDialog.cpp

    r41e15b r5d4b73  
    1919
    2020#include "UIElements/Qt4/QtDialog.hpp"
     21#include "UIElements/Qt4/Query/QtQuery.hpp"
    2122
    2223#include <QtGui/QDialogButtonBox>
  • src/UIElements/Qt4/QtDialog.hpp

    r41e15b r5d4b73  
    1111#include "UIElements/Dialog.hpp"
    1212#include <QtGui/QDialog>
    13 #include <QtGui/QFileDialog>
    14 
    15 #include <boost/filesystem.hpp>
    1613
    1714#include <map>
     
    2017
    2118class QBoxLayout;
    22 class QLabel;
    23 class QSpinBox;
    24 class QDoubleSpinBox;
    25 class QLineEdit;
    26 class QListWidget;
    27 class QTableWidget;
    28 class QComboBox;
    2919class QDialogButtonBox;
    30 
    31 class Matrix;
    32 
    33 // Forward declarations for plumbing
    34 template<typename T> class QtQueryListPipe;
    35 class BooleanQtQueryPipe;
    36 class BoxQtQueryPipe;
    37 class StringQtQueryPipe;
    38 class StringsQtQueryPipe;
    39 class IntQtQueryPipe;
    40 class DoubleQtQueryPipe;
    41 class DoublesQtQueryPipe;
    42 class AtomQtQueryPipe;
    43 class AtomsQtQueryPipe;
    44 class MoleculeQtQueryPipe;
    45 class MoleculesQtQueryPipe;
    46 class EmptyQtQueryPipe;
    47 class ElementQtQueryPipe;
    48 class ElementsQtQueryPipe;
    49 class VectorQtQueryPipe;
    50 class VectorsQtQueryPipe;
    51 class FileQtQueryPipe;
    5220
    5321class QtDialog : public QDialog, public Dialog
     
    8250
    8351protected:
    84   class IntQtQuery : public Dialog::IntQuery {
    85     public:
    86       IntQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
    87       virtual ~IntQtQuery();
    88       virtual bool handle();
    89     private:
    90       QBoxLayout *parent;
    91       QBoxLayout *thisLayout;
    92       QLabel *titleLabel;
    93       QSpinBox *inputBox;
    94 
    95       IntQtQueryPipe *pipe;
    96     };
    97 
    98   class IntsQtQuery : public Dialog::IntsQuery {
    99     public:
    100       IntsQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
    101       virtual ~IntsQtQuery();
    102       virtual bool handle();
    103       void IntegerEntered(const QString&);
    104       void IntegerSelected();
    105       void AddInteger();
    106       void RemoveInteger();
    107     private:
    108       QBoxLayout *parent;
    109       QBoxLayout *thisLayout;
    110       QLabel *titleLabel;
    111 
    112       QtQueryListPipe<int> *pipe;
    113     };
    114 
    115     class DoubleQtQuery : public Dialog::DoubleQuery {
    116     public:
    117       DoubleQtQuery(std::string title,QBoxLayout *_parent,QtDialog *_dialog);
    118       virtual ~DoubleQtQuery();
    119       virtual bool handle();
    120     private:
    121       QBoxLayout *parent;
    122       QBoxLayout *thisLayout;
    123       QLabel *titleLabel;
    124       QDoubleSpinBox *inputBox;
    125 
    126       DoubleQtQueryPipe *pipe;
    127     };
    128 
    129     class DoublesQtQuery : public Dialog::DoublesQuery {
    130     public:
    131       DoublesQtQuery(std::string title,QBoxLayout *_parent,QtDialog *_dialog);
    132       virtual ~DoublesQtQuery();
    133       virtual bool handle();
    134     private:
    135       QBoxLayout *parent;
    136       QBoxLayout *thisLayout;
    137       QLabel *titleLabel;
    138       QDoubleSpinBox *inputBox;
    139 
    140       QtQueryListPipe<double> *pipe;
    141     };
    142 
    143     class StringQtQuery : public Dialog::StringQuery {
    144     public:
    145       StringQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
    146       virtual ~StringQtQuery();
    147       virtual bool handle();
    148     private:
    149       QBoxLayout *parent;
    150       QBoxLayout *thisLayout;
    151       QLabel *titleLabel;
    152       QLineEdit *inputBox;
    153 
    154       StringQtQueryPipe *pipe;
    155     };
    156 
    157     class StringsQtQuery : public Dialog::StringsQuery {
    158     public:
    159       StringsQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
    160       virtual ~StringsQtQuery();
    161       virtual bool handle();
    162     private:
    163       QBoxLayout *parent;
    164       QBoxLayout *thisLayout;
    165       QLabel *titleLabel;
    166       QLineEdit *inputBox;
    167 
    168       QtQueryListPipe<std::string> *pipe;
    169     };
    170 
    171     class BoxQtQuery : public Dialog::BoxQuery {
    172     public:
    173       BoxQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
    174       virtual ~BoxQtQuery();
    175       virtual bool handle();
    176     private:
    177       QBoxLayout *parent;
    178       QBoxLayout *thisLayout;
    179       QLabel *titleLabel;
    180       QTableWidget *inputTable;
    181 
    182       BoxQtQueryPipe *pipe;
    183     };
    184 
    185     class AtomQtQuery : public Dialog::AtomQuery {
    186     public:
    187       AtomQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
    188       virtual ~AtomQtQuery();
    189       virtual bool handle();
    190     private:
    191       QBoxLayout *parent;
    192       QBoxLayout *thisLayout;
    193       QLabel *titleLabel;
    194       QComboBox *inputBox;
    195 
    196       AtomQtQueryPipe *pipe;
    197     };
    198 
    199     class AtomsQtQuery : public Dialog::AtomsQuery {
    200     public:
    201       AtomsQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
    202       virtual ~AtomsQtQuery();
    203       virtual bool handle();
    204     private:
    205       QBoxLayout *parent;
    206       QBoxLayout *thisLayout;
    207       QLabel *titleLabel;
    208       QLabel *inputLabel;
    209       QListWidget *inputList;
    210 
    211       AtomsQtQueryPipe *pipe;
    212     };
    213 
    214     class MoleculeQtQuery : public Dialog::MoleculeQuery {
    215     public:
    216       MoleculeQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
    217       virtual ~MoleculeQtQuery();
    218       virtual bool handle();
    219     private:
    220       QBoxLayout *parent;
    221       QBoxLayout *thisLayout;
    222       QLabel *titleLabel;
    223       QComboBox *inputBox;
    224 
    225       MoleculeQtQueryPipe *pipe;
    226     };
    227 
    228     class MoleculesQtQuery : public Dialog::MoleculesQuery {
    229     public:
    230       MoleculesQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
    231       virtual ~MoleculesQtQuery();
    232       virtual bool handle();
    233     private:
    234       QBoxLayout *parent;
    235       QBoxLayout *thisLayout;
    236       QLabel *titleLabel;
    237       QComboBox *inputBox;
    238 
    239       MoleculesQtQueryPipe *pipe;
    240     };
    241 
    242     class VectorQtQuery : public Dialog::VectorQuery {
    243     public:
    244       VectorQtQuery(std::string title,bool _check,QBoxLayout *,QtDialog *);
    245       virtual ~VectorQtQuery();
    246       virtual bool handle();
    247     private:
    248       QBoxLayout *parent;
    249       QBoxLayout *mainLayout;
    250       QLabel *titleLabel;
    251       QBoxLayout *subLayout;
    252       QBoxLayout *coordLayout;
    253       QLabel *coordLabel;
    254       QDoubleSpinBox *coordInput;
    255 
    256       VectorQtQueryPipe *pipe;
    257     };
    258 
    259     class VectorsQtQuery : public Dialog::VectorsQuery {
    260     public:
    261       VectorsQtQuery(std::string title,bool _check,QBoxLayout *,QtDialog *);
    262       virtual ~VectorsQtQuery();
    263       virtual bool handle();
    264     private:
    265       QBoxLayout *parent;
    266       QBoxLayout *mainLayout;
    267       QLabel *titleLabel;
    268       QBoxLayout *subLayout;
    269       QBoxLayout *coordLayout;
    270       QLabel *coordLabel;
    271       QDoubleSpinBox *coordInput;
    272 
    273       VectorsQtQueryPipe *pipe;
    274     };
    275 
    276     class EmptyQtQuery : public Dialog::EmptyQuery {
    277     public:
    278       EmptyQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
    279       virtual ~EmptyQtQuery();
    280       virtual bool handle();
    281     private:
    282       QBoxLayout *parent;
    283       QBoxLayout *thisLayout;
    284       QLabel *titleLabel;
    285 
    286       EmptyQtQueryPipe *pipe;
    287     };
    288 
    289     class BooleanQtQuery : public Dialog::BooleanQuery {
    290     public:
    291       BooleanQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
    292       virtual ~BooleanQtQuery();
    293       virtual bool handle();
    294     private:
    295       QBoxLayout *parent;
    296       QBoxLayout *thisLayout;
    297       QLabel *titleLabel;
    298       QComboBox *booleanComboBox;
    299 
    300       BooleanQtQueryPipe *pipe;
    301     };
    302 
    303     class ElementQtQuery : public Dialog::ElementQuery {
    304     public:
    305       ElementQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
    306       virtual ~ElementQtQuery();
    307       virtual bool handle();
    308     private:
    309       QBoxLayout *parent;
    310       QBoxLayout *thisLayout;
    311       QLabel *titleLabel;
    312       QComboBox *inputBox;
    313 
    314       ElementQtQueryPipe *pipe;
    315     };
    316 
    317     class ElementsQtQuery : public Dialog::ElementsQuery {
    318     public:
    319       ElementsQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
    320       virtual ~ElementsQtQuery();
    321       virtual bool handle();
    322     private:
    323       QBoxLayout *parent;
    324       QBoxLayout *thisLayout;
    325       QLabel *titleLabel;
    326       QComboBox *inputBox;
    327 
    328       ElementsQtQueryPipe *pipe;
    329     };
    330 
    331     class FileQtQuery : public Dialog::FileQuery {
    332     public:
    333       FileQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
    334       virtual ~FileQtQuery();
    335       virtual bool handle();
    336     private:
    337       QBoxLayout *parent;
    338       QBoxLayout *thisLayout;
    339       QLabel *filenameLabel;
    340       QLineEdit *filenameLineEdit;
    341       QPushButton *filedialogButton;
    342 
    343       FileQtQueryPipe *pipe;
    344     };
     52  class AtomQtQuery;
     53  class AtomsQtQuery;
     54  class BooleanQtQuery;
     55  class BoxQtQuery;
     56  class DoubleQtQuery;
     57  class DoublesQtQuery;
     58  class ElementQtQuery;
     59  class ElementsQtQuery;
     60  class EmptyQtQuery;
     61  class FileQtQuery;
     62  class IntQtQuery;
     63  class IntsQtQuery;
     64  class MoleculeQtQuery;
     65  class MoleculesQtQuery;
     66  class StringQtQuery;
     67  class StringsQtQuery;
     68  class VectorQtQuery;
     69  class VectorsQtQuery;
    34570
    34671private:
     
    35176};
    35277
    353 // All kinds of plumbing for Queries
    354 // Plumbing needs to be outside of the class where it is needed,
    355 // since MOC doesn't like nested classes
    356 
    357 
    358 template<typename T> class QtQueryListPipe : public QWidget {
    359   public:
    360     QtQueryListPipe(std::vector<T> *_content, QtDialog *_dialog, QLineEdit *_inputBox, QListWidget *_inputList, QPushButton *_AddButton, QPushButton *_RemoveButton);
    361     virtual ~QtQueryListPipe();
    362     void AddInteger();
    363     void RemoveInteger();
    364     void IntegerSelected();
    365     void IntegerEntered(const QString&);
    366 
    367   private:
    368     void AddValue(T item);
    369     void RemoveRow(int row);
    370 
    371     std::vector<T> *content;
    372     QtDialog *dialog;
    373     QLineEdit *inputBox;
    374     QListWidget *inputList;
    375     QPushButton *AddButton;
    376     QPushButton *RemoveButton;
    377 };
    378 
    379 
    380 class StringQtQueryPipe : public QWidget {
    381   Q_OBJECT
    382 public:
    383   StringQtQueryPipe(std::string *_content, QtDialog *_dialog);
    384   virtual ~StringQtQueryPipe();
    385 
    386 public slots:
    387   void update(const QString&);
    388 
    389 private:
    390   std::string *content;
    391   QtDialog *dialog;
    392 
    393 };
    394 
    395 class IntQtQueryPipe : public QWidget {
    396   Q_OBJECT
    397 public:
    398   IntQtQueryPipe(int *_content, QtDialog *_dialog);
    399   virtual ~IntQtQueryPipe();
    400 
    401 public slots:
    402   void update(int);
    403 
    404 private:
    405   int *content;
    406   QtDialog *dialog;
    407 
    408 };
    409 
    410 
    411 class DoubleQtQueryPipe : public QWidget {
    412   Q_OBJECT
    413 public:
    414   DoubleQtQueryPipe(double *_content, QtDialog *_dialog);
    415   virtual ~DoubleQtQueryPipe();
    416 
    417 public slots:
    418   void update(double);
    419 
    420 private:
    421   double *content;
    422   QtDialog *dialog;
    423 
    424 };
    425 
    426 class BoxQtQueryPipe : public QWidget {
    427   Q_OBJECT
    428 public:
    429   BoxQtQueryPipe(Box &_content, QtDialog *_dialog, QTableWidget *_inputTable);
    430   virtual ~BoxQtQueryPipe();
    431 
    432 public slots:
    433   void update(int,int);
    434 
    435 private:
    436   Box &content;
    437   QtDialog *dialog;
    438   QTableWidget *inputTable;
    439 
    440   Matrix *tmpM;
    441 };
    442 
    443 
    444 class AtomQtQueryPipe : public QWidget {
    445   Q_OBJECT
    446 public:
    447   AtomQtQueryPipe(const atom **_content, QtDialog *_dialog, QComboBox *_theBox);
    448   virtual ~AtomQtQueryPipe();
    449 
    450 public slots:
    451   void update(int);
    452 
    453 private:
    454   const atom **content;
    455   QtDialog *dialog;
    456   QComboBox *theBox;
    457 
    458 };
    459 
    460 
    461 class AtomsQtQueryPipe : public QWidget {
    462   Q_OBJECT
    463 public:
    464   AtomsQtQueryPipe(std::vector<const atom *>*_content, QtDialog *_dialog, QListWidget *_theList);
    465   virtual ~AtomsQtQueryPipe();
    466 
    467 public slots:
    468   void update();
    469   void add();
    470   void remove();
    471 
    472 private:
    473   std::vector<const atom *>*content;
    474   std::map<int, const atom *> lookup;
    475   std::set<const atom *> currentList;
    476   QtDialog *dialog;
    477   QListWidget *theList;
    478 
    479 };
    480 
    481 class MoleculeQtQueryPipe : public QWidget {
    482   Q_OBJECT
    483 public:
    484   MoleculeQtQueryPipe(const molecule **_content, QtDialog *_dialog, QComboBox *_theBox);
    485   virtual ~MoleculeQtQueryPipe();
    486 
    487 public slots:
    488   void update(int);
    489 
    490 private:
    491   const molecule **content;
    492   QtDialog *dialog;
    493   QComboBox *theBox;
    494 
    495 };
    496 
    497 class MoleculesQtQueryPipe : public QWidget {
    498   Q_OBJECT
    499 public:
    500   MoleculesQtQueryPipe(std::vector<const molecule *>*_content, QtDialog *_dialog, QComboBox *_theBox);
    501   virtual ~MoleculesQtQueryPipe();
    502 
    503 public slots:
    504   void update(int);
    505 
    506 private:
    507   std::vector<const molecule *>*content;
    508   QtDialog *dialog;
    509   QComboBox *theBox;
    510 
    511 };
    512 
    513 class VectorQtQueryPipe : public QWidget {
    514   Q_OBJECT
    515 public:
    516   VectorQtQueryPipe(Vector *_content, QtDialog *_dialog, QComboBox *_theBox);
    517   virtual ~VectorQtQueryPipe();
    518 
    519 public slots:
    520   void update();
    521 
    522 private:
    523   Vector *content;
    524   QtDialog *dialog;
    525   QComboBox *theBox;
    526 };
    527 
    528 class VectorsQtQueryPipe : public QWidget {
    529   Q_OBJECT
    530 public:
    531   VectorsQtQueryPipe(std::vector<Vector>*_content, QtDialog *_dialog, QComboBox *_theBox);
    532   virtual ~VectorsQtQueryPipe();
    533 
    534 public slots:
    535   void update();
    536 
    537 private:
    538   std::vector<Vector> *content;
    539   QtDialog *dialog;
    540   QComboBox *theBox;
    541 };
    542 
    543 class EmptyQtQueryPipe : public QWidget {
    544   Q_OBJECT
    545 public:
    546   EmptyQtQueryPipe(QtDialog *_dialog, QLabel *_textLabel);
    547   virtual ~EmptyQtQueryPipe();
    548 
    549 public slots:
    550   void update();
    551 
    552 private:
    553   QtDialog *dialog;
    554   QLabel *textLabel;
    555 };
    556 
    557 class BooleanQtQueryPipe : public QWidget {
    558   Q_OBJECT
    559 public:
    560   BooleanQtQueryPipe(const bool *_content, QtDialog *_dialog, QComboBox *_booleanComboBox);
    561   virtual ~BooleanQtQueryPipe();
    562 
    563 public slots:
    564   void update();
    565 
    566 private:
    567   const bool *content;
    568   QtDialog *dialog;
    569   QComboBox *booleanComboBox;
    570 };
    571 
    572 class ElementQtQueryPipe : public QWidget {
    573   Q_OBJECT
    574 public:
    575   ElementQtQueryPipe(const element **_content, QtDialog *_dialog, QComboBox *_theBox);
    576   virtual ~ElementQtQueryPipe();
    577 
    578 public slots:
    579   void update(int);
    580 
    581 private:
    582   const element **content;
    583   QtDialog *dialog;
    584   QComboBox *theBox;
    585 };
    586 
    587 class ElementsQtQueryPipe : public QWidget {
    588   Q_OBJECT
    589 public:
    590   ElementsQtQueryPipe(std::vector<const element *>*_content, QtDialog *_dialog, QComboBox *_theBox);
    591   virtual ~ElementsQtQueryPipe();
    592 
    593 public slots:
    594   void update(int);
    595 
    596 private:
    597   std::vector<const element *>*content;
    598   QtDialog *dialog;
    599   QComboBox *theBox;
    600 };
    601 
    602 class FileQtQueryPipe : public QWidget {
    603   Q_OBJECT
    604 public:
    605   FileQtQueryPipe(boost::filesystem::path *_content, QtDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton);
    606   virtual ~FileQtQueryPipe();
    607 
    608 public slots:
    609   void update();
    610   void showFileDialog();
    611 
    612 private:
    613   boost::filesystem::path *content;
    614   QtDialog *dialog;
    615   QLineEdit *filenameLineEdit;
    616   QPushButton *filedialogButton;
    617   QFileDialog *theFileDialog;
    618 };
    61978
    62079#endif /* QTDIALOG_HPP_ */
  • src/UIElements/Qt4/Query/AtomQtQuery.cpp

    r41e15b r5d4b73  
    2424#include "Helpers/MemDebug.hpp"
    2525
    26 #include "UIElements/Qt4/QtDialog.hpp"
     26#include "UIElements/Qt4/Query/QtQuery.hpp"
     27#include "UIElements/Qt4/Pipe/AtomQtQueryPipe.hpp"
    2728
    2829#include "atom.hpp"
  • src/UIElements/Qt4/Query/AtomsQtQuery.cpp

    r41e15b r5d4b73  
    2626#include "Helpers/MemDebug.hpp"
    2727
    28 #include "UIElements/Qt4/QtDialog.hpp"
     28#include "UIElements/Qt4/Query/QtQuery.hpp"
     29#include "UIElements/Qt4/Pipe/AtomsQtQueryPipe.hpp"
    2930
    3031#include "atom.hpp"
  • src/UIElements/Qt4/Query/BooleanQtQuery.cpp

    r41e15b r5d4b73  
    2424#include "Helpers/MemDebug.hpp"
    2525
    26 #include "UIElements/Qt4/QtDialog.hpp"
     26#include "UIElements/Qt4/Query/QtQuery.hpp"
     27#include "UIElements/Qt4/Pipe/BooleanQtQueryPipe.hpp"
    2728
    2829
  • src/UIElements/Qt4/Query/BoxQtQuery.cpp

    r41e15b r5d4b73  
    2424#include "Helpers/MemDebug.hpp"
    2525
    26 #include "UIElements/Qt4/QtDialog.hpp"
     26#include "UIElements/Qt4/Query/QtQuery.hpp"
     27#include "UIElements/Qt4/Pipe/BoxQtQueryPipe.hpp"
    2728
    2829#include "LinearAlgebra/Matrix.hpp"
  • src/UIElements/Qt4/Query/DoubleQtQuery.cpp

    r41e15b r5d4b73  
    2424#include "Helpers/MemDebug.hpp"
    2525
    26 #include "UIElements/Qt4/QtDialog.hpp"
     26#include "UIElements/Qt4/Query/QtQuery.hpp"
     27#include "UIElements/Qt4/Pipe/DoubleQtQueryPipe.hpp"
    2728
    2829
  • src/UIElements/Qt4/Query/DoublesQtQuery.cpp

    r41e15b r5d4b73  
    2626#include "Helpers/MemDebug.hpp"
    2727
    28 #include "UIElements/Qt4/QtDialog.hpp"
     28#include "UIElements/Qt4/Query/QtQuery.hpp"
    2929#include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp"
    3030
  • src/UIElements/Qt4/Query/ElementQtQuery.cpp

    r41e15b r5d4b73  
    2424#include "Helpers/MemDebug.hpp"
    2525
    26 #include "UIElements/Qt4/QtDialog.hpp"
     26#include "UIElements/Qt4/Query/QtQuery.hpp"
     27#include "UIElements/Qt4/Pipe/ElementQtQueryPipe.hpp"
    2728
    2829#include "element.hpp"
  • src/UIElements/Qt4/Query/ElementsQtQuery.cpp

    r41e15b r5d4b73  
    2424#include "Helpers/MemDebug.hpp"
    2525
    26 #include "UIElements/Qt4/QtDialog.hpp"
     26#include "UIElements/Qt4/Query/QtQuery.hpp"
     27#include "UIElements/Qt4/Pipe/ElementsQtQueryPipe.hpp"
    2728
    2829#include "element.hpp"
  • src/UIElements/Qt4/Query/EmptyQtQuery.cpp

    r41e15b r5d4b73  
    2323#include "Helpers/MemDebug.hpp"
    2424
    25 #include "UIElements/Qt4/QtDialog.hpp"
     25#include "UIElements/Qt4/Query/QtQuery.hpp"
     26#include "UIElements/Qt4/Pipe/EmptyQtQueryPipe.hpp"
    2627
    2728
  • src/UIElements/Qt4/Query/FileQtQuery.cpp

    r41e15b r5d4b73  
    2525#include "Helpers/MemDebug.hpp"
    2626
    27 #include "UIElements/Qt4/QtDialog.hpp"
     27#include "UIElements/Qt4/Query/QtQuery.hpp"
     28#include "UIElements/Qt4/Pipe/FileQtQueryPipe.hpp"
    2829
    2930
  • src/UIElements/Qt4/Query/IntQtQuery.cpp

    r41e15b r5d4b73  
    2424#include "Helpers/MemDebug.hpp"
    2525
    26 #include "UIElements/Qt4/QtDialog.hpp"
     26#include "UIElements/Qt4/Query/QtQuery.hpp"
     27#include "UIElements/Qt4/Pipe/IntQtQueryPipe.hpp"
    2728
    2829
  • src/UIElements/Qt4/Query/IntsQtQuery.cpp

    r41e15b r5d4b73  
    2626#include "Helpers/MemDebug.hpp"
    2727
    28 #include "UIElements/Qt4/QtDialog.hpp"
     28#include "UIElements/Qt4/Query/QtQuery.hpp"
    2929#include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp"
    3030
  • src/UIElements/Qt4/Query/MoleculeQtQuery.cpp

    r41e15b r5d4b73  
    2424#include "Helpers/MemDebug.hpp"
    2525
    26 #include "UIElements/Qt4/QtDialog.hpp"
     26#include "UIElements/Qt4/Query/QtQuery.hpp"
     27#include "UIElements/Qt4/Pipe/MoleculeQtQueryPipe.hpp"
    2728
    2829#include "molecule.hpp"
  • src/UIElements/Qt4/Query/MoleculesQtQuery.cpp

    r41e15b r5d4b73  
    2424#include "Helpers/MemDebug.hpp"
    2525
    26 #include "UIElements/Qt4/QtDialog.hpp"
     26#include "UIElements/Qt4/Query/QtQuery.hpp"
     27#include "UIElements/Qt4/Pipe/MoleculesQtQueryPipe.hpp"
    2728
    2829#include "molecule.hpp"
  • src/UIElements/Qt4/Query/StringQtQuery.cpp

    r41e15b r5d4b73  
    2424#include "Helpers/MemDebug.hpp"
    2525
    26 #include "UIElements/Qt4/QtDialog.hpp"
     26#include "UIElements/Qt4/Query/QtQuery.hpp"
     27#include "UIElements/Qt4/Pipe/StringQtQueryPipe.hpp"
    2728
    2829
  • src/UIElements/Qt4/Query/StringsQtQuery.cpp

    r41e15b r5d4b73  
    2626#include "Helpers/MemDebug.hpp"
    2727
    28 #include "UIElements/Qt4/QtDialog.hpp"
     28#include "UIElements/Qt4/Query/QtQuery.hpp"
    2929#include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp"
    3030
  • src/UIElements/Qt4/Query/VectorQtQuery.cpp

    r41e15b r5d4b73  
    2525#include "Helpers/MemDebug.hpp"
    2626
    27 #include "UIElements/Qt4/QtDialog.hpp"
     27#include "UIElements/Qt4/Query/QtQuery.hpp"
     28#include "UIElements/Qt4/Pipe/VectorQtQueryPipe.hpp"
    2829
    2930
  • src/UIElements/Qt4/Query/VectorsQtQuery.cpp

    r41e15b r5d4b73  
    2525#include "Helpers/MemDebug.hpp"
    2626
    27 #include "UIElements/Qt4/QtDialog.hpp"
     27#include "UIElements/Qt4/Query/QtQuery.hpp"
     28#include "UIElements/Qt4/Pipe/VectorsQtQueryPipe.hpp"
    2829
    2930
  • src/UIElements/TextUI/Query/AtomTextQuery.cpp

    r41e15b r5d4b73  
    2424#include <Descriptors/AtomDescriptor.hpp>
    2525#include <Descriptors/AtomIdDescriptor.hpp>
    26 #include "TextUI/TextDialog.hpp"
     26#include "TextUI/Query/TextQuery.hpp"
    2727
    2828#include "Helpers/Log.hpp"
     
    4141  do{
    4242    badInput = false;
    43     Log() << Verbose(0) << getTitle();
    44     cin >> idxOfAtom;
    45     if(cin.fail()){
     43    std::cout << getDescription() << ": ";
     44    std::cin >> idxOfAtom;
     45    if(std::cin.fail()){
    4646      badInput = true;
    47       cin.clear();
    48       cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    49       Log() << Verbose(0) << "Input was not a number!" << endl;
     47      std::cin.clear();
     48      std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     49      std::cout << "Input was not a number!" << std::endl;
    5050      continue;
    5151    }
     
    5353    tmp = World::getInstance().getAtom(AtomById(idxOfAtom));
    5454    if(!tmp && idxOfAtom!=-1){
    55       Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
     55      std::cout << "Invalid Atom Index" << idxOfAtom << std::endl;
    5656      badInput = true;
    5757    }
    5858
    5959  } while(badInput);
    60   cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     60  std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    6161  return (idxOfAtom!=-1);
    6262}
  • src/UIElements/TextUI/Query/AtomsTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <Descriptors/AtomDescriptor.hpp>
    2323#include <Descriptors/AtomIdDescriptor.hpp>
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
     
    3939bool TextDialog::AtomsTextQuery::handle() {
    4040  int idxOfAtom=-1;
    41   Log() << Verbose(0) << getTitle();
     41  std::cout << getDescription() << ": ";
    4242  std::string line;
    43   getline(cin,line);
     43  getline(std::cin,line);
    4444  // dissect by " "
    4545  std::string::iterator olditer = line.begin();
     
    5050      temp = World::getInstance().getAtom(AtomById(idxOfAtom));
    5151      if(!temp && idxOfAtom!=-1){
    52         Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
     52        std::cout << "Invalid Atom Index" << idxOfAtom << std::endl;
    5353        break;
    5454      }
     
    6262    temp = World::getInstance().getAtom(AtomById(idxOfAtom));
    6363    if(!temp && idxOfAtom!=-1) {
    64       Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
     64      std::cout << "Invalid Atom Index" << idxOfAtom << std::endl;
    6565      tmp.push_back(temp);
    6666    }
  • src/UIElements/TextUI/Query/BooleanTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
     
    3939  do{
    4040    badInput = false;
    41     Log() << Verbose(0) << getTitle();
    42     cin >> input;
     41    std::cout << getDescription() << "[y/n]: ";
     42    std::cin >> input;
    4343    if ((input == 'y' ) || (input == 'Y')) {
    4444      tmp = true;
     
    4747    } else {
    4848      badInput=true;
    49       cin.clear();
    50       cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    51       Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
     49      std::cin.clear();
     50      std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     51      std::cout << "Input was not of [yYnN]!" << std::endl;
    5252    }
    5353  } while(badInput);
    5454  // clear the input buffer of anything still in the line
    55   cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     55  std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    5656  return true;
    5757}
  • src/UIElements/TextUI/Query/BoxTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
     
    3737
    3838bool TextDialog::BoxTextQuery::handle() {
    39   Log() << Verbose(0) << getTitle();
     39  std::cout << getTitle();
    4040
    4141  double temp[6];
     42  std::cout << getDescription() << " - ";
    4243  std::string coords[6] = {"xx","yx","yy", "zx", "zy", "zz"};
    4344  for (int i=0;i<6;i++) {
    44     Log() << Verbose(0) << coords[i] << ": ";
    45     cin >> temp[i];
     45    std::cout << coords[i] << ": ";
     46    std::cin >> temp[i];
    4647  }
    4748  Matrix M;
  • src/UIElements/TextUI/Query/DoubleTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
     
    3838  do{
    3939    badInput = false;
    40     Log() << Verbose(0) << getTitle();
    41     cin >> tmp;
    42     if(cin.fail()){
     40    std::cout << getDescription() << ": ";
     41    std::cin >> tmp;
     42    if(std::cin.fail()){
    4343      badInput = true;
    44       cin.clear();
    45       cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    46       Log() << Verbose(0) << "Input was not a number!" << endl;
     44      std::cin.clear();
     45      std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     46      std::cout << "Input was not a number!" << std::endl;
    4747    }
    4848  }while(badInput);
    49   cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     49  std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    5050  return true;
    5151}
  • src/UIElements/TextUI/Query/DoublesTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
     
    3535
    3636bool TextDialog::DoublesTextQuery::handle() {
    37   Log() << Verbose(0) << getTitle();
     37  std::cout << getDescription() << ": ";
    3838  std::string line;
    39   getline(cin,line);
     39  getline(std::cin,line);
    4040  // dissect by " "
    4141  std::string::iterator olditer = line.begin();
  • src/UIElements/TextUI/Query/ElementTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
     
    4444  do{
    4545    badInput = false;
    46     Log() << Verbose(0) << getTitle();
     46    std::cout << getDescription() << ": ";
    4747
    4848    // try to read as Atomic number
    4949    int Z;
    50     cin >> Z;
    51     if(!cin.fail()){
     50    std::cin >> Z;
     51    if(!std::cin.fail()){
    5252      if(Z==-1){
    5353        aborted = true;
     
    5656        temp = World::getInstance().getPeriode()->FindElement(Z);
    5757        if(!temp){
    58           Log() << Verbose(0) << "No element with this atomic number!" << endl;
     58          std::cout << "No element with this atomic number!" << std::endl;
    5959          badInput = true;
    6060        }
     
    6363    }
    6464    else{
    65       cin.clear();
     65      std::cin.clear();
    6666    }
    6767
     
    7070    // same thing again, this time as a std::string
    7171    std::string shorthand;
    72     cin >> shorthand;
    73     if(!cin.fail()){
     72    std::cin >> shorthand;
     73    if(!std::cin.fail()){
    7474      if(shorthand.empty()){
    7575        aborted = true;
     
    7878        temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
    7979        if(!temp){
    80           Log() << Verbose(0) << "No element with this shorthand!" << endl;
     80          std::cout << "No element with this shorthand!" << std::endl;
    8181          badInput = true;
    8282        }
     
    8484    }
    8585    else{
    86       Log() << Verbose(0) << "Could not read input. Try Again." << endl;
    87       cin.clear();
    88       cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     86      std::cout << "Could not read input. Try Again." << std::endl;
     87      std::cin.clear();
     88      std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    8989      badInput = true;
    9090    }
    9191
    9292  }while(badInput);
    93   cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     93  std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    9494  return !aborted;
    9595}
  • src/UIElements/TextUI/Query/ElementsTextQuery.cpp

    r41e15b r5d4b73  
    2323#include <boost/lexical_cast.hpp>
    2424
    25 #include "TextUI/TextDialog.hpp"
     25#include "TextUI/Query/TextQuery.hpp"
    2626
    2727#include "Helpers/Log.hpp"
     
    4545  std::string shorthand;
    4646  int Z=-1;
    47   Log() << Verbose(0) << getTitle();
     47  std::cout << getDescription() << ": ";
    4848  std::string line;
    49   getline(cin,line);
     49  getline(std::cin,line);
    5050  // dissect by " "
    5151  std::string::iterator olditer = line.begin();
     
    6161      };
    6262      if(!temp && Z!=-1){
    63         Log() << Verbose(0) << "Invalid Element" << shorthand << endl;
     63        std::cout << "Invalid Element" << shorthand << std::endl;
    6464        break;
    6565      }
     
    7878    };
    7979    if(!temp && Z!=-1) {
    80       Log() << Verbose(0) << "Invalid Element" << shorthand << endl;
     80      std::cout << "Invalid Element" << shorthand << std::endl;
    8181      tmp.push_back(temp);
    8282    }
  • src/UIElements/TextUI/Query/EmptyTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
  • src/UIElements/TextUI/Query/FileTextQuery.cpp

    r41e15b r5d4b73  
    2121
    2222#include <iostream>
     23#include <string>
    2324
    2425#include <boost/filesystem.hpp>
    2526
    26 #include "TextUI/TextDialog.hpp"
     27#include "TextUI/Query/TextQuery.hpp"
    2728
    2829#include "Helpers/Log.hpp"
     
    3738
    3839bool TextDialog::FileTextQuery::handle() {
    39   Log() << Verbose(0) << getTitle();
     40  bool badInput = false;
    4041  std::string tempstring;
    41   getline(cin,tempstring);
     42  do{
     43    badInput = false;
     44    std::cout << getDescription() << ": ";
     45    std::cin >> tempstring;
     46    if(std::cin.fail()){
     47      badInput = true;
     48      std::cin.clear();
     49      std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     50      std::cout << "Input was not a number!" << std::endl;
     51      continue;
     52    }
     53  } while(badInput);
     54  std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    4255  tmp = tempstring;
    4356  return true;
  • src/UIElements/TextUI/Query/IntTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
     
    3838  do{
    3939    badInput = false;
    40     Log() << Verbose(0) << getTitle();
    41     cin >> tmp;
    42     if(cin.fail()){
     40    std::cout << getDescription() << ": ";
     41    std::cin >> tmp;
     42    if(std::cin.fail()){
    4343      badInput=true;
    44       cin.clear();
    45       cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    46       Log() << Verbose(0) << "Input was not a number!" << endl;
     44      std::cin.clear();
     45      std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     46      std::cout << "Input was not a number!" << std::endl;
    4747    }
    4848  } while(badInput);
    4949  // clear the input buffer of anything still in the line
    50   cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     50  std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    5151  return true;
    5252}
  • src/UIElements/TextUI/Query/IntsTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
     
    3535
    3636bool TextDialog::IntsTextQuery::handle() {
    37   Log() << Verbose(0) << getTitle();
     37  std::cout << getDescription() << ": ";
    3838  std::string line;
    39   getline(cin,line);
     39  getline(std::cin,line);
    4040  // dissect by " "
    4141  std::string::iterator olditer = line.begin();
  • src/UIElements/TextUI/Query/MoleculeTextQuery.cpp

    r41e15b r5d4b73  
    2424#include <Descriptors/MoleculeDescriptor.hpp>
    2525#include <Descriptors/MoleculeIdDescriptor.hpp>
    26 #include "TextUI/TextDialog.hpp"
     26#include "TextUI/Query/TextQuery.hpp"
    2727
    2828#include "Helpers/Log.hpp"
     
    4242  do{
    4343    badInput = false;
    44     Log() << Verbose(0) << getTitle();
    45     cin >> idxOfMol;
    46     if(cin.fail()){
     44    std::cout << getDescription() << ": ";
     45    std::cin >> idxOfMol;
     46    if(std::cin.fail()){
    4747      badInput = true;
    48       cin.clear();
    49       cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    50       Log() << Verbose(0) << "Input was not a number!" << endl;
     48      std::cin.clear();
     49      std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     50      std::cout << "Input was not a number!" << std::endl;
    5151      continue;
    5252    }
     
    5454    tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
    5555    if(!tmp && idxOfMol!=-1){
    56       Log() << Verbose(0) << "Invalid Molecule Index" << endl;
     56      std::cout << "Invalid Molecule Index" << std::endl;
    5757      badInput = true;
    5858    }
    5959
    6060  } while(badInput);
    61   cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
     61  std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
    6262  return (idxOfMol!=-1);
    6363}
  • src/UIElements/TextUI/Query/MoleculesTextQuery.cpp

    r41e15b r5d4b73  
    2424#include <Descriptors/MoleculeDescriptor.hpp>
    2525#include <Descriptors/MoleculeIdDescriptor.hpp>
    26 #include "TextUI/TextDialog.hpp"
     26#include "TextUI/Query/TextQuery.hpp"
    2727
    2828#include "Helpers/Log.hpp"
     
    3939bool TextDialog::MoleculesTextQuery::handle() {
    4040  int idxOfMol=-1;
    41   Log() << Verbose(0) << getTitle();
     41  std::cout << getDescription() << ": ";
    4242  std::string line;
    43   getline(cin,line);
     43  getline(std::cin,line);
    4444  // dissect by " "
    4545  std::string::iterator olditer = line.begin();
     
    5050      temp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
    5151      if(!temp && idxOfMol!=-1){
    52         Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol << endl;
     52        std::cout << "Invalid Molecule Index" << idxOfMol << std::endl;
    5353        break;
    5454      }
     
    6262    temp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
    6363    if(!temp && idxOfMol!=-1){
    64       Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol << endl;
     64      std::cout << "Invalid Molecule Index" << idxOfMol << std::endl;
    6565      tmp.push_back(temp);
    6666    }
  • src/UIElements/TextUI/Query/StringTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
     
    3535
    3636bool TextDialog::StringTextQuery::handle() {
    37   Log() << Verbose(0) << getTitle();
    38   getline(cin,tmp);
     37  std::cout << getDescription() << ": ";
     38  getline(std::cin,tmp);
    3939  return true;
    4040}
  • src/UIElements/TextUI/Query/StringsTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
     
    3535
    3636bool TextDialog::StringsTextQuery::handle() {
    37   Log() << Verbose(0) << getTitle();
    38   getline(cin,temp);
     37  std::cout << getDescription() << ": ";
     38  getline(std::cin,temp);
    3939  // dissect by " "
    4040  std::string::iterator olditer = temp.begin();
  • src/UIElements/TextUI/Query/VectorTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
     
    3939
    4040bool TextDialog::VectorTextQuery::handle() {
    41   std::cout << getTitle();
     41  std::cout << getDescription() << std::endl;
    4242  const Matrix &M = World::getInstance().getDomain().getM();
    4343  char coords[3] = {'x', 'y', 'z'};
     
    4646
    4747  std::string line;
    48   getline(cin,line);
     48  getline(std::cin,line);
    4949
    5050  // dissect by ","
  • src/UIElements/TextUI/Query/VectorsTextQuery.cpp

    r41e15b r5d4b73  
    2222#include <iostream>
    2323
    24 #include "TextUI/TextDialog.hpp"
     24#include "TextUI/Query/TextQuery.hpp"
    2525
    2626#include "Helpers/Log.hpp"
     
    3939
    4040bool TextDialog::VectorsTextQuery::handle() {
    41   std::cout << getTitle();
     41  std::cout << getDescription() << std::endl;
    4242  char coords[3] = {'x', 'y', 'z'};
    4343  const Matrix &M = World::getInstance().getDomain().getM();
     
    4646
    4747  std::string line;
    48   getline(cin,line);
     48  getline(std::cin,line);
    4949
    5050  // dissect by ","
  • src/UIElements/TextUI/TextDialog.cpp

    r41e15b r5d4b73  
    2121
    2222#include "TextUI/TextDialog.hpp"
     23#include "TextUI/Query/TextQuery.hpp"
    2324
    2425using namespace std;
  • src/UIElements/TextUI/TextDialog.hpp

    r41e15b r5d4b73  
    4545protected:
    4646  // specialized stuff for text queries
    47   class EmptyTextQuery : public Dialog::EmptyQuery {
    48   public:
    49     EmptyTextQuery(std::string title, std::string _description = NULL);
    50     virtual ~EmptyTextQuery();
    51     virtual bool handle();
    52   };
    53 
    54   class BooleanTextQuery : public Dialog::BooleanQuery {
    55   public:
    56     BooleanTextQuery(std::string title, std::string _description = NULL);
    57     virtual ~BooleanTextQuery();
    58     virtual bool handle();
    59   };
    60 
    61   class IntTextQuery : public Dialog::IntQuery {
    62   public:
    63     IntTextQuery(std::string title, std::string _description = NULL);
    64     virtual ~IntTextQuery();
    65     virtual bool handle();
    66   };
    67 
    68   class IntsTextQuery : public Dialog::IntsQuery {
    69   public:
    70     IntsTextQuery(std::string title, std::string _description = NULL);
    71     virtual ~IntsTextQuery();
    72     virtual bool handle();
    73   };
    74 
    75   class DoubleTextQuery : public Dialog::DoubleQuery {
    76   public:
    77     DoubleTextQuery(std::string title, std::string _description = NULL);
    78     virtual ~DoubleTextQuery();
    79     virtual bool handle();
    80   };
    81 
    82   class DoublesTextQuery : public Dialog::DoublesQuery {
    83   public:
    84     DoublesTextQuery(std::string title, std::string _description = NULL);
    85     virtual ~DoublesTextQuery();
    86     virtual bool handle();
    87   };
    88 
    89   class StringTextQuery : public Dialog::StringQuery {
    90   public:
    91     StringTextQuery(std::string title, std::string _description = NULL);
    92     virtual ~StringTextQuery();
    93     virtual bool handle();
    94   };
    95 
    96   class StringsTextQuery : public Dialog::StringsQuery {
    97   public:
    98     StringsTextQuery(std::string title, std::string _description = NULL);
    99     virtual ~StringsTextQuery();
    100     virtual bool handle();
    101   };
    102 
    103   class AtomTextQuery : public Dialog::AtomQuery {
    104   public:
    105     AtomTextQuery(std::string title, std::string _description = NULL);
    106     virtual ~AtomTextQuery();
    107     virtual bool handle();
    108   };
    109 
    110   class AtomsTextQuery : public Dialog::AtomsQuery {
    111   public:
    112     AtomsTextQuery(std::string title, std::string _description = NULL);
    113     virtual ~AtomsTextQuery();
    114     virtual bool handle();
    115   };
    116 
    117   class MoleculeTextQuery : public Dialog::MoleculeQuery {
    118   public:
    119     MoleculeTextQuery(std::string title, std::string _description = NULL);
    120     virtual ~MoleculeTextQuery();
    121     virtual bool handle();
    122   };
    123 
    124   class MoleculesTextQuery : public Dialog::MoleculesQuery {
    125   public:
    126     MoleculesTextQuery(std::string title, std::string _description = NULL);
    127     virtual ~MoleculesTextQuery();
    128     virtual bool handle();
    129   };
    130 
    131   class VectorTextQuery : public Dialog::VectorQuery {
    132   public:
    133     VectorTextQuery(std::string title,bool _check, std::string _description = NULL);
    134     virtual ~VectorTextQuery();
    135     virtual bool handle();
    136   };
    137 
    138   class VectorsTextQuery : public Dialog::VectorsQuery {
    139   public:
    140     VectorsTextQuery(std::string title,bool _check, std::string _description = NULL);
    141     virtual ~VectorsTextQuery();
    142     virtual bool handle();
    143   };
    144 
    145   class BoxTextQuery : public Dialog::BoxQuery {
    146   public:
    147     BoxTextQuery(std::string title, std::string _description = NULL);
    148     virtual ~BoxTextQuery();
    149     virtual bool handle();
    150   };
    151 
    152   class ElementTextQuery : public Dialog::ElementQuery {
    153   public:
    154     ElementTextQuery(std::string title, std::string _description = NULL);
    155     virtual ~ElementTextQuery();
    156     virtual bool handle();
    157   };
    158 
    159   class ElementsTextQuery : public Dialog::ElementsQuery {
    160   public:
    161     ElementsTextQuery(std::string title, std::string _description = NULL);
    162     virtual ~ElementsTextQuery();
    163     virtual bool handle();
    164   };
    165 
    166   class FileTextQuery : public Dialog::FileQuery {
    167   public:
    168     FileTextQuery(std::string title, std::string _description = NULL);
    169     virtual ~FileTextQuery();
    170     virtual bool handle();
    171   };
     47  // all placed into Query/TextQuery.hpp
     48  // !please adhere to alphabetical ordering!
     49  class AtomTextQuery;
     50  class AtomsTextQuery;
     51  class BooleanTextQuery;
     52  class BoxTextQuery;
     53  class DoubleTextQuery;
     54  class DoublesTextQuery;
     55  class ElementTextQuery;
     56  class ElementsTextQuery;
     57  class EmptyTextQuery;
     58  class FileTextQuery;
     59  class IntTextQuery;
     60  class IntsTextQuery;
     61  class MoleculeTextQuery;
     62  class MoleculesTextQuery;
     63  class StringTextQuery;
     64  class StringsTextQuery;
     65  class VectorTextQuery;
     66  class VectorsTextQuery;
    17267};
    17368
  • src/UIElements/TextUI/TextWindow.cpp

    r41e15b r5d4b73  
    2626#include "Menu/TextMenu/TxMenu.hpp"
    2727#include "Menu/TextMenu/ActionMenuItem.hpp"
    28 #include "Menu/TextMenu/SeperatorItem.hpp"
     28#include "Menu/TextMenu/SeparatorMenuItem.hpp"
    2929#include "Menu/TextMenu/DisplayMenuItem.hpp"
    3030#include "Menu/TextMenu/SubMenuItem.hpp"
     
    6565  new DisplayMenuItem(main_menu->getMenuInstance(),moleculeView,"Molecule List");
    6666
    67   new SeperatorItem(main_menu->getMenuInstance());
     67  new SeparatorMenuItem(main_menu->getMenuInstance());
    6868
    6969  main_menu->init();
    7070
    71   new SeperatorItem(main_menu->getMenuInstance());
     71  new SeparatorMenuItem(main_menu->getMenuInstance());
    7272
    7373  // save has reserved key 's'
Note: See TracChangeset for help on using the changeset viewer.