Cherry-picking upstream version 1.95+20160128.

Fixed upload to Imgur
Drop debug package
use secure VCS uris
add hardening=+all
make builds reproducible (Closes: #813167)
ubuntu/disco debian/1.95+20160128-1
Alf Gaida 8 years ago
parent b9ad1df2b1
commit 68505468fb

@ -81,7 +81,7 @@ message(STATUS "Library path: ${CMAKE_INSTALL_RPATH}")
# options
option(SG_GLOBALSHORTCUTS "Enable global shortcuts" OFF)
option(SG_EXT_UPLOADS "Enable upload screenshots to MediaCrush and imgur" ON)
option(SG_EXT_UPLOADS "Enable upload screenshots to 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)
@ -117,7 +117,7 @@ if(SG_DBUS_NOTIFY)
endif()
message(STATUS "Global shortcuts support: " ${SG_GLOBALSHORTCUTS})
message(STATUS "Upload to MediaCrush and imgur support: " ${SG_EXT_UPLOADS})
message(STATUS "Imgur upload 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})
@ -155,7 +155,7 @@ 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)

11
debian/changelog vendored

@ -1,3 +1,14 @@
screengrab (1.95+20160128-1) unstable; urgency=medium
* Cherry-picking upstream version 1.95+20160128.
* Fixed upload to Imgur
* Drop debug package
* use secure VCS uris
* add hardening=+all
* make builds reproducible (Closes: #813167)
-- Alf Gaida <agaida@siduction.org> Sat, 30 Jan 2016 03:19:31 +0100
screengrab (1.95+20151117-4) unstable; urgency=medium
* modify some build dependencies - and remove the limit of

16
debian/control vendored

@ -18,8 +18,8 @@ Build-Depends: debhelper (>= 9),
qttools5-dev,
qttools5-dev-tools,
Standards-Version: 3.9.6
Vcs-Browser: http://anonscm.debian.org/cgit/pkg-lxqt/screengrab.git
Vcs-Git: git://anonscm.debian.org/pkg-lxqt/screengrab.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/screengrab.git
Vcs-Git: https://anonscm.debian.org/pkg-lxqt/screengrab.git
Homepage: https://github.com/QtDesktop/screengrab
Package: screengrab
@ -36,15 +36,3 @@ Description: Crossplatform tool for getting screenshots
* 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.

8
debian/rules vendored

@ -1,21 +1,15 @@
#!/usr/bin/make -f
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@ --buildsystem=cmake --parallel
override_dh_auto_install:
dh_auto_install -- DESTDIR=$(CURDIR)/debian/screengrab
override_dh_install:
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

@ -27,18 +27,18 @@
<p>
ScreenGrab is a crossplatform application designed to quickly get screenshots.
ScreenGrab is based on the Qt Framework, which allows the program to be used in
Microsoft Windows and GNU/Linux environments.
GNU/Linux and Microsoft Windows environments.
</p>
<p>
Main features:
</p>
<ul>
<li>Supports Windows & Linux</li>
<li>Supports Linux & Windows</li>
<li>Get desktop screenshots</li>
<li>Get active window screenshots</li>
<li>Get screenshots of selected desktop areas</li>
<li>Copy screenshots into the clipboard</li>
<li>Save your image files in PNG, JPEG or BMP format</li>
<li>Save your image files in PNG or JPEG format</li>
<li>Ability to view and edit screenshots in an external editor</li>
<li>Ability to upload screenshots to MediaCrush and imgur</li>
<li>Ability to set delay before getting screenshots
@ -84,7 +84,7 @@ All management of the program can be carried out through the buttons in the main
<li><b>Quit</b> [Ctrl+Q] -- Exit ScreenGrab</li>
</ul>
<p>
These buttons can be accessed via right-click on the ScreenGrab icon in the systemtray menu as well.
These buttons can be accessed via right-click on the ScreenGrab icon in the system tray menu as well.
</p>
<p>
Additional controls, located in main window.
@ -101,7 +101,7 @@ or active window]. </li>
<li><b>Default directory</b> -- Default directory to save screenshots</li>
<li><b>Default filename</b> -- Default name of the saved file</li>
<li><b>Format</b> -- Default saving image format (you can select other formats)</li>
<li><b>No window decoration</b> -- Grab a screenshot of the active window without window decorations (only for linux version).</li>
<li><b>No window decoration</b> -- Grab a screenshot of the active window without window decorations (only for Linux version).</li>
</ul>
<p>
<b><u>Advanced settings:</u></b>
@ -178,12 +178,12 @@ when exiting ScreenGrab (and restore it at next run)</li>
<li><b>Tray messages</b> -- Mode of displaying tray messages on grab|save events. Can be "none"
or "if hidden" or "always"</li>
<li><b>Time to display tray messages</b> -- Time within a specific notification is displayed </li>
<li><b>Close in tray</b> -- Minimize the main window into the systemtray
<li><b>Close in tray</b> -- Minimize the main window into the system tray
by click on the close window button.</li>
</ul>
<p>
<u><b>Shortcut Settings:</u></b>
<u><b>Shortcut Settings:</b></u>
</p>
<p>
On the tab "Shortcuts" in the options window you can set the keyboard shortcuts, which allows you to access the application functions easily. There are two kinds of key combinations used in ScreenGrab - local and global.
@ -195,7 +195,7 @@ by click on the close window button.</li>
Global shortcuts can be used the get a new screenshot when you have opened other application windows.
</p>
<p>
<u><b>Command line parameters:</u></b>
<u><b>Command line parameters:</b></u>
</p>
<ul>
<li><b>--fullscreen</b> -- Set the fullscreen mode [default].</li>
@ -231,8 +231,8 @@ by click on the close window button.</li>
<strong>Translators:</strong>
</p>
<ul>
<li><strong>Marcio Moraes</strong> -- Brazilian Portuguese translation</strong> </li>
<li><strong>Gennadi Motsyo</strong> -- Ukrainian translation</strong> </li>
<li><strong>Marcio Moraes</strong> -- Brazilian Portuguese translation</li>
<li><strong>Gennadi Motsyo</strong> -- Ukrainian translation</li>
</ul>
<p>
<strong>Beta-testers:</strong>
@ -249,7 +249,7 @@ And all those who use ScreenGrab :)
<h2>Version history <a href='#main'>To start page</a></h2>
<p>
<strong>Version 1.2:</strong>
</p>
</p>
<ul>
<li>Added ability for autosaving type of the last created screenshot.</li>
<li>Some small fixes.</li>
@ -415,9 +415,9 @@ And all those who use ScreenGrab :)
<li>added saving options into INI-file</li>
<li>added i18n support and Russian localisation</li>
<li>some fixes and changes in code</li>
<li>now available as installer (Windows) and deb packages (ubuntu 9.04)</li>
<li>now available as installer (Windows) and deb packages (Ubuntu 9.04)</li>
</ul>
<p>x
<p>
<strong>Version 0.1:</strong>
</p>
<ul>

