mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-13 09:10:45 +00:00
Created progress dialog class
This commit is contained in:
parent
9d1e62e887
commit
88a926e79c
@ -17,9 +17,10 @@
|
|||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QProgressBar>
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include "progressdialog.h"
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "machine.h"
|
#include "machine.h"
|
||||||
@ -393,46 +394,6 @@ const QString Machine::getBackupPath()
|
|||||||
return p_profile->Get("{" + STR_GEN_DataFolder + "}/" + info.loadername + "_" + (info.serial.isEmpty() ? hexid() : info.serial) + "/Backup/");
|
return p_profile->Get("{" + STR_GEN_DataFolder + "}/" + info.loadername + "_" + (info.serial.isEmpty() ? hexid() : info.serial) + "/Backup/");
|
||||||
}
|
}
|
||||||
|
|
||||||
class ProgressDialog:public QDialog {
|
|
||||||
public:
|
|
||||||
explicit ProgressDialog(QWidget * parent);
|
|
||||||
virtual ~ProgressDialog();
|
|
||||||
|
|
||||||
void setMessage(QString msg) { waitmsg->setText(msg); }
|
|
||||||
void setPixmap(QPixmap &pixmap) { imglabel->setPixmap(pixmap); }
|
|
||||||
QProgressBar * progress;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
QLabel * waitmsg;
|
|
||||||
QHBoxLayout *hlayout;
|
|
||||||
QLabel * imglabel;
|
|
||||||
QVBoxLayout * vlayout;
|
|
||||||
|
|
||||||
};
|
|
||||||
ProgressDialog::ProgressDialog(QWidget * parent):
|
|
||||||
QDialog(parent, Qt::SplashScreen)
|
|
||||||
{
|
|
||||||
waitmsg = new QLabel(QObject::tr("PLease Wait..."));
|
|
||||||
hlayout = new QHBoxLayout;
|
|
||||||
|
|
||||||
imglabel = new QLabel(this);
|
|
||||||
|
|
||||||
vlayout = new QVBoxLayout;
|
|
||||||
progress = new QProgressBar(this);
|
|
||||||
this->setLayout(vlayout);
|
|
||||||
vlayout->addLayout(hlayout);
|
|
||||||
hlayout->addWidget(imglabel);
|
|
||||||
hlayout->addWidget(waitmsg,1,Qt::AlignCenter);
|
|
||||||
vlayout->addWidget(progress,1);
|
|
||||||
progress->setMaximum(100);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
ProgressDialog::~ProgressDialog()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Machine::Load()
|
bool Machine::Load()
|
||||||
{
|
{
|
||||||
QString path = getDataPath();
|
QString path = getDataPath();
|
||||||
|
34
sleepyhead/SleepLib/progressdialog.cpp
Normal file
34
sleepyhead/SleepLib/progressdialog.cpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/* SleepLib Progress Dialog Header
|
||||||
|
*
|
||||||
|
* Copyright (c) 2011-2014 Mark Watkins <jedimark@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This file is subject to the terms and conditions of the GNU General Public
|
||||||
|
* License. See the file COPYING in the main directory of the Linux
|
||||||
|
* distribution for more details. */
|
||||||
|
|
||||||
|
#include "progressdialog.h"
|
||||||
|
|
||||||
|
ProgressDialog::ProgressDialog(QWidget * parent):
|
||||||
|
QDialog(parent, Qt::SplashScreen)
|
||||||
|
{
|
||||||
|
waitmsg = new QLabel(QObject::tr("PLease Wait..."));
|
||||||
|
hlayout = new QHBoxLayout;
|
||||||
|
|
||||||
|
imglabel = new QLabel(this);
|
||||||
|
|
||||||
|
vlayout = new QVBoxLayout;
|
||||||
|
progress = new QProgressBar(this);
|
||||||
|
this->setLayout(vlayout);
|
||||||
|
vlayout->addLayout(hlayout);
|
||||||
|
hlayout->addWidget(imglabel);
|
||||||
|
hlayout->addWidget(waitmsg,1,Qt::AlignCenter);
|
||||||
|
vlayout->addWidget(progress,1);
|
||||||
|
progress->setMaximum(100);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ProgressDialog::~ProgressDialog()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
35
sleepyhead/SleepLib/progressdialog.h
Normal file
35
sleepyhead/SleepLib/progressdialog.h
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/* SleepLib Progress Dialog Header
|
||||||
|
*
|
||||||
|
* Copyright (c) 2011-2014 Mark Watkins <jedimark@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This file is subject to the terms and conditions of the GNU General Public
|
||||||
|
* License. See the file COPYING in the main directory of the Linux
|
||||||
|
* distribution for more details. */
|
||||||
|
|
||||||
|
#ifndef PROGRESSDIALOG_H
|
||||||
|
#define PROGRESSDIALOG_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QProgressBar>
|
||||||
|
|
||||||
|
class ProgressDialog:public QDialog {
|
||||||
|
public:
|
||||||
|
explicit ProgressDialog(QWidget * parent);
|
||||||
|
virtual ~ProgressDialog();
|
||||||
|
|
||||||
|
void setMessage(QString msg) { waitmsg->setText(msg); }
|
||||||
|
void setPixmap(QPixmap &pixmap) { imglabel->setPixmap(pixmap); }
|
||||||
|
QProgressBar * progress;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QLabel * waitmsg;
|
||||||
|
QHBoxLayout *hlayout;
|
||||||
|
QLabel * imglabel;
|
||||||
|
QVBoxLayout * vlayout;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // PROGRESSDIALOG_H
|
@ -54,6 +54,7 @@
|
|||||||
#include "Graphs/glcommon.h"
|
#include "Graphs/glcommon.h"
|
||||||
#include "UpdaterWindow.h"
|
#include "UpdaterWindow.h"
|
||||||
#include "SleepLib/calcs.h"
|
#include "SleepLib/calcs.h"
|
||||||
|
#include "SleepLib/progressdialog.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#include "reports.h"
|
#include "reports.h"
|
||||||
|
@ -181,7 +181,8 @@ SOURCES += \
|
|||||||
SleepLib/loader_plugins/weinmann_loader.cpp \
|
SleepLib/loader_plugins/weinmann_loader.cpp \
|
||||||
Graphs/gdailysummary.cpp \
|
Graphs/gdailysummary.cpp \
|
||||||
Graphs/MinutesAtPressure.cpp \
|
Graphs/MinutesAtPressure.cpp \
|
||||||
SleepLib/journal.cpp
|
SleepLib/journal.cpp \
|
||||||
|
SleepLib/progressdialog.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
common_gui.h \
|
common_gui.h \
|
||||||
@ -240,7 +241,8 @@ HEADERS += \
|
|||||||
SleepLib/loader_plugins/weinmann_loader.h \
|
SleepLib/loader_plugins/weinmann_loader.h \
|
||||||
Graphs/gdailysummary.h \
|
Graphs/gdailysummary.h \
|
||||||
Graphs/MinutesAtPressure.h \
|
Graphs/MinutesAtPressure.h \
|
||||||
SleepLib/journal.h
|
SleepLib/journal.h \
|
||||||
|
SleepLib/progressdialog.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
daily.ui \
|
daily.ui \
|
||||||
|
Loading…
Reference in New Issue
Block a user