Cherry-picking upstream version 1.95+20150907.

Added .gitignore
Added watch file
Added lintian-overrides
Added debug package
Fixed copyright
ubuntu/disco
Alf Gaida 9 years ago
parent 2b74a82f85
commit 40607fae55

3
.gitignore vendored

@ -1,3 +0,0 @@
build/
*.qm
*.kdev4

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
# set project's name
project(screengrab)
@ -20,6 +20,24 @@ set(CMAKE_AUTOUIC ON)
include(GNUInstallDirs)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(X11)
if (X11_FOUND)
set(HAVE_X11 1)
endif(X11_FOUND)
# set up xcb and x11_xcb
find_package(
XCB MODULE COMPONENTS
XCB
SHAPE
XFIXES
)
find_package(
X11_XCB MODULE
)
# add version define
set(SCREENGRAB_VERSION "1.95")
set(SCREENGRAB_VERSION_DEV "2.0-beta1")
@ -65,6 +83,7 @@ message(STATUS "Library path: ${CMAKE_INSTALL_RPATH}")
option(SG_GLOBALSHORTCUTS "Enable global shortcuts" OFF)
option(SG_EXT_UPLOADS "Enable upload screenshots to MediaCrush and imgur" ON)
option(SG_EXT_EDIT "Enable ability to edit screenshots in external editor" ON)
option(SG_DBUS_NOTIFY "Enable D-Bus notifications" ON)
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
# Although the names, LXQtTranslateTs and LXQtTranslateDesktop, they don't
@ -90,12 +109,17 @@ endif()
if(SG_EXT_EDIT)
add_definitions( -DSG_EXT_EDIT="1")
find_package(Qt5Xdg REQUIRED)
include(${QTXDG_USE_FILE})
endif()
if(SG_DBUS_NOTIFY)
find_package(Qt5DBus 5.2 REQUIRED)
add_definitions( -DSG_DBUS_NOTIFY="1")
endif()
message(STATUS "Global shortcuts support: " ${SG_GLOBALSHORTCUTS})
message(STATUS "Upload to MediaCrush and imgur support: " ${SG_EXT_UPLOADS})
message(STATUS "Editing screenshots in external editor support: " ${SG_EXT_EDIT})
message(STATUS "Enable D-Bus notifications: " ${SG_DBUS_NOTIFY})
message(STATUS "Use system Qxt Library: " ${SG_USE_SYSTEM_QXT})
message(STATUS "Update source translation translations/*.ts files: " ${UPDATE_TRANSLATIONS})
@ -104,6 +128,9 @@ message(STATUS "Update source translation translations/*.ts files: " ${UPDATE_TR
message(STATUS "Documentation directory: " ${CMAKE_INSTALL_FULL_DOCDIR})
add_definitions(-DSG_DOCDIR="${CMAKE_INSTALL_FULL_DOCDIR}")
# app icon path
add_definitions(-DSG_ICONPATH="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/pixmaps/screengrab.png")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/src/common/qkeysequencewidget")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/common/qkeysequencewidget/src")
@ -128,9 +155,17 @@ set(SCREENGRAB_SRC
src/core/modulemanager.cpp
src/core/ui/configwidget.cpp
src/core/ui/about.cpp
src/core/ui/mainwindow.cpp
src/core/ui/mainwindow.cpp
)
if(SG_DBUS_NOTIFY)
set(SCREENGRAB_SRC ${SCREENGRAB_SRC} src/core/dbusnotifier.cpp)
endif()
if(X11_FOUND)
set(SCREENGRAB_SRC ${SCREENGRAB_SRC} src/core/x11utils.cpp)
endif()
set(SCREENGRAB_HDR
src/core/singleapp.h
)
@ -195,8 +230,31 @@ if(SG_EXT_EDIT)
target_link_libraries(screengrab extedit)
endif()
target_link_libraries(screengrab qkeysequencewidget Qt5::Widgets KF5::WindowSystem)
if(SG_DBUS_NOTIFY)
target_link_libraries(screengrab Qt5::DBus)
endif()
if (X11_XCB_FOUND)
add_definitions( -DX11_XCB_FOUND="1")
target_link_libraries(screengrab ${X11_XCB_LIBRARIES})
endif()
if (XCB_XCB_FOUND)
add_definitions( -DXCB_XCB_FOUND="1")
target_link_libraries(screengrab ${XCB_XCB_LIBRARY})
endif()
if (XCB_SHAPE_FOUND)
add_definitions( -DXCB_SHAPE_FOUND="1")
target_link_libraries(screengrab ${XCB_SHAPE_LIBRARY})
endif()
if (XCB_XFIXES_FOUND)
add_definitions( -DXCB_XFOXES_FOUND="1")
target_link_libraries(screengrab ${XCB_XFIXES_LIBRARY})
endif()
target_link_libraries(screengrab qkeysequencewidget Qt5::Widgets KF5::WindowSystem ${X11_LIBRARIES})
# make src.tar.gz
add_custom_target(dist @echo create source package)
@ -226,4 +284,4 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/docs/html" DESTINATION "${CMAKE_I
# install desktop files
install(FILES ${SCREENGRAB_DESKTOP_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
# install pixmap
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/img/screengrab.png" DESTINATION ${CMAKE_INSTALL_DATADIR}/pixmaps)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/img/screengrab.png" DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps")

@ -32,6 +32,7 @@ You can use some or all of these parameters to customise your build.
* **-DCMAKE_INSTALL_PREFIX** - Install prefix for Linux distro. Default setting: "/usr".
* **-DSG_XDG_CONFIG_SUPPORT** - Place config files into XDGC_CONFIG_HOME directory (usually - ~/.config/${app_name) ). Default setting: ON. In previous versions the config files were stored in ~/.screengrab (Set this parameter to "OFF" to store the config files here).
* **-DSG_EXT_UPLOADS** - Enable uploading screenshots to image hosting services. Default setting: ON.
* **-DSG_DBUS_NOTIFY** - Enable D-Bus notifications.
* **-DSG_GLOBALSHORTCUTS** - Enable global shortcuts for main actions to create screenshots. Default setting: ON.
* **-DSG_USE_SYSTEM_QXT** - Use system version Qxt Library for global shortcuts. Default setting: OFF.
* **-DSG_DOCDIR** - Name for the directory of user's documentation. Default setting: "screengrab".

@ -0,0 +1,31 @@
# - Try to find libX11-xcb
# Once done this will define
#
# X11_XCB_FOUND - system has libX11-xcb
# X11_XCB_LIBRARIES - Link these to use libX11-xcb
# X11_XCB_INCLUDE_DIR - the libX11-xcb include dir
# X11_XCB_DEFINITIONS - compiler switches required for using libX11-xcb
# Copyright (c) 2011 Fredrik Höglund <fredrik@kde.org>
# Copyright (c) 2008 Helio Chissini de Castro, <helio@kde.org>
# Copyright (c) 2007 Matthias Kretz, <kretz@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
IF (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PKG_X11_XCB QUIET x11-xcb)
SET(X11_XCB_DEFINITIONS ${PKG_X11_XCB_CFLAGS})
FIND_PATH(X11_XCB_INCLUDE_DIR NAMES X11/Xlib-xcb.h HINTS ${PKG_X11_XCB_INCLUDE_DIRS})
FIND_LIBRARY(X11_XCB_LIBRARIES NAMES X11-xcb HINTS ${PKG_X11_XCB_LIBRARY_DIRS})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(X11_XCB DEFAULT_MSG X11_XCB_LIBRARIES X11_XCB_INCLUDE_DIR)
MARK_AS_ADVANCED(X11_XCB_INCLUDE_DIR X11_XCB_LIBRARIES)
ENDIF (NOT WIN32)

@ -0,0 +1,238 @@
# Try to find XCB on a Unix system
#
# This will define:
#
# XCB_FOUND - True if xcb is available
# XCB_LIBRARIES - Link these to use xcb
# XCB_INCLUDE_DIRS - Include directory for xcb
# XCB_DEFINITIONS - Compiler flags for using xcb
#
# In addition the following more fine grained variables will be defined:
#
# XCB_XCB_FOUND XCB_XCB_INCLUDE_DIR XCB_XCB_LIBRARY
# XCB_UTIL_FOUND XCB_UTIL_INCLUDE_DIR XCB_UTIL_LIBRARY
# XCB_COMPOSITE_FOUND XCB_COMPOSITE_INCLUDE_DIR XCB_COMPOSITE_LIBRARY
# XCB_DAMAGE_FOUND XCB_DAMAGE_INCLUDE_DIR XCB_DAMAGE_LIBRARY
# XCB_XFIXES_FOUND XCB_XFIXES_INCLUDE_DIR XCB_XFIXES_LIBRARY
# XCB_RENDER_FOUND XCB_RENDER_INCLUDE_DIR XCB_RENDER_LIBRARY
# XCB_RANDR_FOUND XCB_RANDR_INCLUDE_DIR XCB_RANDR_LIBRARY
# XCB_SHAPE_FOUND XCB_SHAPE_INCLUDE_DIR XCB_SHAPE_LIBRARY
# XCB_DRI2_FOUND XCB_DRI2_INCLUDE_DIR XCB_DRI2_LIBRARY
# XCB_GLX_FOUND XCB_GLX_INCLUDE_DIR XCB_GLX_LIBRARY
# XCB_SHM_FOUND XCB_SHM_INCLUDE_DIR XCB_SHM_LIBRARY
# XCB_XV_FOUND XCB_XV_INCLUDE_DIR XCB_XV_LIBRARY
# XCB_SYNC_FOUND XCB_SYNC_INCLUDE_DIR XCB_SYNC_LIBRARY
# XCB_XTEST_FOUND XCB_XTEST_INCLUDE_DIR XCB_XTEST_LIBRARY
# XCB_ICCCM_FOUND XCB_ICCCM_INCLUDE_DIR XCB_ICCCM_LIBRARY
# XCB_EWMH_FOUND XCB_EWMH_INCLUDE_DIR XCB_EWMH_LIBRARY
# XCB_IMAGE_FOUND XCB_IMAGE_INCLUDE_DIR XCB_IMAGE_LIBRARY
# XCB_RENDERUTIL_FOUND XCB_RENDERUTIL_INCLUDE_DIR XCB_RENDERUTIL_LIBRARY
# XCB_KEYSYMS_FOUND XCB_KEYSYMS_INCLUDE_DIR XCB_KEYSYMS_LIBRARY
#
# Copyright (c) 2011 Fredrik Höglund <fredrik@kde.org>
# Copyright (c) 2013 Martin Gräßlin <mgraesslin@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
set(knownComponents XCB
COMPOSITE
DAMAGE
DRI2
EWMH
GLX
ICCCM
IMAGE
KEYSYMS
RANDR
RENDER
RENDERUTIL
SHAPE
SHM
SYNC
UTIL
XFIXES
XTEST
XV)
unset(unknownComponents)
set(pkgConfigModules)
set(requiredComponents)
if (XCB_FIND_COMPONENTS)
set(comps ${XCB_FIND_COMPONENTS})
else()
set(comps ${knownComponents})
endif()
# iterate through the list of requested components, and check that we know them all.
# If not, fail.
foreach(comp ${comps})
list(FIND knownComponents ${comp} index )
if("${index}" STREQUAL "-1")
list(APPEND unknownComponents "${comp}")
else()
if("${comp}" STREQUAL "XCB")
list(APPEND pkgConfigModules "xcb")
elseif("${comp}" STREQUAL "COMPOSITE")
list(APPEND pkgConfigModules "xcb-composite")
elseif("${comp}" STREQUAL "DAMAGE")
list(APPEND pkgConfigModules "xcb-damage")
elseif("${comp}" STREQUAL "DRI2")
list(APPEND pkgConfigModules "xcb-dri2")
elseif("${comp}" STREQUAL "EWMH")
list(APPEND pkgConfigModules "xcb-ewmh")
elseif("${comp}" STREQUAL "GLX")
list(APPEND pkgConfigModules "xcb-glx")
elseif("${comp}" STREQUAL "ICCCM")
list(APPEND pkgConfigModules "xcb-icccm")
elseif("${comp}" STREQUAL "IMAGE")
list(APPEND pkgConfigModules "xcb-image")
elseif("${comp}" STREQUAL "KEYSYMS")
list(APPEND pkgConfigModules "xcb-keysyms")
elseif("${comp}" STREQUAL "RANDR")
list(APPEND pkgConfigModules "xcb-randr")
elseif("${comp}" STREQUAL "RENDER")
list(APPEND pkgConfigModules "xcb-render")
elseif("${comp}" STREQUAL "RENDERUTIL")
list(APPEND pkgConfigModules "xcb-renderutil")
elseif("${comp}" STREQUAL "SHAPE")
list(APPEND pkgConfigModules "xcb-shape")
elseif("${comp}" STREQUAL "SHM")
list(APPEND pkgConfigModules "xcb-shm")
elseif("${comp}" STREQUAL "SYNC")
list(APPEND pkgConfigModules "xcb-sync")
elseif("${comp}" STREQUAL "UTIL")
list(APPEND pkgConfigModules "xcb-util")
elseif("${comp}" STREQUAL "XFIXES")
list(APPEND pkgConfigModules "xcb-xfixes")
elseif("${comp}" STREQUAL "XTEST")
list(APPEND pkgConfigModules "xcb-xtest")
elseif("${comp}" STREQUAL "XV")
list(APPEND pkgConfigModules "xcb-xv")
endif()
endif()
endforeach()
if(DEFINED unknownComponents)
set(msgType STATUS)
if(XCB_FIND_REQUIRED)
set(msgType FATAL_ERROR)
endif()
if(NOT XCB_FIND_QUIETLY)
message(${msgType} "XCB: requested unknown components ${unknownComponents}")
endif()
return()
endif()
macro(_XCB_HANDLE_COMPONENT _comp)
set(_header )
set(_lib )
if("${_comp}" STREQUAL "XCB")
set(_header "xcb/xcb.h")
set(_lib "xcb")
elseif("${_comp}" STREQUAL "COMPOSITE")
set(_header "xcb/composite.h")
set(_lib "xcb-composite")
elseif("${_comp}" STREQUAL "DAMAGE")
set(_header "xcb/damage.h")
set(_lib "xcb-damage")
elseif("${_comp}" STREQUAL "DRI2")
set(_header "xcb/dri2.h")
set(_lib "xcb-dri2")
elseif("${_comp}" STREQUAL "EWMH")
set(_header "xcb/xcb_ewmh.h")
set(_lib "xcb-ewmh")
elseif("${_comp}" STREQUAL "GLX")
set(_header "xcb/glx.h")
set(_lib "xcb-glx")
elseif("${_comp}" STREQUAL "ICCCM")
set(_header "xcb/xcb_icccm.h")
set(_lib "xcb-icccm")
elseif("${_comp}" STREQUAL "IMAGE")
set(_header "xcb/xcb_image.h")
set(_lib "xcb-image")
elseif("${_comp}" STREQUAL "KEYSYMS")
set(_header "xcb/xcb_keysyms.h")
set(_lib "xcb-keysyms")
elseif("${_comp}" STREQUAL "RANDR")
set(_header "xcb/randr.h")
set(_lib "xcb-randr")
elseif("${_comp}" STREQUAL "RENDER")
set(_header "xcb/render.h")
set(_lib "xcb-render")
elseif("${_comp}" STREQUAL "RENDERUTIL")
set(_header "xcb/xcb_renderutil.h")
set(_lib "xcb-render-util")
elseif("${_comp}" STREQUAL "SHAPE")
set(_header "xcb/shape.h")
set(_lib "xcb-shape")
elseif("${_comp}" STREQUAL "SHM")
set(_header "xcb/shm.h")
set(_lib "xcb-shm")
elseif("${_comp}" STREQUAL "SYNC")
set(_header "xcb/sync.h")
set(_lib "xcb-sync")
elseif("${_comp}" STREQUAL "UTIL")
set(_header "xcb/xcb_util.h")
set(_lib "xcb-util")
elseif("${_comp}" STREQUAL "XFIXES")
set(_header "xcb/xfixes.h")
set(_lib "xcb-xfixes")
elseif("${_comp}" STREQUAL "XTEST")
set(_header "xcb/xtest.h")
set(_lib "xcb-xtest")
elseif("${_comp}" STREQUAL "XV")
set(_header "xcb/xv.h")
set(_lib "xcb-xv")
endif()
find_path(XCB_${_comp}_INCLUDE_DIR NAMES ${_header} HINTS ${PKG_XCB_INCLUDE_DIRS})
find_library(XCB_${_comp}_LIBRARY NAMES ${_lib} HINTS ${PKG_XCB_LIBRARY_DIRS})
if(XCB_${_comp}_INCLUDE_DIR AND XCB_${_comp}_LIBRARY)
list(APPEND XCB_INCLUDE_DIRS ${XCB_${_comp}_INCLUDE_DIR})
list(APPEND XCB_LIBRARIES ${XCB_${_comp}_LIBRARY})
if (NOT XCB_FIND_QUIETLY)
message(STATUS "XCB[${_comp}]: Found component ${_comp}")
endif()
endif()
if(XCB_FIND_REQUIRED_${_comp})
list(APPEND requiredComponents XCB_${_comp}_FOUND)
endif()
find_package_handle_standard_args(XCB_${_comp} DEFAULT_MSG XCB_${_comp}_LIBRARY XCB_${_comp}_INCLUDE_DIR)
mark_as_advanced(XCB_${_comp}_LIBRARY XCB_${_comp}_INCLUDE_DIR)
# compatibility for old variable naming
set(XCB_${_comp}_INCLUDE_DIRS ${XCB_${_comp}_INCLUDE_DIR})
set(XCB_${_comp}_LIBRARIES ${XCB_${_comp}_LIBRARY})
endmacro()
IF (NOT WIN32)
include(FindPackageHandleStandardArgs)
# Use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
pkg_check_modules(PKG_XCB QUIET ${pkgConfigModules})
set(XCB_DEFINITIONS ${PKG_XCB_CFLAGS})
foreach(comp ${comps})
_xcb_handle_component(${comp})
endforeach()
if(XCB_INCLUDE_DIRS)
list(REMOVE_DUPLICATES XCB_INCLUDE_DIRS)
endif()
find_package_handle_standard_args(XCB DEFAULT_MSG XCB_LIBRARIES XCB_INCLUDE_DIRS ${requiredComponents})
# compatibility for old variable naming
set(XCB_INCLUDE_DIR ${XCB_INCLUDE_DIRS})
ENDIF (NOT WIN32)

6
debian/.gitignore vendored

@ -0,0 +1,6 @@
/files
/*.log
/*.substvars
/screengrab-dbg/
/screengrab/

6
debian/changelog vendored

@ -1,5 +1,5 @@
screengrab (1.95pr1-1) unstable; urgency=low
screengrab (1.95+20150907-1) unstable; urgency=medium
* Initial packaging
* Initial packaging (Closes: #795791)
-- Alf Gaida <agaida@siduction.org> Fri, 21 Nov 2014 21:45:06 +0100
-- Alf Gaida <agaida@siduction.org> Mon, 07 Sep 2015 23:00:38 +0200

23
debian/control vendored

@ -25,5 +25,24 @@ Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends}
Description: Crossplatform tool for getting screenshots
Screengrab working in Linux and Windows. The program uses Qt and is independent
of any desktop environment.
Screengrab working in Linux and Windows. The program uses Qt and is
independent of any desktop environment.
Main features:
* Get desktop screenshots
* Get active window screenshots
* Get secreenshots of desktop selection area
* Copy screenshot to clipboard
* Saving your image files in formats PNG or JPEG or BMP
* Ability to set delay in getting screenshots (from 1 to 90 seconds)
Package: screengrab-dbg
Architecture: any
Section: debug
Priority: extra
Depends: ${misc:Depends},
screengrab,
Description: Crossplatform tool for getting screenshots (debug)
Screengrab working in Linux and Windows. The program uses Qt and is
independent of any desktop environment.
.
This package contain the debugging symbols for screengrab.

4
debian/copyright vendored

@ -11,7 +11,7 @@ Copyright: 2012-2015 Alf Gaida <agaida@siduction.org>
2010-2013 Artem Galichkin <doomer3d@gmail.com>
License: GPL-2.0+
Files: qkeysequencewidget/*
Files: src/common/qkeysequencewidget/*
Copyright: 2010 Artem Galichkin <doomer3d@gmail.com>
License: BSD-3-Clause
@ -55,4 +55,4 @@ License: BSD-3-Clause
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@ -0,0 +1,6 @@
# there will be no manpage in a foreseeable future
screengrab: binary-without-manpage usr/bin/screengrab
# the contained html documents are shown with the help button
screengrab: possible-documentation-but-no-doc-base-registration

8
debian/rules vendored

@ -1,6 +1,8 @@
#!/usr/bin/make -f
#export DH_VERBOSE=1
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@ --buildsystem=cmake --parallel
@ -8,8 +10,12 @@ override_dh_auto_install:
dh_auto_install -- DESTDIR=$(CURDIR)/debian/screengrab
override_dh_install:
rm -f debian/screengrab/usr/share/doc/screengrab/LICENSE.txt
rm -f $(currdir)/debian/screengrab/usr/share/doc/screengrab/LICENSE.txt
dh_install
override_dh_strip:
dh_strip --dbg-package screengrab-dbg
override_dh_makeshlibs:
# do nothing

2
debian/watch vendored

@ -0,0 +1,2 @@
version=3
https://github.com/QtDesktop/screengrab/releases .*/(.*)\.tar\.gz

@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 2.8.11)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${Qt5Widgets_INCLUDE_DIRS})

@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "src/core/config.h"
@ -56,6 +54,7 @@
#define KEY_TYPE_SCREEN "typeScreenDefault"
#define KEY_ENABLE_EXT_VIEWER "enbaleExternalView"
#define KEY_NODECOR "noDecorations"
#define KEY_INCLUDE_CURSOR "includeCursor"
Config* Config::ptrInstance = 0;
@ -183,6 +182,16 @@ void Config::setEnableExtView(bool val)
setValue(KEY_ENABLE_EXT_VIEWER, val);
}
bool Config::getIncludeCursor()
{
return value(KEY_INCLUDE_CURSOR).toBool();
}
void Config::setIncludeCursor(bool val)
{
setValue(KEY_INCLUDE_CURSOR, val);
}
QString Config::getSaveDir()
{
return value(KEY_SAVEDIR).toString();
@ -410,6 +419,7 @@ void Config::loadSettings()
setAutoSaveFirst(_settings->value(KEY_AUTOSAVE_FIRST, DEF_AUTO_SAVE_FIRST).toBool());
setNoDecoration(_settings->value(KEY_NODECOR, DEF_X11_NODECOR).toBool());
setImageQuality(_settings->value(KEY_IMG_QUALITY, DEF_IMG_QUALITY).toInt());
setIncludeCursor(_settings->value(KEY_INCLUDE_CURSOR, DEF_INCLUDE_CURSOR).toBool());
_settings->endGroup();
_settings->beginGroup("Display");
@ -447,6 +457,7 @@ void Config::saveSettings()
_settings->setValue(KEY_AUTOSAVE_FIRST, getAutoSaveFirst());
_settings->setValue(KEY_IMG_QUALITY, getImageQuality());
_settings->setValue(KEY_NODECOR, getNoDecoration());
_settings->setValue(KEY_INCLUDE_CURSOR, getIncludeCursor());
_settings->endGroup();
_settings->beginGroup("Display");
@ -482,6 +493,7 @@ void Config::setDefaultSettings()
setAutoSave(DEF_AUTO_SAVE);
setAutoSaveFirst(DEF_AUTO_SAVE_FIRST);
setTrayMessages(DEF_TRAY_MESS_TYPE);
setIncludeCursor(DEF_INCLUDE_CURSOR);
setZoomAroundMouse(DEF_ZOOM_AROUND_MOUSE);
setCloseInTray(DEF_CLOSE_IN_TRAY);
setTimeTrayMess(DEF_TIME_TRAY_MESS);

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef CONFIG_H
@ -50,7 +48,8 @@ const bool DEF_AUTO_SAVE = false;
const bool DEF_AUTO_SAVE_FIRST = false;
const QString DEF_DATETIME_TPL = "yyyy-MM-dd-hh-mm-ss";
const bool DEF_SHOW_TRAY = true;
const bool DEF_ENABLE_EXT_VIEWER = 1;
const bool DEF_ENABLE_EXT_VIEWER = true;
const bool DEF_INCLUDE_CURSOR = false;
// class worker with conf data
class Config
@ -219,6 +218,9 @@ public:
bool getEnableExtView();
void setEnableExtView(bool val);
bool getIncludeCursor();
void setIncludeCursor(bool val);
static QString getSysLang();
ShortcutManager* shortcuts();

@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <QMutex>
@ -31,8 +29,18 @@
#include <QDebug>
#include "core/core.h"
#include <KF5/KWindowSystem/KWindowSystem>
#include <xcb/xfixes.h>
#ifdef X11_XCB_FOUND
#include "x11utils.h"
#endif
#include "core/core.h"
#ifdef SG_DBUS_NOTIFY
#include "dbusnotifier.h"
#endif
#ifdef SG_EXT_UPLOADS
#include "modules/uploader/moduleuploader.h"
@ -183,6 +191,7 @@ void Core::screenShot(bool first)
const QDesktopWidget *desktop = QApplication::desktop();
const int screenNum = desktop->screenNumber(QCursor::pos());
*_pixelMap = screens[screenNum]->grabWindow(desktop->winId());
grabCursor(0, 0);
checkAutoSave(first);
_wnd->updatePixmap(_pixelMap);
@ -212,6 +221,8 @@ void Core::screenShot(bool first)
break;
}
_wnd->updatePixmap(_pixelMap);
_wnd->restoreFromShot();
}
@ -234,7 +245,7 @@ void Core::checkAutoSave(bool first)
if (!first)
{
StateNotifyMessage message(tr("New screen"), tr("New screen is getted!"));
_wnd->showTrayMessage(message.header, message.message);
sendNotify(message);
}
}
}
@ -270,7 +281,26 @@ void Core::getActiveWindow()
geometry.x(),
geometry.y(),
geometry.width(),
geometry.height());
geometry.height());
grabCursor(geometry.x(), geometry.y());
}
void Core::grabCursor(int offsetX, int offsetY)
{
#ifdef XCB_XFOXES_FOUND
if (_conf->getIncludeCursor())
X11Utils::compositePointer(offsetX, offsetY, _pixelMap);
#else
Q_UNUSED(offsetx);
Q_UNUSED(offsety);
#endif
}
void Core::sendSystemNotify(const StateNotifyMessage &notify)
{
qDebug() << "Send system notification";
}
QString Core::getSaveFilePath(QString format)
@ -377,7 +407,7 @@ bool Core::writeScreen(QString& fileName, QString& format, bool tmpScreen)
message.message = message.message + copyFileNameToCliipboard(fileName);
_conf->updateLastSaveDate();
_wnd->showTrayMessage(message.header, message.message);
sendNotify(message);
}
else
qWarning() << "Error saving file " << fileName;
@ -410,11 +440,21 @@ QString Core::copyFileNameToCliipboard(QString file)
return retString;
}
void Core::sendNotify(const StateNotifyMessage &message)
{
#ifdef SG_DBUS_NOTIFY
DBusNotifier *notifier = new DBusNotifier();
notifier->displayNotify(message);
#else
_wnd->showTrayMessage(message.header, message.message);
#endif
}
void Core::copyScreen()
{
QApplication::clipboard()->setPixmap(*_pixelMap, QClipboard::Clipboard);
StateNotifyMessage message(tr("Copied"), tr("Screenshot is copied to clipboard"));
_wnd->showTrayMessage(message.header, message.message);
sendNotify(message);
}
void Core::openInExtViewer()
@ -519,7 +559,7 @@ QPixmap* Core::getPixmap()
return _pixelMap;
}
QByteArray Core::getScreen()
QByteArray Core::getScreenData()
{
QByteArray bytes;
QBuffer buffer(&bytes);

@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef SCREENGRAB_H
#define SCREENGRAB_H
@ -26,7 +24,6 @@
#include "config.h"
#include "regionselect.h"
#include "modulemanager.h"
#include "ui/mainwindow.h"
@ -84,7 +81,7 @@ public:
static QString getVersionPrintable();
QPixmap* getPixmap();
QByteArray getScreen();
QByteArray getScreenData();
void updatePixmap();
QString getTempFilename(const QString& format);
@ -115,9 +112,12 @@ private:
void checkAutoSave(bool first = false);
void getActiveWindow();
void grabCursor(int offsetX, int offsetY);
void sendSystemNotify(const StateNotifyMessage& notify);
bool checkExsistFile(QString path);
QString copyFileNameToCliipboard(QString file);
void sendNotify(const StateNotifyMessage& message);
QPixmap *_pixelMap; // pixel map
RegionSelect *_selector; // region grabber widget
QRect _lastSelectedArea;

@ -0,0 +1,106 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* 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 2 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/>. *
***************************************************************************/
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QDBusInterface>
#include <QDir>
#include <QTimer>
#include <QDebug>
#include "dbusnotifier.h"
#include "config.h"
#define SERVICE_FREEDESKTOP "org.freedesktop.Notifications"
#define PATH_FREEDESKTOP "/org/freedesktop/Notifications" ,"org.freedesktop.Notifications"
#define CACHE_DIR "notify-cache"
#define CACHE_PREV "preview.jpg"
DBusNotifier::DBusNotifier(QObject *parent) : QObject(parent)
{
_notifier = new QDBusInterface(SERVICE_FREEDESKTOP, PATH_FREEDESKTOP,
QDBusConnection::sessionBus(), this);
if (_notifier->lastError().type() != QDBusError::NoError) {
qWarning() << "Notify: Unable to create interface.";
return;
}
qWarning() << "Notify: DBus interfece created successfully.";
QDir dir(Config::getConfigDir());
if (!dir.exists(CACHE_DIR))
dir.mkdir(CACHE_DIR);
_previewPath = dir.absolutePath() + QDir::toNativeSeparators(QDir::separator()) + CACHE_PREV;
_appIconPath = QString(SG_ICONPATH);
_notifyDuration = Config::instance()->getTimeTrayMess() * 1000;
}
DBusNotifier::~DBusNotifier()
{
if (!_previewPath.isEmpty()) {
QDir dir(QDir::home());
dir.remove(_previewPath);
}
}
void DBusNotifier::displayNotify(const StateNotifyMessage &message)
{
QList<QVariant> n = prepareNotification(message);
if (!n.isEmpty()) {
QDBusReply<uint> reply = _notifier->callWithArgumentList(QDBus::Block,"Notify",n);
}
deleteLater();
}
QList<QVariant> DBusNotifier::prepareNotification(const StateNotifyMessage& message)
{
QList<QVariant> args;
args << "Screen Grab";
args << QVariant(QVariant::UInt); // id
// app-icon(path to icon on disk)
args << _appIconPath;
// summary (notification title)
args << message.header;
// message text
args << message.message;
// actions is none
args << QStringList();
// hints
args << QVariantMap();
// timeout
args << _notifyDuration;
return args;
}

@ -0,0 +1,46 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* 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 2 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/>. *
***************************************************************************/
#ifndef DBUSNOTIFIER_H
#define DBUSNOTIFIER_H
#include <QObject>
#include "core.h"
class QDBusInterface;
class DBusNotifier : public QObject
{
Q_OBJECT
public:
explicit DBusNotifier(QObject *parent = 0);
~DBusNotifier();
void displayNotify(const StateNotifyMessage& message);
private:
QList<QVariant> prepareNotification(const StateNotifyMessage& message);
QDBusInterface *_notifier;
int _notifyDuration;
QString _appIconPath;
QString _previewPath;
};
#endif // DBUSNOTIFIER_H

@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "singleapp.h"

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "modulemanager.h"

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef MODULEMANAGER_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "src/core/regionselect.h"

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef REGIONSELECT_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "shortcutmanager.h"

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef SHORTCUTMANAGER_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2010 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2010 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <QTimer>

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2010 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2010 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef SINGLEAPP_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "about.h"

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef ABOUT_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,10 +13,8 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <QKeyEvent>
@ -167,8 +165,8 @@ void ConfigDialog::loadSettings()
_ui->checkAutoSave->setChecked(conf->getAutoSave());;
_ui->checkAutoSaveFirst->setChecked(conf->getAutoSaveFirst());;
_ui->checkZommMouseArea->setChecked(conf->getZoomAroundMouse());
_ui->cbxIncludeCursor->setChecked(conf->getIncludeCursor());
// integration tab
_ui->checkInTray->setChecked(conf->getCloseInTray());
_ui->checkAllowCopies->setChecked(conf->getAllowMultipleInstance());
@ -261,6 +259,7 @@ void ConfigDialog::saveSettings()
conf->setAutoSaveFirst(_ui->checkAutoSaveFirst->isChecked());
conf->setTrayMessages(_ui->cbxTrayMsg->currentIndex());
conf->setCloseInTray(_ui->checkInTray->isChecked());
conf->setIncludeCursor(_ui->cbxIncludeCursor->isChecked());
conf->setZoomAroundMouse(_ui->checkZommMouseArea->isChecked());
conf->setAllowMultipleInstance(_ui->checkAllowCopies->isChecked());
conf->setTimeTrayMess(_ui->timeTrayMess->value());

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef CONFIGWIDGET_H

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>554</width>
<height>278</height>
<width>634</width>
<height>294</height>
</rect>
</property>
<property name="minimumSize">
@ -106,7 +106,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="page_6">
<layout class="QVBoxLayout" name="verticalLayout_6">
@ -368,6 +368,13 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="cbxIncludeCursor">
<property name="text">
<string>Include mouse pointer</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkZommMouseArea">
<property name="text">

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,10 +13,8 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "mainwindow.h"
#include "ui_mainwindow.h"
@ -96,12 +94,18 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent),
help->setMenu(menuInfo);
_ui->toolBar->addWidget(help);
QWidget* spacer = new QWidget();
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
_ui->toolBar->addWidget(spacer);
_ui->toolBar->addAction(actQuit);
void (QSpinBox::*delayChange)(int) = &QSpinBox::valueChanged;
connect(_ui->delayBox, delayChange, this, &MainWindow::delayBoxChange);
void (QComboBox::*typeScr)(int) = &QComboBox::currentIndexChanged;
connect(_ui->cbxTypeScr, typeScr, this, &MainWindow::typeScreenShotChange);
connect(_ui->checkIncludeCursor, &QCheckBox::toggled, this, &MainWindow::checkIncludeCursor);
QIcon icon(":/res/img/logo.png");
setWindowIcon(icon);
@ -398,11 +402,17 @@ void MainWindow::typeScreenShotChange(int type)
_conf->setTypeScreen(type);
}
void MainWindow::checkIncludeCursor(bool include)
{
_conf->setIncludeCursor(include);
}
// updating UI from configdata
void MainWindow::updateUI()
{
_ui->cbxTypeScr->setCurrentIndex(_conf->getTypeScreen());
_ui->delayBox->setValue(_conf->getDelay());
_ui->checkIncludeCursor->setChecked(_conf->getIncludeCursor());
updateShortcuts();

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef MAINWINDOW_H
@ -106,6 +104,7 @@ private Q_SLOTS:
void showAbout();
void delayBoxChange(int);
void typeScreenShotChange(int type);
void checkIncludeCursor(bool include);
void updateUI();
void trayClick(QSystemTrayIcon::ActivationReason reason);

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>480</width>
<height>299</height>
<height>343</height>
</rect>
</property>
<property name="minimumSize">
@ -30,9 +30,6 @@
<enum>Qt::RightToLeft</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum>
</property>
<item>
<widget class="QLabel" name="scrLabel">
<property name="sizePolicy">
@ -201,6 +198,43 @@
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_3">
<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>
<widget class="QCheckBox" name="checkIncludeCursor">
<property name="text">
<string>Include mouse pointer</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QToolBar" name="toolBar">

@ -0,0 +1,43 @@
/***************************************************************************
* Copyright (C) 2010 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* 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 2 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/>. *
***************************************************************************/
#include "x11utils.h"
#include <xcb/xfixes.h>
#include <QDebug>
#include <QPainter>
void X11Utils::compositePointer(int offsetX, int offsetY, QPixmap *snapshot)
{
Xcb::ScopedCPointer<xcb_xfixes_get_cursor_image_reply_t> cursor(
xcb_xfixes_get_cursor_image_reply(Xcb::connection(),
xcb_xfixes_get_cursor_image_unchecked(Xcb::connection()),
NULL));
if (cursor.isNull()) {
return;
}
QImage qcursorimg((uchar *) xcb_xfixes_get_cursor_image_cursor_image(cursor.data()),
cursor->width, cursor->height,
QImage::Format_ARGB32_Premultiplied);
QPainter painter(snapshot);
painter.drawImage(QPointF(cursor->x - cursor->xhot - offsetX, cursor->y - cursor ->yhot - offsetY), qcursorimg);
}

@ -0,0 +1,50 @@
/***************************************************************************
* Copyright (C) 2010 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* 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 2 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/>. *
***************************************************************************/
#ifndef X11UTILS_H
#define X11UTILS_H
#include <QPixmap>
#include <QScopedPointer>
#include <QX11Info>
#include <X11/Xlib-xcb.h>
#include <fixx11h.h>
#include <xcb/xcb.h>
namespace X11Utils {
void compositePointer(int offsetX, int offsetY, QPixmap *snapshot);
}
namespace Xcb {
template <typename T>
class ScopedCPointer : public QScopedPointer<T, QScopedPointerPodDeleter>
{
public:
ScopedCPointer(T *p = 0) : QScopedPointer<T, QScopedPointerPodDeleter>(p) {}
};
inline xcb_connection_t *connection()
{
return XGetXCBConnection(QX11Info::display());
}
} // namespace Xcb
#endif // X11UTILS_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef ABSTRACTMODULE_H

@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 2.8.11)
set (extedit_SRC
moduleextedit.cpp
extedit.cpp
@ -34,4 +32,4 @@ add_library(extedit
set_property (TARGET extedit PROPERTY SOVERSION 1.0.0)
install(TARGETS extedit DESTINATION ${SG_LIBDIR})
target_link_libraries(extedit Qt5::Widgets Qt5::X11Extras ${QTXDG_LIBRARIES})
target_link_libraries(extedit Qt5::Widgets Qt5::X11Extras Qt5Xdg)

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "extedit.h"

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef EXTEDIT_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,10 +13,8 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "moduleextedit.h"

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef MODULEEXTEDIT_H

@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 2.8.11)
set(uploader_SRC
moduleuploader.cpp
uploader.cpp

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "dialoguploader.h"

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef DIALOGUPLOADER_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "uploader_imgur.h"

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef UPLOADER_IMGUR_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "uploader_imgur_widget.h"

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef UPLOADER_IMGUR_WIDGET_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "uploaderconfigwidget_imgur.h"

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef UPLOADERCONFIGWIDGET_IMGUR_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "uploader_mediacrush.h"
@ -24,6 +22,8 @@
#include <QtNetwork/QHttpMultiPart>
#include <QtNetwork/QHttpPart>
#include "uploaderconfig.h"
#include <QDebug>
Uploader_MediaCrush::Uploader_MediaCrush(const QString& format, QObject* parent): Uploader(parent)
@ -64,7 +64,10 @@ void Uploader_MediaCrush::setCurrentFormat(const QString& format)
*/
QUrl Uploader_MediaCrush::apiUrl()
{
return QUrl("https://mediacru.sh/api/upload/file");
UploaderConfig config;
// QUrl("https://mediacru.sh/api/upload/file")
return config.loadSingleParam("mediacru.sh", KEY_MCSH_URL).toUrl();
}
/*!

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef UPLOADER_MEDIACRUSH_H

@ -1,3 +1,21 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* 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 2 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/>. *
***************************************************************************/
#include "uploader_mediacrush_widget.h"
#include "ui_uploader_mediacrush_widget.h"

@ -1,3 +1,21 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* 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 2 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/>. *
***************************************************************************/
#ifndef UPLOADER_MEDIACRUSH_WIDGET_H
#define UPLOADER_MEDIACRUSH_WIDGET_H

@ -1,14 +1,56 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* 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 2 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/>. *
***************************************************************************/
#include "uploaderconfigwidget_mediacrush.h"
#include "ui_uploaderconfigwidget_mediacrush.h"
#include "uploaderconfig.h"
#include <QDebug>
UploaderConfigWidget_MediaCrush::UploaderConfigWidget_MediaCrush(QWidget *parent) :
QWidget(parent),
ui(new Ui::UploaderConfigWidget_MediaCrush)
{
ui->setupUi(this);
// load settings
UploaderConfig config;
QVariantMap loadedValues;
loadedValues.insert(KEY_MCSH_URL, "");
loadedValues = config.loadSettings("mediacru.sh", loadedValues);
ui->editUrl->setText(loadedValues[KEY_MCSH_URL].toString());
}
UploaderConfigWidget_MediaCrush::~UploaderConfigWidget_MediaCrush()
{
delete ui;
}
void UploaderConfigWidget_MediaCrush::saveSettings()
{
UploaderConfig config;
QVariantMap savingValues;
savingValues.insert(KEY_MCSH_URL, ui->editUrl->text());
config.saveSettings("mediacru.sh", savingValues);
}

@ -1,3 +1,21 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* 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 2 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/>. *
***************************************************************************/
#ifndef UPLOADERCONFIGWIDGET_MEDIACRUSH_H
#define UPLOADERCONFIGWIDGET_MEDIACRUSH_H
@ -15,6 +33,9 @@ public:
explicit UploaderConfigWidget_MediaCrush(QWidget *parent = 0);
~UploaderConfigWidget_MediaCrush();
public Q_SLOTS:
void saveSettings();
private:
Ui::UploaderConfigWidget_MediaCrush *ui;
};

@ -29,24 +29,44 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>87</height>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="labDescription">
<widget class="QLabel" name="labDesclabUrlription">
<property name="text">
<string>Now is nothing yet</string>
<string>URL forupload</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editUrl"/>
</item>
<item>
<widget class="QLabel" name="labDescription">
<property name="text">
<string>Central server MediaCrush is down, but you can set up self-hosted instance. And add here url to it.</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labUrlExample">
<property name="text">
<string notr="true">e.g. &quot;https://mediacru.sh/api/upload/file&quot;</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "moduleuploader.h"

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef MODULEUPLOADER_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "uploader.h"
@ -159,11 +157,11 @@ void Uploader::createData(bool inBase64)
if (inBase64 == false)
{
imageData = core->getScreen();
imageData = core->getScreenData();
}
else
{
imageData = core->getScreen().toBase64();
imageData = core->getScreenData().toBase64();
}
core->killTempFile();
}

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef UPLOADER_H

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "uploaderconfig.h"
@ -28,7 +26,10 @@
// common defaults
#define DEF_AUTO_COPY_RESULT_LIMK false
#define DEF_DEFAULT_HOST "MediaCrush"
#define DEF_DEFAULT_HOST "Imgur"
// mediacru.sh settings
#define DEF_MCSH_URL "https://mediacru.sh/api/upload/file"
QStringList UploaderConfig::_labelsList = QStringList() << "MediaCrush" << "Imgur";
@ -103,8 +104,13 @@ void UploaderConfig::defaultSettings()
_settings->setValue(KEY_DEFAULT_HOST, DEF_DEFAULT_HOST);
_settings->endGroup();
// imgur.com settings
// mediacru.sh settings
_settings->beginGroup(_groupsList[0]);
_settings->setValue(KEY_MCSH_URL, DEF_MCSH_URL);
_settings->endGroup();
// imgur.com settings
_settings->beginGroup(_groupsList[1]);
_settings->endGroup();
}

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef UPLOADERCONFIG_H
@ -30,6 +28,9 @@
#define KEY_AUTO_COPY_RESULT_LIMK "autoCopyDirectLink"
#define KEY_DEFAULT_HOST "defaultHost"
// Uploader config file mediacru.sh keys
#define KEY_MCSH_URL "uploadUrl"
class UploaderConfig
{

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "uploaderconfigwidget.h"
@ -50,6 +48,8 @@ UploaderConfigWidget::UploaderConfigWidget(QWidget *parent) :
void (QComboBox::*hostChanged)(int) = &QComboBox::currentIndexChanged;
connect(_ui->cbxHosts, hostChanged, _ui->stackedHosts, &QStackedWidget::setCurrentIndex);
_ui->stackedHosts->setCurrentIndex(_ui->cbxDefaultHost->currentIndex());
}
UploaderConfigWidget::~UploaderConfigWidget()
@ -83,6 +83,7 @@ void UploaderConfigWidget::loadSettings()
_ui->cbxDefaultHost->setCurrentIndex(index);
}
_ui->cbxHosts->setCurrentIndex(_ui->cbxDefaultHost->currentIndex());
_ui->checkAutoCopyMainLink->setChecked(loadValues["autoCopyDirectLink"].toBool());
}
@ -99,7 +100,7 @@ void UploaderConfigWidget::saveSettings()
config.saveSettings("common", savingValues);
QMetaObject::invokeMethod(_imgur, "saveSettings");
QMetaObject::invokeMethod(_crush, "saveSettings");
}
void UploaderConfigWidget::changeEvent(QEvent *e)

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* Copyright (C) 2009 - 2013 by Artem 'DOOMer' Galichkin *
* doomer3d@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
@ -13,9 +13,7 @@
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef UPLOADERCONFIGWIDGET_H

