Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def __init__(self, host):

def update(self, host):
response = json.loads(requests.get(f"https://api.oscwii.org/v2/{host['id']}/packages", timeout=10).text)
for element in response:
element["repo"] = host['id']
self.__apps = response

def get_apps(self):
Expand Down
Binary file added assets/gui/icons/category/queue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/gui/icons/download-all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 23 additions & 11 deletions gui/DownloadLocationDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class DownloadLocationDialog(ui_DownloadLocationDialog.Ui_Dialog, QDialog):
def __init__(self, package, parent=None):
def __init__(self, packages, parent=None):
super().__init__(parent)
self.setupUi(self)
self.setWindowIcon(QIcon(resource_path("assets/gui/icons/downloadlocationdialog.png")))
Expand All @@ -20,22 +20,29 @@ def __init__(self, package, parent=None):
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)

self.screen = QGuiApplication.primaryScreen()
self.package = package
self.packages = packages
self.selection = None
self.drives = set()

self.setWindowTitle(f"Download \"{self.package['display_name']}\"")
if len(self.packages) > 1:
self.setWindowTitle(f"Download {len(gui_helpers.MULTISELECT)} Items")
self.buttonBox.button(QDialogButtonBox.Ok).setText("Download to directory")
else:
self.setWindowTitle(f"Download \"{self.packages[0]['display_name']}\"")

# set required space label
self.label_required_space.setText(f"**Required Space:** {file_size(self.package['extracted'])}")
total_file_size = 0
for package in self.packages:
total_file_size += package['extracted']
self.label_required_space.setText(f"**{'Total ' if len(self.packages) > 1 else ''}Required Space:** {file_size(total_file_size)}")

# populate list of extra dirs
for directory in self.package["extra_directories"]:
if not directory.startswith("/apps"):
item = QListWidgetItem()
item.setText(directory)
item.setIcon(QIcon(resource_path("assets/gui/icons/directory.png")))
self.listWidget.addItem(item)
for package in self.packages:
for directory in package["extra_directories"]:
if not directory.startswith("/apps"):
item = QListWidgetItem()
item.setText(directory)
item.setIcon(QIcon(resource_path("assets/gui/icons/directory.png")))
self.listWidget.addItem(item)

# initialize volumes, set timer for checking for changes to volumes once per second
self.timer = QTimer()
Expand Down Expand Up @@ -112,8 +119,13 @@ def combobox_index_changed(self):
self.label_2.hide()
self.checkBox.setChecked(False)
self.label_available_space.setVisible(False)
if len(self.packages) > 1:
self.buttonBox.button(QDialogButtonBox.Ok).setText("Download to directory")
else:
self.buttonBox.button(QDialogButtonBox.Ok).setText("Download")
else:
# set available space label
self.buttonBox.button(QDialogButtonBox.Ok).setText("Download")
self.label_available_space.setVisible(True)
self.label_available_space.setText(
f"**Available Space:** {file_size(self.comboBox.currentData()['drive'].bytesFree())}")
Expand Down
5 changes: 4 additions & 1 deletion gui/SendDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def __init__(self, package, parent=None):
self.buttonBox.button(QDialogButtonBox.Ok).setText(f"Send {self.send_as}")

self.setWindowIcon(QIcon(resource_path("assets/gui/icons/send.png")))
self.setWindowTitle(f"Send to Wii - {package['display_name']}")
if len(gui_helpers.MULTISELECT) > 1:
self.setWindowTitle(f"Send to Wii - {len(gui_helpers.MULTISELECT)} {self.send_as}s")
else:
self.setWindowTitle(f"Send to Wii - \"{gui_helpers.MULTISELECT[0]['display_name']}\"")

self.USBDes.setTextFormat(Qt.TextFormat.RichText)
self.IPDes.setTextFormat(Qt.TextFormat.RichText)
Expand Down
34 changes: 22 additions & 12 deletions gui/ui_united.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
################################################################################
## Form generated from reading UI file 'united.ui'
##
## Created by: Qt User Interface Compiler version 6.5.0
## Created by: Qt User Interface Compiler version 6.4.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
Expand Down Expand Up @@ -63,6 +63,8 @@ def setupUi(self, MainWindow):
self.actionCopy_Direct_Link.setObjectName(u"actionCopy_Direct_Link")
self.actionDeveloper_Profile = QAction(MainWindow)
self.actionDeveloper_Profile.setObjectName(u"actionDeveloper_Profile")
self.actionDownload_All_From_Repo = QAction(MainWindow)
self.actionDownload_All_From_Repo.setObjectName(u"actionDownload_All_From_Repo")
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName(u"centralwidget")
self.horizontalLayout_2 = QHBoxLayout(self.centralwidget)
Expand Down Expand Up @@ -156,6 +158,7 @@ def setupUi(self, MainWindow):
self.CategoriesComboBox.addItem("")
self.CategoriesComboBox.addItem("")
self.CategoriesComboBox.addItem("")
self.CategoriesComboBox.addItem("")
self.CategoriesComboBox.setObjectName(u"CategoriesComboBox")
self.CategoriesComboBox.setMaximumSize(QSize(100, 16777215))

