Skip to content

Commit

Permalink
Screenshot popup alert
Browse files Browse the repository at this point in the history
This feature adds a screenshot alert to Sugar.
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.
This feature solves the above problem.
  • Loading branch information
iamutkarshtiwari committed Apr 7, 2016
1 parent 0056589 commit dc8f759
Show file tree
Hide file tree
Showing 7 changed files with 462 additions and 5 deletions.
4 changes: 2 additions & 2 deletions extensions/deviceicon/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

from jarabe.frame.frameinvoker import FrameWidgetInvoker
from jarabe.model import brightness
from jarabe.model.screenshot import take_screenshot
from jarabe.screenshotpanel.gui import ScreenshotPanel
from jarabe import frame


Expand Down Expand Up @@ -230,7 +230,7 @@ def __screenshot_cb(self, palette):
def __take_screenshot_cb(self, frame_):
if frame_.is_visible():
return True
take_screenshot()
panel = ScreenshotPanel()
frame_.show()
return False

Expand Down
4 changes: 2 additions & 2 deletions extensions/globalkey/screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

from jarabe.model.screenshot import take_screenshot
from jarabe.screenshotpanel.gui import ScreenshotPanel

BOUND_KEYS = ['<alt>1', 'Print']


def handle_key_press(key):
take_screenshot()
panel = ScreenshotPanel()
3 changes: 2 additions & 1 deletion src/jarabe/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
SUBDIRS = \
controlpanel \
controlpanel \
desktop \
frame \
journal \
model \
screenshotpanel \
view \
intro \
util \
Expand Down
5 changes: 5 additions & 0 deletions src/jarabe/screenshotpanel/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sugardir = $(pythondir)/jarabe/screenshotpanel
sugar_PYTHON = \
__init__.py \
gui.py \
toolbar.py
20 changes: 20 additions & 0 deletions src/jarabe/screenshotpanel/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Utkarsh Tiwari
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact information:
# Utkarsh Tiwari [email protected]
Loading

0 comments on commit dc8f759

Please sign in to comment.