@ -38,8 +38,7 @@ Microsoft Windows e GNU/Linux.
<li>Obtém captura de tela da janela ativa</li>
<li>Obtém captura de tela de uma região do desktop</li>
<li>Copia a captura de tela para a área de transferência</li>
<li>Salva seus arquivos de imagens no formato PNG
ou JPEG ou BMP</li>
<li>Salva seus arquivos de imagens no formato PNG ou JPEG</li>
<li>Ability to view and edit screenshots in an external editor</li>
<li>Ability to upload screenshots on several image hostings (mediacru.sh, imgur.com)</li>
<li>Habilidade em definir atraso ao obter as capturas de telas
@ -242,7 +241,7 @@ E a todos aqueles que utilizam ScreenGrab :)
<h2>Histórico das versões <a href='#main'>Para o início da página</a></h2>
<p>
<strong>Versão 1.2:</strong>
</p>
</p>
<ul>
<li>Added ability for autosaving type of the last created screenshot.</li>
<li>Some small fixes.</li>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -130,7 +130,6 @@ Config::Config()
saveSettings();
}
_imageFormats << "png" << "jpg" << "bmp";
_settings->setIniCodec("UTF-8");
_scrNum = 0;
}

@ -240,14 +240,6 @@ void Core::checkAutoSave(bool first)
else
autoSave();
}
else
{
if (!first)
{
StateNotifyMessage message(tr("New screen"), tr("New screen is getted!"));
sendNotify(message);
}
}
}
void Core::getActiveWindow()