Expand Down Expand Up @@ -271,7 +274,7 @@ def setupUi(self, MainWindow):
self.statusIcon.setMargin(3)
self.gridLayoutWidget = QWidget(self.GeneralTab)
self.gridLayoutWidget.setObjectName(u"gridLayoutWidget")
self.gridLayoutWidget.setGeometry(QRect(10, 100, 223, 136))
self.gridLayoutWidget.setGeometry(QRect(10, 100, 223, 147))
self.gridLayout = QGridLayout(self.gridLayoutWidget)
self.gridLayout.setObjectName(u"gridLayout")
self.gridLayout.setContentsMargins(0, 0, 0, 0)
Expand Down Expand Up @@ -376,29 +379,31 @@ def setupUi(self, MainWindow):

self.MetadataBottomFrame = QFrame(self.SelectionInfoBox)
self.MetadataBottomFrame.setObjectName(u"MetadataBottomFrame")
self.MetadataBottomFrame.setMaximumSize(QSize(16777215, 34))
self.MetadataBottomFrame.setMaximumSize(QSize(16777215, 56))
self.MetadataBottomFrame.setFrameShape(QFrame.NoFrame)
self.MetadataBottomFrame.setLineWidth(0)
self.horizontalLayout_6 = QHBoxLayout(self.MetadataBottomFrame)
self.horizontalLayout_6.setObjectName(u"horizontalLayout_6")
self.horizontalLayout_6.setContentsMargins(-1, 0, -1, 0)
self.ViewMetadataBtn = QPushButton(self.MetadataBottomFrame)
self.ViewMetadataBtn.setObjectName(u"ViewMetadataBtn")
self.ViewMetadataBtn.setGeometry(QRect(10, 29, 121, 23))
sizePolicy6 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Expanding)
sizePolicy6.setHorizontalStretch(0)
sizePolicy6.setVerticalStretch(0)
sizePolicy6.setHeightForWidth(self.ViewMetadataBtn.sizePolicy().hasHeightForWidth())
self.ViewMetadataBtn.setSizePolicy(sizePolicy6)

self.horizontalLayout_6.addWidget(self.ViewMetadataBtn)

self.WiiLoadButton = QPushButton(self.MetadataBottomFrame)
self.WiiLoadButton.setObjectName(u"WiiLoadButton")
self.WiiLoadButton.setGeometry(QRect(140, 29, 121, 23))
sizePolicy6.setHeightForWidth(self.WiiLoadButton.sizePolicy().hasHeightForWidth())
self.WiiLoadButton.setSizePolicy(sizePolicy6)

self.horizontalLayout_6.addWidget(self.WiiLoadButton)

self.ClearMultiSelectButton = QPushButton(self.MetadataBottomFrame)
self.ClearMultiSelectButton.setObjectName(u"ClearMultiSelectButton")
self.ClearMultiSelectButton.setEnabled(False)
self.ClearMultiSelectButton.setGeometry(QRect(75, 3, 121, 23))
sizePolicy6.setHeightForWidth(self.ClearMultiSelectButton.sizePolicy().hasHeightForWidth())
self.ClearMultiSelectButton.setSizePolicy(sizePolicy6)
self.horizontalLayout_6 = QHBoxLayout(self.MetadataBottomFrame)
self.horizontalLayout_6.setObjectName(u"horizontalLayout_6")
self.horizontalLayout_6.setContentsMargins(-1, 0, -1, 0)

self.verticalLayout_3.addWidget(self.MetadataBottomFrame)

Expand Down Expand Up @@ -439,6 +444,8 @@ def setupUi(self, MainWindow):
self.menuDebug.addAction(self.actionEnable_Log_File)
self.menuDebug.addAction(self.actionClear_Log)
self.menuDebug.addSeparator()
self.menuDebug.addAction(self.actionDownload_All_From_Repo)
self.menuDebug.addSeparator()
self.menuDebug.addAction(self.menuExperimental.menuAction())
self.menuExperimental.addAction(self.menuAnnouncement_Banner.menuAction())
self.menuExperimental.addAction(self.actionSelect_Theme)
Expand Down Expand Up @@ -481,6 +488,7 @@ def retranslateUi(self, MainWindow):
#if QT_CONFIG(tooltip)
self.actionDeveloper_Profile.setToolTip(QCoreApplication.translate("MainWindow", u"View Profile", None))
#endif // QT_CONFIG(tooltip)
self.actionDownload_All_From_Repo.setText(QCoreApplication.translate("MainWindow", u"Download All From Repo", None))
#if QT_CONFIG(accessibility)
self.centralwidget.setAccessibleName(QCoreApplication.translate("MainWindow", u"centralcontainer", None))
#endif // QT_CONFIG(accessibility)
Expand All @@ -495,6 +503,7 @@ def retranslateUi(self, MainWindow):
self.CategoriesComboBox.setItemText(3, QCoreApplication.translate("MainWindow", u"Games", None))
self.CategoriesComboBox.setItemText(4, QCoreApplication.translate("MainWindow", u"Media", None))
self.CategoriesComboBox.setItemText(5, QCoreApplication.translate("MainWindow", u"Demos", None))
self.CategoriesComboBox.setItemText(6, QCoreApplication.translate("MainWindow", u"Queued", None))

