Skip to content

Commit

Permalink
- removing webview
Browse files Browse the repository at this point in the history
  • Loading branch information
trueromanus committed Jul 10, 2022
1 parent 159e201 commit 63b2cb8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 178 deletions.
2 changes: 1 addition & 1 deletion src/AniLibria.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
QT += quick multimedia network webengine concurrent svg websockets
QT += quick multimedia network concurrent svg websockets
CONFIG += c++11

windows {
Expand Down
95 changes: 8 additions & 87 deletions src/Views/Releases.qml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Page {
}

onSetWebViewUrl: {
if (webView.status === Loader.Ready) webView.item.url = releasesViewModel.getVkontakteCommentPage(releasesViewModel.openedReleaseCode);
//REMOVE!!!!
}

background: Rectangle {
Expand Down Expand Up @@ -1726,7 +1726,6 @@ Page {
anchors.fill: parent
onPressed: {
releasePosterPreview.isVisible = true;
if (Qt.platform.os !== "windows") webView.item.visible = false;
}
}
}
Expand Down Expand Up @@ -1919,7 +1918,6 @@ Page {
iconWidth: 26
iconHeight: 26
onButtonPressed: {
if (Qt.platform.os !== "windows") webView.item.visible = false;
cardCopyMenu.open();
}

Expand All @@ -1931,9 +1929,6 @@ Page {
CommonMenu {
id: cardCopyMenu
width: 350
onClosed: {
if (Qt.platform.os !== "windows") webView.item.visible = true;
}

CommonMenuItem {
text: "Копировать название"
Expand Down Expand Up @@ -1968,49 +1963,6 @@ Page {

}
}
IconButton {
height: 40
width: 40
overlayVisible: false
hoverColor: ApplicationTheme.filterIconButtonHoverColor
iconPath: "../Assets/Icons/vk.svg"
iconWidth: 26
iconHeight: 26
onButtonPressed: {
if (Qt.platform.os !== "windows") webView.item.visible = false;
vkontakteMenu.open();
}

CommonMenu {
id: vkontakteMenu
width: 350
onClosed: {
if (Qt.platform.os !== "windows") webView.item.visible = true;
}

CommonMenuItem {
text: "Авторизоваться для комментариев"
onPressed: {
webView.item.url = "https://oauth.vk.com/authorize?client_id=-1&display=widget&widget=4&redirect_uri=https://vk.com/";
}
}
CommonMenuItem {
text: "Переоткрыть комментарии"
onPressed: {
webView.item.url = releasesViewModel.getVkontakteCommentPage(releasesViewModel.openedReleaseCode);
if (vkCommentsWindow.opened) vkCommentsWindow.refreshComments();
}
}
CommonMenuItem {
enabled: !vkCommentsWindow.opened
text: "Открыть в отдельном окне"
onPressed: {
vkCommentsWindow.setModalVisible(true);
vkontakteMenu.close();
}
}
}
}
IconButton {
height: 40
width: 40
Expand All @@ -2021,16 +1973,12 @@ Page {
iconWidth: 26
iconHeight: 26
onButtonPressed: {
if (Qt.platform.os !== "windows") webView.item.visible = false;
seenMarkMenu.open();
}

CommonMenu {
id: seenMarkMenu
width: 350
onClosed: {
if (Qt.platform.os !== "windows") webView.item.visible = true;
}

CommonMenuItem {
text: "Отметить как просмотренное"
Expand Down Expand Up @@ -2077,16 +2025,12 @@ Page {
iconWidth: 26
iconHeight: 26
onButtonPressed: {
if (Qt.platform.os !== "windows") webView.item.visible = false;
cardFavoritesMenu.open();
}

CommonMenu {
id: cardFavoritesMenu
width: 350
onClosed: {
if (Qt.platform.os !== "windows") webView.item.visible = true;
}

CommonMenuItem {
enabled: !releasesViewModel.openedReleaseInFavorites
Expand Down Expand Up @@ -2115,16 +2059,12 @@ Page {
iconWidth: 26
iconHeight: 26
onButtonPressed: {
if (Qt.platform.os !== "windows") webView.item.visible = false;
externalPlayerMenu.open();
}

CommonMenu {
id: externalPlayerMenu
width: 380
onClosed: {
if (Qt.platform.os !== "windows") webView.item.visible = true;
}

CommonMenuItem {
text: "Открыть во внешнем плеере в HD качестве"
Expand Down Expand Up @@ -2184,16 +2124,12 @@ Page {
iconWidth: 26
iconHeight: 26
onButtonPressed: {
if (Qt.platform.os !== "windows") webView.item.visible = false;
setSeriesMenu.open();
}

CommonMenu {
id: setSeriesMenu
width: 330
onClosed: {
if (Qt.platform.os !== "windows") webView.item.visible = true;
}

Repeater {
model: releasesViewModel.isOpenedCard ? releasesViewModel.openedReleaseCountVideos : 0
Expand All @@ -2204,7 +2140,6 @@ Page {
watchSingleRelease(releasesViewModel.openedReleaseId, releasesViewModel.openedReleaseVideos, index, releasesViewModel.openedReleasePoster);

releasesViewModel.hideAfterWatchReleaseCard();
if (Qt.platform.os !== "windows") webView.item.visible = true;
}
}
}
Expand All @@ -2223,17 +2158,13 @@ Page {
anchors.left: parent.left
text: qsTr("Скачать")
onClicked: {
if (Qt.platform.os !== "windows") webView.item.visible = false;
dowloadTorrent.open();
}

CommonMenu {
id: dowloadTorrent
y: parent.height - parent.height
width: 380
onClosed: {
if (Qt.platform.os !== "windows") webView.item.visible = true;
}

Repeater {
model: releasesViewModel.openedCardTorrents
Expand Down Expand Up @@ -2278,7 +2209,6 @@ Page {

releasesViewModel.hideAfterWatchReleaseCard();
releasePosterPreview.isVisible = false;
if (Qt.platform.os !== "windows") webView.item.visible = true;
}
}

Expand All @@ -2288,24 +2218,15 @@ Page {
anchors.rightMargin: 10
}

PlainText {
RoundedActionButton {
id: openCommentsButton
text: qsTr("Открыть комментарии")
anchors.verticalCenter: parent.verticalCenter
anchors.centerIn: parent
visible: webView.item && webView.item.loading
fontPointSize: 11
text: "Загрузка комментариев..."
}
}
Loader {
id: webView
sourceComponent: releasesViewModel.isOpenedCard && !vkCommentsWindow.opened ? webViewComponent : null
}
Component {
id: webViewComponent

WebEngineView {
width: cardContainer.width
height: cardContainer.height - releaseInfo.height - 60
onClicked: {
const url = releasesViewModel.getVkontakteCommentPage(releasesViewModel.openedReleaseCode);
Qt.openUrlExternally(url);
}
}
}
}
Expand Down
77 changes: 0 additions & 77 deletions src/Views/VkCommentsWindow.qml

This file was deleted.

9 changes: 2 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QtWebEngine>
#include <QtSvg>
#include <QQmlContext>
#include <QString>
Expand Down Expand Up @@ -79,13 +78,9 @@ int main(int argc, char *argv[])
if (argc >= 2 && QString(argv[1]) == "portable") {
IsPortable = true;
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
QtWebEngine::initialize();
#endif

QGuiApplication app(argc, argv);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QtWebEngine::initialize();
#endif

qmlRegisterType<SynchronizationService>("Anilibria.Services", 1, 0, "SynchronizationService");
qmlRegisterType<LocalStorageService>("Anilibria.Services", 1, 0, "LocalStorage");
qmlRegisterType<ApplicationSettings>("Anilibria.Services", 1, 0, "ApplicationSettings");
Expand Down
5 changes: 0 additions & 5 deletions src/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,6 @@ ApplicationWindow {
onReleaseCardOpened: {
analyticsService.sendView("releasecard", "open", "%2Frelease");
releases.setWebViewUrl();
vkCommentsWindow.refreshComments();
userActivityViewModel.addOpenedCardToCounter();
}
onAfterSynchronizedReleases: {
Expand Down Expand Up @@ -1305,10 +1304,6 @@ ApplicationWindow {
videoOutput: videoplayer.videoOutputSource
}

VkCommentsWindow {
id: vkCommentsWindow
}

MyAnilibriaViewModel {
id: myAnilibriaViewModel
releasesViewModel: releasesViewModel
Expand Down
1 change: 0 additions & 1 deletion src/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
<file>Assets/Icons/listcustom.svg</file>
<file>Assets/Icons/sortascending.svg</file>
<file>Assets/Icons/sortdescending.svg</file>
<file>Views/VkCommentsWindow.qml</file>
<file>Assets/Icons/christmasball.svg</file>
<file>Assets/Icons/snowflake.svg</file>
<file>Assets/Icons/snowbackground.png</file>
Expand Down

0 comments on commit 63b2cb8

Please sign in to comment.