Remove bottom duration in statusbar

This commit is contained in:
Mark Watkins 2014-08-18 03:03:50 +10:00
parent 88a926e79c
commit 5ae43e8ab8
8 changed files with 15 additions and 99 deletions

View File

@ -18,7 +18,6 @@
#include "Graphs/layer.h"
#include "SleepLib/profiles.h"
extern QLabel *qstatus2;
extern MainWindow *mainwin;
// Graph globals.
@ -757,10 +756,6 @@ void gGraph::mouseMoveEvent(QMouseEvent *event)
int offset = (x >= x2) ? 20 : - 20;
ToolTip(m_selDurString, m_rect.left() + x + offset, m_rect.top() + y + 20, align);
if (qstatus2) {
qstatus2->setText(m_selDurString);
}
doredraw = true;
} else if (event->buttons() & Qt::RightButton) { // Right Mouse button dragging
m_graphview->setPointClicked(event->pos());

View File

@ -34,7 +34,6 @@
#include "SleepLib/profiles.h"
extern MainWindow *mainwin;
extern QLabel *qstatus2;
#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)
{
//qint64 m1=0,m2=0;
@ -954,28 +928,6 @@ void gGraphView::ResetBounds(bool refresh) //short group)
m_minx = g->min_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();
}
@ -996,24 +948,6 @@ void gGraphView::SetXBounds(qint64 minx, qint64 maxx, short group, bool refresh)
m_minx = minx;
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(); }
}

View File

@ -342,9 +342,6 @@ class gGraphView
gToolTip *m_tooltip;
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)
void AddTextQue(const QString &text, QRectF rect, quint32 flags, float angle = 0.0,
QColor color = Qt::black, QFont *font = defaultfont, bool antialias = true);

View File

@ -12,7 +12,6 @@
#include "gYAxis.h"
#include "gSummaryChart.h"
extern QLabel *qstatus2;
SummaryChart::SummaryChart(QString label, GraphType type)
: Layer(NoChannel), m_label(label), m_graphtype(type)
{

View File

@ -60,6 +60,9 @@ protected:
bool newsession;
};
void BackupJournal(QString filename);
class DayController
{
DayController();

View File

@ -24,11 +24,15 @@ ProgressDialog::ProgressDialog(QWidget * parent):
hlayout->addWidget(waitmsg,1,Qt::AlignCenter);
vlayout->addWidget(progress,1);
progress->setMaximum(100);
}
ProgressDialog::~ProgressDialog()
{
}
void ProgressDialog::doUpdateProgress(int cnt, int total)
{
progress->setMaximum(total);
progress->setValue(cnt);
}

View File

@ -23,6 +23,8 @@ public:
void setMessage(QString msg) { waitmsg->setText(msg); }
void setPixmap(QPixmap &pixmap) { imglabel->setPixmap(pixmap); }
QProgressBar * progress;
public slots:
void doUpdateProgress(int cnt, int total);
protected:
QLabel * waitmsg;

View File

@ -62,7 +62,6 @@
QProgressBar *qprogress;
QLabel *qstatus;
QLabel *qstatus2;
QStatusBar *qstatusbar;
extern Profile *profile;
@ -198,19 +197,11 @@ MainWindow::MainWindow(QWidget *parent) :
qstatusbar = ui->statusbar;
qprogress = new QProgressBar(this);
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);
qprogress->hide();
ui->statusbar->setMinimumWidth(200);
ui->statusbar->addPermanentWidget(qstatus, 0);
ui->statusbar->addPermanentWidget(qprogress, 1);
ui->statusbar->addPermanentWidget(qstatus2, 0);
ui->actionDebug->setChecked(p_profile->general->showDebug());
@ -1257,7 +1248,6 @@ void MainWindow::on_dailyButton_clicked()
{
ui->tabWidget->setCurrentWidget(daily);
daily->RedrawGraphs();
qstatus2->setText(STR_TR_Daily);
}
void MainWindow::JumpDaily()
{
@ -1267,7 +1257,6 @@ void MainWindow::JumpDaily()
void MainWindow::on_overviewButton_clicked()
{
ui->tabWidget->setCurrentWidget(overview);
qstatus2->setText(STR_TR_Overview);
}
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)
{
Q_UNUSED(index);
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();
}
// QWidget *widget = ui->tabWidget->currentWidget();
}
@ -2654,6 +2633,8 @@ void MainWindow::on_actionDaily_Calendar_toggled(bool visible)
getDaily()->setCalendarVisible(visible);
}
#include "SleepLib/journal.h"
void MainWindow::on_actionExport_Journal_triggered()
{
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)"));
BackupJournal(filename);
}