mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 19:20:45 +00:00
Daily report tinkering
This commit is contained in:
parent
bb66402c21
commit
9e3553f709
@ -1494,3 +1494,11 @@ void Daily::on_ouncesSpinBox_valueChanged(int arg1)
|
|||||||
}
|
}
|
||||||
journal->SetChanged(true);
|
journal->SetChanged(true);
|
||||||
}
|
}
|
||||||
|
QString Daily::GetDetailsText()
|
||||||
|
{
|
||||||
|
ui->webView->triggerPageAction(QWebPage::SelectAll);
|
||||||
|
QString text=ui->webView->page()->selectedText();
|
||||||
|
ui->webView->triggerPageAction(QWebPage::MoveToEndOfDocument);
|
||||||
|
ui->webView->triggerPageAction(QWebPage::SelectEndOfDocument);
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
1
daily.h
1
daily.h
@ -48,6 +48,7 @@ public:
|
|||||||
void PrintReport();
|
void PrintReport();
|
||||||
void UnitsChanged();
|
void UnitsChanged();
|
||||||
Session * GetJournalSession(QDate date);
|
Session * GetJournalSession(QDate date);
|
||||||
|
QString GetDetailsText();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
@ -689,14 +689,15 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool print_bookmarks=false;
|
|
||||||
QString username=PROFILE.Get("_{Username}_");
|
QString username=PROFILE.Get("_{Username}_");
|
||||||
QStringList booknotes;
|
|
||||||
|
bool print_bookmarks=false;
|
||||||
if (name=="Daily") {
|
if (name=="Daily") {
|
||||||
|
QVariantList book_start;
|
||||||
journal=getDaily()->GetJournalSession(getDaily()->getDate());
|
journal=getDaily()->GetJournalSession(getDaily()->getDate());
|
||||||
if (journal && journal->settings.contains("BookmarkNotes")) {
|
if (journal && journal->settings.contains("BookmarkStart")) {
|
||||||
booknotes=journal->settings["BookmarkNotes"].toStringList();
|
book_start=journal->settings["BookmarkStart"].toList();
|
||||||
if (booknotes.size()>0) {
|
if (book_start.size()>0) {
|
||||||
if (QMessageBox::question(this,"Bookmarks","Would you like to show bookmarked areas in this report?",QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes) {
|
if (QMessageBox::question(this,"Bookmarks","Would you like to show bookmarked areas in this report?",QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes) {
|
||||||
print_bookmarks=true;
|
print_bookmarks=true;
|
||||||
}
|
}
|
||||||
@ -707,14 +708,15 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
QPrinter * zprinter;
|
QPrinter * zprinter;
|
||||||
|
|
||||||
bool highres;
|
bool highres;
|
||||||
|
|
||||||
bool aa_setting=PROFILE.ExistsAndTrue("UseAntiAliasing");
|
bool aa_setting=PROFILE.ExistsAndTrue("UseAntiAliasing");
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
highres=true;
|
PROFILE["HighResPrinting"]=true; // forced on
|
||||||
bool force_antialiasing=true;
|
bool force_antialiasing=true;
|
||||||
zprinter=new QPrinter(QPrinter::HighResolution);
|
|
||||||
#else
|
#else
|
||||||
|
bool force_antialiasing=PROFILE.ExistsAndTrue("UseAntiAliasing");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (PROFILE.ExistsAndTrue("HighResPrinting")) {
|
if (PROFILE.ExistsAndTrue("HighResPrinting")) {
|
||||||
zprinter=new QPrinter(QPrinter::HighResolution);
|
zprinter=new QPrinter(QPrinter::HighResolution);
|
||||||
highres=true;
|
highres=true;
|
||||||
@ -722,12 +724,8 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
zprinter=new QPrinter(QPrinter::ScreenResolution);
|
zprinter=new QPrinter(QPrinter::ScreenResolution);
|
||||||
highres=false;
|
highres=false;
|
||||||
}
|
}
|
||||||
bool force_antialiasing=PROFILE.ExistsAndTrue("UseAntiAliasing");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
QPrinter & printer=*zprinter;;
|
QPrinter & printer=*zprinter;;
|
||||||
//QPrinter printer(QPrinter::HighResolution);
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
printer.setPrinterName("Print to File (PDF)");
|
printer.setPrinterName("Print to File (PDF)");
|
||||||
printer.setOutputFormat(QPrinter::PdfFormat);
|
printer.setOutputFormat(QPrinter::PdfFormat);
|
||||||
@ -889,8 +887,16 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
painter.drawText(bounds,ovinfo,QTextOption(Qt::AlignLeft));
|
painter.drawText(bounds,ovinfo,QTextOption(Qt::AlignLeft));
|
||||||
|
|
||||||
if (bounds.height()>maxy) maxy=bounds.height();
|
if (bounds.height()>maxy) maxy=bounds.height();
|
||||||
|
|
||||||
}
|
}
|
||||||
top+=maxy;
|
top+=maxy;
|
||||||
|
/*if (name=="Daily") {
|
||||||
|
QString text=getDaily()->GetDetailsText();
|
||||||
|
QRectF bounds=painter.boundingRect(QRectF(0,top,res.width(),0),text,QTextOption(Qt::AlignLeft));
|
||||||
|
painter.drawText(bounds,text,QTextOption(Qt::AlignLeft));
|
||||||
|
|
||||||
|
top+=bounds.height();
|
||||||
|
}*/
|
||||||
// top+=15*yscale; //spacer
|
// top+=15*yscale; //spacer
|
||||||
//top=header_height;
|
//top=header_height;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user