Fixes in "printers@cinnamon.org"#13524
Fixes in "printers@cinnamon.org"#13524hans-fritz-pommes wants to merge 14 commits intolinuxmint:masterfrom
Conversation
|
Oh and I changed icons. If you think they're ugly, just revert it |
|
I have an idea how to fix this mini-problem (identical bytes & job-number). But later |
Fix mini-problem (See linuxmint#13524)
|
Ok, now the identical bytes/document-name & job-number-problem is fixed. |
|
Sorry that I'm so chaotic |
Support filenames with whitespaces
files/usr/share/cinnamon/applets/printers@cinnamon.org/applet.js
Outdated
Show resolved
Hide resolved
files/usr/share/cinnamon/applets/printers@cinnamon.org/applet.js
Outdated
Show resolved
Hide resolved
files/usr/share/cinnamon/applets/printers@cinnamon.org/applet.js
Outdated
Show resolved
Hide resolved
Best-practices scannerThis is a regex-based check for API usage that can pose security, performance or This check is not perfect will not replace a normal review.Found 1 potential issue(s):
|
Improved with mtwebsters ideas (linuxmint#13524)
Best-practices scannerThis is a regex-based check for API usage that can pose security, performance or This check is not perfect will not replace a normal review.Found 1 potential issue(s):
|
What should be done with that? |
|
Please squash the commits into one. |
What it suggests - use an arrow function instead of using Lang.bind(). Look at other applets, it's a pretty straightforward change. |
removed deprecated lang.bind
|
By the way: |
Adressed linuxmint#9265
Adressing linuxmint#9265 Necessary update to catch the error reason
|
Those new commits intend to make it compatible with a turned-off CUPS-service |
I will do that when merging |
improved error handling
improved error handling
added this.removed
removed unnecessary timeout
improved looking of error-handling
| sendJobs.push(new PopupMenu.PopupIconMenuItem(text, 'xsi-go-up', St.IconType.SYMBOLIC)); | ||
| sendJobs[sendJobs.length - 1].job = job; | ||
| sendJobs[sendJobs.length - 1].connect('activate', Lang.bind(sendJobs[sendJobs.length - 1], this.onSendToFrontClicked)); | ||
| sendJobs[sendJobs.length - 1].connect('activate', () => this.onSendToFrontClicked(sendJobs[sendJobs.length - 1])); |
There was a problem hiding this comment.
This might not do what you expect:
The callback will evaluate sendJobs[sendJobs.length - 1] at the time of activation, not when you created the callback. You should probably just do something less clever like:
let sendjob = new PopupMenu.PopupIconMenuuItem.....
sendJobs.push(sendjob)
...
...
then reference sendJob as the callback argument.
|
Can we drop the python script? |
| if (lpq_present) { | ||
| doc = jobInfo[job][2]; | ||
| user = jobInfo[job][1]; | ||
| size = GLib.format_size_for_display(jobInfo[job][3]); |
There was a problem hiding this comment.
format_size_for_display() is deprecated - use format_size() instead (same arguments).
I encountered several small issues with the printers applet.
I modified the
applet.jsin/usr/share/cinnamon/applets/printers@cinnamon.organd tested printing documents.The things I did correct:
cancel -afor a specific printer, even if all of the jobs on this printer belonged to him.-> Now the "Cancel all jobs" command tries to cancel every single job, not
cancel -afor every printer(job number) lpstat -o(lpstat several times, if there was more than one job - see point before)-> The description is now:
(job number) 'document_name' on <printer_name> (<size in Bytes/MB/KB>) by <user>(using lpq -a).The following problem could occur:If a job has the same number as byte-size like the job-id of the following one, the username and the filesize of the first one will be strange (job-id and functions stay working).I would say this will happen that seldom - we should ignore it.Which user will open the menu exactly in that minute and have a problem with a strange username or filesize?EDIT: fixed in new commit