@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="settings">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="commonSettings">
<attribute name="title">

@ -0,0 +1,3 @@
# Translations
Comment[it]=Catturare schermate e condividerle in rete
GenericName[it]=Cattura schermata

@ -6,12 +6,12 @@
<message>
<location filename="../src/ui/about.cpp" line="37"/>
<source>built on </source>
<translation>compilato in </translation>
<translation>compilato il </translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="42"/>
<source>using Qt </source>
<translation>usando QT</translation>
<translation>usando le librerie QT</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="52"/>
@ -26,63 +26,64 @@
<message>
<location filename="../src/ui/about.cpp" line="122"/>
<source>Licensed under the </source>
<translation>Rilasciato sotto licensa </translation>
<translation>Rilasciato sotto licenza </translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="115"/>
<location filename="../src/ui/about.cpp" line="144"/>
<source>E-Mail</source>
<translation></translation>
<translation>email</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="54"/>
<source>Help us</source>
<translation type="unfinished"></translation>
<translation>Contribuisci</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="118"/>
<source>Web site</source>
<translation type="unfinished"></translation>
<translation>Sito web</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="126"/>
<source>Copyright &amp;copy; 2009-2013, Artem &apos;DOOMer&apos; Galichkin</source>
<translation type="unfinished">Copyright &amp;copy; 2009-2010, Artem &apos;DOOMer&apos; Galichkin {2009-2012,?} {2009-2013,?}</translation>
<translatorcomment>copyright updated to 2015, ok?</translatorcomment>
<translation>Copyright &amp;copy; 2009-2015, Artem &apos;DOOMer&apos; Galichkin </translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="136"/>
<source>What you can do?</source>
<translation type="unfinished"></translation>
<translation>Cosa puoi fare?</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="110"/>
<source>is a crossplatform application for fast creating screenshots of your desktop.</source>
<translation type="unfinished"></translation>
<translation>è una applicazione per catturare velocemente schermate per tutte le piattaforme.</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="112"/>
<source>It is a light and powerful application and has been written using the Qt framework, so that you are able to use in Windows and Linux.</source>
<translation type="unfinished"></translation>
<translation>E&apos; una applicazione leggera e e potente ed è stato scritta usando il Qt-framework, così puoi usarla in Windows e Linux</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="133"/>
<source>You can join us and help us if you want. This is an invitation if you like this application.</source>
<translation type="unfinished"></translation>
<translation>Se ti piace questa applicazione puoi aiutarci!</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="139"/>
<source>Translate ScreenGrab to other languages</source>
<translation type="unfinished"></translation>
<translation>Puoi tradurre ScreenGrab in altre lingue</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="140"/>
<source>Make suggestions for next releases</source>
<translation type="unfinished"></translation>
<translation>Fai proposte per le prossime versioni</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="141"/>
<source>Report bugs and issues</source>
<translation type="unfinished"></translation>
<translation>Segnala problemi e bug</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="148"/>
@ -117,7 +118,7 @@
<message>
<location filename="../src/ui/about.cpp" line="166"/>
<source> Spanish translation</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="167"/>
@ -127,22 +128,22 @@
<message>
<location filename="../src/ui/about.cpp" line="169"/>
<source> Italian translation</source>
<translation type="unfinished"></translation>
<translation>Traduziona italiana</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="173"/>
<source>Testing:</source>
<translation></translation>
<translation>Test:</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="175"/>
<source>Dual monitor support and other in Linux</source>
<translation type="unfinished"></translation>
<translation>Supporto per due monitor e altro in Linux</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="176"/>
<source>Dual monitor support in Linux</source>
<translation type="unfinished"></translation>
<translation>Supporto dual monitor in Linux</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="177"/>
@ -152,7 +153,7 @@
<message>
<location filename="../src/ui/about.cpp" line="178"/>
<source>old win32-build [Windows Vista]</source>
<translation type="unfinished"></translation>
<translation type="unfinished"> win32-build vecchio[Windows Vista]</translation>
</message>
<message>
<location filename="../src/ui/about.cpp" line="179"/>
@ -176,12 +177,12 @@
<message>
<location filename="../src/ui/configwidget.cpp" line="222"/>
<source>Directory %1 does not exist. Do you want to create it?</source>
<translation type="unfinished"></translation>
<translation>La cartella %1 non esiste. Vuoi crearla?</translation>
</message>
<message>
<location filename="../src/ui/configwidget.cpp" line="329"/>
<source>Do you want to reset the settings to the defaults?</source>
<translation type="unfinished"></translation>
<translation>Vuoi ripristinare la configurazione iniziale?</translation>
</message>
<message>
<location filename="../src/ui/configwidget.cpp" line="347"/>
@ -196,12 +197,12 @@
<message>
<location filename="../src/ui/configwidget.cpp" line="449"/>
<source>This key is already used in your system! Please select another.</source>
<translation type="unfinished"></translation>
<translation>Questa scorciatoia è già in uso. Seleziona un altra per favore.</translation>
</message>
<message>
<location filename="../src/ui/configwidget.cpp" line="455"/>
<source>This key is already used in ScreenGrab! Please select another.</source>
<translation type="unfinished"></translation>
<translation>Questa scorciatoia è già usata in ScreenGrab. Seleziona un altra.</translation>
</message>
<message>
<location filename="../src/ui/configwidget.cpp" line="473"/>
@ -234,7 +235,7 @@
<message>
<location filename="../src/core/core.cpp" line="327"/>
<source>Name of saved file is copied to the clipboard</source>
<translation type="unfinished"></translation>
<translation>Il nome del file salvato è stato copiato negli appunti</translation>
</message>
<message>
<location filename="../src/core/core.cpp" line="345"/>
@ -249,7 +250,7 @@
<message>
<location filename="../src/core/core.cpp" line="333"/>
<source>Path to saved file is copied to the clipboard</source>
<translation type="unfinished"></translation>
<translation>Il percorso del file salvato è stato copiato negli appunti</translation>
</message>
<message>
<location filename="../src/core/core.cpp" line="345"/>
@ -296,7 +297,7 @@
<message>
<location filename="../src/ui/mainwindow.ui" line="112"/>
<source>Full screen</source>
<translation>Tutto schermo</translation>
<translation>Schermo intero</translation>
</message>
<message>
<location filename="../src/ui/mainwindow.ui" line="117"/>
@ -311,12 +312,12 @@
<message>
<location filename="../src/ui/mainwindow.ui" line="127"/>
<source>Previous selection</source>
<translation type="unfinished"></translation>
<translation>Selezione precedente</translation>
</message>
<message>
<location filename="../src/ui/mainwindow.ui" line="196"/>
<source>toolBar</source>
<translation type="unfinished"></translation>
<translation>Barra degli strumenti</translation>
</message>
<message>
<source>Getting new screenshot</source>
@ -415,12 +416,12 @@
<message>
<location filename="../src/ui/mainwindow.cpp" line="321"/>
<source>Screenshot </source>
<translation type="unfinished"></translation>
<translation>Schermata</translation>
</message>
<message>
<location filename="../src/ui/mainwindow.cpp" line="325"/>
<source>Double click for open screenshot in external default image viewer</source>
<translation type="unfinished"></translation>
<translation>Doppio clic per aprire la cattura in un editor esterno</translation>
</message>
<message>
<location filename="../src/ui/mainwindow.cpp" line="379"/>
@ -507,7 +508,7 @@ un tasto qualsiasi o usando il tasto destro o centrale del mouse.</translation>
<message>
<location filename="../src/ui/configwidget.ui" line="421"/>
<source>Insert current date and time in file name</source>
<translation type="unfinished"></translation>
<translation>Inserisci data e ora nel nome del file</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="468"/>
@ -522,37 +523,37 @@ un tasto qualsiasi o usando il tasto destro o centrale del mouse.</translation>
<message>
<location filename="../src/ui/configwidget.ui" line="337"/>
<source>Image quality</source>
<translation type="unfinished"></translation>
<translation>Qualità imagine</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="346"/>
<source>Image quality (1 - small file, 100 - high quality)</source>
<translation type="unfinished"></translation>
<translation>Qualità immagine (1 -bassa, 100 massima qualità)</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="489"/>
<source>Allow run multiplies copy of ScreenGrab</source>
<translation type="unfinished"></translation>
<translation>Permetti istanze multiple di ScreenGrab</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="502"/>
<source>Enable external viewer</source>
<translation type="unfinished"></translation>
<translation>Abilita visualizzatore esterno</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="537"/>
<source>Show ScreenGrab in the system tray</source>
<translation type="unfinished"></translation>
<translation>Mostra ScreenGrab nel vassoio di sistema</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="622"/>
<source>Minimize to tray on click close button</source>
<translation type="unfinished"></translation>
<translation>Minimizza nel vassoio di sistema cliccando il pulsante chiudi</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="625"/>
<source>Minimize to tray when closing</source>
<translation type="unfinished"></translation>
<translation>Minimizza nel vassoio alla chiusura</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="664"/>
@ -582,7 +583,7 @@ un tasto qualsiasi o usando il tasto destro o centrale del mouse.</translation>
<message>
<location filename="../src/ui/configwidget.ui" line="697"/>
<source>Local shortcuts</source>
<translation type="unfinished"></translation>
<translation>Scorciatoie locali</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="701"/>
@ -651,12 +652,12 @@ un tasto qualsiasi o usando il tasto destro o centrale del mouse.</translation>
<message>
<location filename="../src/ui/configwidget.ui" line="90"/>
<source>System tray</source>
<translation type="unfinished"></translation>
<translation>Vassoio</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="129"/>
<source>Saving</source>
<translation type="unfinished"></translation>
<translation>Salvataggio</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="143"/>
@ -696,27 +697,27 @@ un tasto qualsiasi o usando il tasto destro o centrale del mouse.</translation>
<message>
<location filename="../src/ui/configwidget.ui" line="233"/>
<source>Copy file name to the clipboard when saving</source>
<translation type="unfinished"></translation>
<translation>Copia nome del file negli appunti quando salvi</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="247"/>
<source>Do not copy</source>
<translation type="unfinished"></translation>
<translation>Non copiare</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="252"/>
<source>Copy file name only</source>
<translation type="unfinished"></translation>
<translation>Copia solo il nome del file</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="257"/>
<source>Copy full file path</source>
<translation type="unfinished"></translation>
<translation>Copia il percorso completo</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="281"/>
<source>Screenshot</source>
<translation type="unfinished"></translation>
<translation>Cattura</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="289"/>
@ -797,12 +798,12 @@ un tasto qualsiasi o usando il tasto destro o centrale del mouse.</translation>
<message>
<location filename="../src/ui/configwidget.ui" line="492"/>
<source>Allow multiple instances of ScreenGrab</source>
<translation type="unfinished"></translation>
<translation>Permetti istanze multiple di ScreenGrab</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="499"/>
<source>Open in external viewer on double click</source>
<translation type="unfinished"></translation>
<translation>Apri la cattura in un visualizzatore esterno con doppio clic</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="669"/>
@ -812,7 +813,7 @@ un tasto qualsiasi o usando il tasto destro o centrale del mouse.</translation>
<message>
<location filename="../src/ui/configwidget.ui" line="726"/>
<source>Quit</source>
<translation type="unfinished">Esci</translation>
<translation>Esci</translation>
</message>
<message>
<location filename="../src/ui/configwidget.ui" line="737"/>

Loading…
Cancel
Save