mirror of
https://github.com/Alvin-Zilverstand/Twitter-X-Media-Batch-Downloader.git
synced 2026-11-21 22:03:09 +01:00
34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
from PyQt6.QtWidgets import (
|
|
QDialog, QVBoxLayout, QLabel, QPushButton, QDialogButtonBox
|
|
)
|
|
from PyQt6.QtCore import Qt
|
|
|
|
class UpdateDialog(QDialog):
|
|
def __init__(self, current_version, new_version, parent=None):
|
|
super().__init__(parent)
|
|
self.setWindowTitle("Update Now")
|
|
self.setFixedWidth(400)
|
|
self.setModal(True)
|
|
|
|
layout = QVBoxLayout()
|
|
|
|
message = QLabel(f"Twitter/X Media Batch Downloader v{new_version} Available!")
|
|
message.setWordWrap(True)
|
|
layout.addWidget(message)
|
|
|
|
button_box = QDialogButtonBox()
|
|
self.update_button = QPushButton("Check")
|
|
self.update_button.setCursor(Qt.CursorShape.PointingHandCursor)
|
|
self.cancel_button = QPushButton("Later")
|
|
self.cancel_button.setCursor(Qt.CursorShape.PointingHandCursor)
|
|
|
|
button_box.addButton(self.update_button, QDialogButtonBox.ButtonRole.AcceptRole)
|
|
button_box.addButton(self.cancel_button, QDialogButtonBox.ButtonRole.RejectRole)
|
|
|
|
layout.addWidget(button_box)
|
|
|
|
self.setLayout(layout)
|
|
|
|
self.update_button.clicked.connect(self.accept)
|
|
self.cancel_button.clicked.connect(self.reject)
|