From 5d528b24359bbab2d7bff6e244ad02c63bec223a Mon Sep 17 00:00:00 2001 From: ArsenArsen Date: Tue, 27 Jun 2017 18:29:08 +0200 Subject: [PATCH] 4.0 4.1 soon as I haven't implemented multi monitor support yet --- docs/CNAME | 1 + docs/README.md | 45 +++++++++++++++++++++ docs/_config.yml | 1 + main.cpp | 2 +- mainwindow.cpp | 10 +++-- mainwindow.hpp | 2 + mainwindow.ui | 6 +++ platformspecifics/u32/u32backend.cpp | 2 +- recording/encoders/encoder.cpp | 2 +- recording/encoders/encodersettingsdialog.ui | 3 ++ screenshotter.cpp | 2 +- settingsdialog.ui | 4 +- 12 files changed, 71 insertions(+), 9 deletions(-) create mode 100644 docs/CNAME create mode 100644 docs/README.md create mode 100644 docs/_config.yml diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..daca5f8 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +kshare.arsenarsen.com diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..2e19b55 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,45 @@ +# **KShare** +## The open source and cross platform screen sharing software +###### Inspired by [ShareX](https://getsharex.com) + +KShare is a screenshotting utility built using Qt and written in C++. +It has many features, including: +* Area capture, +* Fullscreen capture, +* Active window capture, +* Magnifier, to make those aligments, +* Drawing on screenshots (blur, shapes, text, ...), +* Recording, +* Highly customizable video codecs, +* Automatic upload/clipboard copying, +* Hotkeys, +* Color picker, and last but not least, +* Custom upload destinations + +## Enough talking, show us how it looks +The main window is rather simple, with only a log, and a button in it: +![image1](http://i.imgur.com/QOebwEM.png) + +The settings have quite a bit more going on: +![image2](http://i.imgur.com/kZzQzGr.png) + +The area selection editor is simple: +![image3](http://i.imgur.com/kyWZk3p.jpg) + +And the color picker is the simplest thing ever: +![image4](http://i.imgur.com/VIeGbdQ.jpg) + +The way you select the area to record is by resizing this simple widget: +![image5](http://i.imgur.com/0iXFHnm.png) + +And when you start recording there is a simple preview shown: +![image6](http://i.imgur.com/6fu33TR.png) + +## Download +Currently, the only good download I provide is for Arch Linux and Ubuntu 17.04 +The Arch download is on the AUR as `kshare` and `kshare-git`, +and the Ubuntu build is a .deb found on my CI: [kshare.deb](https://nativeci.arsenarsen.com/job/KShare/73/artifact/packages/simpleName.deb) + +## Wait.. how do I actually use this? + +Here is the wiki: [`ding`](https://github.com/ArsenArsen/KShare/wiki) diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 0000000..fff4ab9 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-minimal diff --git a/main.cpp b/main.cpp index d2d8c0f..6e5e926 100644 --- a/main.cpp +++ b/main.cpp @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) { a.setQuitOnLastWindowClosed(false); a.setApplicationName("KShare"); a.setOrganizationName("ArsenArsen"); - a.setApplicationVersion("3.0"); + a.setApplicationVersion("4.0"); QCommandLineParser parser; parser.addHelpOption(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 6634544..9d9e0eb 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -46,10 +46,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi QAction *quit = new QAction("Quit", this); QAction *shtoggle = new QAction("Show/Hide", this); QAction *fullscreen = new QAction("Take fullscreen shot", this); + QAction *area = new QAction("Take area shot", this); - QAction *active = new QAction("Take area shot", this); #ifdef PLATFORM_CAPABILITY_ACTIVEWINDOW - QAction *area = new QAction("Screenshot active window", this); + QAction *active = new QAction("Screenshot active window", this); connect(active, &QAction::triggered, this, [] { screenshotter::activeDelayed(); }); #endif QAction *picker = new QAction("Show color picker", this); @@ -57,7 +57,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi QAction *recoff = new QAction("Stop recording", this); menu->addActions({ quit, shtoggle, picker }); menu->addSeparator(); - menu->addActions({ fullscreen, area }); + menu->addActions({ fullscreen, area, active }); #ifdef PLATFORM_CAPABILITY_ACTIVEWINDOW menu->addAction(area); #endif @@ -159,3 +159,7 @@ void MainWindow::on_actionAbout_triggered() { box->setAttribute(Qt::WA_DeleteOnClose); box->show(); } + +void MainWindow::on_actionActive_window_triggered() { + screenshotter::activeDelayed(); +} diff --git a/mainwindow.hpp b/mainwindow.hpp index cc52b30..4eb3b53 100644 --- a/mainwindow.hpp +++ b/mainwindow.hpp @@ -29,6 +29,8 @@ private slots: void on_actionColor_Picker_triggered(); void on_actionAbout_triggered(); + void on_actionActive_window_triggered(); + public: static MainWindow *inst(); explicit MainWindow(QWidget *parent = 0); diff --git a/mainwindow.ui b/mainwindow.ui index 18d3526..d68b223 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -70,6 +70,7 @@ + @@ -130,6 +131,11 @@ About + + + Active window + + diff --git a/platformspecifics/u32/u32backend.cpp b/platformspecifics/u32/u32backend.cpp index 650e68a..344ba68 100644 --- a/platformspecifics/u32/u32backend.cpp +++ b/platformspecifics/u32/u32backend.cpp @@ -26,5 +26,5 @@ DWORD PlatformBackend::pid() { } WId PlatformBackend::getActiveWID() { - return GetForegroundWindow(); + return (WId)GetForegroundWindow(); } diff --git a/recording/encoders/encoder.cpp b/recording/encoders/encoder.cpp index 52bb31c..2b2b58a 100644 --- a/recording/encoders/encoder.cpp +++ b/recording/encoders/encoder.cpp @@ -53,7 +53,7 @@ Encoder::Encoder(QString &targetFile, QSize res, CodecSettings *settings) { if (out->enc->codec_id == AV_CODEC_ID_GIF) out->enc->pix_fmt = AV_PIX_FMT_RGB8; else if (out->enc->codec_id == AV_CODEC_ID_H264 || out->enc->codec_id == AV_CODEC_ID_H265) { - av_dict_set(&dict, "preset", settings->h264Profile.toLocal8Bit().constData(), 0); + av_dict_set(&dict, "preset", settings ? settings->h264Profile.toLocal8Bit().constData() : "medium", 0); av_dict_set_int(&dict, "crf", OR_DEF(settings, h264Crf, 12), 0); } else if (out->enc->codec_id == AV_CODEC_ID_VP8 || out->enc->codec_id == AV_CODEC_ID_VP9) av_dict_set_int(&dict, "lossless", OR_DEF(settings, vp9Lossless, false), 0); diff --git a/recording/encoders/encodersettingsdialog.ui b/recording/encoders/encodersettingsdialog.ui index 362474b..0ba32c2 100644 --- a/recording/encoders/encodersettingsdialog.ui +++ b/recording/encoders/encodersettingsdialog.ui @@ -84,6 +84,9 @@ medium + + 5 + ultrafast diff --git a/screenshotter.cpp b/screenshotter.cpp index a39c7f5..c583557 100644 --- a/screenshotter.cpp +++ b/screenshotter.cpp @@ -29,7 +29,7 @@ void screenshotter::fullscreenDelayed() { } void screenshotter::activeDelayed() { - QTimer::singleShot(settings::settings().value("delay", 0.5).toFloat() * 1000, &screenshotter::activeDelayed); + QTimer::singleShot(settings::settings().value("delay", 0.5).toFloat() * 1000, &screenshotter::active); } void screenshotter::active() { diff --git a/settingsdialog.ui b/settingsdialog.ui index c5cef5e..f463ef3 100644 --- a/settingsdialog.ui +++ b/settingsdialog.ui @@ -88,7 +88,7 @@ - http://doc.qt.io/qt-5/qdatetime.html#toString + %(date format)date and %ext are supported Screenshot %(yyyy-MM-dd HH:mm:ss)date.%ext @@ -126,7 +126,7 @@ - Uploader selection: + Destination: