-
-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PICARD-1325: Allow disabling new version update checking for packagers #1024
Conversation
picard/tagger.py
Outdated
@@ -146,7 +146,7 @@ def __init__(self, picard_args, unparsed_args, localedir, autoupdate): | |||
) | |||
|
|||
self._cmdline_files = picard_args.FILE | |||
self._autoupdate = autoupdate | |||
self.autoupdate_enabled = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this True
setting left over from your testing? Should it be self.autoupdate_enabled = autoupdate
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it was only for testing. Thank you.
picard/tagger.py
Outdated
@@ -251,7 +251,8 @@ def __init__(self, picard_args, unparsed_args, localedir, autoupdate): | |||
self.stopping = False | |||
|
|||
# Load release version information | |||
self.updatecheckmanager = UpdateCheckManager(parent=self.window) | |||
if QtWidgets.QApplication.instance().autoupdate_enabled: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you simply use the self.autoupdate_enabled
object here rather than the instance()
object?
picard/ui/mainwindow.py
Outdated
@@ -189,7 +189,8 @@ def keyPressEvent(self, event): | |||
def show(self): | |||
self.restoreWindowState() | |||
super().show() | |||
self.auto_update_check() | |||
if QtWidgets.QApplication.instance().autoupdate_enabled: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that the value is exposed as self.tagger.autoupdate_enabled
so the instance()
object shouldn't be required. Same throughout the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I didn't notice that.
picard/ui/options/general.py
Outdated
@@ -17,8 +17,7 @@ | |||
# along with this program; if not, write to the Free Software | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
|
|||
from PyQt5 import QtCore | |||
from PyQt5.QtWidgets import QInputDialog | |||
from PyQt5 import QtCore,QtWidgets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use self.tagger.autoupdate_enabled
this likely isn't required. If it is required, there should be a space after the comma.
picard/ui/options/general.py
Outdated
self.ui.update_level.addItem(_(description['title']), level) | ||
self.ui.update_level.setCurrentIndex(self.ui.update_level.findData(config.setting["update_level"])) | ||
self.ui.update_check_days.setValue(config.setting["update_check_days"]) | ||
if QtWidgets.QApplication.instance().autoupdate_enabled: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that the value is exposed as self.tagger.autoupdate_enabled
so the instance()
object shouldn't be required. Same throughout the file.
picard/ui/ui_options_general.py
Outdated
self.verticalLayout_2.addLayout(self.gridLayout_2) | ||
self.vboxlayout.addWidget(self.groupBox_3) | ||
|
||
if QtWidgets.QApplication.instance().autoupdate_enabled: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is automatically generated by python setup.py build_ui
command and should not be edited manually. I suggest that you simply hide the elements associated with the update checking settings when the ui is displayed in picard/ui/options/general.py
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it ok to add that hiding feature to load() function?
I used setEnabled() - please tell me if it's better to hide it completely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I would add it to the load()
method. I think it would be better to hide it completely, that way users of a packaged version don't see something that they can't change. It's less likely to generate questions that way. ;-)
picard/ui/ui_options_general.py
Outdated
self.vboxlayout.addWidget(self.groupBox_3) | ||
|
||
if QtWidgets.QApplication.instance().autoupdate_enabled: | ||
self.groupBox_3 = QtWidgets.QGroupBox(GeneralOptionsPage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're likely to be referring to this to hide it, the name should probably be changed from groupbox_3
to something more appropriate (e.g. update_check_groupbox
).
picard/ui/options/general.py
Outdated
@@ -18,7 +18,6 @@ | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
|
|||
from PyQt5 import QtCore | |||
from PyQt5.QtWidgets import QInputDialog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QImportDialog
still needs to be imported because it is used in the login(self)
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, misclick :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually surprised that wasn't caught with the automatic checks. Then again, I would have expected codacy to have caught it and it seems the codacy checking didn't run.
@@ -181,7 +181,7 @@ class picard_build(build): | |||
user_options = build.user_options + [ | |||
('build-locales=', 'd', "build directory for locale files"), | |||
('localedir=', None, ''), | |||
('disable-autoupdate', None, ''), | |||
('disable-autoupdate', None, 'disable update checking and hide settings for it'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done adding a comment for this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you :)
picard/ui/options/general.py
Outdated
@@ -19,7 +19,6 @@ | |||
|
|||
from PyQt5 import QtCore | |||
from PyQt5.QtWidgets import QInputDialog | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whiteline should stay, can you just re-add it and squash again ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks :)
Summary
When user uses --disable-autoupdate flag when installing or building Picard, it automatically hide "Update checking" feature from user and disable update checking code itself
Problem
Recently the ability to automatically and manually check for program updates was added to MusicBrainz Picard. Picard release packagers should be able to completely hide this functionality and configuration settings from the user for the packages they produce.
Solution