@ -31,16 +31,8 @@ AboutDialog::AboutDialog(QWidget *parent):
_ui->setupUi(this);
_ui->labAppName->setText(_ui->labAppName->text() + QString(" <b>") + qApp->applicationVersion() + QString("</b>"));
QString versionInfo;
versionInfo = tr("built on ");
versionInfo.append(__DATE__);
versionInfo.append(" ");
versionInfo.append(__TIME__);
_ui->labQtVer->setText(tr("using Qt ") + qVersion());
_ui->labVersion->setText(versionInfo);
QTabBar *tabs = new QTabBar;
_ui->frame->layout()->addWidget(tabs);

@ -150,7 +150,6 @@ void ConfigDialog::loadSettings()
_ui->cbxFormat->addItem("png");
_ui->cbxFormat->addItem("jpg");
_ui->cbxFormat->addItem("bmp");
_ui->cbxFormat->setCurrentIndex(conf->getDefaultFormatID());
_ui->defDelay->setValue(conf->getDefDelay());

@ -497,7 +497,6 @@ void MainWindow::saveScreen()
formatsAvalible["png"] = tr("PNG Files");
formatsAvalible["jpg"] = tr("JPEG Files");
formatsAvalible["bmp"] = tr("BMP Files");
QString format = "png";
_conf->getSaveFormat();

