Fix Desktop shortcut and login dialog task bar icon + bump version
This commit is contained in:
parent
87c3534da4
commit
150fff348b
|
@ -24,7 +24,7 @@ AppDir:
|
|||
id: org.dummerle.rare
|
||||
name: Rare
|
||||
icon: Rare
|
||||
version: 1.8.7
|
||||
version: 1.8.9
|
||||
exec: usr/bin/python3
|
||||
exec_args: $APPDIR/usr/src/__main__.py $@
|
||||
apt:
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
__version__ = "1.8.8"
|
||||
__version__ = "1.8.9"
|
||||
|
||||
code_name = "Stellula Kakopo"
|
||||
|
|
|
@ -93,7 +93,8 @@ class LaunchDialog(QDialog, Ui_LaunchDialog):
|
|||
raise ValueError("You are not logged in. Open Login Window")
|
||||
except ValueError as e:
|
||||
logger.info(str(e))
|
||||
do_launch = LoginDialog(core=self.core, parent=self).login()
|
||||
# Do not set parent, because it won't show a task bar icon
|
||||
do_launch = LoginDialog(core=self.core).login()
|
||||
except ConnectionError as e:
|
||||
logger.warning(e)
|
||||
self.args.offline = True
|
||||
|
|
|
@ -3,11 +3,11 @@ from logging import getLogger
|
|||
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtWidgets import QSizePolicy, QLayout, QDialog, QMessageBox
|
||||
|
||||
from legendary.core import LegendaryCore
|
||||
from rare.shared import LegendaryCoreSingleton, ArgumentsSingleton
|
||||
|
||||
from rare.components.dialogs.login.browser_login import BrowserLogin
|
||||
from rare.components.dialogs.login.import_login import ImportLogin
|
||||
from rare.shared import ArgumentsSingleton
|
||||
from rare.ui.components.dialogs.login.login_dialog import Ui_LoginDialog
|
||||
|
||||
logger = getLogger("Login")
|
||||
|
@ -28,7 +28,7 @@ class LoginDialog(QDialog, Ui_LoginDialog):
|
|||
super(LoginDialog, self).__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
self.setAttribute(Qt.WA_DeleteOnClose, True)
|
||||
self.setWindowFlags(Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint)
|
||||
self.setWindowFlags(Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint)
|
||||
self.setWindowModality(Qt.WindowModal)
|
||||
|
||||
self.core = core
|
||||
|
@ -63,7 +63,7 @@ class LoginDialog(QDialog, Ui_LoginDialog):
|
|||
self.login_stack.setCurrentIndex(self.pages.landing)
|
||||
|
||||
self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
|
||||
self.dialog_layout.setSizeConstraint(QLayout.SetFixedSize)
|
||||
self.layout().setSizeConstraint(QLayout.SetFixedSize)
|
||||
# self.resize(self.minimumSizeHint())
|
||||
|
||||
def back_clicked(self):
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# Form implementation generated from reading ui file 'rare/ui/components/dialogs/login/login_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.6
|
||||
# Created by: PyQt5 UI code generator 5.15.4
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
@ -14,21 +14,16 @@ from PyQt5 import QtCore, QtGui, QtWidgets
|
|||
class Ui_LoginDialog(object):
|
||||
def setupUi(self, LoginDialog):
|
||||
LoginDialog.setObjectName("LoginDialog")
|
||||
LoginDialog.resize(498, 311)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(LoginDialog.sizePolicy().hasHeightForWidth())
|
||||
LoginDialog.setSizePolicy(sizePolicy)
|
||||
self.dialog_layout = QtWidgets.QVBoxLayout(LoginDialog)
|
||||
self.dialog_layout.setObjectName("dialog_layout")
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
self.dialog_layout.addItem(spacerItem)
|
||||
LoginDialog.resize(498, 269)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(LoginDialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
spacerItem = QtWidgets.QSpacerItem(477, 17, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
self.verticalLayout.addItem(spacerItem)
|
||||
self.welcome_label = QtWidgets.QLabel(LoginDialog)
|
||||
self.welcome_label.setObjectName("welcome_label")
|
||||
self.dialog_layout.addWidget(self.welcome_label)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
self.dialog_layout.addItem(spacerItem1)
|
||||
self.verticalLayout.addWidget(self.welcome_label)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(477, 17, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
self.verticalLayout.addItem(spacerItem1)
|
||||
self.login_stack = QtWidgets.QStackedWidget(LoginDialog)
|
||||
self.login_stack.setEnabled(True)
|
||||
self.login_stack.setMinimumSize(QtCore.QSize(480, 135))
|
||||
|
@ -78,7 +73,7 @@ class Ui_LoginDialog(object):
|
|||
self.login_browser_radio.setObjectName("login_browser_radio")
|
||||
self.login_page_layout.addWidget(self.login_browser_radio, 1, 0, 1, 1)
|
||||
self.login_stack.addWidget(self.login_page)
|
||||
self.dialog_layout.addWidget(self.login_stack)
|
||||
self.verticalLayout.addWidget(self.login_stack)
|
||||
self.button_layout = QtWidgets.QHBoxLayout()
|
||||
self.button_layout.setObjectName("button_layout")
|
||||
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
|
@ -92,7 +87,7 @@ class Ui_LoginDialog(object):
|
|||
self.next_button = QtWidgets.QPushButton(LoginDialog)
|
||||
self.next_button.setObjectName("next_button")
|
||||
self.button_layout.addWidget(self.next_button)
|
||||
self.dialog_layout.addLayout(self.button_layout)
|
||||
self.verticalLayout.addLayout(self.button_layout)
|
||||
|
||||
self.retranslateUi(LoginDialog)
|
||||
self.login_stack.setCurrentIndex(0)
|
||||
|
@ -100,7 +95,7 @@ class Ui_LoginDialog(object):
|
|||
|
||||
def retranslateUi(self, LoginDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
LoginDialog.setWindowTitle(_translate("LoginDialog", "Welcome to Rare"))
|
||||
LoginDialog.setWindowTitle(_translate("LoginDialog", "Rare Login"))
|
||||
self.welcome_label.setText(_translate("LoginDialog", "<h1>Welcome to Rare</h1>"))
|
||||
self.login_browser_label.setText(_translate("LoginDialog", "Login using a browser."))
|
||||
self.login_label.setText(_translate("LoginDialog", "Select login method"))
|
||||
|
|
|
@ -7,19 +7,13 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>498</width>
|
||||
<height>311</height>
|
||||
<height>269</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Welcome to Rare</string>
|
||||
<string>Rare Login</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="dialog_layout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="login_vspacer_top">
|
||||
<property name="orientation">
|
||||
|
@ -30,8 +24,8 @@
|
|||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
<width>477</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
|
@ -53,8 +47,8 @@
|
|||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
<width>477</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
|
@ -136,30 +130,30 @@
|
|||
</item>
|
||||
<item row="1" column="2" rowspan="2">
|
||||
<spacer name="login_hspacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="login_browser_radio">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browser</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="login_browser_radio">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browser</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
|
|
@ -354,9 +354,10 @@ def create_desktop_link(app_name=None, core: LegendaryCore = None, type_of_link=
|
|||
|
||||
shortcut.Targetpath = executable
|
||||
shortcut.Arguments = shlex.join(arguments)
|
||||
|
||||
# Maybe there is a better solution, but windows does not accept single quotes (Windows is weird)
|
||||
shortcut.Arguments = shortcut.Arguments.replace("'", '"')
|
||||
if for_rare:
|
||||
shortcut.WorkingDirectory = os.getcwd()
|
||||
shortcut.WorkingDirectory = QStandardPaths.writableLocation(QStandardPaths.HomeLocation)
|
||||
|
||||
# Icon
|
||||
if for_rare:
|
||||
|
@ -366,7 +367,7 @@ def create_desktop_link(app_name=None, core: LegendaryCore = None, type_of_link=
|
|||
img = QImage()
|
||||
img.load(f"{icon}.png")
|
||||
img.save(f"{icon}.ico")
|
||||
logger.info("Create Icon")
|
||||
logger.info("Created ico file")
|
||||
icon_location = f"{icon}.ico"
|
||||
shortcut.IconLocation = os.path.abspath(icon_location)
|
||||
|
||||
|
|
Loading…
Reference in a new issue