| 22 | using namespace ZenLib; |
| 23 | |
| 24 | HTMLViewWidget::HTMLViewWidget(Core *C, QSettings *settings, QWidget *parent) |
| 25 | : QWidget(parent), C(C), FilePos(0) { |
| 26 | |
| 27 | if (C->Kind_Get() == Core::Kind_Graph_Svg) { |
| 28 | C->Menu_Option_Preferences_Option(__T("Graph_Adm_ShowTrackUIDs"), settings->value("Graph_Adm_ShowTrackUIDs",false).toBool() ? __T("1") : __T("0")); |
| 29 | C->Menu_Option_Preferences_Option(__T("Graph_Adm_ShowChannelFormats"), settings->value("Graph_Adm_ShowChannelFormats",false).toBool() ? __T("1") : __T("0")); |
| 30 | |
| 31 | QComboBox *fileChoice = new QComboBox(this); |
| 32 | fileChoice->setMinimumContentsLength(1); |
| 33 | for (size_t Pos = 0; Pos < C->Count_Get(); ++Pos) |
| 34 | fileChoice->addItem(wstring2QString(C->Get(Pos, Stream_General, 0, __T("CompleteName")))); |
| 35 | fileChoice->setCurrentIndex(FilePos); |
| 36 | connect(fileChoice, SIGNAL(currentIndexChanged(int)), SLOT(changeFilePos(int))); |
| 37 | |
| 38 | webView = new WebViewWidget(this); |
| 39 | |
| 40 | QVBoxLayout *layout = new QVBoxLayout(this); |
| 41 | layout->addWidget(fileChoice); |
| 42 | layout->addWidget(webView); |
| 43 | |
| 44 | this->setLayout(layout); |
| 45 | } |
| 46 | else { |
| 47 | webView = new WebViewWidget(this); |
| 48 | QVBoxLayout *layout = new QVBoxLayout(this); |
| 49 | layout->setContentsMargins(0, 0, 0, 0); |
| 50 | layout->addWidget(webView); |
| 51 | this->setLayout(layout); |
| 52 | } |
| 53 | |
| 54 | #if defined(EDGE_WEBVIEW2_YES) && (QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)) |
| 55 | webView->setPreferredColorScheme(qApp->styleHints()->colorScheme()); |
| 56 | #endif |
| 57 | |
| 58 | tempFile.setFileTemplate(tempFile.fileTemplate() + ".html"); |
| 59 | refresh(); |
| 60 | } |
| 61 | |
| 62 | QString HTMLViewWidget::generateGraphHTML() { |
| 63 | QString html; |
nothing calls this directly
no test coverage detected