@ -7,9 +7,6 @@ set(uploader_SRC
uploaderconfigwidget.cpp
imgur/uploader_imgur_widget.cpp
imgur/uploaderconfigwidget_imgur.cpp
mediacrush/uploader_mediacrush.cpp
mediacrush/uploader_mediacrush_widget.cpp
mediacrush/uploaderconfigwidget_mediacrush.cpp
)
set(uploader_UI
@ -17,8 +14,6 @@ set(uploader_UI
uploaderconfigwidget.ui
imgur/uploader_imgur_widget.ui
imgur/uploaderconfigwidget_imgur.ui
mediacrush/uploader_mediacrush_widget.ui
mediacrush/uploaderconfigwidget_mediacrush.ui
)
lxqt_translate_ts(uploader_QMS

@ -22,8 +22,6 @@
#include "uploaderconfig.h"
#include "imgur/uploader_imgur.h"
#include "imgur/uploader_imgur_widget.h"
#include "mediacrush/uploader_mediacrush.h"
#include "mediacrush/uploader_mediacrush_widget.h"
#include <core/core.h>
#include <QMessageBox>
@ -113,9 +111,6 @@ void DialogUploader::slotUploadStart()
switch(_selectedHost)
{
case 0:
_uploader = new Uploader_MediaCrush(Core::instance()->config()->getSaveFormat());
break;
case 1:
_uploader = new Uploader_ImgUr;
break;
default:
@ -148,13 +143,10 @@ void DialogUploader::slotSeletHost(int type)
switch(_selectedHost)
{
case 0:
_uploaderWidget = new Uploader_MediaCrush_Widget();
break;
case 1:
_uploaderWidget = new Uploader_ImgUr_Widget();
break;
default:
_uploaderWidget = new Uploader_MediaCrush_Widget();
_uploaderWidget = new Uploader_ImgUr_Widget();
}
_ui->stackedWidget->addWidget(_uploaderWidget);

@ -17,7 +17,7 @@
<item>
<widget class="QLabel" name="labTitle">
<property name="text">
<string>Upload to ImgUr.com</string>
<string>Upload to Imgur</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>

@ -40,7 +40,7 @@
<item>
<widget class="QLabel" name="labImgurConfDescription">
<property name="text">
<string>Now is nothing yet</string>
<string>No settings available right now</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>

@ -1,137 +0,0 @@
/***************************************************************************
* 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.h"
#include <QStringList>
#include <QtNetwork/QHttpMultiPart>
#include <QtNetwork/QHttpPart>
#include "uploaderconfig.h"
#include <QDebug>
Uploader_MediaCrush::Uploader_MediaCrush(const QString& format, QObject* parent): Uploader(parent)
{
_host = "mediacru.sh";
qDebug() << " create MediaCrush uploader";
UpdateUploadedStrList();
setCurrentFormat(format);
}
Uploader_MediaCrush::~Uploader_MediaCrush()
{
qDebug() << " kill MediaCrush uploader";
}
/*!
* Start upload process
*/
void Uploader_MediaCrush::startUploading()
{
createData();
createRequest(imageData, apiUrl());
_request.setRawHeader("Host", _host);
Uploader::startUploading();
}
/*!
* Set type of uploading image, for generate right direct link on it.
*/
void Uploader_MediaCrush::setCurrentFormat(const QString& format)
{
_currentFormat = format.toLatin1();
}
/*!
* Return url for upload image
*/
QUrl Uploader_MediaCrush::apiUrl()
{
UploaderConfig config;
// QUrl("https://mediacru.sh/api/upload/file")
return config.loadSingleParam("mediacru.sh", KEY_MCSH_URL).toUrl();
}
/*!
* Prepare image data for uploading
*/
void Uploader_MediaCrush::createData(bool inBase64)
{
Uploader::createData(inBase64);
_multipartData = new QHttpMultiPart(QHttpMultiPart::FormDataType);
QHttpPart imagePart;
if (_formatString == "jpg")
{
imagePart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("image/jpeg"));
}
else
{
imagePart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("image/" + _formatString));
}
QByteArray disposition = "form-data; name=\"file\"; filename='"+ _uploadFilename.toLatin1() +"'";
imagePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant(disposition));
imagePart.setBody(imageData);
_multipartData->append(imagePart);
imageData.clear();
}
/*!
* Process server reply data
*/
void Uploader_MediaCrush::replyFinished(QNetworkReply* reply)
{
if (reply->error() == QNetworkReply::NoError)
{
QByteArray response = reply->readAll();
if (response.split(':').count() >= 2)
{
response = response.split(':').at(1);
response = response.mid(2, 12);
}
_uploadedStrings[UL_DIRECT_LINK].first = "https://" + _host + "/" + response + "." + _currentFormat;
_uploadedStrings[UL_DELETE_URL].first = "https://" + _host + "/" + response + "/delete";
Q_EMIT uploadDoneStr(_uploadedStrings[UL_DIRECT_LINK].first);
Q_EMIT uploadDone();
}
else
{
Q_EMIT uploadFail(reply->errorString().toLatin1());
}
reply->deleteLater();
}
void Uploader_MediaCrush::UpdateUploadedStrList()
{
QStringList nonUsed = QStringList() << UL_BB_CODE << UL_BB_CODE_THUMB << UL_HTML_CODE << UL_HTML_CODE_THUMB;
for (int i =0; i < nonUsed.count(); ++i)
{
_uploadedStrings.remove(nonUsed.at(i).toLatin1());
}
}

