Cherry-picking upstream version 1.95-20151117.
This commit is contained in:
parent
043e3115cd
commit
a3dbf3aaea
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,3 +1,10 @@
|
||||
screengrab (1.95+20151117-1) experimental; urgency=medium
|
||||
|
||||
* Cherry-picking upstream version 1.95+20151117.
|
||||
* Added libxcb-xfixes0-dev as build dependency
|
||||
|
||||
-- Alf Gaida <agaida@siduction.org> Fri, 20 Nov 2015 00:23:43 +0100
|
||||
|
||||
screengrab (1.95+20150929-1) experimental; urgency=medium
|
||||
|
||||
[Alf Gaida ]
|
||||
|
1
debian/control
vendored
1
debian/control
vendored
@ -12,6 +12,7 @@ Build-Depends: debhelper (>= 9),
|
||||
libqt5x11extras5-dev,
|
||||
libqt5xdg-dev (>= 1.3.0),
|
||||
libx11-dev,
|
||||
libxcb-xfixes0-dev,
|
||||
pkg-config,
|
||||
qttools5-dev,
|
||||
qttools5-dev-tools
|
||||
|
@ -35,6 +35,8 @@
|
||||
#define KEY_SAVEFORMAT "defImgFormat"
|
||||
#define KEY_DELAY_DEF "defDelay"
|
||||
#define KEY_DELAY "delay"
|
||||
#define KEY_SCREENSHOT_TYPE_DEF "defScreenshotType"
|
||||
#define KEY_SCREENSHOT_TYPE "screenshotType"
|
||||
#define KEY_IMG_QUALITY "imageQuality"
|
||||
#define KEY_FILENAMEDATE "insDateTimeInFilename"
|
||||
#define KEY_DATETIME_TPL "templateDateTime"
|
||||
@ -51,11 +53,60 @@
|
||||
#define KEY_ZOOMBOX "zoomAroundMouse"
|
||||
#define KEY_TIME_NOTIFY "timeTrayMessages"
|
||||
#define KEY_ALLOW_COPIES "AllowCopies"
|
||||
#define KEY_TYPE_SCREEN "typeScreenDefault"
|
||||
#define KEY_ENABLE_EXT_VIEWER "enbaleExternalView"
|
||||
#define KEY_NODECOR "noDecorations"
|
||||
#define KEY_INCLUDE_CURSOR "includeCursor"
|
||||
|
||||
|
||||
static const QLatin1String FullScreen("FullScreen");
|
||||
static const QLatin1String Window("Window");
|
||||
static const QLatin1String Area("Area");
|
||||
static const QLatin1String PreviousSelection("PreviousSelection");
|
||||
|
||||
static QString screenshotTypeToString(int v);
|
||||
static int screenshotTypeFromString(const QString& str);
|
||||
|
||||
static QString screenshotTypeToString(int v)
|
||||
{
|
||||
QString r;
|
||||
|
||||
switch(v) {
|
||||
case Core::FullScreen:
|
||||
r = FullScreen;
|
||||
break;
|
||||
case Core::Window:
|
||||
r = Window;
|
||||
break;
|
||||
case Core::Area:
|
||||
r = Area;
|
||||
break;
|
||||
case Core::PreviousSelection:
|
||||
r = PreviousSelection;
|
||||
break;
|
||||
default:
|
||||
r = FullScreen;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
static int screenshotTypeFromString(const QString& str)
|
||||
{
|
||||
int r;
|
||||
|
||||
if (str == FullScreen)
|
||||
r = Core::FullScreen;
|
||||
else if (str == Window)
|
||||
r = Core::Window;
|
||||
else if (str == Area)
|
||||
r = Core::Area;
|
||||
else if (str == PreviousSelection)
|
||||
r = Core::PreviousSelection;
|
||||
else
|
||||
r = Core::FullScreen; // Default
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
Config* Config::ptrInstance = 0;
|
||||
|
||||
// constructor
|
||||
@ -242,6 +293,26 @@ void Config::setDelay(quint8 sec)
|
||||
setValue(KEY_DELAY, sec);
|
||||
}
|
||||
|
||||
int Config::getDefScreenshotType()
|
||||
{
|
||||
return (value(QLatin1String(KEY_SCREENSHOT_TYPE_DEF)).toInt());
|
||||
}
|
||||
|
||||
void Config::setDefScreenshotType(const int type)
|
||||
{
|
||||
setValue(QLatin1String(KEY_SCREENSHOT_TYPE_DEF), type);
|
||||
}
|
||||
|
||||
int Config::getScreenshotType()
|
||||
{
|
||||
return (value(QLatin1String(KEY_SCREENSHOT_TYPE)).toInt());
|
||||
}
|
||||
|
||||
void Config::setScreenshotType(const int type)
|
||||
{
|
||||
setValue(QLatin1String(KEY_SCREENSHOT_TYPE), type);
|
||||
}
|
||||
|
||||
quint8 Config::getAutoCopyFilenameOnSaving()
|
||||
{
|
||||
return value(KEY_FILENAME_TO_CLB).toInt();
|
||||
@ -283,16 +354,6 @@ void Config::setCloseInTray(bool val)
|
||||
setValue(KEY_CLOSE_INTRAY, val);
|
||||
}
|
||||
|
||||
int Config::getTypeScreen()
|
||||
{
|
||||
return value(KEY_TYPE_SCREEN).toInt();
|
||||
}
|
||||
|
||||
void Config::setTypeScreen(quint8 type)
|
||||
{
|
||||
setValue(KEY_TYPE_SCREEN, type);
|
||||
}
|
||||
|
||||
quint8 Config::getTimeTrayMess()
|
||||
{
|
||||
return value(KEY_TIME_NOTIFY).toInt();
|
||||
@ -412,6 +473,7 @@ void Config::loadSettings()
|
||||
setSaveFileName(_settings->value(KEY_SAVENAME,DEF_SAVE_NAME).toString());
|
||||
setSaveFormat(_settings->value(KEY_SAVEFORMAT, DEF_SAVE_FORMAT).toString());
|
||||
setDefDelay(_settings->value(KEY_DELAY, DEF_DELAY).toInt());
|
||||
setDefScreenshotType(screenshotTypeFromString(_settings->value(QLatin1String(KEY_SCREENSHOT_TYPE_DEF)).toString()));
|
||||
setAutoCopyFilenameOnSaving(_settings->value(KEY_FILENAME_TO_CLB, DEF_FILENAME_TO_CLB).toInt());
|
||||
setDateTimeInFilename(_settings->value(KEY_FILENAMEDATE, DEF_DATETIME_FILENAME).toBool());
|
||||
setDateTimeTpl(_settings->value(KEY_DATETIME_TPL, DEF_DATETIME_TPL).toString());
|
||||
@ -450,6 +512,7 @@ void Config::saveSettings()
|
||||
_settings->setValue(KEY_SAVENAME, getSaveFileName());
|
||||
_settings->setValue(KEY_SAVEFORMAT, getSaveFormat());
|
||||
_settings->setValue(KEY_DELAY, getDefDelay());
|
||||
_settings->setValue(QLatin1String(KEY_SCREENSHOT_TYPE_DEF), screenshotTypeToString(getDefScreenshotType()));
|
||||
_settings->setValue(KEY_FILENAME_TO_CLB, getAutoCopyFilenameOnSaving());
|
||||
_settings->setValue(KEY_FILENAMEDATE, getDateTimeInFilename());
|
||||
_settings->setValue(KEY_DATETIME_TPL, getDateTimeTpl());
|
||||
@ -486,6 +549,7 @@ void Config::setDefaultSettings()
|
||||
setSaveFileName(DEF_SAVE_NAME);
|
||||
setSaveFormat(DEF_SAVE_FORMAT);
|
||||
setDefDelay(DEF_DELAY);
|
||||
setScreenshotType(Core::FullScreen);
|
||||
setImageQuality(DEF_IMG_QUALITY);
|
||||
setDateTimeInFilename(DEF_DATETIME_FILENAME);
|
||||
setDateTimeTpl(DEF_DATETIME_TPL);
|
||||
|
@ -144,6 +144,14 @@ public:
|
||||
quint8 getDelay();
|
||||
void setDelay(quint8 sec);
|
||||
|
||||
// configured default screenshot type
|
||||
int getDefScreenshotType();
|
||||
void setDefScreenshotType(const int type);
|
||||
|
||||
// current screenshot type
|
||||
int getScreenshotType();
|
||||
void setScreenshotType(const int type);
|
||||
|
||||
quint8 getAutoCopyFilenameOnSaving();
|
||||
void setAutoCopyFilenameOnSaving(quint8 val);
|
||||
|
||||
@ -159,10 +167,6 @@ public:
|
||||
bool getCloseInTray();
|
||||
void setCloseInTray(bool val);
|
||||
|
||||
// type of screen
|
||||
int getTypeScreen();
|
||||
void setTypeScreen(quint8 type);
|
||||
|
||||
// tume of tray messages
|
||||
quint8 getTimeTrayMess();
|
||||
void setTimeTrayMess(int src);
|
||||
|
@ -183,9 +183,9 @@ void Core::screenShot(bool first)
|
||||
if (_firstScreen)
|
||||
_conf->updateLastSaveDate();
|
||||
|
||||
switch(_conf->getTypeScreen())
|
||||
switch(_conf->getScreenshotType())
|
||||
{
|
||||
case 0:
|
||||
case Core::FullScreen:
|
||||
{
|
||||
const QList<QScreen *> screens = qApp->screens();
|
||||
const QDesktopWidget *desktop = QApplication::desktop();
|
||||
@ -197,20 +197,20 @@ void Core::screenShot(bool first)
|
||||
_wnd->updatePixmap(_pixelMap);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
case Core::Window:
|
||||
{
|
||||
getActiveWindow();
|
||||
checkAutoSave(first);
|
||||
_wnd->updatePixmap(_pixelMap);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
case Core::Area:
|
||||
{
|
||||
_selector = new RegionSelect(_conf);
|
||||
connect(_selector, &RegionSelect::processDone, this, &Core::regionGrabbed);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
case Core::PreviousSelection:
|
||||
{
|
||||
_selector = new RegionSelect(_conf, _lastSelectedArea);
|
||||
connect(_selector, &RegionSelect::processDone, this, &Core::regionGrabbed);
|
||||
@ -517,7 +517,7 @@ void Core::processCmdLineOpts(const QStringList& arguments)
|
||||
// Check commandline parameters and set screenshot type
|
||||
for (int i=0; i < _screenTypeOpts.count(); ++i)
|
||||
if (_cmdLine.isSet(_screenTypeOpts.at(i)))
|
||||
_conf->setTypeScreen(i);
|
||||
_conf->setScreenshotType(i);
|
||||
|
||||
#ifdef SG_EXT_UPLOADS
|
||||
/// FIXMA - In module interface need add the mthod for geting module cmdLine options
|
||||
|
@ -71,6 +71,13 @@ public Q_SLOTS:
|
||||
void autoSave();
|
||||
|
||||
public:
|
||||
enum ScreenshotType {
|
||||
FullScreen = 0,
|
||||
Window,
|
||||
Area,
|
||||
PreviousSelection
|
||||
};
|
||||
|
||||
static Core* instance();
|
||||
~Core();
|
||||
|
||||
|
@ -34,7 +34,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (!ScreenGrab->config()->getAllowMultipleInstance() && scr.isRunning())
|
||||
{
|
||||
QString type = QString::number(ScreenGrab->config()->getTypeScreen());
|
||||
QString type = QString::number(ScreenGrab->config()->getDefScreenshotType());
|
||||
scr.sendMessage("screengrab --type=" + type);
|
||||
return 0;
|
||||
}
|
||||
|
@ -154,6 +154,7 @@ void ConfigDialog::loadSettings()
|
||||
_ui->cbxFormat->setCurrentIndex(conf->getDefaultFormatID());
|
||||
|
||||
_ui->defDelay->setValue(conf->getDefDelay());
|
||||
_ui->cbxTypeScr->setCurrentIndex(conf->getDefScreenshotType());
|
||||
_ui->checkIncDate->setChecked(conf->getDateTimeInFilename());
|
||||
_ui->editDateTmeTpl->setText(conf->getDateTimeTpl());
|
||||
_ui->cbxCopyFileName->setCurrentIndex(conf->getAutoCopyFilenameOnSaving());
|
||||
@ -252,6 +253,7 @@ void ConfigDialog::saveSettings()
|
||||
conf->setSaveFileName(_ui->editFileName->text());
|
||||
conf->setSaveFormat(_ui->cbxFormat->currentText());
|
||||
conf->setDefDelay(_ui->defDelay->value());
|
||||
conf->setDefScreenshotType(_ui->cbxTypeScr->currentIndex());
|
||||
conf->setDateTimeInFilename(_ui->checkIncDate->isChecked());
|
||||
conf->setDateTimeTpl(_ui->editDateTmeTpl->text());
|
||||
conf->setAutoCopyFilenameOnSaving(_ui->cbxCopyFileName->currentIndex());
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>634</width>
|
||||
<height>294</height>
|
||||
<width>770</width>
|
||||
<height>335</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
@ -280,8 +280,8 @@
|
||||
<attribute name="title">
|
||||
<string>Screenshot</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
@ -331,14 +331,83 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_15">
|
||||
<item>
|
||||
<widget class="QLabel" name="labTypeScr_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Type: </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cbxTypeScr">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Type of screenshot</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Full screen</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Window</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Screen area</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Previous selection</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>118</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labImgQuality">
|
||||
<property name="text">
|
||||
<string>Image quality</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="3" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<item>
|
||||
<widget class="QSlider" name="slideImgQuality">
|
||||
@ -368,21 +437,21 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="cbxIncludeCursor">
|
||||
<property name="text">
|
||||
<string>Include mouse pointer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkZommMouseArea">
|
||||
<property name="text">
|
||||
<string>Zoom area around mouse in selection mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="6" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -399,7 +399,7 @@ void MainWindow::delayBoxChange(int delay)
|
||||
|
||||
void MainWindow::typeScreenShotChange(int type)
|
||||
{
|
||||
_conf->setTypeScreen(type);
|
||||
_conf->setScreenshotType(type);
|
||||
}
|
||||
|
||||
void MainWindow::checkIncludeCursor(bool include)
|
||||
@ -410,8 +410,8 @@ void MainWindow::checkIncludeCursor(bool include)
|
||||
// updating UI from configdata
|
||||
void MainWindow::updateUI()
|
||||
{
|
||||
_ui->cbxTypeScr->setCurrentIndex(_conf->getTypeScreen());
|
||||
_ui->delayBox->setValue(_conf->getDelay());
|
||||
_ui->cbxTypeScr->setCurrentIndex(_conf->getDefScreenshotType());
|
||||
_ui->checkIncludeCursor->setChecked(_conf->getIncludeCursor());
|
||||
|
||||
updateShortcuts();
|
||||
|
Loading…
x
Reference in New Issue
Block a user