| 1 | /*
|
|---|
| 2 | * Project: MoleCuilder
|
|---|
| 3 | * Description: creates and alters molecular systems
|
|---|
| 4 | * Copyright (C) 2010 University of Bonn. All rights reserved.
|
|---|
| 5 | * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | /*
|
|---|
| 9 | * FileQtQuery.cpp
|
|---|
| 10 | *
|
|---|
| 11 | * Created on: Oct 25, 2010
|
|---|
| 12 | * Author: heber
|
|---|
| 13 | */
|
|---|
| 14 |
|
|---|
| 15 | // include config.h
|
|---|
| 16 | #ifdef HAVE_CONFIG_H
|
|---|
| 17 | #include <config.h>
|
|---|
| 18 | #endif
|
|---|
| 19 |
|
|---|
| 20 | #include <Qt/qboxlayout.h>
|
|---|
| 21 | #include <Qt/qlabel.h>
|
|---|
| 22 | #include <Qt/qlineedit.h>
|
|---|
| 23 | #include <Qt/qpushbutton.h>
|
|---|
| 24 |
|
|---|
| 25 | #include "Helpers/MemDebug.hpp"
|
|---|
| 26 |
|
|---|
| 27 | #include "UIElements/Qt4/Query/QtQuery.hpp"
|
|---|
| 28 | #include "UIElements/Qt4/Pipe/FileQtQueryPipe.hpp"
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 | QtDialog::FileQtQuery::FileQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
|
|---|
| 32 | Dialog::FileQuery(_title),
|
|---|
| 33 | parent(_parent)
|
|---|
| 34 | {
|
|---|
| 35 |
|
|---|
| 36 | filenameLineEdit = new QLineEdit(_dialog);
|
|---|
| 37 | filenameLineEdit->setText(QString());
|
|---|
| 38 | filenameLineEdit->setReadOnly(true);
|
|---|
| 39 |
|
|---|
| 40 | filenameLabel = new QLabel(QString("Input file:"));
|
|---|
| 41 | filenameLabel->setBuddy(filenameLineEdit);
|
|---|
| 42 |
|
|---|
| 43 | filedialogButton = new QPushButton("&Choose", _dialog);
|
|---|
| 44 |
|
|---|
| 45 | pipe = new FileQtQueryPipe(&tmp,_dialog,filenameLineEdit,filedialogButton);
|
|---|
| 46 |
|
|---|
| 47 | thisLayout = new QHBoxLayout();
|
|---|
| 48 | parent->addLayout(thisLayout);
|
|---|
| 49 | thisLayout->addWidget(filenameLabel);
|
|---|
| 50 | thisLayout->addWidget(filenameLineEdit);
|
|---|
| 51 | thisLayout->addWidget(filedialogButton);
|
|---|
| 52 |
|
|---|
| 53 | QObject::connect(filedialogButton,SIGNAL(clicked()),pipe,SLOT(showFileDialog()));
|
|---|
| 54 | }
|
|---|
| 55 |
|
|---|
| 56 | QtDialog::FileQtQuery::~FileQtQuery()
|
|---|
| 57 | {
|
|---|
| 58 | delete pipe;
|
|---|
| 59 | }
|
|---|
| 60 |
|
|---|
| 61 | bool QtDialog::FileQtQuery::handle(){
|
|---|
| 62 | return true;
|
|---|
| 63 | }
|
|---|
| 64 |
|
|---|