Skip to content
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

Screenshot popup alert #675

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

iamutkarshtiwari
Copy link
Contributor

@iamutkarshtiwari iamutkarshtiwari commented Apr 6, 2016

This feature add a screenshot alert to Sugar.
On pressing Alt+1 key combination or selecting 'Take a screenshot' option from bottom toolbar
a popup alert appears where user could can the default name of that screenshot.
The popup can be dismissed by clicking 'X' button or by pressing 'Escape' key.
Enter can also be used to save and dismiss the alert.
desktop-animation

@iamutkarshtiwari
Copy link
Contributor Author

@quozl @davelab6 Please try this patch and share your suggestions. @samdroid-apps You might like it ;)

preview_surface.write_to_png(preview_str)

return dbus.ByteArray(preview_str.getvalue())

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank lines, please remove.

@quozl
Copy link
Contributor

quozl commented Apr 6, 2016

Looks great.

Worried about the commit message; during review it wasn't clear what you had done and why.

@iamutkarshtiwari
Copy link
Contributor Author

Fixed the commit message. Fixed the blank lines. Updated the copyright.

On pressing <Alt>+1 key or selecting 'Take a screenshot' option from bottom toolbar
generates a popup alert where user can change the default name of that screenshot.
The popup can be dismissed by clicking 'X' button or by pressing 'Escape' key.

Currently there is no notification on screen capture in Sugar.
The user wants to rename the screenshot, he has to go back to Journal to do it.
@quozl
Copy link
Contributor

quozl commented Apr 12, 2016

I'm hopeful of receiving feedback from others on whether the dialog should be styled to look like either;

  • the wireless password prompt (no X or tick decorators), or
  • the control panel, view source, or help modal windows.

@quozl
Copy link
Contributor

quozl commented Apr 13, 2016

It is proving difficult to get any feedback, sorry for the delay.

@quozl
Copy link
Contributor

quozl commented Apr 13, 2016

While we wait for feedback ... tested on Ubuntu 16.04 with Sugar 0.108.

appearance issues

  • the "Name" label is unnecessary; we don't have a name label in the Journal detail view, or the activity toolkit text entry for journal object; it is obvious from context that it is a journal entry name,
  • if after consensus the "Name" label is kept,
    • it is yellow, it should be white,
    • it is too close to the text entry,
    • it might be to the left of the text entry, like "Server:' in My Settings, Network, Collaboration,
  • the preview image is distorted; because the aspect ratio of the preview doesn't match the aspect ratio of the display; you've coded 200:160 (1.5) instead of detecting the display, (you've also used these constants at least twice in the code without using a variable for them),

interaction issues - keyboard

  • the dialog does not respond to the Esc key, it must dismiss the dialog and cancel the screenshot, see Hotkeys,
  • the dialog does not respond to the Enter key, it must accept the dialog and save the screenshot,

interaction issues - other windows

  • while the dialog is visible, the frame can be shown with the f6 key, but does not react to input,
  • while the dialog is visible, the f1, f2, f3 keys will hide the dialog and switch view, but the view does not react to input, the user is trapped with no obvious way to fix, but any key press shows the dialog again,
  • while in the home view, activating the My Settings control panel (alt-shift-m), and then pressing alt+1 locks the display; the control panel cannot be closed, workaround is to restart display manager service lightdm restart,
  • while in the home view, activating the Help window (alt+shift+h), and then pressing alt+1 locks the display, as above.

Hope that helps!

@quozl
Copy link
Contributor

quozl commented Apr 13, 2016

  • Unwelcome side-effect; when a menu palette is open, such as the central icon on the home view, the alt+1 key causes the palette to close.

@davelab6
Copy link
Contributor

Unwelcome side-effect; when a menu palette is open, such as the central icon on the home view, the alt+1 key causes the palette to close.

Is that a GTK level issue?

@quozl
Copy link
Contributor

quozl commented Apr 13, 2016

Is that a GTK level issue?

No, it's a Sugar Python code issue. GTK will do whatever we tell it to do.

@davelab6
Copy link
Contributor

No, it's a Sugar Python code issue. GTK will do whatever we tell it to do.

Should it be solved in this PR?

@quozl
Copy link
Contributor

quozl commented Apr 13, 2016

Should it be solved in this PR?

Yes, because this PR causes the regression. It doesn't happen without this PR.

@samdroid-apps
Copy link
Contributor

samdroid-apps commented May 12, 2016

  • Maybe we could move the screenshotpopup module into jarabe.view. I don't want to clutter the root jarabe namespace.

Also, please add the screenshpotpopup directory to the parent's Makefile.am's SUBDIRS.

@samdroid-apps
Copy link
Contributor

Also also add the new directory to configure.ac

@iamutkarshtiwari
Copy link
Contributor Author

iamutkarshtiwari commented May 12, 2016

@samdroid-apps I'll do as directed but I need your little help with this patch. Whenever I press the +<1> key combination more than once, more than one popup gets generated over one another.

Whereas what I expect is that it should generate only one popup even if the user presses the key combination more than once.

@samdroid-apps
Copy link
Contributor

Yes, only one of these popups should be shown at a time. You might be interested in sharing this logic between the screenshot and settings popups.

Visually, I think it has regressed. The toolbar buttons were more consistent than using the traditional buttons as you do now.

Additionally, you did not fix any issues that @quozl posted in: #675 (comment)

You may be interested in @AbrahmAB's patch to move most of the modal popup logic into a common base class. You should co-ordinate. I don't want any new modal popups that do more of this copy paste code reuse.

Module is now inherited from sugar3.graphics.popwindow
Thumbnail size fixed according to the aspect ratio.
@iamutkarshtiwari
Copy link
Contributor Author

@samdroid-apps Module rewritten using Abhijit's popup module.

@@ -0,0 +1,342 @@
#!/usr/bin/env python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this to jarabe.gui.screenshotpanel or something? Having a whole folder for 1 file is unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do it but before that we need to patch that grey rectangle bug.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is blocking me from testing :)

Panel file now moved to jarabe/
@iamutkarshtiwari
Copy link
Contributor Author

iamutkarshtiwari commented Jun 17, 2016

@samdroid-apps Issue resolved ;) 👍

