mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-12 16:50:46 +00:00
Switch Records and Bookmars to QTextBrowser instead of Webkit
This commit is contained in:
parent
ea2e0cb147
commit
e2aee8ddf7
@ -2598,7 +2598,7 @@ int ResmedLoader::Open(const QString & dirpath)
|
|||||||
QFile impfile(mach->getDataPath()+"/imported_files.csv");
|
QFile impfile(mach->getDataPath()+"/imported_files.csv");
|
||||||
if (impfile.exists()) impfile.remove();
|
if (impfile.exists()) impfile.remove();
|
||||||
|
|
||||||
emit updateMessage(QObject::tr("Searching for EDF Files..."));
|
emit updateMessage(QObject::tr("Cataloguing EDF Files..."));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
if (isAborted()) return 0;
|
if (isAborted()) return 0;
|
||||||
|
@ -213,10 +213,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
ui->action_Sidebar_Toggle->setChecked(b);
|
ui->action_Sidebar_Toggle->setChecked(b);
|
||||||
ui->toolBox->setVisible(b);
|
ui->toolBox->setVisible(b);
|
||||||
|
|
||||||
ui->recordsBox->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
|
|
||||||
ui->statisticsView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
|
ui->statisticsView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
|
||||||
ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
|
ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
|
||||||
ui->bookmarkView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
|
|
||||||
|
|
||||||
QString loadingtxt =
|
QString loadingtxt =
|
||||||
"<HTML><body style='text-align: center; vertical-align: center'><table width='100%' height='100%'>"
|
"<HTML><body style='text-align: center; vertical-align: center'><table width='100%' height='100%'>"
|
||||||
@ -2039,35 +2037,6 @@ void MainWindow::on_action_Sidebar_Toggle_toggled(bool visible)
|
|||||||
AppSetting->setRightSidebarVisible(visible);
|
AppSetting->setRightSidebarVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_recordsBox_linkClicked(const QUrl &linkurl)
|
|
||||||
{
|
|
||||||
QString link = linkurl.toString().section("=", 0, 0).toLower();
|
|
||||||
QString data = linkurl.toString().section("=", 1).toLower();
|
|
||||||
qDebug() << linkurl.toString() << link << data;
|
|
||||||
|
|
||||||
if (link == "daily") {
|
|
||||||
QDate date = QDate::fromString(data, Qt::ISODate);
|
|
||||||
ui->tabWidget->setCurrentWidget(daily);
|
|
||||||
QApplication::processEvents();
|
|
||||||
daily->LoadDate(date);
|
|
||||||
} else if (link == "overview") {
|
|
||||||
QString date1 = data.section(",", 0, 0);
|
|
||||||
QString date2 = data.section(",", 1);
|
|
||||||
|
|
||||||
QDate d1 = QDate::fromString(date1, Qt::ISODate);
|
|
||||||
QDate d2 = QDate::fromString(date2, Qt::ISODate);
|
|
||||||
overview->setRange(d1, d2);
|
|
||||||
ui->tabWidget->setCurrentWidget(overview);
|
|
||||||
} else if (link == "import") {
|
|
||||||
// Don't run the importer directly from here because it destroys the object that called this function..
|
|
||||||
// Schedule it instead
|
|
||||||
if (data == "cpap") QTimer::singleShot(0, mainwin, SLOT(on_importButton_clicked()));
|
|
||||||
if (data == "oximeter") QTimer::singleShot(0, mainwin, SLOT(on_oximetryButton_clicked()));
|
|
||||||
} else if (link == "statistics") {
|
|
||||||
ui->tabWidget->setCurrentWidget(ui->statisticsTab);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::on_helpButton_clicked()
|
void MainWindow::on_helpButton_clicked()
|
||||||
{
|
{
|
||||||
ui->tabWidget->setCurrentWidget(ui->helpTab);
|
ui->tabWidget->setCurrentWidget(ui->helpTab);
|
||||||
@ -2109,11 +2078,6 @@ void MainWindow::on_tabWidget_currentChanged(int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_bookmarkView_linkClicked(const QUrl &arg1)
|
|
||||||
{
|
|
||||||
on_recordsBox_linkClicked(arg1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::on_filterBookmarks_editingFinished()
|
void MainWindow::on_filterBookmarks_editingFinished()
|
||||||
{
|
{
|
||||||
bookmarkFilter = ui->filterBookmarks->text();
|
bookmarkFilter = ui->filterBookmarks->text();
|
||||||
@ -2208,9 +2172,7 @@ void MainWindow::doRecompressEvents()
|
|||||||
|
|
||||||
// Load the events if they aren't loaded already
|
// Load the events if they aren't loaded already
|
||||||
sess->OpenEvents();
|
sess->OpenEvents();
|
||||||
|
|
||||||
sess->SetChanged(true);
|
sess->SetChanged(true);
|
||||||
|
|
||||||
sess->machine()->SaveSession(sess);
|
sess->machine()->SaveSession(sess);
|
||||||
|
|
||||||
if (!isopen) {
|
if (!isopen) {
|
||||||
@ -2518,8 +2480,7 @@ void MainWindow::on_statisticsButton_clicked()
|
|||||||
|
|
||||||
void MainWindow::on_statisticsView_linkClicked(const QUrl &arg1)
|
void MainWindow::on_statisticsView_linkClicked(const QUrl &arg1)
|
||||||
{
|
{
|
||||||
//qDebug() << arg1;
|
on_recordsBox_anchorClicked(arg1);
|
||||||
on_recordsBox_linkClicked(arg1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_reportModeMonthly_clicked()
|
void MainWindow::on_reportModeMonthly_clicked()
|
||||||
@ -2663,3 +2624,37 @@ void MainWindow::on_profilesButton_clicked()
|
|||||||
{
|
{
|
||||||
ui->tabWidget->setCurrentWidget(profileSelector);
|
ui->tabWidget->setCurrentWidget(profileSelector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_bookmarkView_anchorClicked(const QUrl &arg1)
|
||||||
|
{
|
||||||
|
on_recordsBox_anchorClicked(arg1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_recordsBox_anchorClicked(const QUrl &linkurl)
|
||||||
|
{
|
||||||
|
QString link = linkurl.toString().section("=", 0, 0).toLower();
|
||||||
|
QString data = linkurl.toString().section("=", 1).toLower();
|
||||||
|
qDebug() << linkurl.toString() << link << data;
|
||||||
|
|
||||||
|
if (link == "daily") {
|
||||||
|
QDate date = QDate::fromString(data, Qt::ISODate);
|
||||||
|
ui->tabWidget->setCurrentWidget(daily);
|
||||||
|
QApplication::processEvents();
|
||||||
|
daily->LoadDate(date);
|
||||||
|
} else if (link == "overview") {
|
||||||
|
QString date1 = data.section(",", 0, 0);
|
||||||
|
QString date2 = data.section(",", 1);
|
||||||
|
|
||||||
|
QDate d1 = QDate::fromString(date1, Qt::ISODate);
|
||||||
|
QDate d2 = QDate::fromString(date2, Qt::ISODate);
|
||||||
|
overview->setRange(d1, d2);
|
||||||
|
ui->tabWidget->setCurrentWidget(overview);
|
||||||
|
} else if (link == "import") {
|
||||||
|
// Don't run the importer directly from here because it destroys the object that called this function..
|
||||||
|
// Schedule it instead
|
||||||
|
if (data == "cpap") QTimer::singleShot(0, mainwin, SLOT(on_importButton_clicked()));
|
||||||
|
if (data == "oximeter") QTimer::singleShot(0, mainwin, SLOT(on_oximetryButton_clicked()));
|
||||||
|
} else if (link == "statistics") {
|
||||||
|
ui->tabWidget->setCurrentWidget(ui->statisticsTab);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -135,7 +135,7 @@ class MainWindow : public QMainWindow
|
|||||||
void JumpImport();
|
void JumpImport();
|
||||||
void JumpOxiWizard();
|
void JumpOxiWizard();
|
||||||
|
|
||||||
void sendStatsUrl(QString msg) { on_recordsBox_linkClicked(QUrl(msg)); }
|
void sendStatsUrl(QString msg) { on_recordsBox_anchorClicked(QUrl(msg)); }
|
||||||
|
|
||||||
//! \brief Sets up recalculation of all event summaries and flags
|
//! \brief Sets up recalculation of all event summaries and flags
|
||||||
void reprocessEvents(bool restart = false);
|
void reprocessEvents(bool restart = false);
|
||||||
@ -265,8 +265,6 @@ class MainWindow : public QMainWindow
|
|||||||
|
|
||||||
void on_action_Sidebar_Toggle_toggled(bool arg1);
|
void on_action_Sidebar_Toggle_toggled(bool arg1);
|
||||||
|
|
||||||
void on_recordsBox_linkClicked(const QUrl &arg1);
|
|
||||||
|
|
||||||
void on_helpButton_clicked();
|
void on_helpButton_clicked();
|
||||||
|
|
||||||
void on_actionView_Statistics_triggered();
|
void on_actionView_Statistics_triggered();
|
||||||
@ -283,8 +281,6 @@ class MainWindow : public QMainWindow
|
|||||||
void LinkHovered(const QString &link, const QString &title, const QString &textContent);
|
void LinkHovered(const QString &link, const QString &title, const QString &textContent);
|
||||||
void on_tabWidget_currentChanged(int index);
|
void on_tabWidget_currentChanged(int index);
|
||||||
|
|
||||||
void on_bookmarkView_linkClicked(const QUrl &arg1);
|
|
||||||
|
|
||||||
void on_filterBookmarks_editingFinished();
|
void on_filterBookmarks_editingFinished();
|
||||||
|
|
||||||
void on_filterBookmarksButton_clicked();
|
void on_filterBookmarksButton_clicked();
|
||||||
@ -348,6 +344,10 @@ class MainWindow : public QMainWindow
|
|||||||
|
|
||||||
void reloadProfile();
|
void reloadProfile();
|
||||||
|
|
||||||
|
void on_bookmarkView_anchorClicked(const QUrl &arg1);
|
||||||
|
|
||||||
|
void on_recordsBox_anchorClicked(const QUrl &linkurl);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void importCPAPBackups();
|
void importCPAPBackups();
|
||||||
void finishCPAPImport();
|
void finishCPAPImport();
|
||||||
|
@ -1407,7 +1407,7 @@ QToolBox::tab:selected {
|
|||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="tabSpacing">
|
<property name="tabSpacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
@ -2908,111 +2908,19 @@ border-radius: 10px;
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWebView" name="bookmarkView" native="true">
|
<widget class="QTextBrowser" name="bookmarkView">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="palette">
|
|
||||||
<palette>
|
|
||||||
<active>
|
|
||||||
<colorrole role="Button">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>163</red>
|
|
||||||
<green>190</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Base">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>163</red>
|
|
||||||
<green>190</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Window">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>163</red>
|
|
||||||
<green>190</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
</active>
|
|
||||||
<inactive>
|
|
||||||
<colorrole role="Button">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>163</red>
|
|
||||||
<green>190</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Base">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>163</red>
|
|
||||||
<green>190</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Window">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>163</red>
|
|
||||||
<green>190</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
</inactive>
|
|
||||||
<disabled>
|
|
||||||
<colorrole role="Button">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>163</red>
|
|
||||||
<green>190</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Base">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>163</red>
|
|
||||||
<green>190</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Window">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>163</red>
|
|
||||||
<green>190</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
</disabled>
|
|
||||||
</palette>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background: rgb(163, 190, 255)</string>
|
<string notr="true">background: rgb(163, 190, 255)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="url" stdset="0">
|
<property name="html">
|
||||||
<url>
|
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<string>about:blank</string>
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
</url>
|
p, li { white-space: pre-wrap; }
|
||||||
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||||
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="openLinks">
|
||||||
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -3057,19 +2965,19 @@ border-radius: 10px;
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWebView" name="recordsBox" native="true">
|
<widget class="QTextBrowser" name="recordsBox">
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background: rgb(163, 190, 255)</string>
|
<string notr="true">background: rgb(163, 190, 255)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="url" stdset="0">
|
<property name="html">
|
||||||
<url>
|
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<string>about:blank</string>
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
</url>
|
p, li { white-space: pre-wrap; }
|
||||||
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||||
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="openLinks">
|
||||||
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user