@ -1,51 +0,0 @@
/***************************************************************************
* 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_H
#define UPLOADER_MEDIACRUSH_H
#include <uploader.h>
#include <QUrl>
class Uploader_MediaCrush : public Uploader
{
Q_OBJECT
public:
explicit Uploader_MediaCrush(const QString& format, QObject* parent = 0);
virtual ~Uploader_MediaCrush();
virtual void startUploading();
protected:
virtual QUrl apiUrl();
virtual void createData(bool inBase64 = false);
protected Q_SLOTS:
virtual void replyFinished(QNetworkReply* reply);
private:
void setCurrentFormat(const QString& format);
QByteArray _host;
QByteArray _currentFormat;
void UpdateUploadedStrList();
};
#endif // UPLOADER_MEDIACRUSH_H

@ -1,32 +0,0 @@
/***************************************************************************
* 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"
Uploader_MediaCrush_Widget::Uploader_MediaCrush_Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Uploader_MediaCrush_Widget)
{
ui->setupUi(this);
}
Uploader_MediaCrush_Widget::~Uploader_MediaCrush_Widget()
{
delete ui;
}

@ -1,40 +0,0 @@
/***************************************************************************
* 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
#include <QWidget>
namespace Ui {
class Uploader_MediaCrush_Widget;
}
class Uploader_MediaCrush_Widget : public QWidget
{
Q_OBJECT
public:
explicit Uploader_MediaCrush_Widget(QWidget *parent = 0);
~Uploader_MediaCrush_Widget();
private:
Ui::Uploader_MediaCrush_Widget *ui;
};
#endif // UPLOADER_MEDIACRUSH_WIDGET_H

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Uploader_MediaCrush_Widget</class>
<widget class="QWidget" name="Uploader_MediaCrush_Widget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>417</width>
<height>203</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="labTitle">
<property name="text">
<string>Upload to MediaCrush</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>168</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -1,56 +0,0 @@
/***************************************************************************
* 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,43 +0,0 @@
/***************************************************************************
* 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
#include <QWidget>
namespace Ui {
class UploaderConfigWidget_MediaCrush;
}
class UploaderConfigWidget_MediaCrush : public QWidget
{
Q_OBJECT
public:
explicit UploaderConfigWidget_MediaCrush(QWidget *parent = 0);
~UploaderConfigWidget_MediaCrush();
public Q_SLOTS:
void saveSettings();
private:
Ui::UploaderConfigWidget_MediaCrush *ui;
};
#endif // UPLOADERCONFIGWIDGET_MEDIACRUSH_H

@ -1,87 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>UploaderConfigWidget_MediaCrush</class>
<widget class="QWidget" name="UploaderConfigWidget_MediaCrush">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>320</width>
<height>240</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="labTitle">
<property name="text">
<string>Configuration for mediacru.sh upload</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<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>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="labDesclabUrlription">
<property name="text">
<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">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>87</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -21,7 +21,6 @@
#include "uploaderconfigwidget.h"
#include "uploaderconfig.h"
#include "imgur/uploader_imgur.h"
#include "mediacrush/uploader_mediacrush.h"
#include "core/core.h"
@ -62,9 +61,6 @@ void ModuleUploader::init()
switch(config.labelsList().indexOf(selectedtHost))
{
case 0:
uploader = new Uploader_MediaCrush(core->config()->getSaveFormat());
break;
case 1:
uploader = new Uploader_ImgUr;
break;
default:

@ -28,10 +28,8 @@
#define DEF_AUTO_COPY_RESULT_LIMK false
#define DEF_DEFAULT_HOST "Imgur"
// mediacru.sh settings
#define DEF_MCSH_URL "https://mediacru.sh/api/upload/file"
QStringList UploaderConfig::_labelsList = QStringList() << "Imgur" << "MediaCrush";
QStringList UploaderConfig::_labelsList = QStringList() << "Imgur";
UploaderConfig::UploaderConfig()
{
@ -104,11 +102,6 @@ void UploaderConfig::defaultSettings()
_settings->setValue(KEY_DEFAULT_HOST, DEF_DEFAULT_HOST);
_settings->endGroup();
// 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();

@ -28,9 +28,6 @@
#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
{

@ -40,10 +40,8 @@ UploaderConfigWidget::UploaderConfigWidget(QWidget *parent) :
loadSettings();
_crush = new UploaderConfigWidget_MediaCrush(this);
_imgur = new UploaderConfigWidget_ImgUr(this);
_ui->stackedHosts->addWidget(_crush);
_ui->stackedHosts->addWidget(_imgur);
void (QComboBox::*hostChanged)(int) = &QComboBox::currentIndexChanged;
@ -100,7 +98,6 @@ void UploaderConfigWidget::saveSettings()
config.saveSettings("common", savingValues);
QMetaObject::invokeMethod(_imgur, "saveSettings");
QMetaObject::invokeMethod(_crush, "saveSettings");
}
void UploaderConfigWidget::changeEvent(QEvent *e)

@ -22,7 +22,6 @@
#include <QWidget>
#include "imgur/uploaderconfigwidget_imgur.h"
#include "mediacrush/uploaderconfigwidget_mediacrush.h"
namespace Ui {
class UploaderConfigWidget;
@ -47,7 +46,6 @@ private:
Ui::UploaderConfigWidget *_ui;
// services widgets
UploaderConfigWidget_MediaCrush *_crush;
UploaderConfigWidget_ImgUr *_imgur;
};

@ -655,21 +655,6 @@ indem Sie die &lt;Esc&gt;-Taste oder die mittlere Maustaste drücken.</translati
<translation type="vanished">Keine Konfiguration vorhanden</translation>
</message>
</context>
<context>
<name>UploaderConfigWidget_MediaCrush</name>
<message>
<source>Form</source>
<translation type="vanished">Formular</translation>
</message>
<message>
<source>Configuration for mediacru.sh upload</source>
<translation type="vanished">Konfiguration für &lt;mediacru.sh&gt;</translation>
</message>
<message>
<source>Now is nothing yet</source>
<translation type="vanished">Keine Konfiguration vorhanden</translation>
</message>
</context>
<context>
<name>Uploader_ImgUr_Widget</name>
<message>
@ -677,17 +662,6 @@ indem Sie die &lt;Esc&gt;-Taste oder die mittlere Maustaste drücken.</translati
<translation type="vanished">Nach &lt;ImgUr.com&gt; hochladen</translation>
</message>
</context>
<context>
<name>Uploader_MediaCrush_Widget</name>
<message>
<source>Form</source>
<translation type="vanished">Formular</translation>
</message>
<message>
<source>Upload to MediaCrush</source>
<translation type="vanished">Nach &lt;MediaCrush&gt; hochladen</translation>
</message>
</context>
<context>
<name>aboutWidget</name>
<message>

@ -652,17 +652,6 @@ any key or using the right or middle mouse buttons.</source>
<translation type="vanished">Пока ничего нет</translation>
</message>
</context>
<context>
<name>UploaderConfigWidget_MediaCrush</name>
<message>
<source>Configuration for mediacru.sh upload</source>
<translation type="vanished">Настройка загрузки для mediacru.sh</translation>
</message>
<message>
<source>Now is nothing yet</source>
<translation type="vanished">Пока ничего нет</translation>
</message>
</context>
<context>
<name>Uploader_ImgUr_Widget</name>
<message>
@ -670,13 +659,6 @@ any key or using the right or middle mouse buttons.</source>
<translation type="vanished">Загрузка на ImgUr.com</translation>
</message>
</context>
<context>
<name>Uploader_MediaCrush_Widget</name>
<message>
<source>Upload to MediaCrush</source>
<translation type="vanished">Загрузить на MediaCrush</translation>
</message>
</context>
<context>
<name>aboutWidget</name>
<message>

@ -584,13 +584,6 @@ any key or using the right or middle mouse buttons.</source>
<translation type="vanished">Ще нічого немає</translation>
</message>
</context>
<context>
<name>UploaderConfigWidget_MediaCrush</name>
<message>
<source>Now is nothing yet</source>
<translation type="obsolete">Ще нічого немає</translation>
</message>
</context>
<context>
<name>Uploader_ImgUr_Widget</name>
<message>

@ -215,24 +215,6 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>UploaderConfigWidget_MediaCrush</name>
<message>
<location filename="../src/modules/uploader/mediacrush/uploaderconfigwidget_mediacrush.ui" line="14"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/modules/uploader/mediacrush/uploaderconfigwidget_mediacrush.ui" line="20"/>
<source>Configuration for mediacru.sh upload</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/modules/uploader/mediacrush/uploaderconfigwidget_mediacrush.ui" line="43"/>
<source>Now is nothing yet</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Uploader_ImgUr_Widget</name>
<message>
@ -241,17 +223,4 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Uploader_MediaCrush_Widget</name>
<message>
<location filename="../src/modules/uploader/mediacrush/uploader_mediacrush_widget.ui" line="14"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/modules/uploader/mediacrush/uploader_mediacrush_widget.ui" line="20"/>
<source>Upload to MediaCrush</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

Loading…
Cancel
Save