| 1 | /* |
| 2 | * File: NewReaderFile.cpp |
| 3 | * |
| 4 | * Author: Jacob Dekel |
| 5 | * Created on: Aug 7, 2009 |
| 6 | * |
| 7 | * Copyright (c) 2009-2013 Jacob Dekel |
| 8 | * $Id$ |
| 9 | * |
| 10 | * This object handles the creation of a new reader file |
| 11 | * |
| 12 | * This program is free software: you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by |
| 14 | * the Free Software Foundation, either version 3 of the License, or |
| 15 | * (at your option) any later version. |
| 16 | * |
| 17 | * This program is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | * GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License |
| 23 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 24 | * |
| 25 | */ |
| 26 | |
| 27 | #include "NewReaderFile.h"cxx . . $ `<file>/HercConfiguration/NewReaderFile.h`/ |
| 28 | #include "Preferences.h"cxx . . $ `<file>/HercStudio/Preferences.h`/ |
| 29 | |
| 30 | #include <QFileDialog> |
| 31 | |
| 32 | |
| 33 | NewReaderFilecxx . . $ NewReaderFile#::NewReaderFilecxx . . $ NewReaderFile#NewReaderFile(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# * parent) |
| 34 | : QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d).(parent), |
| 35 | mLabelcxx . . $ NewReaderFile#mLabel.(this), |
| 36 | mFileNamecxx . . $ NewReaderFile#mFileName.(this), |
| 37 | mBrowseButtoncxx . . $ NewReaderFile#mBrowseButton.(this), |
| 38 | mOKButtoncxx . . $ NewReaderFile#mOKButton.(this), |
| 39 | mCancelButtoncxx . . $ NewReaderFile#mCancelButton.(this) |
| 40 | { |
| 41 | initializecxx . . $ NewReaderFile#initialize(49f6e7a06ebc5aa8).(); |
| 42 | movecxx . . $ QWidget#move(3e454b8ccf442868).(parent->xcxx . . $ QWidget#x(455f465bc33b4cdf).()+50,parent->ycxx . . $ QWidget#y(455f465bc33b4cdf).()+50); |
| 43 | |
| 44 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&mCancelButtoncxx . . $ NewReaderFile#mCancelButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(pressed()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(doCancel())); |
| 45 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&mOKButtoncxx . . $ NewReaderFile#mOKButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(pressed()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(doOK())); |
| 46 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&mBrowseButtoncxx . . $ NewReaderFile#mBrowseButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(pressed()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(doBrowse())); |
| 47 | } |
| 48 | |
| 49 | NewReaderFilecxx . . $ NewReaderFile#::~cxx . . $ NewReaderFile#`~NewReaderFile`(49f6e7a06ebc5aa8).NewReaderFilecxx . . $ NewReaderFile#() |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | void NewReaderFilecxx . . $ NewReaderFile#::doCancelcxx . . $ NewReaderFile#doCancel(49f6e7a06ebc5aa8).() |
| 54 | { |
| 55 | this->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 56 | } |
| 57 | |
| 58 | void NewReaderFilecxx . . $ NewReaderFile#::doOKcxx . . $ NewReaderFile#doOK(49f6e7a06ebc5aa8).() |
| 59 | { |
| 60 | if (!mFileNamecxx . . $ NewReaderFile#mFileName..textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) |
| 61 | { |
| 62 | QStringcxx . . $ QString# str = mFileNamecxx . . $ QString#QString(e1217c004a86c950)..textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(); |
| 63 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! okPressedcxx . . $ NewReaderFile#okPressed(4c89b026053e4d32).(str); |
| 64 | } |
| 65 | doCancelcxx . . $ NewReaderFile#doCancel(49f6e7a06ebc5aa8).(); |
| 66 | } |
| 67 | |
| 68 | void NewReaderFilecxx . . $ NewReaderFile#::doBrowsecxx . . $ NewReaderFile#doBrowse(49f6e7a06ebc5aa8).() |
| 69 | { |
| 70 | stdcxx . . $ std/::stringcxx . . $ std/string# scxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f). = QFileDialogcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).::getOpenFileNamecxx . . $ QFileDialog#getOpenFileName(a6b29be4bec65236).(this, |
| 71 | "Locate reader file(s)"cxx . . $ QString#QString(85c52e162fed56f9)., |
| 72 | Preferencescxx . . $ QString#QString(85c52e162fed56f9).::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).().configDircxx . . $ Preferences#configDir(219584694fe2b248).().c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), |
| 73 | trcxx . . $ NewReaderFile#tr(75d9f1c324b4579d).("All files(*)")).toUtf8cxx . . $ QString#toUtf8(7c2073558a834e49).().datacxx . . $ QByteArray#data(41208ce6ca65dd58).(); |
| 74 | mFileNamecxx . . $ NewReaderFile#mFileName..setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(scxx . . $ QString#QString(85c52e162fed56f9)..c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).()); |
| 75 | } |
| 76 | |
| 77 | void NewReaderFilecxx . . $ NewReaderFile#::initializecxx . . $ NewReaderFile#initialize(49f6e7a06ebc5aa8).() |
| 78 | { |
| 79 | if (objectNamecxx . . $ QObject#objectName(6ef7b6c27b00b43d).().isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) |
| 80 | setObjectNamecxx . . $ QObject#setObjectName(3520e46b33348bf6).(QStringcxx . . $ QString#::fromUtf8cxx . . $ QString#fromUtf8(5ac70cc0fa2a874e).("NewReaderFile")); |
| 81 | |
| 82 | int x = this->geometrycxx . . $ QWidget#geometry(f4023511c62cad66).().xcxx . . $ QRect#x(455f465bc33b4cdf).(); |
| 83 | int y = this->geometrycxx . . $ QWidget#geometry(f4023511c62cad66).().xcxx . . $ QRect#x(455f465bc33b4cdf).(); |
| 84 | this->setGeometrycxx . . $ QWidget#setGeometry(748afa4755bc9595).(x, y, 400, 90); |
| 85 | |
| 86 | mLabelcxx . . $ NewReaderFile#mLabel..setTextcxx . . $ QLabel#setText(3520e46b33348bf6).("Enter file name to be used as reader file"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 87 | mLabelcxx . . $ NewReaderFile#mLabel..setGeometrycxx . . $ QWidget#setGeometry(748afa4755bc9595).(5,5,300,12); |
| 88 | |
| 89 | mFileNamecxx . . $ NewReaderFile#mFileName..setGeometrycxx . . $ QWidget#setGeometry(748afa4755bc9595).(5, 30,300,30); |
| 90 | |
| 91 | mBrowseButtoncxx . . $ NewReaderFile#mBrowseButton..setGeometrycxx . . $ QWidget#setGeometry(748afa4755bc9595).(310,40,30,20); |
| 92 | mBrowseButtoncxx . . $ NewReaderFile#mBrowseButton..setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).("..."cxx . . $ QString#QString(85c52e162fed56f9).); |
| 93 | |
| 94 | mOKButtoncxx . . $ NewReaderFile#mOKButton..setGeometrycxx . . $ QWidget#setGeometry(748afa4755bc9595).(5,60,50,30); |
| 95 | mOKButtoncxx . . $ NewReaderFile#mOKButton..setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).("OK"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 96 | |
| 97 | mCancelButtoncxx . . $ NewReaderFile#mCancelButton..setGeometrycxx . . $ QWidget#setGeometry(748afa4755bc9595).(310,60,50,30); |
| 98 | mCancelButtoncxx . . $ NewReaderFile#mCancelButton..setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).("Cancel"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 99 | } |