From 64fa95c02945c607b36ae04f60c62b572e5da018 Mon Sep 17 00:00:00 2001 From: aquiles Date: Sun, 21 Nov 2010 18:59:29 +0100 Subject: [PATCH] Fixed: #1163 files for new dialog --- .../georges_editor_qt/src/progress_dialog.cpp | 64 +++++++++++++++++++ .../georges_editor_qt/src/progress_dialog.h | 59 +++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/progress_dialog.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/progress_dialog.h diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/progress_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/progress_dialog.cpp new file mode 100644 index 000000000..369eb576b --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/progress_dialog.cpp @@ -0,0 +1,64 @@ +/* +Georges Editor Qt +Copyright (C) 2010 Adrian Jaekel + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +*/ + +#include "progress_dialog.h" + +// Qt includes +#include +#include +#include +#include +// STL includes + +// NeL includes +#include +#include + +// Project includes + +namespace NLQT +{ + + CProgressDialog::CProgressDialog(QDialog *parent): QDialog(parent) + { + setWindowTitle(tr("Loading Data")); + QGridLayout* gridLayout = new QGridLayout(this); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + _infoLabel = new QLabel("test",this); + _progressBar = new QProgressBar(this); + gridLayout->addWidget(_progressBar, 0, 0); + gridLayout->addWidget(_infoLabel, 1, 0); + resize(250, 100); + _progressBar->setMinimum(0); + _progressBar->setMaximum(100); + } + + CProgressDialog::~CProgressDialog() + { + } + + void CProgressDialog::progress (float progressValue) + { + _infoLabel->setText(QString(tr("Adding Folder:\n%1")).arg(DisplayString.c_str())); + _progressBar->setValue(getCropedValue(progressValue) * 100); + QApplication::processEvents(); + } + +} /* namespace NLQT */ + diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/progress_dialog.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/progress_dialog.h new file mode 100644 index 000000000..83471f46c --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/progress_dialog.h @@ -0,0 +1,59 @@ +/* +Georges Editor Qt +Copyright (C) 2010 Adrian Jaekel + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +*/ + +#ifndef NLQT_PROGRESS_WIDGET_H +#define NLQT_PROGRESS_WIDGET_H + +// Qt includes +#include + +// STL includes + +// NeL includes +#include + +// Project includes + +namespace NLMISC { + class IProgressCallback; +} + +class QProgressBar; +class QLabel; + +namespace NLQT +{ + class CProgressDialog : public QDialog, public NLMISC::IProgressCallback + { + Q_OBJECT + + public: + CProgressDialog(QDialog *parent = 0); + ~CProgressDialog(); + + private: + void progress (float progressValue); + + QProgressBar* _progressBar; + QLabel* _infoLabel; + }; + +} /* namespace NLQT */ + +#endif // NLQT_PROGRESS_WIDGET_H \ No newline at end of file