desktop-animation

@devAbnull
Copy link
Contributor

devAbnull commented Jun 17, 2016

Unwelcome effect: After taking Screenshot of Control Panel and while typing in the text entry of the pop-up, the search_entry of Control Panel toolbar steals the focus!
The user needs to close the Control Panel to write in the text-entry of the pop-up.

@samdroid-apps
Copy link
Contributor

Looks so good. Here is my feedback:

  • Sorry for my miscommunication. I intended to say jarabe.view.screenshotpopup, not jarabe.gui.
  • Instead of having the yes/no buttons, can you just add a tick ("Save Screenshot") button to the toolbar?
  • Then entry is very short. Can you put it above the screenshot, with the label to the left of the entry. Like:

    | Save Screenshot         [Save] [X] |
    |-----------------------------------|
    | Title:  |Screenshot Of XYZ......|  |
    | .________________________________. |
    | |THUMBNAIL                       | |
    | |                                | |
    | |                                | |
    | |________________________________| |
  • The thumbnail seems static for me. I took a screenshot of the home view, and got the right thumbnail. Then I opened Log, took a screenshot and I got the same homeview thumbnail. It saved the correct screenshot though.
  • I can reproduce Abhijit's issue with the settings popup
  • The thumbnail looks squashed on my laptop. My screen is a 16:9 aspect ratio, not 4:3. It would be interesting to fix it.

del jobject


def generate_thumbnail(screenshot_surface):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is coppied from somewhere right (which is fine)?

If so, can you delete it in the other place? I don't want to have 2 identical generate_thumbnail functions lying around the codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This function is a modified version of the original generate_thumbnail() so the code is unique in itself.

@iamutkarshtiwari
Copy link
Contributor Author

iamutkarshtiwari commented Aug 20, 2016

@samdroid-apps Is there any way to fix that deadlock of this popup with Settings windows? I am eager on improving this PR. I'll rework the UI as you suggested.

@quozl
Copy link
Contributor

quozl commented Nov 9, 2016

@iamutkarshtiwari, any news on this one?

@iamutkarshtiwari
Copy link
Contributor Author

@quozl There were some UI changes proposed by Sam which I haven't looked into yet (been busy with other projects) but will soon get back to it.

@i5o
Copy link
Contributor

i5o commented Nov 15, 2016

@iamutkarshtiwari if you need help let me know.

We can also make a GCI Task for this feature.

@iamutkarshtiwari
Copy link
Contributor Author

@i5o I would really love to get this PR fixed. Sure, we can make a GCI task for this feature.

Things to be done-

  1. Changes to be made as suggested by Screenshot popup alert #675 (comment)
  2. This popup seems to get deadlocked by 'settings' popup - Screenshot popup alert #675 (comment). We can get this fixed as well.

Let me know if you need more info.

@quozl
Copy link
Contributor

quozl commented Nov 15, 2016

Handing an incomplete pull request to a student for GCI seems unfair to me. Huge complexity to deal with. I'm fine with you finishing up your work and merging it. 😄

@iamutkarshtiwari
Copy link
Contributor Author

@quozl @tony37 Give me some time, I'll patch this one soon.

@quozl
Copy link
Contributor

quozl commented Apr 25, 2017

Thanks. Also please list what was changed from feedback.

@jamessandy
Copy link

@iamutkarshtiwari they is a way of fixing the deadlock

@iamutkarshtiwari
Copy link
Contributor Author

@jamessandy Thanks for your interest in this PR. Your suggestions are welcome :)

@jamessandy
Copy link

Lets begin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants