Changes in / [5d4b73:41e15b]


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

Legend:

Unmodified
Added
Removed
  • src/Makefile.am

    r5d4b73 r41e15b  
    124124  Thermostats/Thermostat.hpp \
    125125  Thermostats/Woodcock.hpp
     126
     127QTUIMOC_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                                 
     136QTUISOURCE = 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             
     179QTUIHEADER = \
     180  ${QTUIMOC_HEADER} \
     181  UIElements/Qt4/Pipe/QtQueryListPipe.hpp \
     182  UIElements/Qt4/QtUIFactory.hpp
     183
     184QTUI_DEFS =
    126185
    127186TESSELATIONSOURCE = \
     
    299358
    300359#Stuff for building the GUI using Qt
    301 molecuildergui_SOURCES = builder.cpp
     360molecuildergui_SOURCES = ${QTUISOURCE} builder.cpp
    302361molecuildergui_CXXFLAGS = ${QT_CXXFLAGS} ${GLU_CXXFLAGS} -DUSE_GUI_QT
    303362molecuildergui_LDFLAGS = $(BOOST_LIB) ${QT_LDFLAGS} ${GLU_LDFLAGS}
     
    308367molecuildergui_LDADD = \
    309368        UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \
    310         UIElements/libMolecuilderQtUI-@MOLECUILDER_API_VERSION@.la \
    311369        Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
    312370        libMolecuilder-@MOLECUILDER_API_VERSION@.la \
     
    339397        Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
    340398        $(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
     404allmocs.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;
    341413
    342414#EXTRA_DIST = ${molecuilder_DATA}
  • src/UIElements/CommandLineUI/CommandLineDialog.cpp

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

    r5d4b73 r41e15b  
    4848protected:
    4949  // specialized stuff for text queries
    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;
     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  };
    68175};
    69176
  • src/UIElements/CommandLineUI/CommandLineParser.cpp

    r5d4b73 r41e15b  
    2121
    2222#include <boost/filesystem.hpp>
     23#include <boost/lexical_cast.hpp>
    2324#include <boost/program_options.hpp>
    2425#include <fstream>
    2526#include <iostream>
    2627#include <map>
     28#include <vector>
    2729
    2830#include "Actions/Action.hpp"
     
    3234#include "Actions/OptionTrait.hpp"
    3335#include "Actions/Values.hpp"
     36#include "Helpers/Assert.hpp"
    3437#include "Helpers/Log.hpp"
    3538#include "Helpers/Verbose.hpp"
    3639#include "CommandLineParser.hpp"
    37 #include "CommandLineParser_validate.hpp"
    3840
    3941#include "Patterns/Singleton_impl.hpp"
    4042
    4143class element;
     44
     45using 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 */
     54void 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
     88void 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 */
     132void 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
    42147
    43148/** Constructor of class CommandLineParser.
     
    356461{
    357462  po::store(po::command_line_parser(argc,argv).options(cmdline_options).run(), vm);
    358   std::ifstream input;
     463  ifstream input;
    359464  input.open("example.cfg");
    360465  if (!input.fail())
     
    368473void CommandLineParser::scanforSequenceOfArguments()
    369474{
    370   std::map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap();
     475  map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap();
    371476  // go through all arguments
    372477  for (int i=1;i<argc;i++) {
    373     (std::cout << Verbose(1) << "Checking on " << argv[i] << std::endl);
     478    (cout << Verbose(1) << "Checking on " << argv[i] << endl);
    374479    // check whether they
    375480    if (argv[i][0] == '-') { // .. begin with -
     
    380485        //  .. and check that next letter is not numeric, if so insert
    381486      } else if (((argv[i][1] < '0') || (argv[i][1] > '9')) && ((argv[i][1] != '.'))) {
    382         std::map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1]));
     487        map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1]));
    383488        if (iter != ShortFormToActionMap.end()) {
    384489          (cout << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl);
     
    406511std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap()
    407512{
    408   std::map <std::string, std::string> result;
     513  map <std::string, std::string> result;
    409514
    410515  ActionRegistry &AR = ActionRegistry::getInstance();
  • src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    r5d4b73 r41e15b  
    33INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/UIElements
    44
    5 AM_LDFLAGS = -ldl
    6 AM_CXXFLAGS = ${QT_CXXFLAGS} ${GLU_CXXFLAGS}
     5AM_LDFLAGS = $(CPPUNIT_LIBS) -ldl
     6AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
    77
    88VIEWSOURCE = \
     
    2828 
    2929TEXTMENUSOURCE = \
    30   Menu/TextMenu/TxMenuLeaveAction.cpp \
    3130  Menu/TextMenu/TxMenu.cpp \
    3231  Menu/TextMenu/MenuItem.cpp \
    3332  Menu/TextMenu/SubMenuItem.cpp \
    3433  Menu/TextMenu/ActionMenuItem.cpp \
    35   Menu/TextMenu/SeparatorMenuItem.cpp \
     34  Menu/TextMenu/SeperatorItem.cpp \
    3635  Menu/TextMenu/DisplayMenuItem.cpp
    3736 
     
    4241  Menu/TextMenu/SubMenuItem.hpp \
    4342  Menu/TextMenu/ActionMenuItem.hpp \
    44   Menu/TextMenu/SeparatorMenuItem.hpp \
     43  Menu/TextMenu/SeperatorItem.hpp \
    4544  Menu/TextMenu/DisplayMenuItem.hpp
    4645
     
    108107  TextUI/TextWindow.cpp
    109108TEXTUIHEADER = \
    110   TextUI/Query/TextQuery.hpp \
    111109  TextUI/TextDialog.hpp \
    112110  TextUI/TextStatusIndicator.hpp \
     
    135133  CommandLineUI/CommandLineDialog.cpp \
    136134  CommandLineUI/CommandLineParser.cpp \
    137   CommandLineUI/CommandLineParser_validate.cpp \
    138135  CommandLineUI/CommandLineStatusIndicator.cpp \
    139136  CommandLineUI/CommandLineUIFactory.cpp \
     
    142139 
    143140COMMANDLINEUIHEADER = \
    144   CommandLineUI/Query/CommandLineQuery.hpp \
    145141  CommandLineUI/CommandLineDialog.hpp \
    146142  CommandLineUI/CommandLineParser.hpp \
    147   CommandLineUI/CommandLineParser_validate.hpp \
    148143  CommandLineUI/CommandLineStatusIndicator.hpp \
    149144  CommandLineUI/CommandLineUIFactory.hpp \
     
    151146  CommandLineUI/TypeEnumContainer.cpp
    152147
    153 QTUIMOC_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                                  
    177 QTUISOURCE = 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              
    220 QTUIHEADER = \
    221   ${QTUIMOC_HEADER} \
    222         Menu/Qt4/QtMenu.hpp \
    223         Qt4/Query/QtQuery.hpp \
    224   Qt4/QtUIFactory.hpp \
    225   Qt4/Pipe/QtQueryListPipe.hpp
    226 
    227 QTUI_DEFS =
    228 
    229 
    230 
    231 lib_LTLIBRARIES = libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \
    232         libMolecuilderQtUI-@MOLECUILDER_API_VERSION@.la
     148lib_LTLIBRARIES = libMolecuilderUI-@MOLECUILDER_API_VERSION@.la
    233149libMolecuilderUI_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/
    234 libMolecuilderQtUI_includedir = $(includedir)/molecuilder-$(MOLECUILDER_API_VERSION)/Actions/
    235150libMolecuilderUI_LIBS = \
    236         Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la
    237 libMolecuilderQtUI_LIBS = \
    238151        Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la
    239152
    240153nobase_libMolecuilderUI_include_HEADERS = ${UIHEADER}
    241 nobase_libMolecuilderQtUI_include_HEADERS = ${QTUIHEADER}
    242154
    243155## Define the source file list for the "libexample-@MOLECUILDER_API_VERSION@.la"
     
    250162## which are already listed elsewhere in a _HEADERS variable assignment.
    251163libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_SOURCES = ${UISOURCE}
    252 libMolecuilderQtUI_@MOLECUILDER_API_VERSION@_la_SOURCES = ${QTUISOURCE}
    253164
    254165## Instruct libtool to include ABI version information in the generated shared
     
    256167## that all version information is kept in one place.
    257168libMolecuilderUI_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION)
    258 libMolecuilderQtUI_@MOLECUILDER_API_VERSION@_la_LDFLAGS = -version-info $(MOLECUILDER_SO_VERSION)
    259169
    260170## The generated configuration header is installed in its own subdirectory of
     
    270180## shipped with the source tarball.
    271181libMolecuilderUI_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include
    272 libMolecuilderQtUI_libincludedir = $(libdir)/molecuilder-$(MOLECUILDER_API_VERSION)/include
    273182nodist_libMolecuilderUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h
    274 nodist_libMolecuilderQtUI_libinclude_HEADERS = $(top_builddir)/libmolecuilder_config.h
    275183
    276184## Install the generated pkg-config file (.pc) into the expected location for
     
    287195        done;
    288196       
    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
    293 allmocs.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        
    304197MOSTLYCLEANFILES = unity.cpp
  • src/UIElements/Menu/Menu.hpp

    r5d4b73 r41e15b  
    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.
    4823 */
    4924class Menu : virtual public MenuInterface
  • src/UIElements/Menu/TextMenu/TextMenu.hpp

    r5d4b73 r41e15b  
    1212#include <string>
    1313
    14 #include "Helpers/MemDebug.hpp"
    15 
    1614#include "Helpers/Log.hpp"
    1715#include "Helpers/Verbose.hpp"
     
    2119#include "Actions/ActionRegistry.hpp"
    2220#include "Actions/ActionTraits.hpp"
    23 #include "Menu/TextMenu/TxMenuLeaveAction.hpp"
     21#include "Menu/TextMenu/TxMenu.hpp"
    2422#include "Menu/TextMenu/ActionMenuItem.hpp"
    25 #include "Menu/TextMenu/SeparatorMenuItem.hpp"
     23#include "Menu/TextMenu/SeperatorItem.hpp"
    2624#include "Menu/TextMenu/SubMenuItem.hpp"
    2725
    2826/** 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  *
    3427 * \sa QtMenu.
    3528 */
     
    3831{
    3932public:
    40   /** Constructor for class TextMenu.
    41    * Initializes outputter and token and takes note whether to delete the
    42    * MenuInstance or not.
    43    */
    4433  TextMenu(std::ostream &_outputter, const std::string &_token) :
    4534    MenuInterface(_token),
     
    5746  {}
    5847
    59   /** Destructor of MenuInstance.
    60    *
    61    */
    6248  virtual ~TextMenu()
    6349  {
     
    6652  }
    6753
    68   /** Display this MenuInstance.
    69    *
    70    */
    7154  void display()
    7255  {
     
    7457  }
    7558
    76   /** Returns a pointer to the contained/wrapped MenuInstance.
    77    * \return pointer to template class pointer
    78    */
    7959  T * const getMenuInstance()
    8060  {
     
    8262  }
    8363
    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    */
    8864  void reserveShortcut(char trigger, const std::string &name)
    8965  {
     
    10278  MenuShortcutMap ShortcutMap;
    10379
    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    */
    10880  virtual void addActionItem(const std::string &token, const std::string &description)
    10981  {
     
    11183  }
    11284
    113   /** Adds a (dead) separator item.
    114    *
    115    */
    11685  virtual void addSeparatorItem()
    11786  {
    118     new SeparatorMenuItem(MenuInstance);
     87    new SeperatorItem(MenuInstance);
    11988  }
    12089
    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    */
    12790  virtual void addSubmenuItem(const std::string &token, const std::string &description)
    12891  {
     
    139102  }
    140103
    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    */
    147104  char getSuitableShortForm(const std::string &name)
    148105  {
  • src/UIElements/Menu/TextMenu/TxMenu.cpp

    r5d4b73 r41e15b  
    2424#include <iostream>
    2525#include <cmath>
     26#include "Actions/Action.hpp"
     27#include "Actions/ActionTraits.hpp"
    2628#include "Menu/TextMenu/TxMenu.hpp"
    2729#include "Menu/TextMenu/MenuItem.hpp"
     30#include "Helpers/Assert.hpp"
    2831
    2932
    30 /** Constructor for class TxMenu.
    31  *
     33/**
    3234 * produce a text menu with a given title.
    3335 * 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
    3836 */
    3937TxMenu::TxMenu(std::ostream& _outputter, const std::string _title, char _spacer,int _length) :
     
    4745}
    4846
    49 /** Destructor for class TxMenu.
    50  *
    51  */
    5247TxMenu::~TxMenu()
    5348{
     
    5651}
    5752
    58 /** Adds an MenuItem to the internal list.
    59  * \param *item item to add
    60  */
    6153void TxMenu::addItem(MenuItem* item) {
    6254  items.push_back(item);
    6355}
    6456
    65 /** Removes an MenuItem to the internal list.
    66  * \param *item item to remove
    67  */
    6857void TxMenu::removeItem(MenuItem* item) {
    6958  items.remove(item);
    7059}
    7160
    72 /** Function to quit this TxMenu.
    73  */
    7461void TxMenu::doQuit(){
    7562  quit = true;
    7663}
    7764
    78 /** Return the current state of quitting.
    79  * \return quit boolean
    80  */
    8165bool TxMenu::hasQuit(){
    8266  return quit;
    8367}
    8468
    85 /** Display in a formatted manner a given entry of this menu.
    86  * \param *entry MenuItem to show
    87  */
    8869void TxMenu::showEntry(MenuItem* entry){
    8970  if(entry->isActive()==false){
     
    9778}
    9879
    99 /** Display this menu.
    100  *
    101  */
    10280void TxMenu::display() {
    10381  char choice;
     
    136114}
    137115
    138 /**  Return the internally stored title of the menu.
    139  * \return title string
    140  */
    141116std::string TxMenu::getTitle(){
    142117  return title;
    143118}
    144119
    145 /**  Return the internally stored outputter of the menu.
    146  * \return output stream reference
    147  */
    148120std::ostream& TxMenu::getOutputter()
    149121{
     
    151123}
    152124
    153 /** Add a default item to the menu.
    154  * \param *_defaultItem MenuItem to act as default item.
    155  */
     125
    156126void TxMenu::addDefault(MenuItem* _defaultItem) {
    157127  defaultItem = _defaultItem;
    158128}
    159129
     130/****************************** Contained Actions ****************/
     131
     132TxMenu::LeaveAction::LeaveAction(TxMenu* const _menu, const ActionTraits & LeaveActionTrait) :
     133  Action(LeaveActionTrait, true),
     134  menu(_menu)
     135{}
     136
     137TxMenu::LeaveAction::~LeaveAction(){}
     138
     139bool TxMenu::LeaveAction::canUndo(){
     140  return false;
     141}
     142
     143bool TxMenu::LeaveAction::shouldUndo(){
     144  return false;
     145}
     146
     147void TxMenu::LeaveAction::getParametersfromValueStorage()
     148{}
     149
     150Dialog* TxMenu::LeaveAction::fillDialog(Dialog *dialog){
     151  ASSERT(dialog,"No Dialog given when filling action dialog");
     152  return dialog;
     153}
     154
     155
     156Action::state_ptr TxMenu::LeaveAction::performCall(){
     157  menu->doQuit();
     158  return Action::success;
     159}
     160
     161
     162Action::state_ptr TxMenu::LeaveAction::performUndo(Action::state_ptr){
     163  ASSERT(0,"Cannot undo leaving a menu");
     164  return Action::success;
     165}
     166
     167Action::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

    r5d4b73 r41e15b  
    1414
    1515#include "Menu/Menu.hpp"
     16#include "Actions/Action.hpp"
     17#include "Actions/ActionTraits.hpp"
    1618#include "defs.hpp"
    1719
    1820class MenuItem;
    1921
    20 /** Menu for the TextUI.
     22/**
     23 * Used to produce any kind of text menu
    2124 *
    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.
     25 * All Items are displayed and user is prompted for a key. The item corresponding to that key is then activated.
    3426 */
    3527class TxMenu
    3628{
    3729public:
    38   class LeaveAction;
     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  };
    3948
    4049  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

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

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

    r5d4b73 r41e15b  
    1818#endif
    1919
    20 #include "UIElements/Qt4/Pipe/BooleanQtQueryPipe.hpp"
    2120#include "UIElements/Qt4/QtDialog.hpp"
    2221
    2322#include <Qt/qcombobox.h>
    2423
    25 #include "Helpers/MemDebug.hpp"
    2624
    2725BooleanQtQueryPipe::BooleanQtQueryPipe(const bool *_content, QtDialog *_dialog, QComboBox *_booleanComboBox) :
  • src/UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp

    r5d4b73 r41e15b  
    1818#endif
    1919
    20 #include "UIElements/Qt4/Pipe/BoxQtQueryPipe.hpp"
    2120#include "UIElements/Qt4/QtDialog.hpp"
    2221
     
    2423#include <Qt/qtablewidget.h>
    2524
    26 #include "Helpers/MemDebug.hpp"
    2725#include "LinearAlgebra/Matrix.hpp"
    2826#include "Box.hpp"
  • src/UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp

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

    r5d4b73 r41e15b  
    1818#endif
    1919
    20 #include "UIElements/Qt4/Pipe/ElementQtQueryPipe.hpp"
    2120#include "UIElements/Qt4/QtDialog.hpp"
    2221
    2322#include <Qt/qcombobox.h>
    2423
    25 #include "Helpers/MemDebug.hpp"
    2624#include "element.hpp"
    2725#include "periodentafel.hpp"
  • src/UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp

    r5d4b73 r41e15b  
    1818#endif
    1919
    20 #include "UIElements/Qt4/Pipe/ElementsQtQueryPipe.hpp"
    2120#include "UIElements/Qt4/QtDialog.hpp"
    2221
     
    2524#include <Qt/qcombobox.h>
    2625
    27 #include "Helpers/MemDebug.hpp"
    2826#include "element.hpp"
    2927#include "periodentafel.hpp"
  • src/UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp

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

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

    r5d4b73 r41e15b  
    1818#endif
    1919
    20 #include "UIElements/Qt4/Pipe/IntQtQueryPipe.hpp"
    2120#include "UIElements/Qt4/QtDialog.hpp"
    2221
    23 #include "Helpers/MemDebug.hpp"
     22#include <Qt/qcombobox.h>
    2423
    2524
  • src/UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp

    r5d4b73 r41e15b  
    1818#endif
    1919
    20 #include "UIElements/Qt4/Pipe/MoleculeQtQueryPipe.hpp"
    2120#include "UIElements/Qt4/QtDialog.hpp"
    2221
    2322#include <Qt/qcombobox.h>
    24 
    25 #include "Helpers/MemDebug.hpp"
    2623
    2724#include "Descriptors/MoleculeIdDescriptor.hpp"
  • src/UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp

    r5d4b73 r41e15b  
    1818#endif
    1919
    20 #include "UIElements/Qt4/Pipe/MoleculesQtQueryPipe.hpp"
    2120#include "UIElements/Qt4/QtDialog.hpp"
    2221
     
    2423
    2524#include <Qt/qcombobox.h>
    26 
    27 #include "Helpers/MemDebug.hpp"
    2825
    2926#include "Descriptors/MoleculeIdDescriptor.hpp"
  • src/UIElements/Qt4/Pipe/QtQueryListPipe.hpp

    r5d4b73 r41e15b  
    99#define QTQUERYLISTPIPE_HPP_
    1010
    11 #include "QtQueryPipe.hpp"
    12 
    1311#include <boost/lexical_cast.hpp>
    1412
    1513using boost::lexical_cast;
    1614using boost::bad_lexical_cast;
    17 
    1815
    1916template<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

    r5d4b73 r41e15b  
    1818#endif
    1919
    20 #include "UIElements/Qt4/Pipe/StringQtQueryPipe.hpp"
    2120#include "UIElements/Qt4/QtDialog.hpp"
    2221
    23 #include "Helpers/MemDebug.hpp"
     22#include <string>
    2423
    25 #include <string>
     24#include <Qt/qcombobox.h>
    2625
    2726
  • src/UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp

    r5d4b73 r41e15b  
    1818#endif
    1919
    20 #include "UIElements/Qt4/Pipe/VectorQtQueryPipe.hpp"
    2120#include "UIElements/Qt4/QtDialog.hpp"
    2221
    2322#include <Qt/qcombobox.h>
    24 
    25 #include "Helpers/MemDebug.hpp"
    2623
    2724
  • src/UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp

    r5d4b73 r41e15b  
    1818#endif
    1919
    20 #include "UIElements/Qt4/Pipe/VectorsQtQueryPipe.hpp"
    2120#include "UIElements/Qt4/QtDialog.hpp"
    2221
     22#include <vector>
     23
    2324#include <Qt/qcombobox.h>
    24 
    25 #include "Helpers/MemDebug.hpp"
    26 
    27 #include <vector>
    2825
    2926
  • src/UIElements/Qt4/QtDialog.cpp

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

    r5d4b73 r41e15b  
    1111#include "UIElements/Dialog.hpp"
    1212#include <QtGui/QDialog>
     13#include <QtGui/QFileDialog>
     14
     15#include <boost/filesystem.hpp>
    1316
    1417#include <map>
     
    1720
    1821class QBoxLayout;
     22class QLabel;
     23class QSpinBox;
     24class QDoubleSpinBox;
     25class QLineEdit;
     26class QListWidget;
     27class QTableWidget;
     28class QComboBox;
    1929class QDialogButtonBox;
     30
     31class Matrix;
     32
     33// Forward declarations for plumbing
     34template<typename T> class QtQueryListPipe;
     35class BooleanQtQueryPipe;
     36class BoxQtQueryPipe;
     37class StringQtQueryPipe;
     38class StringsQtQueryPipe;
     39class IntQtQueryPipe;
     40class DoubleQtQueryPipe;
     41class DoublesQtQueryPipe;
     42class AtomQtQueryPipe;
     43class AtomsQtQueryPipe;
     44class MoleculeQtQueryPipe;
     45class MoleculesQtQueryPipe;
     46class EmptyQtQueryPipe;
     47class ElementQtQueryPipe;
     48class ElementsQtQueryPipe;
     49class VectorQtQueryPipe;
     50class VectorsQtQueryPipe;
     51class FileQtQueryPipe;
    2052
    2153class QtDialog : public QDialog, public Dialog
     
    5082
    5183protected:
    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;
     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    };
    70345
    71346private:
     
    76351};
    77352
     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
     358template<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
     380class StringQtQueryPipe : public QWidget {
     381  Q_OBJECT
     382public:
     383  StringQtQueryPipe(std::string *_content, QtDialog *_dialog);
     384  virtual ~StringQtQueryPipe();
     385
     386public slots:
     387  void update(const QString&);
     388
     389private:
     390  std::string *content;
     391  QtDialog *dialog;
     392
     393};
     394
     395class IntQtQueryPipe : public QWidget {
     396  Q_OBJECT
     397public:
     398  IntQtQueryPipe(int *_content, QtDialog *_dialog);
     399  virtual ~IntQtQueryPipe();
     400
     401public slots:
     402  void update(int);
     403
     404private:
     405  int *content;
     406  QtDialog *dialog;
     407
     408};
     409
     410
     411class DoubleQtQueryPipe : public QWidget {
     412  Q_OBJECT
     413public:
     414  DoubleQtQueryPipe(double *_content, QtDialog *_dialog);
     415  virtual ~DoubleQtQueryPipe();
     416
     417public slots:
     418  void update(double);
     419
     420private:
     421  double *content;
     422  QtDialog *dialog;
     423
     424};
     425
     426class BoxQtQueryPipe : public QWidget {
     427  Q_OBJECT
     428public:
     429  BoxQtQueryPipe(Box &_content, QtDialog *_dialog, QTableWidget *_inputTable);
     430  virtual ~BoxQtQueryPipe();
     431
     432public slots:
     433  void update(int,int);
     434
     435private:
     436  Box &content;
     437  QtDialog *dialog;
     438  QTableWidget *inputTable;
     439
     440  Matrix *tmpM;
     441};
     442
     443
     444class AtomQtQueryPipe : public QWidget {
     445  Q_OBJECT
     446public:
     447  AtomQtQueryPipe(const atom **_content, QtDialog *_dialog, QComboBox *_theBox);
     448  virtual ~AtomQtQueryPipe();
     449
     450public slots:
     451  void update(int);
     452
     453private:
     454  const atom **content;
     455  QtDialog *dialog;
     456  QComboBox *theBox;
     457
     458};
     459
     460
     461class AtomsQtQueryPipe : public QWidget {
     462  Q_OBJECT
     463public:
     464  AtomsQtQueryPipe(std::vector<const atom *>*_content, QtDialog *_dialog, QListWidget *_theList);
     465  virtual ~AtomsQtQueryPipe();
     466
     467public slots:
     468  void update();
     469  void add();
     470  void remove();
     471
     472private:
     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
     481class MoleculeQtQueryPipe : public QWidget {
     482  Q_OBJECT
     483public:
     484  MoleculeQtQueryPipe(const molecule **_content, QtDialog *_dialog, QComboBox *_theBox);
     485  virtual ~MoleculeQtQueryPipe();
     486
     487public slots:
     488  void update(int);
     489
     490private:
     491  const molecule **content;
     492  QtDialog *dialog;
     493  QComboBox *theBox;
     494
     495};
     496
     497class MoleculesQtQueryPipe : public QWidget {
     498  Q_OBJECT
     499public:
     500  MoleculesQtQueryPipe(std::vector<const molecule *>*_content, QtDialog *_dialog, QComboBox *_theBox);
     501  virtual ~MoleculesQtQueryPipe();
     502
     503public slots:
     504  void update(int);
     505
     506private:
     507  std::vector<const molecule *>*content;
     508  QtDialog *dialog;
     509  QComboBox *theBox;
     510
     511};
     512
     513class VectorQtQueryPipe : public QWidget {
     514  Q_OBJECT
     515public:
     516  VectorQtQueryPipe(Vector *_content, QtDialog *_dialog, QComboBox *_theBox);
     517  virtual ~VectorQtQueryPipe();
     518
     519public slots:
     520  void update();
     521
     522private:
     523  Vector *content;
     524  QtDialog *dialog;
     525  QComboBox *theBox;
     526};
     527
     528class VectorsQtQueryPipe : public QWidget {
     529  Q_OBJECT
     530public:
     531  VectorsQtQueryPipe(std::vector<Vector>*_content, QtDialog *_dialog, QComboBox *_theBox);
     532  virtual ~VectorsQtQueryPipe();
     533
     534public slots:
     535  void update();
     536
     537private:
     538  std::vector<Vector> *content;
     539  QtDialog *dialog;
     540  QComboBox *theBox;
     541};
     542
     543class EmptyQtQueryPipe : public QWidget {
     544  Q_OBJECT
     545public:
     546  EmptyQtQueryPipe(QtDialog *_dialog, QLabel *_textLabel);
     547  virtual ~EmptyQtQueryPipe();
     548
     549public slots:
     550  void update();
     551
     552private:
     553  QtDialog *dialog;
     554  QLabel *textLabel;
     555};
     556
     557class BooleanQtQueryPipe : public QWidget {
     558  Q_OBJECT
     559public:
     560  BooleanQtQueryPipe(const bool *_content, QtDialog *_dialog, QComboBox *_booleanComboBox);
     561  virtual ~BooleanQtQueryPipe();
     562
     563public slots:
     564  void update();
     565
     566private:
     567  const bool *content;
     568  QtDialog *dialog;
     569  QComboBox *booleanComboBox;
     570};
     571
     572class ElementQtQueryPipe : public QWidget {
     573  Q_OBJECT
     574public:
     575  ElementQtQueryPipe(const element **_content, QtDialog *_dialog, QComboBox *_theBox);
     576  virtual ~ElementQtQueryPipe();
     577
     578public slots:
     579  void update(int);
     580
     581private:
     582  const element **content;
     583  QtDialog *dialog;
     584  QComboBox *theBox;
     585};
     586
     587class ElementsQtQueryPipe : public QWidget {
     588  Q_OBJECT
     589public:
     590  ElementsQtQueryPipe(std::vector<const element *>*_content, QtDialog *_dialog, QComboBox *_theBox);
     591  virtual ~ElementsQtQueryPipe();
     592
     593public slots:
     594  void update(int);
     595
     596private:
     597  std::vector<const element *>*content;
     598  QtDialog *dialog;
     599  QComboBox *theBox;
     600};
     601
     602class FileQtQueryPipe : public QWidget {
     603  Q_OBJECT
     604public:
     605  FileQtQueryPipe(boost::filesystem::path *_content, QtDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton);
     606  virtual ~FileQtQueryPipe();
     607
     608public slots:
     609  void update();
     610  void showFileDialog();
     611
     612private:
     613  boost::filesystem::path *content;
     614  QtDialog *dialog;
     615  QLineEdit *filenameLineEdit;
     616  QPushButton *filedialogButton;
     617  QFileDialog *theFileDialog;
     618};
    78619
    79620#endif /* QTDIALOG_HPP_ */
  • src/UIElements/Qt4/Query/AtomQtQuery.cpp

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    r5d4b73 r41e15b  
    2121
    2222#include <iostream>
    23 #include <string>
    2423
    2524#include <boost/filesystem.hpp>
    2625
    27 #include "TextUI/Query/TextQuery.hpp"
     26#include "TextUI/TextDialog.hpp"
    2827
    2928#include "Helpers/Log.hpp"
     
    3837
    3938bool TextDialog::FileTextQuery::handle() {
    40   bool badInput = false;
     39  Log() << Verbose(0) << getTitle();
    4140  std::string 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');
     41  getline(cin,tempstring);
    5542  tmp = tempstring;
    5643  return true;
  • src/UIElements/TextUI/Query/IntTextQuery.cpp

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

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

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

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

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

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

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

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

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

    r5d4b73 r41e15b  
    4545protected:
    4646  // specialized stuff for text queries
    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;
     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  };
    67172};
    68173
  • src/UIElements/TextUI/TextWindow.cpp

    r5d4b73 r41e15b  
    2626#include "Menu/TextMenu/TxMenu.hpp"
    2727#include "Menu/TextMenu/ActionMenuItem.hpp"
    28 #include "Menu/TextMenu/SeparatorMenuItem.hpp"
     28#include "Menu/TextMenu/SeperatorItem.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 SeparatorMenuItem(main_menu->getMenuInstance());
     67  new SeperatorItem(main_menu->getMenuInstance());
    6868
    6969  main_menu->init();
    7070
    71   new SeparatorMenuItem(main_menu->getMenuInstance());
     71  new SeperatorItem(main_menu->getMenuInstance());
    7272
    7373  // save has reserved key 's'
Note: See TracChangeset for help on using the changeset viewer.