mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 03:30:44 +00:00
Remove bottom duration in statusbar
This commit is contained in:
parent
88a926e79c
commit
5ae43e8ab8
@ -18,7 +18,6 @@
|
|||||||
#include "Graphs/layer.h"
|
#include "Graphs/layer.h"
|
||||||
#include "SleepLib/profiles.h"
|
#include "SleepLib/profiles.h"
|
||||||
|
|
||||||
extern QLabel *qstatus2;
|
|
||||||
extern MainWindow *mainwin;
|
extern MainWindow *mainwin;
|
||||||
|
|
||||||
// Graph globals.
|
// Graph globals.
|
||||||
@ -757,10 +756,6 @@ void gGraph::mouseMoveEvent(QMouseEvent *event)
|
|||||||
int offset = (x >= x2) ? 20 : - 20;
|
int offset = (x >= x2) ? 20 : - 20;
|
||||||
ToolTip(m_selDurString, m_rect.left() + x + offset, m_rect.top() + y + 20, align);
|
ToolTip(m_selDurString, m_rect.left() + x + offset, m_rect.top() + y + 20, align);
|
||||||
|
|
||||||
if (qstatus2) {
|
|
||||||
qstatus2->setText(m_selDurString);
|
|
||||||
}
|
|
||||||
|
|
||||||
doredraw = true;
|
doredraw = true;
|
||||||
} else if (event->buttons() & Qt::RightButton) { // Right Mouse button dragging
|
} else if (event->buttons() & Qt::RightButton) { // Right Mouse button dragging
|
||||||
m_graphview->setPointClicked(event->pos());
|
m_graphview->setPointClicked(event->pos());
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include "SleepLib/profiles.h"
|
#include "SleepLib/profiles.h"
|
||||||
|
|
||||||
extern MainWindow *mainwin;
|
extern MainWindow *mainwin;
|
||||||
extern QLabel *qstatus2;
|
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
@ -882,31 +881,6 @@ void gGraphView::scrollbarValueChanged(int val)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gGraphView::updateSelectionTime()
|
|
||||||
{
|
|
||||||
qint64 xx = m_maxx - m_minx;
|
|
||||||
double d = xx / 86400000L;
|
|
||||||
int h = xx / 3600000L;
|
|
||||||
int m = (xx / 60000) % 60;
|
|
||||||
int s = (xx / 1000) % 60;
|
|
||||||
int ms(xx % 1000);
|
|
||||||
QString str;
|
|
||||||
|
|
||||||
if (d > 1) {
|
|
||||||
/*QDate d1=QDateTime::fromTime_t(m_minx/1000).toUTC().date();
|
|
||||||
QDate d2=QDateTime::fromTime_t(m_maxx/1000).toUTC().date();
|
|
||||||
d=p_profile->countDays(MT_CPAP,d1,d2); */
|
|
||||||
|
|
||||||
str.sprintf("%1.0f days", ceil(d));
|
|
||||||
} else {
|
|
||||||
str.sprintf("%02i:%02i:%02i:%03i", h, m, s, ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qstatus2) {
|
|
||||||
qstatus2->setText(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
void gGraphView::GetRXBounds(qint64 &st, qint64 &et)
|
void gGraphView::GetRXBounds(qint64 &st, qint64 &et)
|
||||||
{
|
{
|
||||||
//qint64 m1=0,m2=0;
|
//qint64 m1=0,m2=0;
|
||||||
@ -954,28 +928,6 @@ void gGraphView::ResetBounds(bool refresh) //short group)
|
|||||||
m_minx = g->min_x;
|
m_minx = g->min_x;
|
||||||
m_maxx = g->max_x;
|
m_maxx = g->max_x;
|
||||||
|
|
||||||
qint64 xx = g->max_x - g->min_x;
|
|
||||||
double d = xx / 86400000L;
|
|
||||||
int h = xx / 3600000L;
|
|
||||||
int m = (xx / 60000) % 60;
|
|
||||||
int s = (xx / 1000) % 60;
|
|
||||||
int ms(xx % 1000);
|
|
||||||
QString str;
|
|
||||||
|
|
||||||
if (d > 1) {
|
|
||||||
/*QDate d1=QDateTime::fromTime_t(m_minx/1000).toUTC().date();
|
|
||||||
QDate d2=QDateTime::fromTime_t(m_maxx/1000).toUTC().date();
|
|
||||||
d=p_profile->countDays(MT_CPAP,d1,d2); */
|
|
||||||
|
|
||||||
str.sprintf("%1.0f days", ceil(d));
|
|
||||||
} else {
|
|
||||||
str.sprintf("%02i:%02i:%02i:%03i", h, m, s, ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qstatus2) {
|
|
||||||
qstatus2->setText(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
updateScale();
|
updateScale();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -996,24 +948,6 @@ void gGraphView::SetXBounds(qint64 minx, qint64 maxx, short group, bool refresh)
|
|||||||
m_minx = minx;
|
m_minx = minx;
|
||||||
m_maxx = maxx;
|
m_maxx = maxx;
|
||||||
|
|
||||||
qint64 xx = maxx - minx;
|
|
||||||
double d = xx / 86400000L;
|
|
||||||
int h = xx / 3600000L;
|
|
||||||
int m = (xx / 60000) % 60;
|
|
||||||
int s = (xx / 1000) % 60;
|
|
||||||
int ms(xx % 1000);
|
|
||||||
QString str = "";
|
|
||||||
|
|
||||||
if (d > 1) {
|
|
||||||
str.sprintf("%1.0f days", ceil(xx / 86400000.0));
|
|
||||||
} else {
|
|
||||||
str.sprintf("%02i:%02i:%02i:%03i", h, m, s, ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qstatus2) {
|
|
||||||
qstatus2->setText(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (refresh) { redraw(); }
|
if (refresh) { redraw(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,9 +342,6 @@ class gGraphView
|
|||||||
gToolTip *m_tooltip;
|
gToolTip *m_tooltip;
|
||||||
QTimer *timer;
|
QTimer *timer;
|
||||||
|
|
||||||
//! \brief Updates the current selection time in the statusbar area
|
|
||||||
void updateSelectionTime();
|
|
||||||
|
|
||||||
//! \brief Add the Text information to the Text Drawing Queue (called by gGraphs renderText method)
|
//! \brief Add the Text information to the Text Drawing Queue (called by gGraphs renderText method)
|
||||||
void AddTextQue(const QString &text, QRectF rect, quint32 flags, float angle = 0.0,
|
void AddTextQue(const QString &text, QRectF rect, quint32 flags, float angle = 0.0,
|
||||||
QColor color = Qt::black, QFont *font = defaultfont, bool antialias = true);
|
QColor color = Qt::black, QFont *font = defaultfont, bool antialias = true);
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#include "gYAxis.h"
|
#include "gYAxis.h"
|
||||||
#include "gSummaryChart.h"
|
#include "gSummaryChart.h"
|
||||||
|
|
||||||
extern QLabel *qstatus2;
|
|
||||||
SummaryChart::SummaryChart(QString label, GraphType type)
|
SummaryChart::SummaryChart(QString label, GraphType type)
|
||||||
: Layer(NoChannel), m_label(label), m_graphtype(type)
|
: Layer(NoChannel), m_label(label), m_graphtype(type)
|
||||||
{
|
{
|
||||||
|
@ -60,6 +60,9 @@ protected:
|
|||||||
bool newsession;
|
bool newsession;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void BackupJournal(QString filename);
|
||||||
|
|
||||||
|
|
||||||
class DayController
|
class DayController
|
||||||
{
|
{
|
||||||
DayController();
|
DayController();
|
||||||
|
@ -24,11 +24,15 @@ ProgressDialog::ProgressDialog(QWidget * parent):
|
|||||||
hlayout->addWidget(waitmsg,1,Qt::AlignCenter);
|
hlayout->addWidget(waitmsg,1,Qt::AlignCenter);
|
||||||
vlayout->addWidget(progress,1);
|
vlayout->addWidget(progress,1);
|
||||||
progress->setMaximum(100);
|
progress->setMaximum(100);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgressDialog::~ProgressDialog()
|
ProgressDialog::~ProgressDialog()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProgressDialog::doUpdateProgress(int cnt, int total)
|
||||||
|
{
|
||||||
|
progress->setMaximum(total);
|
||||||
|
progress->setValue(cnt);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ public:
|
|||||||
void setMessage(QString msg) { waitmsg->setText(msg); }
|
void setMessage(QString msg) { waitmsg->setText(msg); }
|
||||||
void setPixmap(QPixmap &pixmap) { imglabel->setPixmap(pixmap); }
|
void setPixmap(QPixmap &pixmap) { imglabel->setPixmap(pixmap); }
|
||||||
QProgressBar * progress;
|
QProgressBar * progress;
|
||||||
|
public slots:
|
||||||
|
void doUpdateProgress(int cnt, int total);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QLabel * waitmsg;
|
QLabel * waitmsg;
|
||||||
|
@ -62,7 +62,6 @@
|
|||||||
|
|
||||||
QProgressBar *qprogress;
|
QProgressBar *qprogress;
|
||||||
QLabel *qstatus;
|
QLabel *qstatus;
|
||||||
QLabel *qstatus2;
|
|
||||||
QStatusBar *qstatusbar;
|
QStatusBar *qstatusbar;
|
||||||
|
|
||||||
extern Profile *profile;
|
extern Profile *profile;
|
||||||
@ -198,19 +197,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
qstatusbar = ui->statusbar;
|
qstatusbar = ui->statusbar;
|
||||||
qprogress = new QProgressBar(this);
|
qprogress = new QProgressBar(this);
|
||||||
qprogress->setMaximum(100);
|
qprogress->setMaximum(100);
|
||||||
qstatus2 = new QLabel(tr("Welcome"), this);
|
|
||||||
qstatus2->setFrameStyle(QFrame::Raised);
|
|
||||||
qstatus2->setFrameShadow(QFrame::Sunken);
|
|
||||||
qstatus2->setFrameShape(QFrame::Box);
|
|
||||||
//qstatus2->setMinimumWidth(100);
|
|
||||||
qstatus2->setMaximumWidth(100);
|
|
||||||
qstatus2->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
|
||||||
qstatus = new QLabel("", this);
|
qstatus = new QLabel("", this);
|
||||||
qprogress->hide();
|
qprogress->hide();
|
||||||
ui->statusbar->setMinimumWidth(200);
|
ui->statusbar->setMinimumWidth(200);
|
||||||
ui->statusbar->addPermanentWidget(qstatus, 0);
|
ui->statusbar->addPermanentWidget(qstatus, 0);
|
||||||
ui->statusbar->addPermanentWidget(qprogress, 1);
|
ui->statusbar->addPermanentWidget(qprogress, 1);
|
||||||
ui->statusbar->addPermanentWidget(qstatus2, 0);
|
|
||||||
|
|
||||||
ui->actionDebug->setChecked(p_profile->general->showDebug());
|
ui->actionDebug->setChecked(p_profile->general->showDebug());
|
||||||
|
|
||||||
@ -1257,7 +1248,6 @@ void MainWindow::on_dailyButton_clicked()
|
|||||||
{
|
{
|
||||||
ui->tabWidget->setCurrentWidget(daily);
|
ui->tabWidget->setCurrentWidget(daily);
|
||||||
daily->RedrawGraphs();
|
daily->RedrawGraphs();
|
||||||
qstatus2->setText(STR_TR_Daily);
|
|
||||||
}
|
}
|
||||||
void MainWindow::JumpDaily()
|
void MainWindow::JumpDaily()
|
||||||
{
|
{
|
||||||
@ -1267,7 +1257,6 @@ void MainWindow::JumpDaily()
|
|||||||
void MainWindow::on_overviewButton_clicked()
|
void MainWindow::on_overviewButton_clicked()
|
||||||
{
|
{
|
||||||
ui->tabWidget->setCurrentWidget(overview);
|
ui->tabWidget->setCurrentWidget(overview);
|
||||||
qstatus2->setText(STR_TR_Overview);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_webView_loadFinished(bool arg1)
|
void MainWindow::on_webView_loadFinished(bool arg1)
|
||||||
@ -2232,17 +2221,7 @@ void MainWindow::LinkHovered(const QString &link, const QString &title, const QS
|
|||||||
void MainWindow::on_tabWidget_currentChanged(int index)
|
void MainWindow::on_tabWidget_currentChanged(int index)
|
||||||
{
|
{
|
||||||
Q_UNUSED(index);
|
Q_UNUSED(index);
|
||||||
QWidget *widget = ui->tabWidget->currentWidget();
|
// QWidget *widget = ui->tabWidget->currentWidget();
|
||||||
|
|
||||||
if ((widget == ui->statisticsTab) || (widget == ui->helpTab)) {
|
|
||||||
qstatus2->setVisible(false);
|
|
||||||
} else if (widget == daily) {
|
|
||||||
qstatus2->setVisible(true);
|
|
||||||
daily->graphView()->updateSelectionTime();
|
|
||||||
} else if (widget == overview) {
|
|
||||||
qstatus2->setVisible(true);
|
|
||||||
overview->graphView()->updateSelectionTime();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2654,6 +2633,8 @@ void MainWindow::on_actionDaily_Calendar_toggled(bool visible)
|
|||||||
getDaily()->setCalendarVisible(visible);
|
getDaily()->setCalendarVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "SleepLib/journal.h"
|
||||||
|
|
||||||
void MainWindow::on_actionExport_Journal_triggered()
|
void MainWindow::on_actionExport_Journal_triggered()
|
||||||
{
|
{
|
||||||
QString folder;
|
QString folder;
|
||||||
@ -2666,4 +2647,5 @@ void MainWindow::on_actionExport_Journal_triggered()
|
|||||||
|
|
||||||
QString filename = QFileDialog::getSaveFileName(this, tr("Choose where to save journal"), folder, tr("XML Files (*.xml)"));
|
QString filename = QFileDialog::getSaveFileName(this, tr("Choose where to save journal"), folder, tr("XML Files (*.xml)"));
|
||||||
|
|
||||||
|
BackupJournal(filename);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user