self.announcementLabel.setText(QCoreApplication.translate("MainWindow", u"<html><head/><body><p><span style=\" font-weight:600;\">Announcement Header: </span>Announcement Content.</p></body></html>", None))
self.announcementURLLabel.setText(QCoreApplication.translate("MainWindow", u"<html><head/><body><p><a href=\"https://google.com\"><span style=\" text-decoration: underline; color:#ffff00;\">Announcement URL</span></a></p></body></html>", None))
Expand Down Expand Up @@ -534,6 +543,7 @@ def retranslateUi(self, MainWindow):
self.tabMetadata.setTabText(self.tabMetadata.indexOf(self.RawTab), QCoreApplication.translate("MainWindow", u"Peripherals", None))
self.ViewMetadataBtn.setText(QCoreApplication.translate("MainWindow", u"Download", None))
self.WiiLoadButton.setText(QCoreApplication.translate("MainWindow", u"Send to Wii", None))
self.ClearMultiSelectButton.setText(QCoreApplication.translate("MainWindow", u"Clear Queue", None))
self.menuAbout.setTitle(QCoreApplication.translate("MainWindow", u"About", None))
self.menuDebug.setTitle(QCoreApplication.translate("MainWindow", u"Options", None))
self.menuExperimental.setTitle(QCoreApplication.translate("MainWindow", u"Experimental", None))
Expand Down
102 changes: 74 additions & 28 deletions gui/united.ui
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@
<string>Demos</string>
</property>
</item>
<item>
<property name="text">
<string>Queued</string>
</property>
</item>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -532,7 +537,7 @@ background-color: rgba(255, 255, 255, 0);
<x>10</x>
<y>100</y>
<width>223</width>
<height>136</height>
<height>147</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
Expand Down Expand Up @@ -738,7 +743,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
<property name="maximumSize">
<size>
<width>16777215</width>
<height>34</height>
<height>56</height>
</size>
</property>
<property name="frameShape">
Expand All @@ -754,33 +759,67 @@ li.checked::marker { content: &quot;\2612&quot;; }
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="ViewMetadataBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Download</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="WiiLoadButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Send to Wii</string>
</property>
</widget>
</item>
</layout>
<widget class="QPushButton" name="ViewMetadataBtn">
<property name="geometry">
<rect>
<x>10</x>
<y>29</y>
<width>121</width>
<height>23</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Download</string>
</property>
</widget>
<widget class="QPushButton" name="WiiLoadButton">
<property name="geometry">
<rect>
<x>140</x>
<y>29</y>
<width>121</width>
<height>23</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Send to Wii</string>
</property>
</widget>
<widget class="QPushButton" name="ClearMultiSelectButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>75</x>
<y>3</y>
<width>121</width>
<height>23</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Clear Queue</string>
</property>
</widget>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -828,6 +867,8 @@ li.checked::marker { content: &quot;\2612&quot;; }
<addaction name="actionEnable_Log_File"/>
<addaction name="actionClear_Log"/>
<addaction name="separator"/>
<addaction name="actionDownload_All_From_Repo"/>
<addaction name="separator"/>
<addaction name="menuExperimental"/>
</widget>
<widget class="QMenu" name="menuClients">
Expand Down Expand Up @@ -932,6 +973,11 @@ li.checked::marker { content: &quot;\2612&quot;; }
<string>View Profile</string>
</property>
</action>
<action name="actionDownload_All_From_Repo">
<property name="text">
<string>Download All From Repo</string>
</property>
</action>
</widget>
<resources/>
<connections/>
Expand Down
10 changes: 8 additions & 2 deletions gui_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
DATASENT = False
CURRENTLY_SENDING = False
IN_DOWNLOAD_DIALOG = False



MULTISELECT = []
MULTISELECT_SIGNAL_COLORS = {
"notselected": "#000000FF",
"in queue": "#cbc845",
"downloaded": "#3db072",
"failed": "#cb5045"
}
MULTISELECT_SIGNAL_CACHE = {}
Loading