Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
645 KB
Referenced Files
None
Subscribers
None
This file is larger than 256 KB, so syntax highlighting was skipped.
This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
diff --git a/dialogs/aboutdialog.ui b/dialogs/aboutdialog.ui
new file mode 100644
index 0000000..76df1f9
--- /dev/null
+++ b/dialogs/aboutdialog.ui
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>AboutDialogClass</class>
+ <widget class="QDialog" name="AboutDialogClass">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>261</width>
+ <height>220</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>About - Lightscreen</string>
+ </property>
+ <layout class="QVBoxLayout" name="layout">
+ <item>
+ <widget class="QLabel" name="mainLabel">
+ <property name="text">
+ <string>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/b&gt;.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="versionLabel">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="linksLabel">
+ <property name="text">
+ <string>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Close</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <tabstops>
+ <tabstop>buttonBox</tabstop>
+ </tabstops>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>clicked(QAbstractButton*)</signal>
+ <receiver>AboutDialogClass</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>235</x>
+ <y>210</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>131</x>
+ <y>226</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/dialogs/areadialog.cpp b/dialogs/areadialog.cpp
new file mode 100644
index 0000000..3897aa8
--- /dev/null
+++ b/dialogs/areadialog.cpp
@@ -0,0 +1,571 @@
+/*
+ * Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 Luca Gugelmann <lucag@student.ethz.ch>
+ * released under the GNU LGPL <http://www.gnu.org/licenses/old-licenses/library.txt>
+ */
+
+#include "areadialog.h"
+#include "../tools/os.h"
+#include "../tools/screenshot.h"
+#include "../tools/screenshotmanager.h"
+
+#include <QPainter>
+#include <QMouseEvent>
+#include <QApplication>
+#include <QDesktopWidget>
+#include <QToolTip>
+#include <QPushButton>
+#include <Qsettings>
+#include <QHBoxLayout>
+#include <QTimer>
+
+#include <QDebug>
+
+AreaDialog::AreaDialog(Screenshot *screenshot) :
+ QDialog(0), mScreenshot(screenshot), mMouseDown(false), mMouseMagnifier(false),
+ mNewSelection(false), mHandleSize(10), mMouseOverHandle(0), mIdleTimer(),
+ mShowHelp(true), mGrabbing(false), mOverlayAlpha(1), mAutoclose(false),
+ mTLHandle(0, 0, mHandleSize, mHandleSize), mTRHandle(0, 0, mHandleSize, mHandleSize),
+ mBLHandle(0, 0, mHandleSize, mHandleSize), mBRHandle(0, 0, mHandleSize, mHandleSize),
+ mLHandle(0, 0, mHandleSize, mHandleSize), mTHandle(0, 0, mHandleSize, mHandleSize),
+ mRHandle(0, 0, mHandleSize, mHandleSize), mBHandle(0, 0, mHandleSize, mHandleSize)
+{
+ mHandles << &mTLHandle << &mTRHandle << &mBLHandle << &mBRHandle
+ << &mLHandle << &mTHandle << &mRHandle << &mBHandle;
+
+ mMouseOverHandle = &mBRHandle;
+
+ setMouseTracking(true);
+ setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint);
+
+ if (screenshot->options().magnify) {
+ setCursor(Qt::BlankCursor);
+ }
+ else {
+ setCursor(Qt::CrossCursor);
+ }
+
+ connect(&mIdleTimer, SIGNAL(timeout()), this, SLOT(displayHelp()));
+ mIdleTimer.start(2000);
+
+
+ mAutoclose = ScreenshotManager::instance()->settings()->value("options/areaAutoclose").toBool();
+
+ if (mAutoclose)
+ return; // Avoid creating the accept widget if it's not going to get used.
+
+ // Creating accept widget:
+ mAcceptWidget = new QWidget(this);
+ mAcceptWidget->resize(110, 60);
+ mAcceptWidget->setWindowOpacity(0.4);
+ mAcceptWidget->setGraphicsEffect(os::shadow(QColor(50, 50, 50, 255), 8));
+ mAcceptWidget->setStyleSheet("QWidget { background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(140, 140, 140, 230), stop:1 rgba(80, 80, 80, 230)); padding: 6px 10px; border: 1px solid rgba(0, 0, 0, 200); border-radius: 8px; } QPushButton { background: transparent; border: none; height: 50px; color: white; padding: 0; } QPushButton:hover { cursor: hand; }");
+
+ QPushButton *awAcceptButton = new QPushButton(QIcon(":/icons/yes.big"), "", this);
+ connect(awAcceptButton, SIGNAL(clicked()), this, SLOT(grabRect()));
+ awAcceptButton->setCursor(Qt::PointingHandCursor);
+ awAcceptButton->setIconSize(QSize(48, 48));
+ awAcceptButton->setGraphicsEffect(os::shadow(QColor(50, 50, 50, 255)));
+
+ QPushButton *awRejectButton = new QPushButton(QIcon(":/icons/no.big"), "", this);
+ connect(awRejectButton, SIGNAL(clicked()), this, SLOT(cancel()));
+ awRejectButton->setCursor(Qt::PointingHandCursor);
+ awRejectButton->setIconSize(QSize(48, 48));
+ awRejectButton->setGraphicsEffect(os::shadow(QColor(50, 50, 50, 255)));
+
+ QHBoxLayout *awLayout = new QHBoxLayout(this);
+ awLayout->addWidget(awAcceptButton);
+ awLayout->addWidget(awRejectButton);
+ awLayout->setMargin(0);
+ awLayout->setSpacing(0);
+
+ mAcceptWidget->setLayout(awLayout);
+ mAcceptWidget->setVisible(false);
+}
+
+AreaDialog::~AreaDialog()
+{
+ //releaseMouse();
+}
+
+QRect AreaDialog::resultRect()
+{
+ return mSelection;
+}
+
+void AreaDialog::displayHelp()
+{
+ mShowHelp = true;
+ update();
+}
+
+void AreaDialog::paintEvent(QPaintEvent* e)
+{
+ Q_UNUSED(e);
+
+ if (mGrabbing) // grabWindow() should just get the background
+ return;
+
+ QPainter painter(this);
+
+ QPalette pal = palette();
+ QFont font = QToolTip::font();
+
+ QColor handleColor(25, 115, 240, 180);
+ QColor overlayColor(0, 0, 0, mOverlayAlpha);
+ QColor textColor = pal.color(QPalette::Active, QPalette::Text);
+ QColor textBackgroundColor = pal.color(QPalette::Active, QPalette::Base);
+ painter.drawPixmap(0, 0, mScreenshot->pixmap());
+ painter.setFont(font);
+
+ QRect r = mSelection.normalized().adjusted(0, 0, -1, -1);
+
+ QRegion grey(rect());
+ grey = grey.subtracted(r);
+ painter.setPen(handleColor);
+ painter.setBrush(overlayColor);
+ painter.setClipRegion(grey);
+ painter.drawRect(-1, -1, rect().width() + 1, rect().height() + 1);
+ painter.setClipRect(rect());
+ painter.setBrush(Qt::NoBrush);
+ painter.drawRect(r);
+
+ if (mShowHelp) {
+ //Drawing the explanatory text.
+ QRect helpRect = qApp->desktop()->screenGeometry(qApp->desktop()->primaryScreen());
+ QString helpTxt = tr("Lightscreen area mode:\nUse your mouse to draw a rectangle to capture.\nPress any key or right click to exit.");
+
+ helpRect.setHeight(qRound(helpRect.height() / 10)); // We get a decently sized rect where the text should be drawn (centered)
+
+ // We draw the white contrasting background for the text, using the same text and options to get the boundingRect that the text will have.
+ painter.setPen(QPen(Qt::white));
+ painter.setBrush(QBrush(QColor(255, 255, 255, 180), Qt::SolidPattern));
+ QRectF bRect = painter.boundingRect(helpRect, Qt::AlignCenter, helpTxt);
+
+ // These four calls provide padding for the rect
+ bRect.setWidth(bRect.width() + 12);
+ bRect.setHeight(bRect.height() + 10);
+ bRect.setX(bRect.x() - 12);
+ bRect.setY(bRect.y() - 10);
+
+ painter.drawRoundedRect(bRect, 8, 8);
+
+ // Draw the text:
+ painter.setPen(QPen(Qt::black));
+ painter.drawText(helpRect, Qt::AlignCenter, helpTxt);
+ }
+
+ if (!mSelection.isNull()) {
+ // The grabbed region is everything which is covered by the drawn
+ // rectangles (border included). This means that there is no 0px
+ // selection, since a 0px wide rectangle will always be drawn as a line.
+ QString txt = QString("%1x%2").arg(mSelection.width() == 0 ? 2 : mSelection.width())
+ .arg(mSelection.height() == 0 ? 2 : mSelection.height());
+ QRect textRect = painter.boundingRect(rect(), Qt::AlignLeft, txt);
+ QRect boundingRect = textRect.adjusted(-4, 0, 0, 0);
+
+ if (textRect.width() < r.width() - 2*mHandleSize &&
+ textRect.height() < r.height() - 2*mHandleSize &&
+ (r.width() > 100 && r.height() > 100)) // center, unsuitable for small selections
+ {
+ boundingRect.moveCenter(r.center());
+ textRect.moveCenter(r.center());
+ }
+ else if (r.y() - 3 > textRect.height() &&
+ r.x() + textRect.width() < rect().right()) // on top, left aligned
+ {
+ boundingRect.moveBottomLeft(QPoint(r.x(), r.y() - 3));
+ textRect.moveBottomLeft(QPoint(r.x() + 2, r.y() - 3));
+ }
+ else if (r.x() - 3 > textRect.width()) // left, top aligned
+ {
+ boundingRect.moveTopRight(QPoint(r.x() - 3, r.y()));
+ textRect.moveTopRight(QPoint(r.x() - 5, r.y()));
+ }
+ else if (r.bottom() + 3 + textRect.height() < rect().bottom() &&
+ r.right() > textRect.width()) // at bottom, right aligned
+ {
+ boundingRect.moveTopRight(QPoint(r.right(), r.bottom() + 3));
+ textRect.moveTopRight(QPoint(r.right() - 2, r.bottom() + 3));
+ }
+ else if (r.right() + textRect.width() + 3 < rect().width()) // right, bottom aligned
+ {
+ boundingRect.moveBottomLeft(QPoint(r.right() + 3, r.bottom()));
+ textRect.moveBottomLeft(QPoint(r.right() + 5, r.bottom()));
+ }
+ // if the above didn't catch it, you are running on a very tiny screen...
+ painter.setPen(textColor);
+ painter.setBrush(textBackgroundColor);
+ painter.drawRect(boundingRect);
+ painter.drawText(textRect, txt);
+
+ if ((r.height() > mHandleSize*2 && r.width() > mHandleSize*2)
+ || !mMouseDown)
+ {
+ updateHandles();
+ painter.setPen(handleColor);
+ handleColor.setAlpha(80);
+ painter.setBrush(handleColor);
+ painter.drawRects(handleMask().rects());
+ }
+ }
+
+ if (!mScreenshot->options().magnify)
+ return;
+
+ // Drawing the magnified version
+ QPoint magStart, magEnd, drawPosition;
+ QRect newRect;
+
+ QRect pixmapRect = mScreenshot->pixmap().rect();
+
+ if (mMouseMagnifier) {
+ drawPosition = QCursor::pos() - QPoint(100, 100);
+
+ magStart = QCursor::pos() - QPoint(50, 50);
+ magEnd = QCursor::pos() + QPoint(50, 50);
+
+ newRect = QRect(magStart, magEnd);
+ }
+ else {
+ // So pretty.. oh so pretty.
+ if (mMouseOverHandle == &mTLHandle)
+ magStart = mSelection.topLeft();
+
+ if (mMouseOverHandle == &mTRHandle)
+ magStart = mSelection.topRight();
+
+ if (mMouseOverHandle == &mBLHandle)
+ magStart = mSelection.bottomLeft();
+
+ if (mMouseOverHandle == &mBRHandle)
+ magStart = mSelection.bottomRight();
+
+ if (mMouseOverHandle == &mLHandle)
+ magStart = QPoint(mSelection.left(), mSelection.center().y());
+
+ if (mMouseOverHandle == &mTHandle)
+ magStart = QPoint(mSelection.center().x(), mSelection.top());
+
+ if (mMouseOverHandle == &mRHandle)
+ magStart = QPoint(mSelection.right(), mSelection.center().y());
+
+ if (mMouseOverHandle == &mBHandle)
+ magStart = QPoint(mSelection.center().x(), mSelection.bottom());
+
+ magEnd = magStart;
+ drawPosition = mSelection.bottomRight();
+
+ magStart -= QPoint(50, 50);
+ magEnd += QPoint(50, 50);
+
+ newRect = QRect(magStart, magEnd);
+
+ if ((drawPosition.x()+newRect.width()*2) > pixmapRect.width())
+ drawPosition.setX(drawPosition.x()-newRect.width()*2);
+
+ if ((drawPosition.y()+newRect.height()*2) > pixmapRect.height())
+ drawPosition.setY(drawPosition.y()-newRect.height()*2);
+
+ if (drawPosition.y() == mSelection.bottomRight().y()-newRect.height()*2
+ && drawPosition.x() == mSelection.bottomRight().x()-newRect.width()*2)
+ painter.setOpacity(0.7);
+ }
+
+ if (!pixmapRect.contains(newRect, true))
+ return;
+
+ QPixmap magnified = mScreenshot->pixmap().copy(newRect).scaled(QSize(newRect.width()*2, newRect.height()*2));
+
+ QPainter magPainter(&magnified);
+ magPainter.setPen(QPen(QBrush(QColor(25, 115, 240)), 2)); // Same border pen
+ magPainter.drawRect(magnified.rect());
+ magPainter.drawText(magnified.rect().center()-QPoint(4, -4), "+"); //Center minus the 4 pixels wide and across of the "+" -- TODO: Test alternative DPI settings.
+
+ painter.drawPixmap(drawPosition, magnified);
+}
+
+void AreaDialog::resizeEvent(QResizeEvent* e)
+{
+ Q_UNUSED(e);
+
+ if (mSelection.isNull())
+ return;
+
+ QRect r = mSelection;
+ r.setTopLeft(limitPointToRect(r.topLeft(), rect()));
+ r.setBottomRight(limitPointToRect(r.bottomRight(), rect()));
+
+ if (r.width() <= 1 || r.height() <= 1) //this just results in ugly drawing...
+ r = QRect();
+
+ mSelection = r;
+}
+
+void AreaDialog::mousePressEvent(QMouseEvent* e)
+{
+ mShowHelp = false;
+ mIdleTimer.stop();
+
+ if (mAcceptWidget)
+ mAcceptWidget->hide();
+
+ if (e->button() == Qt::LeftButton) {
+ mMouseDown = true;
+ mDragStartPoint = e->pos();
+ mSelectionBeforeDrag = mSelection;
+ if (!mSelection.contains(e->pos())) {
+ mNewSelection = true;
+ mSelection = QRect();
+ mShowHelp = true;
+ setCursor(Qt::CrossCursor);
+ }
+ else {
+ setCursor(Qt::ClosedHandCursor);
+ }
+ }
+ else if (e->button() == Qt::RightButton
+ || e->button() == Qt::MidButton)
+ {
+ cancel();
+ }
+
+ update();
+}
+
+void AreaDialog::mouseMoveEvent(QMouseEvent* e)
+{
+ mMouseMagnifier = false;
+
+ if (mMouseDown) {
+
+ mMousePos = e->pos();
+
+ if (mNewSelection) {
+ QRect r = rect();
+ mSelection = QRect(mDragStartPoint, limitPointToRect(mMousePos, r)).normalized();
+ }
+ else if (mMouseOverHandle == 0) { // moving the whole selection
+ QRect r = rect().normalized(), s = mSelectionBeforeDrag.normalized();
+ QPoint p = s.topLeft() + e->pos() - mDragStartPoint;
+ r.setBottomRight(r.bottomRight() - QPoint(s.width(), s.height()));
+
+ if (!r.isNull() && r.isValid())
+ mSelection.moveTo(limitPointToRect(p, r));
+ }
+ else {// dragging a handle
+ QRect r = mSelectionBeforeDrag;
+ QPoint offset = e->pos() - mDragStartPoint;
+
+ if (mMouseOverHandle == &mTLHandle || mMouseOverHandle == &mTHandle
+ || mMouseOverHandle == &mTRHandle) // dragging one of the top handles
+ {
+ r.setTop(r.top() + offset.y());
+ }
+
+ if (mMouseOverHandle == &mTLHandle || mMouseOverHandle == &mLHandle
+ || mMouseOverHandle == &mBLHandle) // dragging one of the left handles
+ {
+ r.setLeft(r.left() + offset.x());
+ }
+
+ if (mMouseOverHandle == &mBLHandle || mMouseOverHandle == &mBHandle
+ || mMouseOverHandle == &mBRHandle) // dragging one of the bottom handles
+ {
+ r.setBottom(r.bottom() + offset.y());
+ }
+
+ if (mMouseOverHandle == &mTRHandle || mMouseOverHandle == &mRHandle
+ || mMouseOverHandle == &mBRHandle) // dragging one of the right handles
+ {
+ r.setRight(r.right() + offset.x());
+ }
+
+ r = r.normalized();
+ r.setTopLeft(limitPointToRect(r.topLeft(), rect()));
+ r.setBottomRight(limitPointToRect(r.bottomRight(), rect()));
+ mSelection = r;
+ }
+
+ if (mAcceptWidget) {
+ QPoint acceptPos = e->pos() + QPoint(0, 0);
+ QRect acceptRect = QRect(acceptPos, QSize(120, 70));
+
+ if ((acceptPos.x()+120) > mScreenshot->pixmap().rect().width())
+ acceptPos.setX(acceptPos.x()-120);
+
+ if ((acceptPos.y()+70) > mScreenshot->pixmap().rect().height())
+ acceptPos.setY(acceptPos.y()-70);
+
+ // Prevent the widget from overlapping the handles
+ if (acceptRect.intersects(mTLHandle)) {
+ acceptPos = mTLHandle.bottomRight() + QPoint(2, 2); // Corner case
+ }
+
+ if (acceptRect.intersects(mBRHandle)) {
+ acceptPos = mBRHandle.bottomRight();
+ }
+
+ if (acceptRect.intersects(mBHandle)) {
+ acceptPos = mBHandle.bottomRight();
+ }
+
+ if (acceptRect.intersects(mRHandle)) {
+ acceptPos = mRHandle.topRight();
+ }
+
+ mAcceptWidget->move(acceptPos);
+ }
+
+ update();
+ }
+ else
+ {
+ if (mSelection.isNull()) {
+ mMouseMagnifier = true;
+ update();
+ return;
+ }
+
+ bool found = false;
+ foreach(QRect* r, mHandles) {
+
+ if (r->contains(e->pos())) {
+ mMouseOverHandle = r;
+ found = true;
+ break;
+ }
+
+ }
+
+ if (!found) {
+ mMouseOverHandle = 0;
+ if (mSelection.contains(e->pos()))
+ setCursor(Qt::OpenHandCursor);
+ else if (mAcceptWidget && QRect(mAcceptWidget->mapToParent(mAcceptWidget->pos()), QSize(100, 60)).contains(e->pos()))
+ setCursor(Qt::PointingHandCursor);
+ else
+ setCursor(Qt::CrossCursor);
+ }
+ else {
+ if (mMouseOverHandle == &mTLHandle || mMouseOverHandle == &mBRHandle)
+ setCursor(Qt::SizeFDiagCursor);
+ if (mMouseOverHandle == &mTRHandle || mMouseOverHandle == &mBLHandle)
+ setCursor(Qt::SizeBDiagCursor);
+ if (mMouseOverHandle == &mLHandle || mMouseOverHandle == &mRHandle)
+ setCursor(Qt::SizeHorCursor);
+ if (mMouseOverHandle == &mTHandle || mMouseOverHandle == &mBHandle)
+ setCursor(Qt::SizeVerCursor);
+ }
+ }
+}
+
+void AreaDialog::mouseReleaseEvent(QMouseEvent* e)
+{
+ if (mAutoclose)
+ grabRect();
+
+ if (!mSelection.isNull() && mAcceptWidget)
+ mAcceptWidget->show();
+
+ mMouseDown = false;
+ mNewSelection = false;
+ mIdleTimer.start();
+
+ if (mMouseOverHandle == 0 && mSelection.contains(e->pos()))
+ setCursor(Qt::OpenHandCursor);
+
+ update();
+}
+
+void AreaDialog::mouseDoubleClickEvent(QMouseEvent*)
+{
+ grabRect();
+}
+
+void AreaDialog::keyPressEvent(QKeyEvent* e)
+{
+ if (e->key() == Qt::Key_Escape) {
+ cancel();
+ }
+ else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
+ grabRect();
+ }
+ else {
+ e->ignore();
+ }
+}
+
+void AreaDialog::showEvent(QShowEvent* e)
+{
+ Q_UNUSED(e)
+
+ QRect geometry = qApp->desktop()->geometry();
+
+ if (mScreenshot->options().currentMonitor) {
+ geometry = qApp->desktop()->screenGeometry(qApp->desktop()->screenNumber(QCursor::pos()));
+ }
+
+ resize(geometry.size());
+ move(geometry.topLeft());
+
+ if (mScreenshot->options().animations) {
+ os::effect(this, SLOT(animationTick(int)), 85, 300);
+ }
+ else {
+ animationTick(85);
+ }
+
+ setMouseTracking(true);
+}
+
+void AreaDialog::grabRect()
+{
+ QRect r = mSelection.normalized();
+ if (!r.isNull() && r.isValid()) {
+ mGrabbing = true;
+ accept();
+ }
+}
+
+void AreaDialog::cancel()
+{
+ reject();
+}
+
+void AreaDialog::animationTick(int frame)
+{
+ mOverlayAlpha = frame;
+ update();
+}
+
+void AreaDialog::updateHandles()
+{
+ QRect r = mSelection.normalized().adjusted(0, 0, -1, -1);
+ int s2 = mHandleSize / 2;
+
+ mTLHandle.moveTopLeft(r.topLeft());
+ mTRHandle.moveTopRight(r.topRight());
+ mBLHandle.moveBottomLeft(r.bottomLeft());
+ mBRHandle.moveBottomRight(r.bottomRight());
+
+ mLHandle.moveTopLeft(QPoint(r.x(), r.y() + r.height() / 2 - s2));
+ mTHandle.moveTopLeft(QPoint(r.x() + r.width() / 2 - s2, r.y()));
+ mRHandle.moveTopRight(QPoint(r.right(), r.y() + r.height() / 2 - s2));
+ mBHandle.moveBottomLeft(QPoint(r.x() + r.width() / 2 - s2, r.bottom()));
+}
+
+QRegion AreaDialog::handleMask() const
+{
+ // note: not normalized QRects are bad here, since they will not be drawn
+ QRegion mask;
+ foreach(QRect* rect, mHandles) mask += QRegion(*rect);
+ return mask;
+}
+
+QPoint AreaDialog::limitPointToRect(const QPoint &p, const QRect &r) const
+{
+ QPoint q;
+ q.setX(p.x() < r.x() ? r.x() : p.x() < r.right() ? p.x() : r.right());
+ q.setY(p.y() < r.y() ? r.y() : p.y() < r.bottom() ? p.y() : r.bottom());
+ return q;
+}
diff --git a/dialogs/areadialog.h b/dialogs/areadialog.h
new file mode 100644
index 0000000..dc42f26
--- /dev/null
+++ b/dialogs/areadialog.h
@@ -0,0 +1,82 @@
+/*
+ * Based on KDE's KSnapshot regiongrabber.h, revision 772337, Copyright 2007 Luca Gugelmann <lucag@student.ethz.ch>
+ * released under the GNU LGPL <http://www.gnu.org/licenses/old-licenses/library.txt>
+ */
+
+#ifndef AREADIALOG_H
+#define AREADIALOG_H
+
+#include <QDialog>
+#include <QVector>
+#include <QPointer>
+#include <QTimer>
+
+struct QRegion;
+struct QPoint;
+struct QRect;
+class QPaintEvent;
+class QResizeEvent;
+class QMouseEvent;
+class Screenshot;
+
+class AreaDialog : public QDialog
+{
+ Q_OBJECT
+public:
+ AreaDialog(Screenshot* screenshot);
+ ~AreaDialog();
+ QRect resultRect();
+
+protected slots:
+ void displayHelp();
+ void grabRect();
+ void cancel();
+ void animationTick(int frame);
+
+signals:
+ void regionGrabbed( const QPixmap & );
+
+protected:
+ void paintEvent( QPaintEvent* e );
+ void resizeEvent( QResizeEvent* e );
+ void mousePressEvent( QMouseEvent* e );
+ void mouseMoveEvent( QMouseEvent* e );
+ void mouseReleaseEvent( QMouseEvent* e );
+ void mouseDoubleClickEvent( QMouseEvent* );
+ void keyPressEvent( QKeyEvent* e );
+ void showEvent( QShowEvent* e );
+
+ void updateHandles();
+
+ QRegion handleMask() const;
+ QPoint limitPointToRect( const QPoint &p, const QRect &r ) const;
+
+ Screenshot *mScreenshot;
+ QPoint mMousePos;
+ QRect mSelection;
+ bool mMouseDown;
+ bool mMouseMagnifier;
+ bool mNewSelection;
+ const int mHandleSize;
+ QRect *mMouseOverHandle;
+ QPoint mDragStartPoint;
+ QRect mSelectionBeforeDrag;
+ QTimer mIdleTimer;
+ bool mShowHelp;
+ bool mGrabbing;
+ int mOverlayAlpha;
+ bool mAutoclose;
+
+
+ // naming convention for handles
+ // T top, B bottom, R Right, L left
+ // 2 letters: a corner
+ // 1 letter: the handle on the middle of the corresponding side
+ QRect mTLHandle, mTRHandle, mBLHandle, mBRHandle;
+ QRect mLHandle, mTHandle, mRHandle, mBHandle;
+
+ QVector<QRect*> mHandles;
+ QPointer<QWidget> mAcceptWidget;
+};
+
+#endif
diff --git a/dialogs/namingdialog.cpp b/dialogs/namingdialog.cpp
new file mode 100644
index 0000000..5ee69b6
--- /dev/null
+++ b/dialogs/namingdialog.cpp
@@ -0,0 +1,80 @@
+#include "namingdialog.h"
+#include "../tools/screenshot.h"
+#include "../tools/os.h"
+#include "../tools/screenshotmanager.h"
+
+#include <QSettings>
+#include <QKeyEvent>
+#include <QUrl>
+#include <QDesktopServices>
+
+NamingDialog::NamingDialog(Screenshot::Naming naming,QWidget *parent) :
+ QDialog(parent)
+{
+ ui.setupUi(this);
+ setModal(true);
+ setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
+
+ ui.dateFormatComboBox->installEventFilter(this);
+
+ // Aero
+ if (os::aeroGlass(this)) {
+ ui.container->setStyleSheet("#container { background: palette(light); border: 1px solid palette(dark); border-radius: 4px; }");
+ ui.container->setWindowOpacity(0.5);
+ layout()->setMargin(2);
+ }
+
+ // Settings
+ QSettings *s = ScreenshotManager::instance()->settings();
+ ui.flipNamingCheckBox->setChecked(s->value("options/flip", false).toBool());
+
+ ui.dateFormatComboBox->setCurrentIndex(
+ ui.dateFormatComboBox->findText(s->value("options/naming/dateFormat", "yyyy-MM-dd").toString())
+ );
+
+ if (ui.dateFormatComboBox->currentIndex() == -1) {
+ ui.dateFormatComboBox->addItem(s->value("options/naming/dateFormat", "yyyy-MM-dd").toString());
+ ui.dateFormatComboBox->setCurrentIndex(ui.dateFormatComboBox->count()-1);
+ }
+
+ ui.leadingZerosSpinBox->setValue(s->value("options/naming/leadingZeros", 0).toInt());
+
+ // Signals/Slots
+ connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(saveSettings()));
+ connect(ui.dateHelpLabel, SIGNAL(linkActivated(QString)), this, SLOT(openUrl(QString)));
+
+ // Stack & window size adjustments
+ ui.stack->setCurrentIndex((int)naming);
+ ui.stack->currentWidget()->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
+
+ resize(minimumSizeHint());
+}
+
+void NamingDialog::saveSettings()
+{
+ QSettings *s = ScreenshotManager::instance()->settings();
+ s->setValue("options/flip" , ui.flipNamingCheckBox->isChecked());
+ s->setValue("options/naming/dateFormat" , ui.dateFormatComboBox->currentText());
+ s->setValue("options/naming/leadingZeros", ui.leadingZerosSpinBox->value());
+}
+
+void NamingDialog::openUrl(QString url)
+{
+ QDesktopServices::openUrl(QUrl(url));
+}
+
+bool NamingDialog::eventFilter(QObject *object, QEvent *event)
+{
+ if (event->type() == QEvent::KeyPress
+ && object == ui.dateFormatComboBox)
+ {
+ QKeyEvent *keyEvent = (QKeyEvent*)(event);
+ if (QRegExp("[?:\\\\/*\"<>|]").exactMatch(keyEvent->text())) {
+ event->ignore();
+ return true;
+ }
+ }
+
+ return QDialog::eventFilter(object, event);
+}
+
diff --git a/dialogs/namingdialog.h b/dialogs/namingdialog.h
new file mode 100644
index 0000000..72f53f9
--- /dev/null
+++ b/dialogs/namingdialog.h
@@ -0,0 +1,27 @@
+#ifndef NAMINGDIALOG_H
+#define NAMINGDIALOG_H
+
+#include "ui_namingdialog.h"
+#include "tools/screenshot.h"
+
+#include <QUrl>
+
+class NamingDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit NamingDialog(Screenshot::Naming naming, QWidget *parent = 0);
+
+protected:
+ bool eventFilter(QObject *object, QEvent *event);
+
+private slots:
+ void openUrl(QString url);
+ void saveSettings();
+
+private:
+ Ui::NamingDialog ui;
+};
+
+#endif // NAMINGDIALOG_H
diff --git a/dialogs/namingdialog.ui b/dialogs/namingdialog.ui
new file mode 100644
index 0000000..f845782
--- /dev/null
+++ b/dialogs/namingdialog.ui
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>NamingDialog</class>
+ <widget class="QDialog" name="NamingDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>174</width>
+ <height>88</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Naming Options - Lightscreen</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QWidget" name="container" native="true">
+ <layout class="QVBoxLayout" name="verticalLayout_11">
+ <property name="margin">
+ <number>9</number>
+ </property>
+ <item>
+ <widget class="QStackedWidget" name="stack">
+ <property name="currentIndex">
+ <number>1</number>
+ </property>
+ <widget class="QWidget" name="numericStackPage">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Ignored" vsizetype="Ignored">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QGridLayout" name="namePageLayout">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="leadingZerosLabel">
+ <property name="text">
+ <string>Leading zeros:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QSpinBox" name="leadingZerosSpinBox">
+ <property name="buttonSymbols">
+ <enum>QAbstractSpinBox::PlusMinus</enum>
+ </property>
+ <property name="minimum">
+ <number>0</number>
+ </property>
+ <property name="maximum">
+ <number>25</number>
+ </property>
+ <property name="value">
+ <number>0</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <spacer name="horizontalSpacer_9">
+ <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>
+ </widget>
+ <widget class="QWidget" name="dateStackPage">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Ignored" vsizetype="Ignored">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <property name="horizontalSpacing">
+ <number>0</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="dateFormatLabel">
+ <property name="text">
+ <string>Date Format:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <spacer name="horizontalSpacer_10">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>1</width>
+ <height>1</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2">
+ <widget class="QLabel" name="dateHelpLabel">
+ <property name="font">
+ <font>
+ <pointsize>10</pointsize>
+ </font>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">margin-left: 4px</string>
+ </property>
+ <property name="text">
+ <string> &lt;a href=&quot;http://lightscreen.sourceforge.net/help/date&quot;&gt;[?]&lt;/a&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QComboBox" name="dateFormatComboBox">
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <item>
+ <property name="text">
+ <string>yyyy-MM-dd</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>yyyy-MM-dd HH.mm.ss</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="timestampStackPage">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Ignored" vsizetype="Ignored">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="flipNamingCheckBox">
+ <property name="text">
+ <string>Flip naming.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>NamingDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>NamingDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/dialogs/optionsdialog-orig.ui b/dialogs/optionsdialog-orig.ui
new file mode 100644
index 0000000..e076e8d
--- /dev/null
+++ b/dialogs/optionsdialog-orig.ui
@@ -0,0 +1,794 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>OptionsDialog</class>
+ <widget class="QDialog" name="OptionsDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>354</width>
+ <height>278</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Options - Lightscreen</string>
+ </property>
+ <layout class="QVBoxLayout" name="optionsLayout">
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="generalTab">
+ <attribute name="title">
+ <string>&amp;General</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="generalLayout">
+ <item>
+ <widget class="QGroupBox" name="fileGroupBox">
+ <property name="title">
+ <string>File</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="fileGroupBoxLayout">
+ <property name="verticalSpacing">
+ <number>4</number>
+ </property>
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="directoryLabel">
+ <property name="text">
+ <string>&amp;Directory:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>targetLineEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="targetLineEdit">
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QPushButton" name="browsePushButton">
+ <property name="maximumSize">
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../lightscreen.qrc">
+ <normaloff>:/icons/OpenFolder</normaloff>:/icons/OpenFolder</iconset>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="filenameLabel">
+ <property name="toolTip">
+ <string>The prefix for the screenshot file</string>
+ </property>
+ <property name="text">
+ <string>&amp;Filename:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>prefixLineEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <layout class="QHBoxLayout" name="filenameLayout">
+ <property name="spacing">
+ <number>3</number>
+ </property>
+ <item>
+ <widget class="QLineEdit" name="prefixLineEdit">
+ <property name="whatsThis">
+ <string>The prefix will be inserted before the &lt;em&gt;Naming&lt;/em&gt; in the screenshot file and it is usually used to distinguish files. It can be left blank.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="namingComboBox">
+ <property name="whatsThis">
+ <string>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3.
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp) that corresponds with the current time.
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss.</string>
+ </property>
+ <item>
+ <property name="text">
+ <string>(number)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>(date)</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="2">
+ <widget class="QPushButton" name="flipPrefixPushButton">
+ <property name="icon">
+ <iconset resource="../lightscreen.qrc">
+ <normaloff>:/icons/PrefixLeft</normaloff>:/icons/PrefixLeft</iconset>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="formatLabel">
+ <property name="toolTip">
+ <string>The file format for the screenshot</string>
+ </property>
+ <property name="text">
+ <string>F&amp;ormat:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>formatComboBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QComboBox" name="formatComboBox">
+ <item>
+ <property name="text">
+ <string>PNG</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>JPG</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>BMP</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="delayLabel">
+ <property name="text">
+ <string>D&amp;elay:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>delaySpinBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QSpinBox" name="delaySpinBox">
+ <property name="whatsThis">
+ <string>Selecting anything other than 0 in this option will cause the program to &lt;b&gt;wait&lt;/b&gt; that amount of seconds before taking the screenshot.</string>
+ </property>
+ <property name="specialValueText">
+ <string>none</string>
+ </property>
+ <property name="accelerated">
+ <bool>true</bool>
+ </property>
+ <property name="correctionMode">
+ <enum>QAbstractSpinBox::CorrectToNearestValue</enum>
+ </property>
+ <property name="suffix">
+ <string> seconds</string>
+ </property>
+ <property name="prefix">
+ <string/>
+ </property>
+ <property name="maximum">
+ <number>32767</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>1</width>
+ <height>1</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="startupCheckBox">
+ <property name="whatsThis">
+ <string/>
+ </property>
+ <property name="text">
+ <string>&amp;Run Lightscreen at system startup.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="startupHideLayout">
+ <item>
+ <spacer name="startupHideSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>10</width>
+ <height>15</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="startupHideCheckBox">
+ <property name="whatsThis">
+ <string/>
+ </property>
+ <property name="text">
+ <string>H&amp;ide the main window.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="hotkeysTab">
+ <attribute name="title">
+ <string>&amp;Hotkeys</string>
+ </attribute>
+ <layout class="QGridLayout" name="hotkeyLayout">
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="screenCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Capture the screen</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <spacer name="hotkeySpacer">
+ <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 row="1" column="0" colspan="2">
+ <widget class="QCheckBox" name="windowCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Capture the current window</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="HotkeyWidget" name="windowHotkeyWidget">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="2">
+ <widget class="QCheckBox" name="windowPickerCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Capture a chosen window</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="HotkeyWidget" name="windowPickerHotkeyWidget">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" colspan="2">
+ <widget class="QCheckBox" name="areaCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Capture a screen area</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="3">
+ <widget class="HotkeyWidget" name="areaHotkeyWidget">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" rowspan="2" colspan="4">
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" colspan="2">
+ <widget class="QCheckBox" name="openCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Open the program window</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="3" rowspan="2">
+ <widget class="HotkeyWidget" name="openHotkeyWidget">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0" colspan="2">
+ <widget class="QCheckBox" name="directoryCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Open the directory</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="3">
+ <widget class="HotkeyWidget" name="directoryHotkeyWidget">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="HotkeyWidget" name="screenHotkeyWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="optionsTab">
+ <attribute name="title">
+ <string>&amp;Options</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="optionsLayout_2">
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QCheckBox" name="trayCheckBox">
+ <property name="whatsThis">
+ <string/>
+ </property>
+ <property name="text">
+ <string>Sho&amp;w a system tray icon.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="hideCheckBox">
+ <property name="text">
+ <string>&amp;Hide Lightscreen while taking a screenshot.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="magnifyCheckBox">
+ <property name="text">
+ <string>&amp;Magnify around the mouse in Area mode.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="previewCheckBox">
+ <property name="text">
+ <string>View a preview of each screenshot.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="languageLayout">
+ <item>
+ <widget class="QLabel" name="languageLabel">
+ <property name="text">
+ <string>&amp;Language:</string>
+ </property>
+ <property name="buddy">
+ <cstring>languageComboBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="languageComboBox"/>
+ </item>
+ <item>
+ <widget class="QLabel" name="moreInformationLabel">
+ <property name="whatsThis">
+ <string>Click here to go to the Lightscreen homepage to learn more about translations.</string>
+ </property>
+ <property name="text">
+ <string>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;More information..&lt;/a&gt;</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="languageSpacer">
+ <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>
+ <item>
+ <layout class="QHBoxLayout" name="notifyLayout">
+ <property name="spacing">
+ <number>12</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="notifyLabel">
+ <property name="text">
+ <string>&amp;Notify with:</string>
+ </property>
+ <property name="buddy">
+ <cstring>messageCheckBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="messageCheckBox">
+ <property name="whatsThis">
+ <string>Shows a completion message once the screenshot is saved, clicking this message takes you to the directory where the screenshot was saved.</string>
+ </property>
+ <property name="text">
+ <string>Tray icon Popup</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="playSoundCheckBox">
+ <property name="text">
+ <string>&amp;Sound cue</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <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>
+ <item>
+ <layout class="QHBoxLayout" name="qualityLayout">
+ <item>
+ <widget class="QLabel" name="qualityLabel">
+ <property name="text">
+ <string>Screenshot &amp;Quality:</string>
+ </property>
+ <property name="buddy">
+ <cstring>qualitySlider</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="qualitySlider">
+ <property name="whatsThis">
+ <string>This slider goes from 0 to 100. 100 being the highest quality and 0 the lowest.&lt;br&gt;
+Quality is related to file size and of course to readability and overall quality of the image.</string>
+ </property>
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="qualityValueLabel">
+ <property name="text">
+ <string>100</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="qualityPercentLabel">
+ <property name="text">
+ <string>%</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="advancedTab">
+ <attribute name="title">
+ <string>&amp;Advanced</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QCheckBox" name="saveAsCheckBox">
+ <property name="text">
+ <string>Choose where and how to &amp;save each screenshot (&quot;&amp;Save as&quot;).</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="clipboardCheckBox">
+ <property name="text">
+ <string>&amp;Copy the screenshot to the clipboard.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cursorCheckBox">
+ <property name="text">
+ <string>Inc&amp;lude the cursor in the screenshot.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="currentMonitorCheckBox">
+ <property name="text">
+ <string>&amp;Grab only the current monitor.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="optiPngCheckBox">
+ <property name="toolTip">
+ <string>Opens a new process called OptiPNG which dramatically reduces the file size.</string>
+ </property>
+ <property name="text">
+ <string>O&amp;ptimize PNG screenshots.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="warnHideCheckBox">
+ <property name="text">
+ <string>Warn when hiding without a tra&amp;y icon.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="updaterCheckBox">
+ <property name="text">
+ <string>Check for updates regularly.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>2</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="advancedButtonLayout">
+ <item>
+ <widget class="QPushButton" name="checkUpdatesPushButton">
+ <property name="text">
+ <string>Chec&amp;k Updates Now</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="advancedButtonSpacer">
+ <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="QPushButton" name="aboutPushButton">
+ <property name="text">
+ <string>About Lightscreen</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>HotkeyWidget</class>
+ <extends>QPushButton</extends>
+ <header>widgets/hotkeywidget.h</header>
+ </customwidget>
+ </customwidgets>
+ <tabstops>
+ <tabstop>fileGroupBox</tabstop>
+ <tabstop>targetLineEdit</tabstop>
+ <tabstop>browsePushButton</tabstop>
+ <tabstop>prefixLineEdit</tabstop>
+ <tabstop>namingComboBox</tabstop>
+ <tabstop>flipPrefixPushButton</tabstop>
+ <tabstop>formatComboBox</tabstop>
+ <tabstop>delaySpinBox</tabstop>
+ <tabstop>startupCheckBox</tabstop>
+ <tabstop>trayCheckBox</tabstop>
+ <tabstop>hideCheckBox</tabstop>
+ <tabstop>magnifyCheckBox</tabstop>
+ <tabstop>languageComboBox</tabstop>
+ <tabstop>messageCheckBox</tabstop>
+ <tabstop>playSoundCheckBox</tabstop>
+ <tabstop>qualitySlider</tabstop>
+ <tabstop>buttonBox</tabstop>
+ </tabstops>
+ <resources>
+ <include location="../lightscreen.qrc"/>
+ </resources>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>OptionsDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>289</x>
+ <y>280</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/dialogs/optionsdialog.cpp b/dialogs/optionsdialog.cpp
new file mode 100644
index 0000000..ff47f32
--- /dev/null
+++ b/dialogs/optionsdialog.cpp
@@ -0,0 +1,624 @@
+#include <QCompleter>
+#include <QDate>
+#include <QDesktopServices>
+#include <QDesktopWidget>
+#include <QDirModel>
+#include <QFileDialog>
+#include <QKeyEvent>
+#include <QMessageBox>
+#include <QSettings>
+#include <QUrl>
+#include <QTimer>
+
+#include <QDebug>
+
+#if defined(Q_WS_WIN)
+ #include <windows.h>
+#endif
+
+#include "optionsdialog.h"
+#include "namingdialog.h"
+#include "../tools/os.h"
+#include "../tools/screenshot.h"
+#include "../tools/screenshotmanager.h"
+#include "../updater/updater.h"
+
+OptionsDialog::OptionsDialog(QWidget *parent) :
+ QDialog(parent)
+{
+ ui.setupUi(this);
+ setModal(true);
+
+ if (os::aeroGlass(this)) {
+ layout()->setMargin(2);
+ resize(minimumSizeHint());
+ }
+
+ QTimer::singleShot(0, this, SLOT(init()));
+ QTimer::singleShot(1, this, SLOT(loadSettings()));
+}
+
+void OptionsDialog::init()
+{
+#if !defined(Q_WS_WIN)
+ ui.cursorCheckBox->setVisible(false);
+ ui.cursorCheckBox->setChecked(false);
+#endif
+
+ // Make the scroll area share the Tab Widget background color
+ QPalette optionsPalette = ui.optionsScrollArea->palette();
+ optionsPalette.setColor(QPalette::Window, ui.tabWidget->palette().color(QPalette::Base));
+ ui.optionsScrollArea->setPalette(optionsPalette);
+
+ ui.buttonBox->addButton(new QPushButton(" " + tr("Restore Defaults") + " ", this), QDialogButtonBox::ResetRole);
+
+ // Set up the autocomplete for the directory.
+ QCompleter *completer = new QCompleter(this);
+ completer->setModel(new QDirModel(QStringList(), QDir::Dirs, QDir::Name, completer));
+ ui.targetLineEdit->setCompleter(completer);
+
+ // HotkeyWidget icons.
+ ui.screenHotkeyWidget->setIcon (QIcon(":/icons/screen"));
+ ui.windowHotkeyWidget->setIcon (QIcon(":/icons/window"));
+ ui.windowPickerHotkeyWidget->setIcon(QIcon(":/icons/picker"));
+ ui.areaHotkeyWidget->setIcon (QIcon(":/icons/area"));
+ ui.openHotkeyWidget->setIcon (QIcon(":/icons/lightscreen.small"));
+ ui.directoryHotkeyWidget->setIcon (QIcon(":/icons/folder"));
+
+ // Version
+ ui.versionLabel->setText(tr("Version %1").arg(qApp->applicationVersion()));
+
+ setEnabled(false); // We disable the widgets to prevent any user interaction until the settings have loaded.
+ setUpdatesEnabled(false);
+
+ //
+ // Connections
+ //
+
+ connect(ui.buttonBox , SIGNAL(clicked(QAbstractButton*)), this , SLOT(dialogButtonClicked(QAbstractButton*)));
+ connect(ui.buttonBox , SIGNAL(accepted()) , this , SLOT(accepted()));
+ connect(ui.buttonBox , SIGNAL(rejected()) , this , SLOT(rejected()));
+ connect(ui.namingOptionsButton , SIGNAL(clicked()) , this , SLOT(namingOptions()));
+
+ connect(ui.prefixLineEdit , SIGNAL(textChanged(QString)) , this , SLOT(updatePreview()));
+ connect(ui.formatComboBox , SIGNAL(currentIndexChanged(int)) , this , SLOT(updatePreview()));
+ connect(ui.namingComboBox , SIGNAL(currentIndexChanged(int)) , this , SLOT(updatePreview()));
+
+ connect(ui.browsePushButton , SIGNAL(clicked()) , this , SLOT(browse()));
+ connect(ui.checkUpdatesPushButton , SIGNAL(clicked()) , this , SLOT(checkUpdatesNow()));
+
+ connect(ui.screenCheckBox , SIGNAL(toggled(bool)), ui.screenHotkeyWidget , SLOT(setEnabled(bool)));
+ connect(ui.areaCheckBox , SIGNAL(toggled(bool)), ui.areaHotkeyWidget , SLOT(setEnabled(bool)));
+ connect(ui.windowCheckBox , SIGNAL(toggled(bool)), ui.windowHotkeyWidget , SLOT(setEnabled(bool)));
+ connect(ui.windowPickerCheckBox, SIGNAL(toggled(bool)), ui.windowPickerHotkeyWidget, SLOT(setEnabled(bool)));
+ connect(ui.openCheckBox , SIGNAL(toggled(bool)), ui.openHotkeyWidget , SLOT(setEnabled(bool)));
+ connect(ui.directoryCheckBox , SIGNAL(toggled(bool)), ui.directoryHotkeyWidget, SLOT(setEnabled(bool)));
+ connect(ui.saveAsCheckBox , SIGNAL(toggled(bool)), ui.targetLineEdit , SLOT(setDisabled(bool)));
+ connect(ui.saveAsCheckBox , SIGNAL(toggled(bool)), ui.browsePushButton , SLOT(setDisabled(bool)));
+ connect(ui.saveAsCheckBox , SIGNAL(toggled(bool)), ui.directoryLabel , SLOT(setDisabled(bool)));
+ connect(ui.startupCheckBox , SIGNAL(toggled(bool)), ui.startupHideCheckBox , SLOT(setEnabled(bool)));
+ connect(ui.qualitySlider , SIGNAL(valueChanged(int)), ui.qualityValueLabel, SLOT(setNum(int)));
+ connect(ui.trayCheckBox , SIGNAL(toggled(bool)), ui.messageCheckBox , SLOT(setEnabled(bool)));
+
+ connect(ui.moreInformationLabel, SIGNAL(linkActivated(QString)) , this, SLOT(openUrl(QString)));
+ connect(ui.languageComboBox , SIGNAL(currentIndexChanged(QString)), this, SLOT(languageChange(QString)));
+
+ connect(ui.mainLabel , SIGNAL(linkActivated(QString)), this, SLOT(openUrl(QString)));
+ connect(ui.linksLabel, SIGNAL(linkActivated(QString)), this, SLOT(openUrl(QString)));
+
+ //
+ // Languages
+ //
+
+ QDir languages(":/translations");
+
+ ui.languageComboBox->addItem("English");
+
+ foreach (QString language, languages.entryList()) {
+ ui.languageComboBox->addItem(language);
+ }
+}
+
+void OptionsDialog::namingOptions()
+{
+ NamingDialog namingDialog((Screenshot::Naming) ui.namingComboBox->currentIndex());
+
+ namingDialog.exec();
+ flipToggled(settings()->value("options/flip").toBool());
+ updatePreview();
+}
+
+QSettings *OptionsDialog::settings() const
+{
+ return ScreenshotManager::instance()->settings();
+}
+
+/*
+ * Slots
+ */
+
+void OptionsDialog::accepted()
+{
+ if (hotkeyCollision()) {
+ QMessageBox::critical(this, tr("Hotkey conflict"), tr("You have assigned the same hotkeys to more than one action."));
+ return;
+ }
+
+ if (ui.prefixLineEdit->text().contains(QRegExp("[?:\\\\/*\"<>|]"))) {
+ QMessageBox::critical(this, tr("Filename character error"), tr("The filename can't contain any of the following characters: ? : \\ / * \" < > |"));
+ return;
+ }
+
+ if (!ui.fileGroupBox->isChecked() && !ui.clipboardCheckBox->isChecked()) {
+ QMessageBox::critical(this, tr("Final Destination"), tr("You can't take screenshots unless you enable either file saving or the clipboard."));
+ return;
+ }
+
+ saveSettings();
+ accept();
+}
+
+void OptionsDialog::browse()
+{
+ QString fileName = QFileDialog::getExistingDirectory(this,
+ tr("Select where you want to save the screenshots"),
+ ui.targetLineEdit->text());
+
+ if (fileName.isEmpty())
+ return;
+
+ ui.targetLineEdit->setText(fileName);
+}
+
+void OptionsDialog::checkUpdatesNow()
+{
+ Updater::instance()->checkWithFeedback();
+}
+
+void OptionsDialog::dialogButtonClicked(QAbstractButton *button)
+{
+ if (ui.buttonBox->buttonRole(button) == QDialogButtonBox::ResetRole) {
+ QMessageBox msgBox;
+ msgBox.setWindowTitle(tr("Lightscreen - Options"));
+ msgBox.setText(tr("Restoring the default options will cause you to lose all of your current configuration."));
+ msgBox.setIcon(QMessageBox::Warning);
+
+ QPushButton *restoreButton = msgBox.addButton(tr("Restore"), QMessageBox::ActionRole);
+ QPushButton *dontRestoreButton = msgBox.addButton(tr("Don't Restore"), QMessageBox::ActionRole);
+
+ msgBox.exec();
+
+ Q_UNUSED(restoreButton)
+
+ if (msgBox.clickedButton() == dontRestoreButton)
+ return;
+
+ settings()->clear();
+ loadSettings();
+ }
+}
+
+void OptionsDialog::flipToggled(bool checked)
+{
+ setUpdatesEnabled(false);
+
+ ui.filenameLayout->removeWidget(ui.prefixLineEdit);
+ ui.filenameLayout->removeWidget(ui.namingComboBox);
+
+ if (checked) {
+ ui.filenameLayout->addWidget(ui.namingComboBox);
+ ui.filenameLayout->addWidget(ui.prefixLineEdit);
+ }
+ else {
+ ui.filenameLayout->addWidget(ui.prefixLineEdit);
+ ui.filenameLayout->addWidget(ui.namingComboBox);
+ }
+
+ if (ui.prefixLineEdit->text() == "screenshot."
+ && checked)
+ ui.prefixLineEdit->setText(".screenshot");
+
+ if (ui.prefixLineEdit->text() == ".screenshot"
+ && !checked)
+ ui.prefixLineEdit->setText("screenshot.");
+
+ setUpdatesEnabled(true); // Avoids flicker
+}
+
+void OptionsDialog::languageChange(QString language)
+{
+ os::translate(language);
+}
+
+void OptionsDialog::openUrl(QString url)
+{
+ if (url == "#aboutqt") {
+ qApp->aboutQt();
+ }
+ else {
+ QDesktopServices::openUrl(QUrl(url));
+ }
+}
+
+void OptionsDialog::rejected()
+{
+ languageChange(settings()->value("options/language").toString()); // Revert language to default.
+}
+
+void OptionsDialog::saveSettings()
+{
+ settings()->beginGroup("file");
+ settings()->setValue("format", ui.formatComboBox->currentIndex());
+ settings()->setValue("prefix", ui.prefixLineEdit->text());
+ settings()->setValue("naming", ui.namingComboBox->currentIndex());
+ settings()->setValue("target", ui.targetLineEdit->text());
+ settings()->setValue("enabled", ui.fileGroupBox->isChecked());
+ settings()->endGroup();
+
+ settings()->beginGroup("options");
+
+ settings()->setValue("startup", ui.startupCheckBox->isChecked());
+ settings()->setValue("startupHide", ui.startupHideCheckBox->isChecked());
+ settings()->setValue("hide", ui.hideCheckBox->isChecked());
+ settings()->setValue("delay", ui.delaySpinBox->value());
+ settings()->setValue("tray", ui.trayCheckBox->isChecked());
+ settings()->setValue("message", ui.messageCheckBox->isChecked());
+ settings()->setValue("quality", ui.qualitySlider->value());
+ settings()->setValue("playSound", ui.playSoundCheckBox->isChecked());
+ // We save the explicit string because addition/removal of language files can cause it to change
+ settings()->setValue("language", ui.languageComboBox->currentText());
+ // This settings is inverted because the first iteration of the Updater did not have a settings but instead relied on the messagebox choice of the user.
+ settings()->setValue("disableUpdater", !ui.updaterCheckBox->isChecked());
+ settings()->setValue("magnify", ui.magnifyCheckBox->isChecked());
+ settings()->setValue("cursor", ui.cursorCheckBox->isChecked());
+ settings()->setValue("saveAs", ui.saveAsCheckBox->isChecked());
+ settings()->setValue("preview", ui.previewCheckBox->isChecked());
+ settings()->setValue("previewSize", ui.previewSizeSpinBox->value());
+ settings()->setValue("previewPosition", ui.previewPositionComboBox->currentIndex());
+ settings()->setValue("previewAutoclose", ui.previewAutocloseCheckBox->isChecked());
+ settings()->setValue("previewAutocloseTime", ui.previewAutocloseTimeSpinBox->value());
+ settings()->setValue("previewAutocloseAction", ui.previewAutocloseActionComboBox->currentIndex());
+ settings()->setValue("areaAutoclose", ui.areaAutocloseCheckBox->isChecked());
+
+ // Advanced
+ settings()->setValue("disableHideAlert", !ui.warnHideCheckBox->isChecked());
+ settings()->setValue("clipboard", ui.clipboardCheckBox->isChecked());
+ settings()->setValue("optipng", ui.optiPngCheckBox->isChecked());
+ settings()->setValue("currentMonitor", ui.currentMonitorCheckBox->isChecked());
+ settings()->setValue("replace", ui.replaceCheckBox->isChecked());
+ settings()->endGroup();
+
+ settings()->beginGroup("actions");
+
+ settings()->beginGroup("screen");
+ settings()->setValue("enabled", ui.screenCheckBox->isChecked());
+ settings()->setValue("hotkey", ui.screenHotkeyWidget->hotkey());
+ settings()->endGroup();
+
+ settings()->beginGroup("area");
+ settings()->setValue("enabled", ui.areaCheckBox->isChecked());
+ settings()->setValue("hotkey", ui.areaHotkeyWidget->hotkey());
+ settings()->endGroup();
+
+ settings()->beginGroup("window");
+ settings()->setValue("enabled", ui.windowCheckBox->isChecked());
+ settings()->setValue("hotkey", ui.windowHotkeyWidget->hotkey());
+ settings()->endGroup();
+
+ settings()->beginGroup("windowPicker");
+ settings()->setValue("enabled", ui.windowPickerCheckBox->isChecked());
+ settings()->setValue("hotkey", ui.windowPickerHotkeyWidget->hotkey());
+ settings()->endGroup();
+
+ settings()->beginGroup("open");
+ settings()->setValue("enabled", ui.openCheckBox->isChecked());
+ settings()->setValue("hotkey", ui.openHotkeyWidget->hotkey());
+ settings()->endGroup();
+
+ settings()->beginGroup("directory");
+ settings()->setValue("enabled", ui.directoryCheckBox->isChecked());
+ settings()->setValue("hotkey", ui.directoryHotkeyWidget->hotkey());
+ settings()->endGroup();
+
+ settings()->endGroup();
+}
+
+/*
+ * Private
+ */
+void OptionsDialog::loadSettings()
+{
+ settings()->sync();
+
+ if (!settings()->contains("file/format")) {
+ // If there are no settings, get rid of the cancel button so that the user is forced to save them
+ ui.buttonBox->clear();
+ ui.buttonBox->addButton(QDialogButtonBox::Ok);
+
+ // Move the first option window to the center of the screen, since Windows usually positions it in a random location since it has no visible parent.
+ if (!(static_cast<QWidget*>(parent())->isVisible()))
+ move(qApp->desktop()->screen(qApp->desktop()->primaryScreen())->rect().center()-QPoint(height()/2, width()/2));
+ }
+
+ ui.startupCheckBox->toggle();
+ ui.trayCheckBox->toggle();
+ ui.previewAutocloseCheckBox->toggle();
+
+ settings()->beginGroup("file");
+ ui.formatComboBox->setCurrentIndex(settings()->value("format", 1).toInt());
+ ui.prefixLineEdit->setText(settings()->value("prefix", "screenshot.").toString());
+ ui.namingComboBox->setCurrentIndex(settings()->value("naming", 0).toInt());
+ ui.targetLineEdit->setText(settings()->value("target", os::getDocumentsPath() + QDir::separator() + "Screenshots").toString()); // Defaults to $HOME$/screenshots
+ ui.fileGroupBox->setChecked(settings()->value("enabled", true).toBool());
+ settings()->endGroup();
+
+ settings()->beginGroup("options");
+ ui.startupCheckBox->setChecked(settings()->value("startup", false).toBool());
+ ui.startupHideCheckBox->setChecked(settings()->value("startupHide", true).toBool());
+ ui.hideCheckBox->setChecked(settings()->value("hide", true).toBool());
+ ui.delaySpinBox->setValue(settings()->value("delay", 0).toInt());
+ flipToggled(settings()->value("flip", false).toBool());
+ ui.trayCheckBox->setChecked(settings()->value("tray", true).toBool());
+ ui.messageCheckBox->setChecked(settings()->value("message", true).toBool());
+ ui.qualitySlider->setValue(settings()->value("quality", 100).toInt());
+ ui.playSoundCheckBox->setChecked(settings()->value("playSound", false).toBool());
+ ui.updaterCheckBox->setChecked(!settings()->value("disableUpdater", false).toBool());
+ ui.magnifyCheckBox->setChecked(settings()->value("magnify", true).toBool());
+ ui.cursorCheckBox->setChecked(settings()->value("cursor", true).toBool());
+ ui.saveAsCheckBox->setChecked(settings()->value("saveAs", false).toBool());
+ ui.previewCheckBox->setChecked(settings()->value("preview", false).toBool());
+ ui.previewSizeSpinBox->setValue(settings()->value("previewSize", 300).toInt());
+ ui.previewPositionComboBox->setCurrentIndex(settings()->value("previewPosition", 3).toInt());
+ ui.previewAutocloseCheckBox->setChecked(settings()->value("previewAutoclose", false).toBool());
+ ui.previewAutocloseTimeSpinBox->setValue(settings()->value("previewAutocloseTime", 15).toInt());
+ ui.previewAutocloseActionComboBox->setCurrentIndex(settings()->value("previewAutocloseAction", 0).toInt());
+ ui.areaAutocloseCheckBox->setChecked(settings()->value("areaAutoclose", false).toBool());
+
+ // Advanced
+ ui.clipboardCheckBox->setChecked(settings()->value("clipboard", true).toBool());
+ ui.optiPngCheckBox->setChecked(settings()->value("optipng", true).toBool());
+ ui.warnHideCheckBox->setChecked(!settings()->value("disableHideAlert", false).toBool());
+ ui.currentMonitorCheckBox->setChecked(settings()->value("currentMonitor", false).toBool());
+ ui.replaceCheckBox->setChecked(settings()->value("replace", false).toBool());
+
+
+#if defined(Q_WS_WIN)
+ if (QFile::exists("optipng.exe")) {
+ ui.optiPngCheckBox->setEnabled(true);
+ }
+ else {
+ ui.optiPngCheckBox->setEnabled(false);
+ }
+#endif
+
+ //TODO: Must replace with not-stupid system
+ QString lang = settings()->value("language").toString();
+ int index = ui.languageComboBox->findText(lang);
+
+ if (index == -1)
+ index = ui.languageComboBox->findText("English");
+
+ ui.languageComboBox->setCurrentIndex(index);
+
+ settings()->endGroup();
+
+ settings()->beginGroup("actions");
+
+ // This toggle is for the first run
+ ui.screenCheckBox->toggle();
+ ui.areaCheckBox->toggle();
+ ui.windowCheckBox->toggle();
+ ui.windowPickerCheckBox->toggle();
+ ui.openCheckBox->toggle();
+ ui.directoryCheckBox->toggle();
+
+ settings()->beginGroup("screen");
+ ui.screenCheckBox->setChecked(settings()->value("enabled", true).toBool());
+ ui.screenHotkeyWidget->setHotkey(settings()->value("hotkey", QKeySequence(Qt::Key_Print)).value<QKeySequence> ());
+ settings()->endGroup();
+
+ settings()->beginGroup("area");
+ ui.areaCheckBox->setChecked(settings()->value("enabled").toBool());
+ ui.areaHotkeyWidget->setHotkey(settings()->value("hotkey", QKeySequence(Qt::CTRL + Qt::Key_Print)).value<QKeySequence> ());
+ settings()->endGroup();
+
+ settings()->beginGroup("window");
+ ui.windowCheckBox->setChecked(settings()->value("enabled").toBool());
+ ui.windowHotkeyWidget->setHotkey(settings()->value("hotkey", QKeySequence(Qt::ALT + Qt::Key_Print)).value<QKeySequence> ());
+ settings()->endGroup();
+
+ settings()->beginGroup("windowPicker");
+ ui.windowPickerCheckBox->setChecked(settings()->value("enabled").toBool());
+ ui.windowPickerHotkeyWidget->setHotkey(settings()->value("hotkey", QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Print)).value<QKeySequence> ());
+ settings()->endGroup();
+
+ settings()->beginGroup("open");
+ ui.openCheckBox->setChecked(settings()->value("enabled").toBool());
+ ui.openHotkeyWidget->setHotkey(settings()->value("hotkey", QKeySequence(Qt::CTRL + Qt::Key_PageUp)).value<QKeySequence> ());
+ settings()->endGroup();
+
+ settings()->beginGroup("directory");
+ ui.directoryCheckBox->setChecked(settings()->value("enabled").toBool());
+ ui.directoryHotkeyWidget->setHotkey(settings()->value("hotkey", QKeySequence(Qt::SHIFT + Qt::Key_PageUp)).value<QKeySequence> ());
+ settings()->endGroup();
+
+ settings()->endGroup();
+
+ QTimer::singleShot(0, this, SLOT(updatePreview()));
+
+ setEnabled(true);
+ setUpdatesEnabled(true);
+}
+
+bool OptionsDialog::hotkeyCollision()
+{
+ // Check for hotkey collision (there's probably a better way to do this...=)
+
+ if (ui.screenCheckBox->isChecked()) {
+ if (ui.screenHotkeyWidget->hotkey() == ui.areaHotkeyWidget->hotkey()
+ && ui.areaCheckBox->isChecked())
+ return true;
+
+ if (ui.screenHotkeyWidget->hotkey() == ui.windowHotkeyWidget->hotkey()
+ && ui.windowCheckBox->isChecked())
+ return true;
+
+ if (ui.screenHotkeyWidget->hotkey() == ui.windowPickerHotkeyWidget->hotkey()
+ && ui.windowPickerCheckBox->isChecked())
+ return true;
+
+ if (ui.screenHotkeyWidget->hotkey() == ui.openHotkeyWidget->hotkey()
+ && ui.openCheckBox->isChecked())
+ return true;
+
+ if (ui.screenHotkeyWidget->hotkey() == ui.directoryHotkeyWidget->hotkey()
+ && ui.directoryCheckBox->isChecked())
+ return true;
+ }
+
+ if (ui.areaCheckBox->isChecked()) {
+ if (ui.areaHotkeyWidget->hotkey() == ui.screenHotkeyWidget->hotkey()
+ && ui.screenCheckBox->isChecked())
+ return true;
+
+ if (ui.areaHotkeyWidget->hotkey() == ui.windowHotkeyWidget->hotkey()
+ && ui.windowCheckBox->isChecked())
+ return true;
+
+ if (ui.areaHotkeyWidget->hotkey() == ui.windowPickerHotkeyWidget->hotkey()
+ && ui.windowPickerCheckBox->isChecked())
+ return true;
+
+ if (ui.areaHotkeyWidget->hotkey() == ui.openHotkeyWidget->hotkey()
+ && ui.openCheckBox->isChecked())
+ return true;
+
+ if (ui.areaHotkeyWidget->hotkey() == ui.directoryHotkeyWidget->hotkey()
+ && ui.directoryCheckBox->isChecked())
+ return true;
+ }
+
+ if (ui.windowCheckBox->isChecked()) {
+ if (ui.windowHotkeyWidget->hotkey() == ui.screenHotkeyWidget->hotkey()
+ && ui.screenCheckBox->isChecked())
+ return true;
+
+ if (ui.windowHotkeyWidget->hotkey() == ui.areaHotkeyWidget->hotkey()
+ && ui.areaCheckBox->isChecked())
+ return true;
+
+ if (ui.windowHotkeyWidget->hotkey() == ui.windowPickerHotkeyWidget->hotkey()
+ && ui.windowPickerCheckBox->isChecked())
+ return true;
+
+ if (ui.windowHotkeyWidget->hotkey() == ui.openHotkeyWidget->hotkey()
+ && ui.openCheckBox->isChecked())
+ return true;
+
+ if (ui.windowHotkeyWidget->hotkey() == ui.directoryHotkeyWidget->hotkey()
+ && ui.directoryCheckBox->isChecked())
+ return true;
+ }
+
+ if (ui.openCheckBox->isChecked()) {
+ if (ui.openHotkeyWidget->hotkey() == ui.screenHotkeyWidget->hotkey()
+ && ui.screenCheckBox->isChecked())
+ return true;
+
+ if (ui.openHotkeyWidget->hotkey() == ui.areaHotkeyWidget->hotkey()
+ && ui.areaCheckBox->isChecked())
+ return true;
+
+ if (ui.openHotkeyWidget->hotkey() == ui.windowPickerHotkeyWidget->hotkey()
+ && ui.windowPickerCheckBox->isChecked())
+ return true;
+
+ if (ui.openHotkeyWidget->hotkey() == ui.windowHotkeyWidget->hotkey()
+ && ui.windowCheckBox->isChecked())
+ return true;
+
+ if (ui.openHotkeyWidget->hotkey() == ui.directoryHotkeyWidget->hotkey()
+ && ui.directoryCheckBox->isChecked())
+ return true;
+ }
+
+ if (ui.directoryCheckBox->isChecked()) {
+ if (ui.directoryHotkeyWidget->hotkey() == ui.screenHotkeyWidget->hotkey()
+ && ui.screenCheckBox->isChecked())
+ return true;
+
+ if (ui.directoryHotkeyWidget->hotkey() == ui.areaHotkeyWidget->hotkey()
+ && ui.areaCheckBox->isChecked())
+ return true;
+
+ if (ui.directoryHotkeyWidget->hotkey() == ui.windowPickerHotkeyWidget->hotkey()
+ && ui.windowPickerCheckBox->isChecked())
+ return true;
+
+ if (ui.directoryHotkeyWidget->hotkey() == ui.windowHotkeyWidget->hotkey()
+ && ui.windowCheckBox->isChecked())
+ return true;
+
+ if (ui.directoryHotkeyWidget->hotkey() == ui.openHotkeyWidget->hotkey()
+ && ui.openCheckBox->isChecked())
+ return true;
+ }
+
+ return false;
+}
+
+void OptionsDialog::updatePreview()
+{
+ Screenshot::NamingOptions options;
+
+ options.naming = (Screenshot::Naming)ui.namingComboBox->currentIndex();
+ options.flip = settings()->value("options/flip").toBool();
+ options.leadingZeros = settings()->value("options/naming/leadingZeros").toInt();
+ options.dateFormat = settings()->value("options/naming/dateFormat").toString();
+
+ ui.namingOptionsButton->setDisabled((options.naming == Screenshot::None));
+
+ QString preview = Screenshot::getName(options,
+ ui.prefixLineEdit->text(),
+ QDir(ui.targetLineEdit->text()));
+
+ preview = QString("%1.%2").arg(preview).arg(ui.formatComboBox->currentText().toLower());
+
+ if (preview.length() >= 40) {
+ preview.truncate(37);
+ preview.append("...");
+ }
+
+ ui.previewLabel->setText(preview);
+}
+
+bool OptionsDialog::event(QEvent* event)
+{
+ if (event->type() == QEvent::LanguageChange) {
+ ui.retranslateUi(this);
+ updatePreview();
+ resize(minimumSizeHint());
+ }
+ else if (event->type() == QEvent::Close) {
+ if (!settings()->contains("file/format")) {
+ // I'm afraid I can't let you do that, Dave.
+ event->ignore();
+ return false;
+ }
+ }
+
+ return QDialog::event(event);
+}
+
+#if defined(Q_WS_WIN)
+// Qt does not send the print screen key as a regular QKeyPress event, so we must use the Windows API
+bool OptionsDialog::winEvent(MSG *message, long *result)
+{
+ if ((message->message == WM_KEYUP || message->message == WM_SYSKEYUP)
+ && message->wParam == VK_SNAPSHOT) {
+ qApp->postEvent(qApp->focusWidget(), new QKeyEvent(QEvent::KeyPress, Qt::Key_Print, qApp->keyboardModifiers()));
+ }
+
+ return QDialog::winEvent(message, result);
+}
+#endif
diff --git a/dialogs/optionsdialog.h b/dialogs/optionsdialog.h
new file mode 100644
index 0000000..c1734bb
--- /dev/null
+++ b/dialogs/optionsdialog.h
@@ -0,0 +1,49 @@
+#ifndef OPTIONSDIALOG_H
+#define OPTIONSDIALOG_H
+
+#include <QtGui/QDialog>
+#include "../updater/updater.h"
+#include "ui_optionsdialog.h"
+
+class QSettings;
+class QAbstractButton;
+class OptionsDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ OptionsDialog(QWidget *parent = 0);
+
+public slots:
+ void accepted();
+ void checkUpdatesNow();
+ void languageChange(QString language);
+ void openUrl(QString url);
+ void rejected();
+ void saveSettings();
+ void updatePreview();
+ void loadSettings();
+
+protected:
+ bool event(QEvent *event);
+
+#if defined(Q_WS_WIN)
+ bool winEvent(MSG *message, long *result);
+#endif
+
+private slots:
+ void namingOptions();
+ void flipToggled(bool checked);
+ void dialogButtonClicked(QAbstractButton *button);
+ void browse();
+ void init();
+
+private:
+ bool hotkeyCollision();
+ QSettings *settings() const;
+
+private:
+ Ui::OptionsDialog ui;
+};
+
+#endif // OPTIONSDIALOG_H
diff --git a/dialogs/optionsdialog.ui b/dialogs/optionsdialog.ui
new file mode 100644
index 0000000..b14b6c2
--- /dev/null
+++ b/dialogs/optionsdialog.ui
@@ -0,0 +1,1218 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>OptionsDialog</class>
+ <widget class="QDialog" name="OptionsDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>399</width>
+ <height>320</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Options - Lightscreen</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="generalTab">
+ <attribute name="title">
+ <string>General</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QGroupBox" name="fileGroupBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>File</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="fileGroupBoxLayout">
+ <property name="verticalSpacing">
+ <number>4</number>
+ </property>
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="directoryLabel">
+ <property name="text">
+ <string>&amp;Directory:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>targetLineEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="targetLineEdit">
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QPushButton" name="browsePushButton">
+ <property name="maximumSize">
+ <size>
+ <width>60</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../lightscreen.qrc">
+ <normaloff>:/icons/folder</normaloff>:/icons/folder</iconset>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="filenameLabel">
+ <property name="toolTip">
+ <string>The prefix for the screenshot file</string>
+ </property>
+ <property name="text">
+ <string>&amp;Filename:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>prefixLineEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <layout class="QHBoxLayout" name="filenameLayout">
+ <property name="spacing">
+ <number>3</number>
+ </property>
+ <item>
+ <widget class="QLineEdit" name="prefixLineEdit">
+ <property name="whatsThis">
+ <string>The prefix will be inserted before the &lt;em&gt;Naming&lt;/em&gt; in the screenshot file and it is usually used to distinguish files. It can be left blank.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="namingComboBox">
+ <property name="whatsThis">
+ <string>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3..&lt;br /&gt;
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date, in the form of dd-MM-yyyy..&lt;br /&gt;
+&lt;b&gt;Date &amp;amp; Time&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss..&lt;br /&gt;
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp, the number of seconds passed since 1970-1-1 00:00:00) that corresponds with the current time.&lt;br /&gt;
+
+</string>
+ </property>
+ <item>
+ <property name="text">
+ <string>(number)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>(date)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>(timestamp)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>(none)</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="2">
+ <widget class="QPushButton" name="namingOptionsButton">
+ <property name="icon">
+ <iconset resource="../lightscreen.qrc">
+ <normaloff>:/icons/configure</normaloff>:/icons/configure</iconset>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="formatLabel">
+ <property name="toolTip">
+ <string>The file format for the screenshot</string>
+ </property>
+ <property name="text">
+ <string>F&amp;ormat:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>formatComboBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QComboBox" name="formatComboBox">
+ <item>
+ <property name="text">
+ <string>PNG</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>JPG</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>BMP</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="qualityLabel">
+ <property name="text">
+ <string>&amp;Quality:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>qualitySlider</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QSlider" name="qualitySlider">
+ <property name="whatsThis">
+ <string>This slider goes from 0 to 100. 100 being the highest quality and 0 the lowest.&lt;br&gt;
+Quality is related to file size and of course to readability and overall quality of the image.</string>
+ </property>
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="2">
+ <layout class="QHBoxLayout" name="qualityLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMinimumSize</enum>
+ </property>
+ <item>
+ <widget class="QLabel" name="qualityValueLabel">
+ <property name="font">
+ <font>
+ <pointsize>8</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>100</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="qualityPercentLabel">
+ <property name="font">
+ <font>
+ <pointsize>7</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>%</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>&lt;i&gt;Preview&lt;/i&gt;:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QLabel" name="previewLabel">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="startupGroupBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>System Startup</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QCheckBox" name="startupCheckBox">
+ <property name="whatsThis">
+ <string/>
+ </property>
+ <property name="text">
+ <string>&amp;Run Lightscreen at system startup.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="startupHideLayout">
+ <item>
+ <spacer name="startupHideSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>13</width>
+ <height>15</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="startupHideCheckBox">
+ <property name="whatsThis">
+ <string/>
+ </property>
+ <property name="text">
+ <string>H&amp;ide the main window.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="hotkeyTab">
+ <attribute name="title">
+ <string>Hotkeys</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QGroupBox" name="capturesGroupBox">
+ <property name="title">
+ <string>Captures</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="screenCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Capture the screen</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="HotkeyWidget" name="screenHotkeyWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="windowCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Capture the current window</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="HotkeyWidget" name="windowHotkeyWidget"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="windowPickerCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Capture a chosen window</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="HotkeyWidget" name="windowPickerHotkeyWidget"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QCheckBox" name="areaCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Capture a screen area</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2">
+ <widget class="HotkeyWidget" name="areaHotkeyWidget"/>
+ </item>
+ <item row="1" column="1">
+ <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>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="controlGroupBox">
+ <property name="title">
+ <string>Lightscreen Control</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="openCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Open the program window</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="HotkeyWidget" name="openHotkeyWidget"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="directoryCheckBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Open the directory</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="HotkeyWidget" name="directoryHotkeyWidget"/>
+ </item>
+ <item row="0" column="1">
+ <spacer name="horizontalSpacer_2">
+ <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>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="optionsTab">
+ <attribute name="title">
+ <string>Options</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_8">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QScrollArea" name="optionsScrollArea">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>375</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="horizontalScrollBarPolicy">
+ <enum>Qt::ScrollBarAlwaysOff</enum>
+ </property>
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>358</width>
+ <height>574</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QGroupBox" name="interfaceGroupBox">
+ <property name="title">
+ <string>Interface</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_7">
+ <item>
+ <widget class="QCheckBox" name="trayCheckBox">
+ <property name="whatsThis">
+ <string/>
+ </property>
+ <property name="text">
+ <string>Sho&amp;w a system tray icon.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="hideCheckBox">
+ <property name="text">
+ <string>&amp;Hide Lightscreen while taking a screenshot.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="warnHideCheckBox">
+ <property name="text">
+ <string>Warn when hiding without a tra&amp;y icon.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="notifyLayout">
+ <property name="spacing">
+ <number>12</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="notifyLabel">
+ <property name="text">
+ <string>&amp;Notify with:</string>
+ </property>
+ <property name="buddy">
+ <cstring>messageCheckBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="messageCheckBox">
+ <property name="whatsThis">
+ <string>Shows a completion message once the screenshot is saved, clicking this message takes you to the directory where the screenshot was saved.</string>
+ </property>
+ <property name="text">
+ <string>Tray icon Popup</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="playSoundCheckBox">
+ <property name="text">
+ <string>&amp;Sound cue</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <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>
+ <item>
+ <layout class="QHBoxLayout" name="languageLayout">
+ <item>
+ <widget class="QLabel" name="languageLabel">
+ <property name="text">
+ <string>&amp;Language:</string>
+ </property>
+ <property name="buddy">
+ <cstring>languageComboBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="languageComboBox">
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="moreInformationLabel">
+ <property name="whatsThis">
+ <string>Click here to go to the Lightscreen homepage to learn more about translations.</string>
+ </property>
+ <property name="text">
+ <string>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;More information..&lt;/a&gt;</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="languageSpacer">
+ <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>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="screenshotsGroupBox">
+ <property name="title">
+ <string>Screenshots</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_9">
+ <item>
+ <widget class="QCheckBox" name="saveAsCheckBox">
+ <property name="text">
+ <string>Choose where to save each screenshot (&quot;&amp;Save as&quot;).</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="clipboardCheckBox">
+ <property name="text">
+ <string>&amp;Copy the screenshot to the clipboard.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="currentMonitorCheckBox">
+ <property name="text">
+ <string>&amp;Grab only the current monitor.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="cursorCheckBox">
+ <property name="text">
+ <string>Inc&amp;lude the cursor in the screenshot.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="magnifyCheckBox">
+ <property name="text">
+ <string>&amp;Magnify around the mouse in Area mode.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="optiPngCheckBox">
+ <property name="toolTip">
+ <string>Opens a new process called OptiPNG which dramatically reduces the file size.</string>
+ </property>
+ <property name="text">
+ <string>O&amp;ptimize PNG screenshots.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="replaceCheckBox">
+ <property name="text">
+ <string>Replace screenshots when there's an existing file.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="areaAutocloseCheckBox">
+ <property name="text">
+ <string>Snap area screenshots automatically (no resizing).</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <item>
+ <widget class="QLabel" name="delayLabel">
+ <property name="text">
+ <string>D&amp;elay:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>delaySpinBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="delaySpinBox">
+ <property name="whatsThis">
+ <string>Selecting anything other than 0 in this option will cause the program to &lt;b&gt;wait&lt;/b&gt; that amount of seconds before taking the screenshot.</string>
+ </property>
+ <property name="specialValueText">
+ <string>none</string>
+ </property>
+ <property name="accelerated">
+ <bool>true</bool>
+ </property>
+ <property name="correctionMode">
+ <enum>QAbstractSpinBox::CorrectToNearestValue</enum>
+ </property>
+ <property name="suffix">
+ <string> seconds</string>
+ </property>
+ <property name="prefix">
+ <string/>
+ </property>
+ <property name="maximum">
+ <number>32767</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_8">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>114</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="previewCheckBox">
+ <property name="title">
+ <string>Screenshot Previews</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0" colspan="2">
+ <widget class="QLabel" name="previewSizeLabel">
+ <property name="text">
+ <string>Maximum Size:</string>
+ </property>
+ <property name="buddy">
+ <cstring>previewSizeSpinBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" colspan="2">
+ <widget class="QSpinBox" name="previewSizeSpinBox">
+ <property name="buttonSymbols">
+ <enum>QAbstractSpinBox::PlusMinus</enum>
+ </property>
+ <property name="accelerated">
+ <bool>true</bool>
+ </property>
+ <property name="correctionMode">
+ <enum>QAbstractSpinBox::CorrectToNearestValue</enum>
+ </property>
+ <property name="suffix">
+ <string notr="true"> px</string>
+ </property>
+ <property name="minimum">
+ <number>200</number>
+ </property>
+ <property name="maximum">
+ <number>800</number>
+ </property>
+ <property name="singleStep">
+ <number>10</number>
+ </property>
+ <property name="value">
+ <number>300</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4" colspan="4">
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>41</width>
+ <height>4</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="previewPositionLabel">
+ <property name="text">
+ <string>Position:</string>
+ </property>
+ <property name="buddy">
+ <cstring>previewPositionComboBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" colspan="3">
+ <widget class="QComboBox" name="previewPositionComboBox">
+ <property name="currentIndex">
+ <number>3</number>
+ </property>
+ <item>
+ <property name="text">
+ <string>Top Left</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Top Right</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Bottom Left</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Bottom Right</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="1" column="4" colspan="4">
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>4</width>
+ <height>4</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="0" colspan="3">
+ <widget class="QCheckBox" name="previewAutocloseCheckBox">
+ <property name="text">
+ <string>Auto-close after</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3" colspan="2">
+ <widget class="QSpinBox" name="previewAutocloseTimeSpinBox">
+ <property name="suffix">
+ <string> seconds</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="5">
+ <widget class="QLabel" name="andLabel">
+ <property name="minimumSize">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string> and </string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="6">
+ <widget class="QComboBox" name="previewAutocloseActionComboBox">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <item>
+ <property name="text">
+ <string>save</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>cancel</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="2" column="7">
+ <spacer name="horizontalSpacer_7">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>23</width>
+ <height>4</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="updaterGroupBox">
+ <property name="title">
+ <string>Updater</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QCheckBox" name="updaterCheckBox">
+ <property name="text">
+ <string>Check for updates regularly.</string>
+ </property>
+ </widget>
+ </item>
+ <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="QPushButton" name="checkUpdatesPushButton">
+ <property name="text">
+ <string>Chec&amp;k Updates Now</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="aboutTab">
+ <attribute name="title">
+ <string>About</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_10">
+ <item>
+ <widget class="QLabel" name="mainLabel">
+ <property name="text">
+ <string>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
+Special thanks goes to the &lt;a href=&quot;http://lightscreen.sourceforge.net/about&quot;&gt;Donators and Translators&lt;/a&gt;.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="versionLabel">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="linksLabel">
+ <property name="text">
+ <string>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>HotkeyWidget</class>
+ <extends>QPushButton</extends>
+ <header>widgets/hotkeywidget.h</header>
+ </customwidget>
+ </customwidgets>
+ <tabstops>
+ <tabstop>fileGroupBox</tabstop>
+ <tabstop>targetLineEdit</tabstop>
+ <tabstop>browsePushButton</tabstop>
+ <tabstop>prefixLineEdit</tabstop>
+ <tabstop>namingComboBox</tabstop>
+ <tabstop>namingOptionsButton</tabstop>
+ <tabstop>formatComboBox</tabstop>
+ <tabstop>qualitySlider</tabstop>
+ <tabstop>startupCheckBox</tabstop>
+ <tabstop>startupHideCheckBox</tabstop>
+ <tabstop>screenCheckBox</tabstop>
+ <tabstop>screenHotkeyWidget</tabstop>
+ <tabstop>windowCheckBox</tabstop>
+ <tabstop>windowHotkeyWidget</tabstop>
+ <tabstop>windowPickerCheckBox</tabstop>
+ <tabstop>windowPickerHotkeyWidget</tabstop>
+ <tabstop>areaCheckBox</tabstop>
+ <tabstop>areaHotkeyWidget</tabstop>
+ <tabstop>openCheckBox</tabstop>
+ <tabstop>openHotkeyWidget</tabstop>
+ <tabstop>directoryCheckBox</tabstop>
+ <tabstop>directoryHotkeyWidget</tabstop>
+ <tabstop>trayCheckBox</tabstop>
+ <tabstop>hideCheckBox</tabstop>
+ <tabstop>warnHideCheckBox</tabstop>
+ <tabstop>messageCheckBox</tabstop>
+ <tabstop>playSoundCheckBox</tabstop>
+ <tabstop>languageComboBox</tabstop>
+ <tabstop>saveAsCheckBox</tabstop>
+ <tabstop>clipboardCheckBox</tabstop>
+ <tabstop>currentMonitorCheckBox</tabstop>
+ <tabstop>cursorCheckBox</tabstop>
+ <tabstop>magnifyCheckBox</tabstop>
+ <tabstop>optiPngCheckBox</tabstop>
+ <tabstop>replaceCheckBox</tabstop>
+ <tabstop>areaAutocloseCheckBox</tabstop>
+ <tabstop>delaySpinBox</tabstop>
+ <tabstop>previewCheckBox</tabstop>
+ <tabstop>previewSizeSpinBox</tabstop>
+ <tabstop>previewPositionComboBox</tabstop>
+ <tabstop>previewAutocloseCheckBox</tabstop>
+ <tabstop>previewAutocloseTimeSpinBox</tabstop>
+ <tabstop>previewAutocloseActionComboBox</tabstop>
+ <tabstop>updaterCheckBox</tabstop>
+ <tabstop>checkUpdatesPushButton</tabstop>
+ <tabstop>buttonBox</tabstop>
+ </tabstops>
+ <resources>
+ <include location="../lightscreen.qrc"/>
+ </resources>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>OptionsDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>307</x>
+ <y>304</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>previewAutocloseCheckBox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>previewAutocloseTimeSpinBox</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>118</x>
+ <y>511</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>219</x>
+ <y>510</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>previewAutocloseCheckBox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>previewAutocloseActionComboBox</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>115</x>
+ <y>511</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>311</x>
+ <y>510</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/dialogs/previewdialog.cpp b/dialogs/previewdialog.cpp
new file mode 100644
index 0000000..17f98e6
--- /dev/null
+++ b/dialogs/previewdialog.cpp
@@ -0,0 +1,332 @@
+#include "previewdialog.h"
+#include "screenshotdialog.h"
+#include "../tools/screenshot.h"
+#include "../tools/screenshotmanager.h"
+#include "../tools/os.h"
+
+#include <QApplication>
+#include <QObject>
+#include <QList>
+#include <QHBoxLayout>
+#include <QIcon>
+#include <QPushButton>
+#include <QPalette>
+#include <QDesktopWidget>
+#include <QGraphicsDropShadowEffect>
+#include <QLabel>
+#include <QStackedLayout>
+#include <QSettings>
+
+#include <QDebug>
+
+PreviewDialog::PreviewDialog(QWidget *parent) :
+ QDialog(parent), mAutoclose(0)
+{
+ setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint);
+ os::aeroGlass(this);
+ setWindowTitle("Screenshot Preview");
+
+ mSize = ScreenshotManager::instance()->settings()->value("options/previewSize", 300).toInt();
+ mPosition = ScreenshotManager::instance()->settings()->value("options/previewPosition", 3).toInt();
+
+ if (ScreenshotManager::instance()->settings()->value("options/previewAutoclose", false).toBool()) {
+ mAutoclose = ScreenshotManager::instance()->settings()->value("options/previewAutocloseTime").toInt();
+ mAutocloseReset = mAutoclose;
+ mAutocloseAction = ScreenshotManager::instance()->settings()->value("options/previewAutocloseAction").toInt();
+ }
+
+ QHBoxLayout *l = new QHBoxLayout;
+ mStack = new QStackedLayout;
+ connect(mStack, SIGNAL(currentChanged(int)), this, SLOT(indexChanged(int)));
+
+ mPrevButton = new QPushButton(QIcon(":/icons/arrow-left"), "", this);
+ connect(mPrevButton, SIGNAL(clicked()), this, SLOT(previous()));
+
+ mNextButton = new QPushButton(QIcon(":/icons/arrow-right"), "", this);
+ connect(mNextButton, SIGNAL(clicked()), this, SLOT(next()));
+
+ mPrevButton->setCursor(Qt::PointingHandCursor);
+ mPrevButton->setFlat(true);
+ mPrevButton->setGraphicsEffect(os::shadow());
+ mPrevButton->setIconSize(QSize(24, 24));
+ mPrevButton->setVisible(false);
+
+ mNextButton->setCursor(Qt::PointingHandCursor);
+ mNextButton->setFlat(true);
+ mNextButton->setGraphicsEffect(os::shadow());
+ mNextButton->setIconSize(QSize(24, 24));
+ mNextButton->setVisible(false);
+
+ l->addWidget(mPrevButton);
+ l->addLayout(mStack);
+ l->addWidget(mNextButton);
+
+ l->setMargin(0);
+ l->setContentsMargins(6, 6, 6, 6);
+
+ mStack->setMargin(0);
+
+ setMaximumHeight(mSize);
+ setLayout(l);
+
+ if (mAutoclose) {
+ startTimer(1000);
+ }
+}
+
+void PreviewDialog::add(Screenshot *screenshot)
+{
+ if (!isVisible()) {
+ show();
+ }
+
+ if (mAutoclose) {
+ mAutoclose = mAutocloseReset;
+ }
+
+ QLabel *widget = new QLabel(this);
+ widget->setGraphicsEffect(os::shadow());
+
+ bool small = false;
+
+ connect(widget, SIGNAL(destroyed()), screenshot, SLOT(discard()));
+
+ QSize size = screenshot->pixmap().size();
+
+ if (size.width() > mSize || size.height() > mSize) {
+ size.scale(mSize, mSize, Qt::KeepAspectRatio);
+ }
+ else {
+ small = true;
+ }
+
+ QPixmap thumbnail = screenshot->pixmap().scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+
+ widget->setPixmap(thumbnail);
+
+ thumbnail = QPixmap();
+
+ widget->setAlignment(Qt::AlignCenter);
+
+ if (size.height() < 80) {
+ widget->setMinimumHeight(80);
+ }
+
+ if (size.width() < 80) {
+ widget->setMinimumWidth(80);
+ }
+
+ widget->resize(size);
+
+ QPushButton *confirmPushButton = new QPushButton(QIcon(":/icons/yes") , "", widget);
+ QPushButton *discardPushButton = new QPushButton(QIcon(":/icons/no") , "", widget);
+ QPushButton *enlargePushButton = new QPushButton(QIcon(":/icons/zoom.in"), "", widget);
+
+ confirmPushButton->setFlat(true);
+ confirmPushButton->setIconSize(QSize(24, 24));
+ confirmPushButton->setCursor(Qt::PointingHandCursor);
+ confirmPushButton->setGraphicsEffect(os::shadow());
+ confirmPushButton->setDefault(true);
+
+ discardPushButton->setFlat(true);
+ discardPushButton->setIconSize(QSize(24, 24));
+ discardPushButton->setCursor(Qt::PointingHandCursor);
+ discardPushButton->setGraphicsEffect(os::shadow());
+
+ enlargePushButton->setFlat(true);
+ enlargePushButton->setIconSize(QSize(22, 22));
+ enlargePushButton->setCursor(Qt::PointingHandCursor);
+ enlargePushButton->setGraphicsEffect(os::shadow());
+
+ enlargePushButton->setDisabled(small);
+
+ connect(this, SIGNAL(acceptAll()), confirmPushButton, SLOT(click()));
+ connect(this, SIGNAL(rejectAll()), discardPushButton, SLOT(click()));
+
+ connect(confirmPushButton, SIGNAL(clicked()), screenshot, SLOT(confirm()));
+ connect(confirmPushButton, SIGNAL(clicked()), this, SLOT(closePreview()));
+
+ connect(discardPushButton, SIGNAL(clicked()), screenshot, SLOT(discard()));
+ connect(discardPushButton, SIGNAL(clicked()), this, SLOT(closePreview()));
+
+ connect(enlargePushButton, SIGNAL(clicked()), this, SLOT(enlargePreview()));
+
+ QHBoxLayout *wlayout = new QHBoxLayout;
+ wlayout->addWidget(confirmPushButton);
+ wlayout->addStretch();
+ wlayout->addWidget(enlargePushButton);
+ wlayout->addStretch();
+ wlayout->addWidget(discardPushButton);
+ wlayout->setMargin(0);
+
+ QVBoxLayout *wl = new QVBoxLayout;
+ wl->addStretch();
+ wl->addLayout(wlayout);
+ wl->setMargin(0);
+
+ widget->setLayout(wl);
+
+ mStack->addWidget(widget);
+ mStack->setCurrentIndex(mStack->count()-1);
+
+ mNextButton->setEnabled(false);
+
+ if (mStack->count() >= 2 && !mNextButton->isVisible()) {
+ mNextButton->setVisible(true);
+ mPrevButton->setVisible(true);
+ }
+
+ relocate();
+}
+
+int PreviewDialog::count()
+{
+ return mStack->count();
+}
+
+void PreviewDialog::relocate()
+{
+ updateGeometry();
+ resize(minimumSizeHint());
+
+ QPoint where;
+ switch (mPosition)
+ {
+ case 0:
+ where = QApplication::desktop()->availableGeometry(this).topLeft();
+ break;
+ case 1:
+ where = QApplication::desktop()->availableGeometry(this).topRight();
+ where.setX(where.x() - frameGeometry().width());
+ break;
+ case 2:
+ where = QApplication::desktop()->availableGeometry(this).bottomLeft();
+ where.setY(where.y() - frameGeometry().height());
+ break;
+ case 3:
+ default:
+ where = QApplication::desktop()->availableGeometry(this).bottomRight();
+ where.setX(where.x() - frameGeometry().width());
+ where.setY(where.y() - frameGeometry().height());
+ break;
+ }
+
+ move(where);
+}
+
+void PreviewDialog::closePreview()
+{
+ QLabel *widget = qobject_cast<QLabel*>(sender()->parent());
+ mStack->removeWidget(widget);
+ widget->hide();
+ widget->deleteLater();
+
+ if (mStack->count() == 0) {
+ close();
+ }
+ else {
+ relocate();
+ }
+}
+
+void PreviewDialog::indexChanged(int i)
+{
+ if (i == mStack->count()-1) {
+ mNextButton->setEnabled(false);
+ mPrevButton->setEnabled(true);
+ }
+
+ if (i == 0 && mStack->count() > 1) {
+ mNextButton->setEnabled(true);
+ mPrevButton->setEnabled(false);
+ }
+
+ if (i != 0 && i != mStack->count()-1) {
+ mNextButton->setEnabled(true);
+ mPrevButton->setEnabled(true);
+ }
+
+ if (mStack->count() < 2) {
+ mNextButton->setEnabled(false);
+ mPrevButton->setEnabled(false);
+ }
+
+ if (mStack->widget(i)) {
+ mStack->widget(i)->setFocus();
+ }
+}
+
+void PreviewDialog::previous()
+{
+ mStack->setCurrentIndex(mStack->currentIndex()-1);
+ relocate();
+}
+
+void PreviewDialog::next()
+{
+ mStack->setCurrentIndex(mStack->currentIndex()+1);
+ relocate();
+}
+
+void PreviewDialog::enlargePreview()
+{
+ Screenshot *screenshot = qobject_cast<Screenshot*>(ScreenshotManager::instance()->children().at(mStack->currentIndex()));
+
+ if (screenshot == 0)
+ return;
+
+ new ScreenshotDialog(screenshot);
+}
+
+void PreviewDialog::closeEvent(QCloseEvent *event)
+{
+ mInstance = 0;
+ deleteLater();
+}
+
+void PreviewDialog::mouseDoubleClickEvent(QMouseEvent *event)
+{
+ Q_UNUSED(event)
+ enlargePreview();
+}
+
+void PreviewDialog::timerEvent(QTimerEvent *event)
+{
+ if (mAutoclose == 0) {
+ if (mAutocloseAction == 0) {
+ emit acceptAll();
+ }
+ else {
+ emit rejectAll();
+ }
+ }
+ else if (mAutoclose < 0) {
+ killTimer(event->timerId());
+ }
+ else {
+ setWindowTitle(tr("Screenshot Preview: Closing in %1").arg(mAutoclose));
+ mAutoclose--;
+ }
+}
+
+// Singleton
+
+PreviewDialog* PreviewDialog::mInstance = 0;
+
+PreviewDialog *PreviewDialog::instance()
+{
+ if (!mInstance) {
+ mInstance = new PreviewDialog(0);
+ }
+
+ return mInstance;
+}
+
+bool PreviewDialog::isActive()
+{
+ if (mInstance) {
+ return true;
+ }
+
+ return false;
+}
diff --git a/dialogs/previewdialog.h b/dialogs/previewdialog.h
new file mode 100644
index 0000000..e71ac5c
--- /dev/null
+++ b/dialogs/previewdialog.h
@@ -0,0 +1,55 @@
+#ifndef PREVIEWDIALOG_H
+#define PREVIEWDIALOG_H
+
+#include <QDialog>
+
+class Screenshot;
+class QStackedLayout;
+class QPushButton;
+class PreviewDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ PreviewDialog(QWidget *parent);
+
+ void add(Screenshot* screenshot);
+ int count();
+
+ static PreviewDialog *instance();
+ static bool isActive();
+
+public slots:
+ void setWidth(int w) { resize(w, height()); }
+ void setHeight(int h) { resize(width(), h); }
+
+signals:
+ void acceptAll();
+ void rejectAll();
+
+private slots:
+ void closePreview();
+ void relocate();
+ void previous();
+ void next();
+ void indexChanged(int i);
+ void enlargePreview();
+
+protected:
+ void closeEvent(QCloseEvent* event);
+ void mouseDoubleClickEvent(QMouseEvent *event);
+ void timerEvent(QTimerEvent *event);
+
+private:
+ static PreviewDialog* mInstance;
+ int mSize;
+ int mPosition; //0: top left, 1: top right, 2: bottom left, 3: bottom rigth (default)
+ int mAutoclose;
+ int mAutocloseReset;
+ int mAutocloseAction;
+ QStackedLayout* mStack;
+ QPushButton* mNextButton;
+ QPushButton* mPrevButton;
+};
+
+#endif // PREVIEWDIALOG_H
diff --git a/dialogs/screenshotdialog.cpp b/dialogs/screenshotdialog.cpp
new file mode 100644
index 0000000..4e9fbad
--- /dev/null
+++ b/dialogs/screenshotdialog.cpp
@@ -0,0 +1,120 @@
+#include "screenshotdialog.h"
+#include "../tools/screenshot.h"
+
+
+#include <QApplication>
+#include <QDesktopWidget>
+#include <QScrollArea>
+#include <QScrollBar>
+#include <QLabel>
+#include <QHBoxLayout>
+#include <QMouseEvent>
+
+#include <QDebug>
+
+ScreenshotDialog::ScreenshotDialog(Screenshot *screenshot, QWidget *parent) :
+ QDialog(parent)
+{
+ setWindowTitle(tr("Lightscreen Screenshot Viewer"));
+ setWindowFlags(windowFlags() | Qt::WindowMaximizeButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowContextHelpButtonHint);
+ setWhatsThis(tr("You can zoom using the mouse wheel while holding the CTRL key. To return to the default zoom press \"Ctrl-0\"."));
+
+ mScrollArea = new QScrollArea(this);
+ mScrollArea->verticalScrollBar()->installEventFilter(this);
+
+ QPalette newPalette = mScrollArea->palette();
+ newPalette.setBrush(QPalette::Background, QBrush(QPixmap(":/backgrounds/checkerboard")));
+ mScrollArea->setPalette(newPalette);
+
+ mLabel = new QLabel(this);
+
+ QHBoxLayout *layout = new QHBoxLayout(this);
+ mLabel->setPixmap(screenshot->pixmap());
+ mLabel->setScaledContents(true);
+
+ mScrollArea->setAlignment(Qt::AlignCenter);
+ mScrollArea->setWidget(mLabel);
+
+ layout->addWidget(mScrollArea);
+ layout->setMargin(0);
+
+ setLayout(layout);
+ setCursor(Qt::OpenHandCursor);
+
+ mOriginalSize = mLabel->size();
+
+ QSize size = (screenshot->pixmap().size() + QSize(2, 2)); // WTF: The 2x2 avoids the scrollbars..
+
+ if (size.width() >= qApp->desktop()->availableGeometry().width()) {
+ size.setWidth(qApp->desktop()->availableGeometry().size().width() - 300);
+ }
+
+ if (size.height() >= qApp->desktop()->availableGeometry().height()) {
+ size.setHeight(qApp->desktop()->availableGeometry().size().height() - 300);
+ }
+
+ resize(size);
+ show();
+}
+
+void ScreenshotDialog::zoom(int offset)
+{
+ if (offset == 0) {
+ mLabel->resize(mOriginalSize);
+ }
+ else {
+ QSize newSize = mLabel->size();
+ newSize.scale(mLabel->size() + QSize(offset, offset), Qt::KeepAspectRatio);
+
+ if (offset < 0 && (newSize.width() < 200 || newSize.height() < 200)) {
+ return;
+ }
+
+ mLabel->resize(newSize);
+ }
+}
+
+void ScreenshotDialog::keyPressEvent(QKeyEvent *event)
+{
+ if (event->key() == Qt::Key_0 && event->modifiers() & Qt::ControlModifier) {
+ zoom(0);
+ }
+}
+
+void ScreenshotDialog::mousePressEvent(QMouseEvent *event)
+{
+ mMousePos = event->pos();
+ setCursor(Qt::ClosedHandCursor);
+}
+
+void ScreenshotDialog::mouseReleaseEvent(QMouseEvent *event)
+{
+ setCursor(Qt::OpenHandCursor);
+}
+
+void ScreenshotDialog::mouseMoveEvent(QMouseEvent *event)
+{
+ QPoint diff = event->pos() - mMousePos;
+ mMousePos = event->pos();
+
+ mScrollArea->verticalScrollBar()->setValue(mScrollArea->verticalScrollBar()->value() - diff.y());
+ mScrollArea->horizontalScrollBar()->setValue(mScrollArea->horizontalScrollBar()->value() - diff.x());
+}
+
+void ScreenshotDialog::closeEvent(QCloseEvent *event)
+{
+ Q_UNUSED(event)
+ deleteLater();
+}
+
+bool ScreenshotDialog::eventFilter(QObject *obj, QEvent *event)
+{
+ if (event->type() == QEvent::Wheel
+ && qApp->keyboardModifiers() & Qt::ControlModifier) {
+ QWheelEvent *wheelEvent = static_cast<QWheelEvent *>(event);
+ zoom(wheelEvent->delta());
+ return true;
+ }
+
+ return QObject::eventFilter(obj, event);
+}
diff --git a/dialogs/screenshotdialog.h b/dialogs/screenshotdialog.h
new file mode 100644
index 0000000..b2ea82a
--- /dev/null
+++ b/dialogs/screenshotdialog.h
@@ -0,0 +1,33 @@
+#ifndef SCREENSHOTDIALOG_H
+#define SCREENSHOTDIALOG_H
+
+#include <QDialog>
+
+struct QPoint;
+class Screenshot;
+class QScrollArea;
+class QLabel;
+class ScreenshotDialog : public QDialog
+{
+public:
+ ScreenshotDialog(Screenshot *screenshot, QWidget *parent = 0);
+
+private:
+ void zoom(int offset);
+
+protected:
+ void keyPressEvent(QKeyEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ void closeEvent(QCloseEvent *event);
+ bool eventFilter(QObject *obj, QEvent *event);
+
+private:
+ QScrollArea *mScrollArea;
+ QLabel *mLabel;
+ QPoint mMousePos;
+ QSize mOriginalSize;
+};
+
+#endif // SCREENSHOTDIALOG_H
diff --git a/dialogs/updaterdialog.cpp b/dialogs/updaterdialog.cpp
new file mode 100644
index 0000000..63a0bd6
--- /dev/null
+++ b/dialogs/updaterdialog.cpp
@@ -0,0 +1,47 @@
+#include <QApplication>
+#include <QDesktopServices>
+#include <QProgressBar>
+#include <QLabel>
+#include <QLayout>
+#include <QUrl>
+
+#include "updaterdialog.h"
+#include "../tools/os.h"
+
+UpdaterDialog::UpdaterDialog() :
+QProgressDialog("", tr("Cancel"), 0, 0)
+{
+ setWindowTitle(tr("Updater - Lightscreen"));
+ setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
+ setAutoClose(false);
+
+ QProgressBar *bar = new QProgressBar(this);
+ bar->setTextVisible(false);
+ bar->setRange(0, 0);
+
+ QLabel *label = new QLabel(tr("Checking for updates..."), this);
+ connect(label, SIGNAL(linkActivated(QString)), this, SLOT(link(QString)));
+
+ setLabel(label);
+ setBar(bar);
+}
+
+void UpdaterDialog::updateDone(bool result)
+{
+ if (result) {
+ setLabelText(tr("There's a new version available,<br> please see <a href=\"http://lightscreen.sourceforge.net/whatsnew/%1\">the Lighscreen website</a>.").arg(qApp->applicationVersion()));
+ }
+ else {
+ setLabelText(tr("No new versions available."));
+ }
+
+ setMaximum(1);
+
+ setCancelButtonText(tr("Close"));
+}
+
+void UpdaterDialog::link(QString url)
+{
+ QDesktopServices::openUrl(url);
+}
+
diff --git a/dialogs/updaterdialog.h b/dialogs/updaterdialog.h
new file mode 100644
index 0000000..4a7b081
--- /dev/null
+++ b/dialogs/updaterdialog.h
@@ -0,0 +1,21 @@
+#ifndef UPDATERDIALOG_H
+#define UPDATERDIALOG_H
+
+#include <QProgressDialog>
+
+class UpdaterDialog : public QProgressDialog
+{
+ Q_OBJECT
+
+public:
+ UpdaterDialog();
+
+public slots:
+ void updateDone(bool result);
+
+private slots:
+ void link(QString url);
+
+};
+
+#endif // UPDATERDIALOG_H
diff --git a/images/LS-prev.ico b/images/LS-prev.ico
new file mode 100644
index 0000000..d88c137
Binary files /dev/null and b/images/LS-prev.ico differ
diff --git a/images/LS.ico b/images/LS.ico
new file mode 100644
index 0000000..0eecbfb
Binary files /dev/null and b/images/LS.ico differ
diff --git a/images/LS.systemtray.bad.png b/images/LS.systemtray.bad.png
new file mode 100644
index 0000000..0586359
Binary files /dev/null and b/images/LS.systemtray.bad.png differ
diff --git a/images/LS.systemtray.good.png b/images/LS.systemtray.good.png
new file mode 100644
index 0000000..8e537cd
Binary files /dev/null and b/images/LS.systemtray.good.png differ
diff --git a/images/LSSmall.Failure.png b/images/LSSmall.Failure.png
new file mode 100644
index 0000000..ca4e1c9
Binary files /dev/null and b/images/LSSmall.Failure.png differ
diff --git a/images/LSSmall.png b/images/LSSmall.png
new file mode 100644
index 0000000..f950f6e
Binary files /dev/null and b/images/LSSmall.png differ
diff --git a/images/area-accept.png b/images/area-accept.png
new file mode 100644
index 0000000..3d65127
Binary files /dev/null and b/images/area-accept.png differ
diff --git a/images/area-cancel.png b/images/area-cancel.png
new file mode 100644
index 0000000..d017873
Binary files /dev/null and b/images/area-cancel.png differ
diff --git a/images/area.png b/images/area.png
new file mode 100644
index 0000000..53312f8
Binary files /dev/null and b/images/area.png differ
diff --git a/images/bad.png b/images/bad.png
new file mode 100644
index 0000000..6b4011a
Binary files /dev/null and b/images/bad.png differ
diff --git a/images/checkerboard.png b/images/checkerboard.png
new file mode 100644
index 0000000..d5023de
Binary files /dev/null and b/images/checkerboard.png differ
diff --git a/images/configure.png b/images/configure.png
new file mode 100644
index 0000000..c3fee6e
Binary files /dev/null and b/images/configure.png differ
diff --git a/images/document-open-folder.png b/images/document-open-folder.png
new file mode 100644
index 0000000..1d2f301
Binary files /dev/null and b/images/document-open-folder.png differ
diff --git a/images/good.png b/images/good.png
new file mode 100644
index 0000000..8c47a68
Binary files /dev/null and b/images/good.png differ
diff --git a/images/help.png b/images/help.png
new file mode 100644
index 0000000..91adba6
Binary files /dev/null and b/images/help.png differ
diff --git a/images/picker.png b/images/picker.png
new file mode 100644
index 0000000..1232b12
Binary files /dev/null and b/images/picker.png differ
diff --git a/images/previewArrowLeft.png b/images/previewArrowLeft.png
new file mode 100644
index 0000000..a04c136
Binary files /dev/null and b/images/previewArrowLeft.png differ
diff --git a/images/previewArrowRight.png b/images/previewArrowRight.png
new file mode 100644
index 0000000..e6dcb29
Binary files /dev/null and b/images/previewArrowRight.png differ
diff --git a/images/screen.png b/images/screen.png
new file mode 100644
index 0000000..5b24b05
Binary files /dev/null and b/images/screen.png differ
diff --git a/images/window.png b/images/window.png
new file mode 100644
index 0000000..51330a6
Binary files /dev/null and b/images/window.png differ
diff --git a/images/zoom-in.png b/images/zoom-in.png
new file mode 100644
index 0000000..8393e28
Binary files /dev/null and b/images/zoom-in.png differ
diff --git a/images/zoom-out.png b/images/zoom-out.png
new file mode 100644
index 0000000..f66575e
Binary files /dev/null and b/images/zoom-out.png differ
diff --git a/lightscreen.pro b/lightscreen.pro
new file mode 100644
index 0000000..730db32
--- /dev/null
+++ b/lightscreen.pro
@@ -0,0 +1,55 @@
+TEMPLATE = app
+TARGET = lightscreen
+HEADERS += tools/os.h \
+ updater/updater.h \
+ dialogs/areadialog.h \
+ dialogs/optionsdialog.h \
+ widgets/hotkeywidget.h \
+ lightscreenwindow.h \
+ tools/screenshot.h \
+ dialogs/previewdialog.h \
+ tools/screenshotmanager.h \
+ tools/windowpicker.h \
+ tools/qtwin.h \
+ dialogs/updaterdialog.h \
+ dialogs/screenshotdialog.h \
+ dialogs/namingdialog.h
+SOURCES += tools/os.cpp \
+ updater/updater.cpp \
+ dialogs/areadialog.cpp \
+ dialogs/optionsdialog.cpp \
+ widgets/hotkeywidget.cpp \
+ main.cpp \
+ lightscreenwindow.cpp \
+ tools/screenshot.cpp \
+ dialogs/previewdialog.cpp \
+ tools/screenshotmanager.cpp \
+ tools/windowpicker.cpp \
+ tools/qtwin.cpp \
+ dialogs/updaterdialog.cpp \
+ dialogs/screenshotdialog.cpp \
+ dialogs/namingdialog.cpp
+FORMS += dialogs/optionsdialog.ui \
+ lightscreenwindow.ui \
+ dialogs/namingdialog.ui
+RESOURCES += lightscreen.qrc
+TRANSLATIONS += translations/untranslated.ts \
+ translations/spanish.ts \
+ translations/russian.ts \
+ translations/portugues.ts \
+ translations/polish.ts \
+ translations/japanese.ts \
+ translations/italiano.ts \
+ translations/dutch.ts
+RC_FILE += lightscreen.rc
+CODECFORSRC = UTF-8
+LIBS += libgcc
+QT += network \
+ core \
+ gui
+win32:LIBS += libgdi32
+include($$PWD/tools/globalshortcut/globalshortcut.pri)
+include($$PWD/tools/qtsingleapplication/qtsingleapplication.pri)
+
+OTHER_FILES += TODO.txt \
+ TODO.txt
diff --git a/lightscreen.qrc b/lightscreen.qrc
new file mode 100644
index 0000000..18b8f2a
--- /dev/null
+++ b/lightscreen.qrc
@@ -0,0 +1,36 @@
+<RCC>
+ <qresource prefix="/icons">
+ <file alias="lightscreen">images/LS.ico</file>
+ <file alias="lightscreen.small">images/LSSmall.png</file>
+ <file alias="lightscreen.yes">images/LS.systemtray.good.png</file>
+ <file alias="lightscreen.no">images/LS.systemtray.bad.png</file>
+ <file alias="yes">images/good.png</file>
+ <file alias="no">images/bad.png</file>
+ <file alias="yes.big">images/area-accept.png</file>
+ <file alias="no.big">images/area-cancel.png</file>
+ <file alias="folder">images/document-open-folder.png</file>
+ <file alias="configure">images/configure.png</file>
+ <file alias="help">images/help.png</file>
+ <file alias="arrow-left">images/previewArrowLeft.png</file>
+ <file alias="arrow-right">images/previewArrowRight.png</file>
+ <file alias="picker">images/picker.png</file>
+ <file alias="zoom.in">images/zoom-in.png</file>
+ <file alias="zoom.out">images/zoom-out.png</file>
+ <file alias="screen">images/screen.png</file>
+ <file alias="area">images/area.png</file>
+ <file alias="window">images/window.png</file>
+ </qresource>
+ <qresource prefix="/backgrounds">
+ <file alias="checkerboard">images/checkerboard.png</file>
+ </qresource>
+ <qresource prefix="/translations">
+ <file alias="Chinese (Simplified)">translations/chinese_simplified.qm</file>
+ <file alias="Dutch">translations/dutch.qm</file>
+ <file alias="Italian">translations/italiano.qm</file>
+ <file alias="Japanese">translations/japanese.qm</file>
+ <file alias="Polish">translations/polish.qm</file>
+ <file alias="Portuguese">translations/portugues.qm</file>
+ <file alias="Russian">translations/russian.qm</file>
+ <file alias="Spanish">translations/spanish.qm</file>
+ </qresource>
+</RCC>
diff --git a/lightscreen.rc b/lightscreen.rc
new file mode 100644
index 0000000..02eadda
--- /dev/null
+++ b/lightscreen.rc
@@ -0,0 +1 @@
+IDI_ICON1 ICON DISCARDABLE "images/LS.ico"
diff --git a/lightscreenwindow.cpp b/lightscreenwindow.cpp
new file mode 100644
index 0000000..002b863
--- /dev/null
+++ b/lightscreenwindow.cpp
@@ -0,0 +1,745 @@
+/*
+ * Qt includes
+ */
+#include <QDate>
+#include <QDesktopServices>
+#include <QFileInfo>
+#include <QHttp>
+#include <QMenu>
+#include <QMessageBox>
+#include <QPointer>
+#include <QProcess>
+#include <QSettings>
+#include <QSound>
+#include <QSystemTrayIcon>
+#include <QTimer>
+#include <QUrl>
+#include <QKeyEvent>
+
+#include <QElapsedTimer>
+#include <QDebug>
+
+#if defined(Q_WS_WIN)
+ #include <windows.h>
+#endif
+
+/*
+ * Lightscreen includes
+ */
+#include "lightscreenwindow.h"
+#include "dialogs/optionsdialog.h"
+#include "dialogs/previewdialog.h"
+
+#include "tools/globalshortcut/globalshortcutmanager.h"
+#include "tools/os.h"
+#include "tools/screenshot.h"
+#include "tools/screenshotmanager.h"
+
+#include "updater/updater.h"
+
+LightscreenWindow::LightscreenWindow(QWidget *parent) :
+ QDialog(parent),
+ mDoCache(false),
+ mHideTrigger(false),
+ mReviveMain(false),
+ mWasVisible(true),
+ mIsOptimizing(false),
+ mLastMode(-1),
+ mLastScreenshot(QString())
+{
+ os::aeroGlass(this);
+ os::translate(settings()->value("options/language").toString());
+
+ ui.setupUi(this);
+
+ setMaximumSize(size());
+ setMinimumSize(size());
+
+ setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint); // Remove the what's this button, no real use in the main window.
+
+ // Actions
+ connect(ui.optionsPushButton , SIGNAL(clicked()), this, SLOT(showOptions()));
+ connect(ui.hidePushButton , SIGNAL(clicked()), this, SLOT(toggleVisibility()));
+ connect(ui.screenshotPushButton, SIGNAL(clicked()), this, SLOT(showScreenshotMenu()));
+
+ // Manager
+ connect(ScreenshotManager::instance(), SIGNAL(confirm(Screenshot*)), this, SLOT(preview(Screenshot*)));
+ connect(ScreenshotManager::instance(), SIGNAL(windowCleanup(Screenshot::Options)), this, SLOT(cleanup(Screenshot::Options)));
+
+ if (!settings()->contains("file/format")) {
+ showOptions(); // There are no options (or the options config is invalid or incomplete)
+ }
+ else {
+ QTimer::singleShot(0, this, SLOT(applySettings()));
+ QTimer::singleShot(5000, this, SLOT(checkForUpdates()));
+ }
+}
+
+LightscreenWindow::~LightscreenWindow()
+{
+ GlobalShortcutManager::instance()->clear();
+ delete mTrayIcon;
+}
+
+/*
+ * Slots
+ */
+
+void LightscreenWindow::action(int mode)
+{
+ if (mode == 4) {
+ goToFolder();
+ }
+ else {
+ show();
+ }
+}
+
+bool LightscreenWindow::closingWithoutTray()
+{
+ if (settings()->value("options/disableHideAlert", false).toBool())
+ return false;
+
+ QMessageBox msgBox;
+ msgBox.setWindowTitle(tr("Lightscreen"));
+ msgBox.setText(tr("You have chosen to hide Lightscreen when there's no system tray icon, so you will not be able to access the program <b>unless you have selected a hotkey to do so</b>.<br>What do you want to do?"));
+ msgBox.setIcon(QMessageBox::Warning);
+
+ msgBox.setStyleSheet("QPushButton { padding: 4px 8px; }");
+
+ QPushButton *enableButton = msgBox.addButton(tr("Hide but enable tray"),
+ QMessageBox::ActionRole);
+ QPushButton *enableAndDenotifyButton = msgBox.addButton(tr("Hide and don't warn"),
+ QMessageBox::ActionRole);
+ QPushButton *hideButton = msgBox.addButton(tr("Just hide"),
+ QMessageBox::ActionRole);
+ QPushButton *abortButton = msgBox.addButton(QMessageBox::Cancel);
+
+ Q_UNUSED(abortButton);
+
+ msgBox.exec();
+
+ if (msgBox.clickedButton() == hideButton) {
+ return false;
+ }
+ else if (msgBox.clickedButton() == enableAndDenotifyButton) {
+ settings()->setValue("options/disableHideAlert", true);
+ applySettings();
+ return false;
+ }
+ else if (msgBox.clickedButton() == enableButton) {
+ settings()->setValue("options/tray", true);
+ applySettings();
+ return false;
+ }
+
+ return true; // Cancel
+}
+
+void LightscreenWindow::cleanup(Screenshot::Options options)
+{
+ // Reversing settings
+ if (settings()->value("options/hide").toBool()) {
+ if (settings()->value("options/tray").toBool() && mTrayIcon) {
+ mTrayIcon->show();
+ }
+
+ if (PreviewDialog::isActive()) {
+ if (PreviewDialog::instance()->count() <= 1 && mWasVisible) {
+ show();
+ }
+
+ PreviewDialog::instance()->show();
+ }
+ else {
+ if (mWasVisible) {
+ show();
+ }
+ }
+
+ mHideTrigger = false;
+ }
+
+ if (settings()->value("options/tray").toBool() && mTrayIcon) {
+ notify(options.result);
+
+ if (settings()->value("options/message").toBool() && options.file) {
+ showScreenshotMessage(options.result, options.fileName);
+ }
+ }
+
+ if (settings()->value("options/playSound", false).toBool()) {
+ if (options.result == Screenshot::Success) {
+ QSound::play("sounds/ls.screenshot.wav");
+ }
+ else {
+ QSound::play("afakepathtomakewindowsplaythedefaultsoundtheresprobablyabetterwaybuticantbebothered");
+ }
+ }
+
+ if (options.result == Screenshot::Success
+ && settings()->value("options/optipng").toBool()
+ && settings()->value("file/format").toInt() == Screenshot::PNG)
+ {
+ compressPng(options.fileName);
+ }
+
+ if (options.result == Screenshot::Success && options.file) {
+ mLastScreenshot = options.fileName;
+ }
+}
+
+void LightscreenWindow::goToFolder()
+{
+#ifdef Q_WS_WIN
+ if (!mLastScreenshot.isEmpty()) {
+ QProcess::startDetached("explorer /select, \"" + mLastScreenshot +"\"");
+ }
+ else {
+#endif
+ QString folder = settings()->value("file/target").toString();
+
+ if (folder.isEmpty())
+ folder = qApp->applicationDirPath();
+
+ if (QDir::toNativeSeparators(folder.at(folder.size()-1)) != QDir::separator())
+ folder.append(QDir::separator());
+
+ QDesktopServices::openUrl("file:///"+folder);
+#ifdef Q_WS_WIN
+ }
+#endif
+}
+
+void LightscreenWindow::messageReceived(const QString message)
+{
+ if (message == "-wake") {
+ qApp->alert(this, 500);
+ show();
+
+ return;
+ }
+
+ if (message == "-screen")
+ screenshotAction();
+
+ if (message == "-area")
+ screenshotAction(2);
+
+ if (message == "-activewindow")
+ screenshotAction(1);
+
+ if (message == "-pickwindow")
+ screenshotAction(3);
+
+ if (message == "-folder")
+ action(4);
+}
+
+void LightscreenWindow::messageClicked()
+{
+ goToFolder();
+}
+
+void LightscreenWindow::preview(Screenshot* screenshot)
+{
+ if (screenshot->options().preview) {
+ PreviewDialog::instance()->add(screenshot);
+ }
+ else {
+ screenshot->confirm(true);
+ }
+}
+
+void LightscreenWindow::restoreNotification()
+{
+ if (mTrayIcon)
+ mTrayIcon->setIcon(QIcon(":/icons/lightscreen.small"));
+
+ setWindowTitle(tr("Lightscreen"));
+}
+
+void LightscreenWindow::screenshotAction(int mode)
+{
+ int delayms = -1;
+
+ bool optionsHide = settings()->value("options/hide").toBool(); // Option cache, used a couple of times.
+
+ if (!mHideTrigger) {
+ mWasVisible = isVisible();
+ mHideTrigger = true;
+ }
+
+ // Applying pre-screenshot settings
+ if (optionsHide) {
+ hide();
+
+ if (mTrayIcon)
+ mTrayIcon->hide();
+ }
+
+ // Screenshot delay
+ delayms = settings()->value("options/delay", 0).toInt();
+ delayms = delayms * 1000; // Converting the delay to milliseconds.
+
+ delayms += 200;
+
+#if defined(Q_WS_WIN)
+ if (optionsHide) {
+ // When on Windows Vista, the window takes a little bit longer to hide
+ if (QSysInfo::WindowsVersion == QSysInfo::WV_VISTA)
+ delayms += 200;
+ }
+#endif
+
+ if (optionsHide && PreviewDialog::isActive()) {
+ if (PreviewDialog::instance()->count() >= 1)
+ PreviewDialog::instance()->hide();
+ }
+
+ // The delayed functions works using the static variable lastMode
+ // which keeps the argument so a QTimer can call this function again.
+ if (delayms > 0) {
+ if (mLastMode < 0) {
+ mLastMode = mode;
+
+ QTimer::singleShot(delayms, this, SLOT(screenshotAction()));
+ return;
+ }
+ else {
+ mode = mLastMode;
+ mLastMode = -1;
+ }
+ }
+
+ static Screenshot::Options options;
+
+ if (!mDoCache) {
+ // Populating the option object that will then be passed to the screenshot engine
+ options.file = settings()->value("file/enabled").toBool();
+ options.format = (Screenshot::Format) settings()->value("file/format").toInt();
+ options.prefix = settings()->value("file/prefix").toString();
+ options.directory = QDir(settings()->value("file/target").toString());
+ options.quality = settings()->value("options/quality", 100).toInt();
+ options.currentMonitor = settings()->value("options/currentMonitor", false).toBool();
+ options.clipboard = settings()->value("options/clipboard", true).toBool();
+ options.preview = settings()->value("options/preview", false).toBool();
+ options.magnify = settings()->value("options/magnify", false).toBool();
+ options.cursor = settings()->value("options/cursor" , false).toBool();
+ options.saveAs = settings()->value("options/saveAs" , false).toBool();
+ options.animations = settings()->value("options/animations" , true).toBool();
+ options.replace = settings()->value("options/replace", false).toBool();
+
+ Screenshot::NamingOptions namingOptions;
+ namingOptions.naming = (Screenshot::Naming) settings()->value("file/naming").toInt();
+ namingOptions.leadingZeros = settings()->value("options/naming/leadingZeros", 0).toInt();
+ namingOptions.flip = settings()->value("options/flip", false).toBool();
+ namingOptions.dateFormat = settings()->value("options/naming/dateFormat", "yyyy-MM-dd").toString();
+
+ options.namingOptions = namingOptions;
+
+ mDoCache = true;
+ }
+
+ options.mode = mode;
+
+ ScreenshotManager::instance()->take(options);
+}
+
+void LightscreenWindow::screenshotActionTriggered(QAction* action)
+{
+ screenshotAction(action->data().toInt());
+}
+
+void LightscreenWindow::showOptions()
+{
+ GlobalShortcutManager::clear();
+
+ QPointer<OptionsDialog> optionsDialog = new OptionsDialog(this);
+
+ optionsDialog->exec();
+ optionsDialog->deleteLater();
+
+ applySettings();
+}
+
+void LightscreenWindow::showScreenshotMessage(Screenshot::Result result, QString fileName)
+{
+ if (result == Screenshot::Cancel)
+ return;
+
+ // Showing message.
+ QString title;
+ QString message;
+
+ if (result == Screenshot::Success) {
+ title = QFileInfo(fileName).fileName();
+
+ if (settings()->value("file/target").toString().isEmpty()) {
+ message = QDir::toNativeSeparators(QCoreApplication::applicationDirPath());
+ }
+ else {
+ message = tr("Saved to \"%1\"").arg(settings()->value("file/target").toString());
+ }
+ }
+ else {
+ title = tr("The screenshot was not taken");
+ message = tr("An error occurred.");
+ }
+
+ mTrayIcon->showMessage(title, message);
+}
+
+void LightscreenWindow::showScreenshotMenu()
+{
+ // This slot is called only on the first click
+ QMenu *buttonMenu = new QMenu;
+
+ QAction *screenAction = new QAction(QIcon(":/icons/screen"), tr("&Screen"), buttonMenu);
+ screenAction->setData(QVariant(0));
+
+ QAction *windowAction = new QAction(QIcon(":/icons/window"),tr("Active &Window"), buttonMenu);
+ windowAction->setData(QVariant(1));
+
+ QAction *windowPickerAction = new QAction(QIcon(":/icons/picker"), tr("&Pick Window"), buttonMenu);
+ windowPickerAction->setData(QVariant(3));
+
+ QAction *areaAction = new QAction(QIcon(":/icons/area"), tr("&Area"), buttonMenu);
+ areaAction->setData(QVariant(2));
+
+ QAction *goAction = new QAction(QIcon(":/icons/folder"), tr("&Go to Folder"), buttonMenu);
+ connect(goAction, SIGNAL(triggered()), this, SLOT(goToFolder()));
+
+ QActionGroup *screenshotGroup = new QActionGroup(buttonMenu);
+ screenshotGroup->addAction(screenAction);
+ screenshotGroup->addAction(windowAction);
+ screenshotGroup->addAction(windowPickerAction);
+ screenshotGroup->addAction(areaAction);
+
+ connect(screenshotGroup, SIGNAL(triggered(QAction*)), this, SLOT(screenshotActionTriggered(QAction*)));
+
+ buttonMenu->addAction(screenAction);
+ buttonMenu->addAction(areaAction);
+ buttonMenu->addAction(windowAction);
+ buttonMenu->addAction(windowPickerAction);
+ buttonMenu->addSeparator();
+ buttonMenu->addAction(goAction);
+
+ ui.screenshotPushButton->setMenu(buttonMenu);
+ ui.screenshotPushButton->showMenu();
+}
+
+void LightscreenWindow::notify(Screenshot::Result result)
+{
+ switch (result)
+ {
+ case Screenshot::Success:
+ mTrayIcon->setIcon(QIcon(":/icons/lightscreen.yes"));
+ setWindowTitle(tr("Success!"));
+ break;
+ case Screenshot::Fail:
+ mTrayIcon->setIcon(QIcon(":/icons/lightscreen.no"));
+ setWindowTitle(tr("Failed!"));
+ break;
+ case Screenshot::Cancel:
+ setWindowTitle(tr("Cancelled!"));
+ break;
+ }
+
+ QTimer::singleShot(1500, this, SLOT(restoreNotification()));
+}
+
+void LightscreenWindow::showHotkeyError(QStringList hotkeys)
+{
+ static bool dontShow = false;
+
+ if (dontShow)
+ return;
+
+ QString messageText;
+
+ messageText = tr("Some hotkeys could not be registered, they might already be in use");
+
+ if (hotkeys.count() > 1) {
+ messageText += tr("<br>The failed hotkeys are the following:") + "<ul>";
+
+ foreach(const QString &hotkey, hotkeys) {
+ messageText += QString("%1%2%3").arg("<li><b>").arg(hotkey).arg("</b></li>");
+ }
+
+ messageText += "</ul>";
+ }
+ else {
+ messageText += tr("<br>The failed hotkey is <b>%1</b>").arg(hotkeys[0]);
+ }
+
+ messageText += tr("<br><i>What do you want to do?</i>");
+
+ QMessageBox msgBox(this);
+ msgBox.setWindowTitle(tr("Lightscreen"));
+ msgBox.setText(messageText);
+
+ QPushButton *changeButton = msgBox.addButton(tr("Change") , QMessageBox::ActionRole);
+ QPushButton *disableButton = msgBox.addButton(tr("Disable"), QMessageBox::ActionRole);
+ QPushButton *exitButton = msgBox.addButton(tr("Quit") , QMessageBox::ActionRole);
+
+ msgBox.exec();
+
+ if (msgBox.clickedButton() == exitButton) {
+ dontShow = true;
+ QTimer::singleShot(10, this, SLOT(accept()));
+ }
+ else if (msgBox.clickedButton() == changeButton) {
+ showOptions();
+ }
+ else if (msgBox.clickedButton() == disableButton) {
+ foreach(const QString &hotkey, hotkeys) {
+ settings()->setValue(QString("actions/%1/enabled").arg(hotkey), false);
+ }
+ }
+
+}
+
+void LightscreenWindow::toggleVisibility(QSystemTrayIcon::ActivationReason reason)
+{
+ if (reason != QSystemTrayIcon::DoubleClick)
+ return;
+
+ if (isVisible()) {
+ if (settings()->value("options/tray").toBool() == false
+ && closingWithoutTray())
+ return;
+
+ hide();
+ }
+ else {
+ show();
+ }
+}
+
+// Aliases
+void LightscreenWindow::windowHotkey() { screenshotAction(1); }
+void LightscreenWindow::windowPickerHotkey() { screenshotAction(3); }
+void LightscreenWindow::areaHotkey() { screenshotAction(2); }
+
+/*
+ * Private
+ */
+
+void LightscreenWindow::applySettings()
+{
+ bool tray = settings()->value("options/tray").toBool();
+
+ if (tray && !mTrayIcon) {
+ createTrayIcon();
+ mTrayIcon->show();
+ }
+ else if (!tray && mTrayIcon) {
+ mTrayIcon->deleteLater();
+ }
+
+ connectHotkeys();
+
+ mDoCache = false;
+
+ os::setStartup(settings()->value("options/startup").toBool(), settings()->value("options/startupHide").toBool());
+}
+
+void LightscreenWindow::compressPng(QString fileName)
+{
+#if defined(Q_OS_UNIX)
+ QProcess::startDetached("optipng " + fileName + " -quiet");
+#else
+ ShellExecuteW(NULL, NULL, (LPCWSTR)QString("optipng.exe").toStdWString().data(), (LPCWSTR)fileName.toStdWString().data(), NULL, SW_HIDE);
+#endif
+}
+
+void LightscreenWindow::connectHotkeys()
+{
+ // Set to true because if the hotkey is disabled it will show an error.
+ bool screen = true, area = true, window = true, open = true, directory = true;
+
+ if (settings()->value("actions/screen/enabled").toBool())
+ screen = GlobalShortcutManager::instance()->connect(settings()->value(
+ "actions/screen/hotkey").value<QKeySequence> (), this, SLOT(screenshotAction()));
+
+ if (settings()->value("actions/area/enabled").toBool())
+ area = GlobalShortcutManager::instance()->connect(settings()->value(
+ "actions/area/hotkey").value<QKeySequence> (), this, SLOT(areaHotkey()));
+
+ if (settings()->value("actions/window/enabled").toBool())
+ window = GlobalShortcutManager::instance()->connect(settings()->value(
+ "actions/window/hotkey").value<QKeySequence> (), this, SLOT(windowHotkey()));
+
+ if (settings()->value("actions/windowPicker/enabled").toBool())
+ window = GlobalShortcutManager::instance()->connect(settings()->value(
+ "actions/windowPicker/hotkey").value<QKeySequence> (), this, SLOT(windowPickerHotkey()));
+
+ if (settings()->value("actions/open/enabled").toBool())
+ open = GlobalShortcutManager::instance()->connect(settings()->value(
+ "actions/open/hotkey").value<QKeySequence> (), this, SLOT(show()));
+
+ if (settings()->value("actions/directory/enabled").toBool())
+ directory = GlobalShortcutManager::instance()->connect(settings()->value(
+ "actions/directory/hotkey").value<QKeySequence> (), this, SLOT(goToFolder()));
+
+ QStringList failed;
+ if (!screen) failed << "screen";
+ if (!area) failed << "area";
+ if (!window) failed << "window";
+ if (!open) failed << "open";
+ if (!directory) failed << "directory";
+
+ if (!failed.isEmpty())
+ showHotkeyError(failed);
+}
+
+void LightscreenWindow::createTrayIcon()
+{
+ mTrayIcon = new QSystemTrayIcon(QIcon(":/icons/lightscreen.small"), this);
+ mTrayIcon->setToolTip(qApp->applicationName() + " " + qApp->applicationVersion());
+
+ connect(mTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(toggleVisibility(QSystemTrayIcon::ActivationReason)));
+ connect(mTrayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
+
+ QAction *hideAction = new QAction(QIcon(":/icons/lightscreen.small"), tr("Show&/Hide"), mTrayIcon);
+ connect(hideAction, SIGNAL(triggered()), this, SLOT(toggleVisibility()));
+
+ QAction *screenAction = new QAction(QIcon(":/icons/screen"), tr("&Screen"), mTrayIcon);
+ screenAction->setData(QVariant(0));
+
+ QAction *windowAction = new QAction(QIcon(":/icons/window"), tr("Active &Window"), this);
+ windowAction->setData(QVariant(1));
+
+ QAction *windowPickerAction = new QAction(QIcon(":/icons/picker"), tr("&Pick Window"), this);
+ windowPickerAction->setData(QVariant(3));
+
+ QAction *areaAction = new QAction(QIcon(":/icons/area"), tr("&Area"), mTrayIcon);
+ areaAction->setData(QVariant(2));
+
+ QActionGroup *screenshotGroup = new QActionGroup(mTrayIcon);
+ screenshotGroup->addAction(screenAction);
+ screenshotGroup->addAction(areaAction);
+ screenshotGroup->addAction(windowAction);
+ screenshotGroup->addAction(windowPickerAction);
+
+ connect(screenshotGroup, SIGNAL(triggered(QAction*)), this, SLOT(screenshotActionTriggered(QAction*)));
+
+ QAction *optionsAction = new QAction(QIcon(":/icons/configure"), tr("View &Options"), mTrayIcon);
+ connect(optionsAction, SIGNAL(triggered()), this, SLOT(showOptions()));
+
+ QAction *goAction = new QAction(QIcon(":/icons/folder"), tr("&Go to Folder"), mTrayIcon);
+ connect(goAction, SIGNAL(triggered()), this, SLOT(goToFolder()));
+
+ QAction *quitAction = new QAction(tr("&Quit"), mTrayIcon);
+ connect(quitAction, SIGNAL(triggered()), this, SLOT(accept()));
+
+ QMenu* screenshotMenu = new QMenu("Screenshot");
+ screenshotMenu->addAction(screenAction);
+ screenshotMenu->addAction(areaAction);
+ screenshotMenu->addAction(windowAction);
+ screenshotMenu->addAction(windowPickerAction);
+
+ QMenu * trayIconMenu = new QMenu;
+ trayIconMenu->addAction(hideAction);
+ trayIconMenu->addSeparator();
+ trayIconMenu->addMenu(screenshotMenu);
+ trayIconMenu->addAction(optionsAction);
+ trayIconMenu->addAction(goAction);
+ trayIconMenu->addSeparator();
+ trayIconMenu->addAction(quitAction);
+
+ mTrayIcon->setContextMenu(trayIconMenu);
+}
+
+QSettings *LightscreenWindow::settings() const
+{
+ return ScreenshotManager::instance()->settings();
+}
+
+void LightscreenWindow::checkForUpdates()
+{
+ if (settings()->value("options/disableUpdater", false).toBool())
+ return;
+
+ if (settings()->value("lastUpdateCheck").toInt() + 7
+ > QDate::currentDate().dayOfYear())
+ return; // If 7 days have not passed since the last update check.
+
+ connect(Updater::instance(), SIGNAL(done(bool)), this, SLOT(updaterDone(bool)));
+ Updater::instance()->check();
+}
+
+
+void LightscreenWindow::updaterDone(bool result)
+{
+ settings()->setValue("lastUpdateCheck", QDate::currentDate().dayOfYear());
+
+ if (!result)
+ return;
+
+ QMessageBox msgBox;
+ msgBox.setWindowTitle(tr("Lightscreen"));
+ msgBox.setText(tr("There's a new version of Lightscreen available.<br>Would you like to see more information?<br>(<em>You can turn this notification off</em>)"));
+ msgBox.setIcon(QMessageBox::Information);
+
+ QPushButton *yesButton = msgBox.addButton(QMessageBox::Yes);
+ QPushButton *turnOffButton = msgBox.addButton(tr("Turn Off"), QMessageBox::ActionRole);
+ QPushButton *remindButton = msgBox.addButton(tr("Remind Me Later"), QMessageBox::RejectRole);
+
+ Q_UNUSED(remindButton);
+
+ msgBox.exec();
+
+ if (msgBox.clickedButton() == yesButton) {
+ QDesktopServices::openUrl(QUrl("http://lightscreen.sourceforge.net/new-version"));
+ }
+ else if (msgBox.clickedButton() == turnOffButton) {
+ settings()->setValue("disableUpdater", true);
+ }
+}
+
+// Event handling
+bool LightscreenWindow::event(QEvent *event)
+{
+ if (event->type() == QEvent::Hide
+ || event->type() == QEvent::Close) {
+ settings()->setValue("position", pos());
+ }
+ else if (event->type() == QEvent::Show) {
+ os::aeroGlass(this);
+
+ if (!settings()->value("position").toPoint().isNull())
+ move(settings()->value("position").toPoint());
+ }
+ else if (event->type() == QEvent::KeyPress) {
+ QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+#ifdef Q_WS_MAC
+ if (keyEvent->modifiers() == Qt::ControlModifier && e->key() == Qt::Key_Period) {
+ keyEvent->ignore();
+
+ if(isVisible())
+ toggleVisibility();
+
+ return false;
+ }
+ else
+#endif
+ if (!keyEvent->modifiers() && keyEvent->key() == Qt::Key_Escape) {
+ keyEvent->ignore();
+
+ if(isVisible())
+ toggleVisibility();
+
+ return false;
+ }
+ }
+ else if (event->type() == QEvent::LanguageChange) {
+ ui.retranslateUi(this);
+ resize(minimumSizeHint());
+ }
+
+ return QDialog::event(event);
+}
+
+
diff --git a/lightscreenwindow.h b/lightscreenwindow.h
new file mode 100644
index 0000000..19b6849
--- /dev/null
+++ b/lightscreenwindow.h
@@ -0,0 +1,75 @@
+#ifndef LIGHTSCREENWINDOW_H
+#define LIGHTSCREENWINDOW_H
+
+#include <QtGui/QDialog>
+#include <QPointer>
+#include <QSystemTrayIcon>
+
+#include "updater/updater.h"
+#include "tools/screenshot.h"
+
+#include "ui_lightscreenwindow.h"
+
+class QHttp;
+class Updater;
+class QSettings;
+class LightscreenWindow : public QDialog
+{
+ Q_OBJECT
+
+public:
+ LightscreenWindow(QWidget *parent = 0);
+ ~LightscreenWindow();
+
+public slots:
+ void action(int mode = 3);
+ void areaHotkey();
+ void checkForUpdates();
+ void cleanup(Screenshot::Options options);
+ bool closingWithoutTray();
+ void goToFolder();
+ void messageReceived(const QString message);
+ void messageClicked();
+ void preview(Screenshot* screenshot);
+ void restoreNotification();
+ void screenshotAction(int mode = 0);
+ void screenshotActionTriggered(QAction* action);
+ void showHotkeyError(QStringList hotkeys);
+ void showOptions();
+ void showScreenshotMenu();
+ void showScreenshotMessage(Screenshot::Result result, QString fileName);
+ void notify(Screenshot::Result result);
+ void toggleVisibility(QSystemTrayIcon::ActivationReason reason = QSystemTrayIcon::DoubleClick);
+ void updaterDone(bool result);
+ void windowHotkey();
+ void windowPickerHotkey();
+
+private slots:
+ void applySettings();
+
+private:
+ void compressPng(QString fileName);
+ void connectHotkeys();
+ void createTrayIcon();
+
+ // Convenience function
+ QSettings *settings() const;
+
+protected:
+ bool event(QEvent *event);
+
+private:
+ bool mDoCache;
+ bool mHideTrigger;
+ bool mReviveMain;
+ bool mWasVisible;
+ bool mIsOptimizing;
+ int mLastMode;
+ QString mLastScreenshot;
+ QPointer<QSystemTrayIcon> mTrayIcon;
+ Ui::LightscreenWindowClass ui;
+
+};
+
+#endif // LIGHTSCREENWINDOW_H
+
diff --git a/lightscreenwindow.ui b/lightscreenwindow.ui
new file mode 100644
index 0000000..c71b305
--- /dev/null
+++ b/lightscreenwindow.ui
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>LightscreenWindowClass</class>
+ <widget class="QDialog" name="LightscreenWindowClass">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>162</width>
+ <height>81</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Lightscreen</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="horizontalSpacing">
+ <number>4</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>2</number>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <item row="0" column="0" rowspan="3">
+ <widget class="QToolButton" name="screenshotPushButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Screenshot</string>
+ </property>
+ <property name="popupMode">
+ <enum>QToolButton::InstantPopup</enum>
+ </property>
+ <property name="autoRaise">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QPushButton" name="optionsPushButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Configure Lightscreen</string>
+ </property>
+ <property name="text">
+ <string>&amp;Options</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QPushButton" name="hidePushButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Hide Lightscreen </string>
+ </property>
+ <property name="whatsThis">
+ <string/>
+ </property>
+ <property name="text">
+ <string>&amp;Hide</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QPushButton" name="quitPushButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string/>
+ </property>
+ <property name="text">
+ <string>&amp;Quit</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>quitPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>LightscreenWindowClass</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>135</x>
+ <y>79</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>71</x>
+ <y>101</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 0000000..131ab45
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,35 @@
+#include <QApplication>
+#include <QDesktopWidget>
+#include <QLocale>
+
+#include "tools/os.h"
+#include <QtSingleApplication>
+#include "lightscreenwindow.h"
+
+int main(int argc, char *argv[])
+{
+ QtSingleApplication application(argc, argv);
+ application.setOrganizationName("K");
+ application.setApplicationName ("Lightscreen");
+ application.setApplicationVersion("2.0");
+ application.setQuitOnLastWindowClosed(false);
+
+ if (application.isRunning()) {
+ application.sendMessage("-wake");
+ return 0;
+ }
+
+ LightscreenWindow lightscreen;
+
+ if (application.arguments().size() > 1) {
+ lightscreen.messageReceived(application.arguments().at(1));
+ }
+ else {
+ lightscreen.show();
+ }
+
+ QObject::connect(&application, SIGNAL(messageReceived(const QString&)), &lightscreen, SLOT(messageReceived(const QString&)));
+ QObject::connect(&lightscreen, SIGNAL(finished(int)), &application, SLOT(quit()));
+
+ return application.exec();
+}
diff --git a/sounds/ls.error.wav b/sounds/ls.error.wav
new file mode 100644
index 0000000..be7cc75
Binary files /dev/null and b/sounds/ls.error.wav differ
diff --git a/sounds/ls.screenshot.wav b/sounds/ls.screenshot.wav
new file mode 100644
index 0000000..c788f37
Binary files /dev/null and b/sounds/ls.screenshot.wav differ
diff --git a/tools/globalshortcut/globalshortcut.pri b/tools/globalshortcut/globalshortcut.pri
new file mode 100644
index 0000000..9a23c0a
--- /dev/null
+++ b/tools/globalshortcut/globalshortcut.pri
@@ -0,0 +1,14 @@
+HEADERS += $$PWD/globalshortcutmanager.h $$PWD/globalshortcuttrigger.h
+SOURCES += $$PWD/globalshortcutmanager.cpp
+INCLUDEPATH += $$PWD
+DEPENDPATH += $$PWD
+
+unix:!mac {
+ SOURCES += $$PWD/globalshortcutmanager_x11.cpp
+}
+win32: {
+ SOURCES += $$PWD/globalshortcutmanager_win.cpp
+}
+mac: {
+ SOURCES += $$PWD/globalshortcutmanager_mac.cpp
+}
diff --git a/tools/globalshortcut/globalshortcutmanager.cpp b/tools/globalshortcut/globalshortcutmanager.cpp
new file mode 100644
index 0000000..4735360
--- /dev/null
+++ b/tools/globalshortcut/globalshortcutmanager.cpp
@@ -0,0 +1,98 @@
+/*
+ * globalshortcutmanager.cpp - Class managing global shortcuts
+ * Copyright (C) 2006 Maciej Niedzielski
+ *
+ * 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "globalshortcutmanager.h"
+
+#include <QCoreApplication>
+#include "globalshortcuttrigger.h"
+
+/**
+ * \brief Constructs new GlobalShortcutManager.
+ */
+GlobalShortcutManager::GlobalShortcutManager()
+ : QObject(QCoreApplication::instance())
+{
+}
+
+GlobalShortcutManager::~GlobalShortcutManager()
+{
+ clear();
+}
+
+GlobalShortcutManager* GlobalShortcutManager::instance_ = 0;
+
+/**
+ * \brief Returns the instance of GlobalShortcutManager.
+ */
+GlobalShortcutManager* GlobalShortcutManager::instance()
+{
+ if (!instance_)
+ instance_ = new GlobalShortcutManager();
+ return instance_;
+}
+
+/**
+ * \brief Connects a key sequence with a slot.
+ * \param key, global shortcut to be connected
+ * \param receiver, object which should receive the notification
+ * \param slot, the SLOT() of the \a receiver which should be triggerd if the \a key is activated
+ */
+bool GlobalShortcutManager::connect(const QKeySequence& key, QObject* receiver, const char* slot)
+{
+ KeyTrigger* t = instance()->triggers_[key];
+ if (!t) {
+ t = new KeyTrigger(key);
+
+ if (!t->isValid())
+ return false;
+
+ instance()->triggers_.insert(key, t);
+ }
+
+ QObject::connect(t, SIGNAL(activated()), receiver, slot);
+ return true;
+}
+
+/**
+ * \brief Disonnects a key sequence from a slot.
+ * \param key, global shortcut to be disconnected
+ * \param receiver, object which \a slot is about to be disconnected
+ * \param slot, the SLOT() of the \a receiver which should no longer be triggerd if the \a key is activated
+ */
+void GlobalShortcutManager::disconnect(const QKeySequence& key, QObject* receiver, const char* slot)
+{
+ KeyTrigger* t = instance()->triggers_[key];
+ if (!t) {
+ return;
+ }
+
+ QObject::disconnect(t, SIGNAL(activated()), receiver, slot);
+
+ if (!t->isUsed()) {
+ delete instance()->triggers_.take(key);
+ }
+}
+
+void GlobalShortcutManager::clear()
+{
+ foreach (KeyTrigger* t, instance()->triggers_)
+ delete t;
+ instance()->triggers_.clear();
+}
diff --git a/tools/globalshortcut/globalshortcutmanager.h b/tools/globalshortcut/globalshortcutmanager.h
new file mode 100644
index 0000000..236598a
--- /dev/null
+++ b/tools/globalshortcut/globalshortcutmanager.h
@@ -0,0 +1,47 @@
+/*
+ * globalshortcutmanager.h - Class managing global shortcuts
+ * Copyright (C) 2006 Maciej Niedzielski
+ *
+ * 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef GLOBALSHORTCUTMANAGER_H
+#define GLOBALSHORTCUTMANAGER_H
+
+#include <QObject>
+#include <QKeySequence>
+#include <QMap>
+
+class QObject;
+class KeyTrigger;
+
+class GlobalShortcutManager : public QObject
+{
+public:
+ static GlobalShortcutManager* instance();
+ static bool connect(const QKeySequence& key, QObject* receiver, const char* slot);
+ static void disconnect(const QKeySequence& key, QObject* receiver, const char* slot);
+ static void clear();
+
+private:
+ GlobalShortcutManager();
+ ~GlobalShortcutManager();
+ static GlobalShortcutManager* instance_;
+ class KeyTrigger;
+ QMap<QKeySequence, KeyTrigger*> triggers_;
+};
+
+#endif
diff --git a/tools/globalshortcut/globalshortcutmanager_mac.cpp b/tools/globalshortcut/globalshortcutmanager_mac.cpp
new file mode 100644
index 0000000..c49a545
--- /dev/null
+++ b/tools/globalshortcut/globalshortcutmanager_mac.cpp
@@ -0,0 +1,414 @@
+/*
+ * globalshortcutmanager_mac.cpp - Mac OS X implementation of global shortcuts
+ * Copyright (C) 2003-2007 Eric Smith, Michail Pishchagin
+ *
+ * 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "globalshortcutmanager.h"
+#include "globalshortcuttrigger.h"
+
+// TODO:
+// - don't invoke hotkey if there is a modal dialog?
+// - do multi-mapping, like the x11 version
+
+#include <QCoreApplication>
+
+#include <Carbon/Carbon.h>
+
+class MacKeyTrigger
+{
+public:
+ virtual ~MacKeyTrigger() {}
+ virtual void activate() = 0;
+ virtual bool isAccepted(int id) const = 0;
+};
+
+class MacKeyTriggerManager : public QObject
+{
+public:
+ static MacKeyTriggerManager* instance()
+ {
+ if(!instance_)
+ instance_ = new MacKeyTriggerManager();
+ return instance_;
+ }
+
+ void addTrigger(MacKeyTrigger* trigger)
+ {
+ triggers_ << trigger;
+ }
+
+ void removeTrigger(MacKeyTrigger* trigger)
+ {
+ triggers_.removeAll(trigger);
+ }
+
+private:
+ MacKeyTriggerManager()
+ : QObject(QCoreApplication::instance())
+ {
+ initAscii2KeyCodeTable(&key_codes_);
+ hot_key_function_ = NewEventHandlerUPP(hotKeyHandler);
+ EventTypeSpec type;
+ type.eventClass = kEventClassKeyboard;
+ type.eventKind = kEventHotKeyPressed;
+ InstallApplicationEventHandler(hot_key_function_, 1, &type, this, NULL);
+ }
+
+ /**
+ * Callback function invoked when the user hits a hot-key.
+ */
+ static pascal OSStatus hotKeyHandler(EventHandlerCallRef /*nextHandler*/, EventRef theEvent, void* userData)
+ {
+ EventHotKeyID hkID;
+ GetEventParameter(theEvent, kEventParamDirectObject, typeEventHotKeyID, NULL, sizeof(EventHotKeyID), NULL, &hkID);
+ static_cast<MacKeyTriggerManager*>(userData)->activated(hkID.id);
+ return noErr;
+ }
+
+ void activated(int id)
+ {
+ foreach(MacKeyTrigger* trigger, triggers_) {
+ if (trigger->isAccepted(id)) {
+ trigger->activate();
+ break;
+ }
+ }
+ }
+
+ static MacKeyTriggerManager* instance_;
+ QList<MacKeyTrigger*> triggers_;
+
+ typedef struct
+ {
+ short kchrID;
+ Str255 KCHRname;
+ short transtable[256];
+ } Ascii2KeyCodeTable;
+
+ enum {
+ kTableCountOffset = 256 + 2,
+ kFirstTableOffset = 256 + 4,
+ kTableSize = 128
+ };
+
+ static EventHandlerUPP hot_key_function_;
+ static Ascii2KeyCodeTable key_codes_;
+
+private:
+ /**
+ * initAscii2KeyCodeTable initializes the ascii to key code
+ * look up table using the currently active KCHR resource. This
+ * routine calls GetResource so it cannot be called at interrupt time.
+ */
+ static OSStatus initAscii2KeyCodeTable(Ascii2KeyCodeTable* ttable)
+ {
+ unsigned char* theCurrentKCHR, *ithKeyTable;
+ short count, i, j, resID;
+ Handle theKCHRRsrc;
+ ResType rType;
+
+ // set up our table to all minus ones
+ for (i = 0; i < 256; i++)
+ ttable->transtable[i] = -1;
+
+ // find the current kchr resource ID
+ ttable->kchrID = (short)GetScriptVariable(smCurrentScript, smScriptKeys);
+
+ // get the current KCHR resource
+ theKCHRRsrc = GetResource('KCHR', ttable->kchrID);
+ if (theKCHRRsrc == NULL)
+ return resNotFound;
+ GetResInfo(theKCHRRsrc, &resID, &rType, ttable->KCHRname);
+
+ // dereference the resource
+ theCurrentKCHR = (unsigned char *)(*theKCHRRsrc);
+
+ // get the count from the resource
+ count = *(short*)(theCurrentKCHR + kTableCountOffset);
+
+ // build inverse table by merging all key tables
+ for (i = 0; i < count; i++) {
+ ithKeyTable = theCurrentKCHR + kFirstTableOffset + (i * kTableSize);
+ for (j = 0; j < kTableSize; j++) {
+ if (ttable->transtable[ ithKeyTable[j] ] == -1)
+ ttable->transtable[ ithKeyTable[j] ] = j;
+ }
+ }
+
+ return noErr;
+ }
+
+ /**
+ * validateAscii2KeyCodeTable verifies that the ascii to key code
+ * lookup table is synchronized with the current KCHR resource. If
+ * it is not synchronized, then the table is re-built. This routine calls
+ * GetResource so it cannot be called at interrupt time.
+ *
+ * Should probably call this at some point, in case the user has switched keyboard
+ * layouts while we were running.
+ */
+ static OSStatus validateAscii2KeyCodeTable(Ascii2KeyCodeTable* ttable, Boolean* wasChanged)
+ {
+ short theID;
+ theID = (short) GetScriptVariable(smCurrentScript, smScriptKeys);
+ if (theID != ttable->kchrID) {
+ *wasChanged = true;
+ return initAscii2KeyCodeTable(ttable);
+ }
+ else {
+ *wasChanged = false;
+ return noErr;
+ }
+ }
+
+ /**
+ * asciiToKeyCode looks up the ascii character in the key
+ * code look up table and returns the virtual key code for that
+ * letter. If there is no virtual key code for that letter, then
+ * the value -1 will be returned.
+ */
+ static short asciiToKeyCode(Ascii2KeyCodeTable* ttable, short asciiCode)
+ {
+ if (asciiCode >= 0 && asciiCode <= 255)
+ return ttable->transtable[asciiCode];
+ else return false;
+ }
+
+ /**
+ * Not used.
+ */
+ static char keyCodeToAscii(short virtualKeyCode)
+ {
+ unsigned long state;
+ long keyTrans;
+ char charCode;
+ Ptr kchr;
+ state = 0;
+ kchr = (Ptr)GetScriptVariable(smCurrentScript, smKCHRCache);
+ keyTrans = KeyTranslate(kchr, virtualKeyCode, &state);
+ charCode = keyTrans;
+ if (!charCode)
+ charCode = (keyTrans >> 16);
+ return charCode;
+ }
+
+private:
+ struct Qt_Mac_Keymap
+ {
+ int qt_key;
+ int mac_key;
+ };
+
+ static Qt_Mac_Keymap qt_keymap[];
+
+public:
+ static bool convertKeySequence(const QKeySequence& ks, quint32* _key, quint32* _mod)
+ {
+ int code = ks[0];
+
+ quint32 mod = 0;
+ if (code & Qt::META)
+ mod |= controlKey;
+ if (code & Qt::SHIFT)
+ mod |= shiftKey;
+ if (code & Qt::CTRL)
+ mod |= cmdKey;
+ if (code & Qt::ALT)
+ mod |= optionKey;
+
+ code &= ~Qt::KeyboardModifierMask;
+ quint32 key = 0;
+ for (int n = 0; qt_keymap[n].qt_key != Qt::Key_unknown; ++n) {
+ if (qt_keymap[n].qt_key == code) {
+ key = qt_keymap[n].mac_key;
+ break;
+ }
+ }
+ if (key == 0) {
+ key = asciiToKeyCode(&key_codes_, code & 0xffff);
+ }
+
+ if (_mod)
+ *_mod = mod;
+ if (_key)
+ *_key = key;
+
+ return true;
+ }
+};
+
+MacKeyTriggerManager* MacKeyTriggerManager::instance_ = NULL;
+EventHandlerUPP MacKeyTriggerManager::hot_key_function_ = NULL;
+MacKeyTriggerManager::Ascii2KeyCodeTable MacKeyTriggerManager::key_codes_;
+
+class GlobalShortcutManager::KeyTrigger::Impl : public MacKeyTrigger
+{
+private:
+ KeyTrigger* trigger_;
+ EventHotKeyRef hotKey_;
+ int id_;
+ static int nextId;
+
+public:
+ /**
+ * Constructor registers the hotkey.
+ */
+ Impl(GlobalShortcutManager::KeyTrigger* t, const QKeySequence& ks)
+ : trigger_(t)
+ , id_(0)
+ {
+ MacKeyTriggerManager::instance()->addTrigger(this);
+
+ quint32 key, mod;
+ if (MacKeyTriggerManager::convertKeySequence(ks, &key, &mod)) {
+ EventHotKeyID hotKeyID;
+ hotKeyID.signature = 'QtHK';
+ hotKeyID.id = nextId;
+
+ OSStatus ret = RegisterEventHotKey(key, mod, hotKeyID, GetApplicationEventTarget(), 0, &hotKey_);
+ if (ret != 0) {
+ qWarning("RegisterEventHotKey(%d, %d): %d", key, mod, (int)ret);
+ return;
+ }
+
+ id_ = nextId++;
+ }
+ }
+
+ /**
+ * Destructor unregisters the hotkey.
+ */
+ ~Impl()
+ {
+ MacKeyTriggerManager::instance()->removeTrigger(this);
+
+ if (id_)
+ UnregisterEventHotKey(hotKey_);
+ }
+
+ void activate()
+ {
+ emit trigger_->activated();
+ }
+
+ bool isAccepted(int id) const
+ {
+ return id_ == id;
+ }
+};
+
+/*
+ * The following table is from Apple sample-code.
+ * Apple's headers don't appear to define any constants for the virtual key
+ * codes of special keys, but these constants are somewhat documented in the chart at
+ * <http://developer.apple.com/techpubs/mac/Text/Text-571.html#MARKER-9-18>
+ *
+ * The constants on the chartappear to be the same values as are used in Apple's iGetKeys
+ * sample.
+ * <http://developer.apple.com/samplecode/Sample_Code/Human_Interface_Toolbox/Mac_OS_High_Level_Toolbox/iGetKeys.htm>.
+ *
+ * See also <http://www.mactech.com/articles/mactech/Vol.04/04.12/Macinkeys/>.
+ */
+MacKeyTriggerManager::Qt_Mac_Keymap
+MacKeyTriggerManager::qt_keymap[] = {
+ { Qt::Key_Escape, 0x35 },
+ { Qt::Key_Tab, 0x30 },
+ { Qt::Key_Backtab, 0 },
+ { Qt::Key_Backspace, 0x33 },
+ { Qt::Key_Return, 0x24 },
+ { Qt::Key_Enter, 0x4c }, // Return & Enter are different on the Mac
+ { Qt::Key_Insert, 0 },
+ { Qt::Key_Delete, 0x75 },
+ { Qt::Key_Pause, 0 },
+ { Qt::Key_Print, 0 },
+ { Qt::Key_SysReq, 0 },
+ { Qt::Key_Clear, 0x47 },
+ { Qt::Key_Home, 0x73 },
+ { Qt::Key_End, 0x77 },
+ { Qt::Key_Left, 0x7b },
+ { Qt::Key_Up, 0x7e },
+ { Qt::Key_Right, 0x7c },
+ { Qt::Key_Down, 0x7d },
+ { Qt::Key_PageUp, 0x74 }, // Page Up
+ { Qt::Key_PageDown, 0x79 }, // Page Down
+ { Qt::Key_Shift, 0x38 },
+ { Qt::Key_Control, 0x3b },
+ { Qt::Key_Meta, 0x37 }, // Command
+ { Qt::Key_Alt, 0x3a }, // Option
+ { Qt::Key_CapsLock, 57 },
+ { Qt::Key_NumLock, 0 },
+ { Qt::Key_ScrollLock, 0 },
+ { Qt::Key_F1, 0x7a },
+ { Qt::Key_F2, 0x78 },
+ { Qt::Key_F3, 0x63 },
+ { Qt::Key_F4, 0x76 },
+ { Qt::Key_F5, 0x60 },
+ { Qt::Key_F6, 0x61 },
+ { Qt::Key_F7, 0x62 },
+ { Qt::Key_F8, 0x64 },
+ { Qt::Key_F9, 0x65 },
+ { Qt::Key_F10, 0x6d },
+ { Qt::Key_F11, 0x67 },
+ { Qt::Key_F12, 0x6f },
+ { Qt::Key_F13, 0x69 },
+ { Qt::Key_F14, 0x6b },
+ { Qt::Key_F15, 0x71 },
+ { Qt::Key_F16, 0 },
+ { Qt::Key_F17, 0 },
+ { Qt::Key_F18, 0 },
+ { Qt::Key_F19, 0 },
+ { Qt::Key_F20, 0 },
+ { Qt::Key_F21, 0 },
+ { Qt::Key_F22, 0 },
+ { Qt::Key_F23, 0 },
+ { Qt::Key_F24, 0 },
+ { Qt::Key_F25, 0 },
+ { Qt::Key_F26, 0 },
+ { Qt::Key_F27, 0 },
+ { Qt::Key_F28, 0 },
+ { Qt::Key_F29, 0 },
+ { Qt::Key_F30, 0 },
+ { Qt::Key_F31, 0 },
+ { Qt::Key_F32, 0 },
+ { Qt::Key_F33, 0 },
+ { Qt::Key_F34, 0 },
+ { Qt::Key_F35, 0 },
+ { Qt::Key_Super_L, 0 },
+ { Qt::Key_Super_R, 0 },
+ { Qt::Key_Menu, 0 },
+ { Qt::Key_Hyper_L, 0 },
+ { Qt::Key_Hyper_R, 0 },
+ { Qt::Key_Help, 0x72 },
+ { Qt::Key_Direction_L, 0 },
+ { Qt::Key_Direction_R, 0 },
+
+ { Qt::Key_unknown, 0 }
+};
+
+int GlobalShortcutManager::KeyTrigger::Impl::nextId = 1;
+
+GlobalShortcutManager::KeyTrigger::KeyTrigger(const QKeySequence& key)
+{
+ d = new Impl(this, key);
+}
+
+GlobalShortcutManager::KeyTrigger::~KeyTrigger()
+{
+ delete d;
+ d = 0;
+}
diff --git a/tools/globalshortcut/globalshortcutmanager_win.cpp b/tools/globalshortcut/globalshortcutmanager_win.cpp
new file mode 100644
index 0000000..8086e41
--- /dev/null
+++ b/tools/globalshortcut/globalshortcutmanager_win.cpp
@@ -0,0 +1,213 @@
+/*
+ * globalshortcutmanager_win.cpp - Windows implementation of global shortcuts
+ * Copyright (C) 2003-2006 Justin Karneges, Maciej Niedzielski
+ *
+ * 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "globalshortcutmanager.h"
+#include "globalshortcuttrigger.h"
+
+#include <QWidget>
+
+#include <windows.h>
+
+class GlobalShortcutManager::KeyTrigger::Impl : public QWidget
+{
+public:
+ /**
+ * Constructor registers the hotkey.
+ */
+ Impl(GlobalShortcutManager::KeyTrigger* t, const QKeySequence& ks)
+ : trigger_(t)
+ , id_(0)
+ , valid(false)
+ {
+ UINT mod = 0, key;
+ if (convertKeySequence(ks, &mod, &key))
+ if (valid = RegisterHotKey(winId(), nextId, mod, key))
+ id_ = nextId++;
+ }
+
+ /**
+ * Destructor unregisters the hotkey.
+ */
+ ~Impl()
+ {
+ if (id_)
+ UnregisterHotKey(winId(), id_);
+ }
+
+ /**
+ * Triggers activated() signal when the hotkey is activated.
+ */
+ bool winEvent(MSG* m, long* result)
+ {
+ if (m->message == WM_HOTKEY && m->wParam == id_) {
+ emit trigger_->activated();
+ return true;
+ }
+ return QWidget::winEvent(m, result);
+ }
+
+ bool isValid() { return valid; }
+
+private:
+ KeyTrigger* trigger_;
+ int id_;
+ static int nextId;
+ bool valid;
+
+private:
+ struct Qt_VK_Keymap
+ {
+ int key;
+ UINT vk;
+ };
+ static Qt_VK_Keymap qt_vk_table[];
+
+ static bool convertKeySequence(const QKeySequence& ks, UINT* mod_, UINT* key_)
+ {
+ int code = ks;
+
+ UINT mod = 0;
+ if (code & Qt::META)
+ mod |= MOD_WIN;
+ if (code & Qt::SHIFT)
+ mod |= MOD_SHIFT;
+ if (code & Qt::CTRL)
+ mod |= MOD_CONTROL;
+ if (code & Qt::ALT)
+ mod |= MOD_ALT;
+
+ UINT key = 0;
+ code &= ~Qt::KeyboardModifierMask;
+ if (code >= 0x20 && code <= 0x7f)
+ key = code;
+ else {
+ for (int n = 0; qt_vk_table[n].key != Qt::Key_unknown; ++n) {
+ if (qt_vk_table[n].key == code) {
+ key = qt_vk_table[n].vk;
+ break;
+ }
+ }
+ if (!key)
+ return false;
+ }
+
+ if (mod)
+ *mod_ = mod;
+
+ if (key)
+ *key_ = key;
+
+ return true;
+ }
+};
+
+GlobalShortcutManager::KeyTrigger::Impl::Qt_VK_Keymap
+GlobalShortcutManager::KeyTrigger::Impl::qt_vk_table[] = {
+ { Qt::Key_Escape, VK_ESCAPE },
+ { Qt::Key_Tab, VK_TAB },
+ { Qt::Key_Backtab, 0 },
+ { Qt::Key_Backspace, VK_BACK },
+ { Qt::Key_Return, VK_RETURN },
+ { Qt::Key_Enter, VK_RETURN },
+ { Qt::Key_Insert, VK_INSERT },
+ { Qt::Key_Delete, VK_DELETE },
+ { Qt::Key_Pause, VK_PAUSE },
+ { Qt::Key_Print, VK_SNAPSHOT }, // Was changed from VK_PRINT
+ { Qt::Key_SysReq, 0 },
+ { Qt::Key_Clear, VK_CLEAR },
+ { Qt::Key_Home, VK_HOME },
+ { Qt::Key_End, VK_END },
+ { Qt::Key_Left, VK_LEFT },
+ { Qt::Key_Up, VK_UP },
+ { Qt::Key_Right, VK_RIGHT },
+ { Qt::Key_Down, VK_DOWN },
+ { Qt::Key_PageUp, VK_PRIOR },
+ { Qt::Key_PageDown, VK_NEXT },
+ { Qt::Key_Shift, VK_SHIFT },
+ { Qt::Key_Control, VK_CONTROL },
+ { Qt::Key_Meta, VK_LWIN },
+ { Qt::Key_Alt, VK_MENU },
+ { Qt::Key_CapsLock, VK_CAPITAL },
+ { Qt::Key_NumLock, VK_NUMLOCK },
+ { Qt::Key_ScrollLock, VK_SCROLL },
+ { Qt::Key_F1, VK_F1 },
+ { Qt::Key_F2, VK_F2 },
+ { Qt::Key_F3, VK_F3 },
+ { Qt::Key_F4, VK_F4 },
+ { Qt::Key_F5, VK_F5 },
+ { Qt::Key_F6, VK_F6 },
+ { Qt::Key_F7, VK_F7 },
+ { Qt::Key_F8, VK_F8 },
+ { Qt::Key_F9, VK_F9 },
+ { Qt::Key_F10, VK_F10 },
+ { Qt::Key_F11, VK_F11 },
+ { Qt::Key_F12, VK_F12 },
+ { Qt::Key_F13, VK_F13 },
+ { Qt::Key_F14, VK_F14 },
+ { Qt::Key_F15, VK_F15 },
+ { Qt::Key_F16, VK_F16 },
+ { Qt::Key_F17, VK_F17 },
+ { Qt::Key_F18, VK_F18 },
+ { Qt::Key_F19, VK_F19 },
+ { Qt::Key_F20, VK_F20 },
+ { Qt::Key_F21, VK_F21 },
+ { Qt::Key_F22, VK_F22 },
+ { Qt::Key_F23, VK_F23 },
+ { Qt::Key_F24, VK_F24 },
+ { Qt::Key_F25, 0 },
+ { Qt::Key_F26, 0 },
+ { Qt::Key_F27, 0 },
+ { Qt::Key_F28, 0 },
+ { Qt::Key_F29, 0 },
+ { Qt::Key_F30, 0 },
+ { Qt::Key_F31, 0 },
+ { Qt::Key_F32, 0 },
+ { Qt::Key_F33, 0 },
+ { Qt::Key_F34, 0 },
+ { Qt::Key_F35, 0 },
+ { Qt::Key_Super_L, 0 },
+ { Qt::Key_Super_R, 0 },
+ { Qt::Key_Menu, 0 },
+ { Qt::Key_Hyper_L, 0 },
+ { Qt::Key_Hyper_R, 0 },
+ { Qt::Key_Help, 0 },
+ { Qt::Key_Direction_L, 0 },
+ { Qt::Key_Direction_R, 0 },
+
+ { Qt::Key_unknown, 0 },
+};
+
+int GlobalShortcutManager::KeyTrigger::Impl::nextId = 1;
+
+GlobalShortcutManager::KeyTrigger::KeyTrigger(const QKeySequence& key)
+{
+ d = new Impl(this, key);
+}
+
+bool GlobalShortcutManager::KeyTrigger::isValid() const
+{
+ return d->isValid();
+}
+
+GlobalShortcutManager::KeyTrigger::~KeyTrigger()
+{
+ delete d;
+ d = 0;
+}
diff --git a/tools/globalshortcut/globalshortcutmanager_x11.cpp b/tools/globalshortcut/globalshortcutmanager_x11.cpp
new file mode 100644
index 0000000..caa228d
--- /dev/null
+++ b/tools/globalshortcut/globalshortcutmanager_x11.cpp
@@ -0,0 +1,446 @@
+/*
+ * globalshortcutmanager_x11.cpp - X11 implementation of global shortcuts
+ * Copyright (C) 2003-2007 Justin Karneges, Michail Pishchagin
+ *
+ * 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "globalshortcutmanager.h"
+#include "globalshortcuttrigger.h"
+
+#include <QWidget>
+#include <QX11Info>
+#include <QKeyEvent>
+#include <QCoreApplication>
+
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/keysym.h>
+
+#ifdef KeyPress
+// defined by X11 headers
+const int XKeyPress = KeyPress;
+const int XKeyRelease = KeyRelease;
+#undef KeyPress
+#endif
+
+class X11KeyTrigger
+{
+public:
+ virtual ~X11KeyTrigger() {}
+ virtual void activate() = 0;
+ virtual bool isAccepted(int qkey) const = 0;
+};
+
+class X11KeyTriggerManager : public QObject
+{
+public:
+ static X11KeyTriggerManager* instance()
+ {
+ if(!instance_)
+ instance_ = new X11KeyTriggerManager();
+ return instance_;
+ }
+
+ void addTrigger(X11KeyTrigger* trigger)
+ {
+ triggers_ << trigger;
+ }
+
+ void removeTrigger(X11KeyTrigger* trigger)
+ {
+ triggers_.removeAll(trigger);
+ }
+
+ struct Qt_XK_Keygroup
+ {
+ char num;
+ int sym[3];
+ };
+
+protected:
+ // reimplemented
+ bool eventFilter(QObject* o, QEvent* e)
+ {
+ if(e->type() == QEvent::KeyPress) {
+ QKeyEvent* k = static_cast<QKeyEvent*>(e);
+ int qkey = k->key();
+ if (k->modifiers() & Qt::ShiftModifier)
+ qkey |= Qt::SHIFT;
+ if (k->modifiers() & Qt::ControlModifier)
+ qkey |= Qt::CTRL;
+ if (k->modifiers() & Qt::AltModifier)
+ qkey |= Qt::ALT;
+ if (k->modifiers() & Qt::MetaModifier)
+ qkey |= Qt::META;
+
+ foreach(X11KeyTrigger* trigger, triggers_) {
+ if (trigger->isAccepted(qkey)) {
+ trigger->activate();
+ return true;
+ }
+ }
+ }
+
+ return QObject::eventFilter(o, e);
+ }
+
+private:
+ X11KeyTriggerManager()
+ : QObject(QCoreApplication::instance())
+ {
+ QCoreApplication::instance()->installEventFilter(this);
+ }
+
+ static X11KeyTriggerManager* instance_;
+ QList<X11KeyTrigger*> triggers_;
+
+private:
+ struct Qt_XK_Keymap
+ {
+ int key;
+ Qt_XK_Keygroup xk;
+ };
+
+ static Qt_XK_Keymap qt_xk_table[];
+ static long alt_mask;
+ static long meta_mask;
+ static long super_mask;
+ static long hyper_mask;
+ static long numlock_mask;
+ static bool haveMods;
+
+ // adapted from qapplication_x11.cpp
+ static void ensureModifiers()
+ {
+ if (haveMods)
+ return;
+
+ Display* appDpy = QX11Info::display();
+ XModifierKeymap* map = XGetModifierMapping(appDpy);
+ if (map) {
+ // XKeycodeToKeysym helper code adapeted from xmodmap
+ int min_keycode, max_keycode, keysyms_per_keycode = 1;
+ XDisplayKeycodes (appDpy, &min_keycode, &max_keycode);
+ XFree(XGetKeyboardMapping (appDpy, min_keycode, (max_keycode - min_keycode + 1), &keysyms_per_keycode));
+
+ int i, maskIndex = 0, mapIndex = 0;
+ for (maskIndex = 0; maskIndex < 8; maskIndex++) {
+ for (i = 0; i < map->max_keypermod; i++) {
+ if (map->modifiermap[mapIndex]) {
+ KeySym sym;
+ int symIndex = 0;
+ do {
+ sym = XKeycodeToKeysym(appDpy, map->modifiermap[mapIndex], symIndex);
+ symIndex++;
+ } while ( !sym && symIndex < keysyms_per_keycode);
+ if (alt_mask == 0 && (sym == XK_Alt_L || sym == XK_Alt_R)) {
+ alt_mask = 1 << maskIndex;
+ }
+ if (meta_mask == 0 && (sym == XK_Meta_L || sym == XK_Meta_R)) {
+ meta_mask = 1 << maskIndex;
+ }
+ if (super_mask == 0 && (sym == XK_Super_L || sym == XK_Super_R)) {
+ super_mask = 1 << maskIndex;
+ }
+ if (hyper_mask == 0 && (sym == XK_Hyper_L || sym == XK_Hyper_R)) {
+ hyper_mask = 1 << maskIndex;
+ }
+ if (numlock_mask == 0 && (sym == XK_Num_Lock)) {
+ numlock_mask = 1 << maskIndex;
+ }
+ }
+ mapIndex++;
+ }
+ }
+
+ XFreeModifiermap(map);
+
+ // logic from qt source see gui/kernel/qkeymapper_x11.cpp
+ if (meta_mask == 0 || meta_mask == alt_mask) {
+ // no meta keys... s,meta,super,
+ meta_mask = super_mask;
+ if (meta_mask == 0 || meta_mask == alt_mask) {
+ // no super keys either? guess we'll use hyper then
+ meta_mask = hyper_mask;
+ }
+ }
+ }
+ else {
+ // assume defaults
+ alt_mask = Mod1Mask;
+ meta_mask = Mod4Mask;
+ }
+
+ haveMods = true;
+ }
+
+public:
+ static bool convertKeySequence(const QKeySequence& ks, unsigned int* _mod, Qt_XK_Keygroup* _kg)
+ {
+ int code = ks;
+ ensureModifiers();
+
+ unsigned int mod = 0;
+ if (code & Qt::META)
+ mod |= meta_mask;
+ if (code & Qt::SHIFT)
+ mod |= ShiftMask;
+ if (code & Qt::CTRL)
+ mod |= ControlMask;
+ if (code & Qt::ALT)
+ mod |= alt_mask;
+
+ Qt_XK_Keygroup kg;
+ kg.num = 0;
+ kg.sym[0] = 0;
+ code &= ~Qt::KeyboardModifierMask;
+
+ bool found = false;
+ for (int n = 0; qt_xk_table[n].key != Qt::Key_unknown; ++n) {
+ if (qt_xk_table[n].key == code) {
+ kg = qt_xk_table[n].xk;
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ // try latin1
+ if (code >= 0x20 && code <= 0x7f) {
+ kg.num = 1;
+ kg.sym[0] = code;
+ }
+ }
+
+ if (!kg.num)
+ return false;
+
+ if (_mod)
+ *_mod = mod;
+ if (_kg)
+ *_kg = kg;
+
+ return true;
+ }
+
+ static QList<long> ignModifiersList()
+ {
+ QList<long> ret;
+ if (numlock_mask) {
+ ret << 0 << LockMask << numlock_mask << (LockMask | numlock_mask);
+ }
+ else {
+ ret << 0 << LockMask;
+ }
+ return ret;
+ }
+};
+
+X11KeyTriggerManager* X11KeyTriggerManager::instance_ = NULL;
+
+class GlobalShortcutManager::KeyTrigger::Impl : public X11KeyTrigger
+{
+private:
+ KeyTrigger* trigger_;
+ int qkey_;
+
+ struct GrabbedKey {
+ int code;
+ uint mod;
+ };
+ QList<GrabbedKey> grabbedKeys_;
+
+ static bool failed;
+ static int XGrabErrorHandler(Display *, XErrorEvent *)
+ {
+ qWarning("failed to grab key");
+ failed = true;
+ return 0;
+ }
+
+ void bind(int keysym, unsigned int mod)
+ {
+ int code = XKeysymToKeycode(QX11Info::display(), keysym);
+
+ // don't grab keys with empty code (because it means just the modifier key)
+ if (keysym && !code)
+ return;
+
+ failed = false;
+ XErrorHandler savedErrorHandler = XSetErrorHandler(XGrabErrorHandler);
+ WId w = QX11Info::appRootWindow();
+ foreach(long mask_mod, X11KeyTriggerManager::ignModifiersList()) {
+ XGrabKey(QX11Info::display(), code, mod | mask_mod, w, False, GrabModeAsync, GrabModeAsync);
+ GrabbedKey grabbedKey;
+ grabbedKey.code = code;
+ grabbedKey.mod = mod | mask_mod;
+ grabbedKeys_ << grabbedKey;
+ }
+ XSync(QX11Info::display(), False);
+ XSetErrorHandler(savedErrorHandler);
+ }
+
+public:
+ /**
+ * Constructor registers the hotkey.
+ */
+ Impl(GlobalShortcutManager::KeyTrigger* t, const QKeySequence& ks)
+ : trigger_(t)
+ , qkey_(ks)
+ {
+ X11KeyTriggerManager::instance()->addTrigger(this);
+
+ X11KeyTriggerManager::Qt_XK_Keygroup kg;
+ unsigned int mod;
+ if (X11KeyTriggerManager::convertKeySequence(ks, &mod, &kg))
+ for (int n = 0; n < kg.num; ++n)
+ bind(kg.sym[n], mod);
+ }
+
+ /**
+ * Destructor unregisters the hotkey.
+ */
+ ~Impl()
+ {
+ X11KeyTriggerManager::instance()->removeTrigger(this);
+
+ foreach(GrabbedKey key, grabbedKeys_)
+ XUngrabKey(QX11Info::display(), key.code, key.mod, QX11Info::appRootWindow());
+ }
+
+ void activate()
+ {
+ emit trigger_->activated();
+ }
+
+ bool isAccepted(int qkey) const
+ {
+ return qkey_ == qkey;
+ }
+
+ bool isValid() { return !failed; }
+};
+
+bool GlobalShortcutManager::KeyTrigger::Impl::failed;
+long X11KeyTriggerManager::alt_mask = 0;
+long X11KeyTriggerManager::meta_mask = 0;
+long X11KeyTriggerManager::super_mask = 0;
+long X11KeyTriggerManager::hyper_mask = 0;
+long X11KeyTriggerManager::numlock_mask = 0;
+bool X11KeyTriggerManager::haveMods = false;
+
+X11KeyTriggerManager::Qt_XK_Keymap
+X11KeyTriggerManager::qt_xk_table[] = {
+ { Qt::Key_Escape, {1, { XK_Escape }}},
+ { Qt::Key_Tab, {2, { XK_Tab, XK_KP_Tab }}},
+ { Qt::Key_Backtab, {1, { XK_ISO_Left_Tab }}},
+ { Qt::Key_Backspace, {1, { XK_BackSpace }}},
+ { Qt::Key_Return, {1, { XK_Return }}},
+ { Qt::Key_Enter, {1, { XK_KP_Enter }}},
+ { Qt::Key_Insert, {2, { XK_Insert, XK_KP_Insert }}},
+ { Qt::Key_Delete, {3, { XK_Delete, XK_KP_Delete, XK_Clear }}},
+ { Qt::Key_Pause, {1, { XK_Pause }}},
+ { Qt::Key_Print, {1, { XK_Print }}},
+ { Qt::Key_SysReq, {1, { XK_Sys_Req }}},
+ { Qt::Key_Clear, {1, { XK_KP_Begin }}},
+ { Qt::Key_Home, {2, { XK_Home, XK_KP_Home }}},
+ { Qt::Key_End, {2, { XK_End, XK_KP_End }}},
+ { Qt::Key_Left, {2, { XK_Left, XK_KP_Left }}},
+ { Qt::Key_Up, {2, { XK_Up, XK_KP_Up }}},
+ { Qt::Key_Right, {2, { XK_Right, XK_KP_Right }}},
+ { Qt::Key_Down, {2, { XK_Down, XK_KP_Down }}},
+ { Qt::Key_PageUp, {2, { XK_Prior, XK_KP_Prior }}},
+ { Qt::Key_PageDown, {2, { XK_Next, XK_KP_Next }}},
+ { Qt::Key_Shift, {3, { XK_Shift_L, XK_Shift_R, XK_Shift_Lock }}},
+ { Qt::Key_Control, {2, { XK_Control_L, XK_Control_R }}},
+ { Qt::Key_Meta, {2, { XK_Meta_L, XK_Meta_R }}},
+ { Qt::Key_Alt, {2, { XK_Alt_L, XK_Alt_R }}},
+ { Qt::Key_CapsLock, {1, { XK_Caps_Lock }}},
+ { Qt::Key_NumLock, {1, { XK_Num_Lock }}},
+ { Qt::Key_ScrollLock, {1, { XK_Scroll_Lock }}},
+ { Qt::Key_Space, {2, { XK_space, XK_KP_Space }}},
+ { Qt::Key_Equal, {2, { XK_equal, XK_KP_Equal }}},
+ { Qt::Key_Asterisk, {2, { XK_asterisk, XK_KP_Multiply }}},
+ { Qt::Key_Plus, {2, { XK_plus, XK_KP_Add }}},
+ { Qt::Key_Comma, {2, { XK_comma, XK_KP_Separator }}},
+ { Qt::Key_Minus, {2, { XK_minus, XK_KP_Subtract }}},
+ { Qt::Key_Period, {2, { XK_period, XK_KP_Decimal }}},
+ { Qt::Key_Slash, {2, { XK_slash, XK_KP_Divide }}},
+ { Qt::Key_F1, {1, { XK_F1 }}},
+ { Qt::Key_F2, {1, { XK_F2 }}},
+ { Qt::Key_F3, {1, { XK_F3 }}},
+ { Qt::Key_F4, {1, { XK_F4 }}},
+ { Qt::Key_F5, {1, { XK_F5 }}},
+ { Qt::Key_F6, {1, { XK_F6 }}},
+ { Qt::Key_F7, {1, { XK_F7 }}},
+ { Qt::Key_F8, {1, { XK_F8 }}},
+ { Qt::Key_F9, {1, { XK_F9 }}},
+ { Qt::Key_F10, {1, { XK_F10 }}},
+ { Qt::Key_F11, {1, { XK_F11 }}},
+ { Qt::Key_F12, {1, { XK_F12 }}},
+ { Qt::Key_F13, {1, { XK_F13 }}},
+ { Qt::Key_F14, {1, { XK_F14 }}},
+ { Qt::Key_F15, {1, { XK_F15 }}},
+ { Qt::Key_F16, {1, { XK_F16 }}},
+ { Qt::Key_F17, {1, { XK_F17 }}},
+ { Qt::Key_F18, {1, { XK_F18 }}},
+ { Qt::Key_F19, {1, { XK_F19 }}},
+ { Qt::Key_F20, {1, { XK_F20 }}},
+ { Qt::Key_F21, {1, { XK_F21 }}},
+ { Qt::Key_F22, {1, { XK_F22 }}},
+ { Qt::Key_F23, {1, { XK_F23 }}},
+ { Qt::Key_F24, {1, { XK_F24 }}},
+ { Qt::Key_F25, {1, { XK_F25 }}},
+ { Qt::Key_F26, {1, { XK_F26 }}},
+ { Qt::Key_F27, {1, { XK_F27 }}},
+ { Qt::Key_F28, {1, { XK_F28 }}},
+ { Qt::Key_F29, {1, { XK_F29 }}},
+ { Qt::Key_F30, {1, { XK_F30 }}},
+ { Qt::Key_F31, {1, { XK_F31 }}},
+ { Qt::Key_F32, {1, { XK_F32 }}},
+ { Qt::Key_F33, {1, { XK_F33 }}},
+ { Qt::Key_F34, {1, { XK_F34 }}},
+ { Qt::Key_F35, {1, { XK_F35 }}},
+ { Qt::Key_Super_L, {1, { XK_Super_L }}},
+ { Qt::Key_Super_R, {1, { XK_Super_R }}},
+ { Qt::Key_Menu, {1, { XK_Menu }}},
+ { Qt::Key_Hyper_L, {1, { XK_Hyper_L }}},
+ { Qt::Key_Hyper_R, {1, { XK_Hyper_R }}},
+ { Qt::Key_Help, {1, { XK_Help }}},
+ { Qt::Key_Direction_L, {0, { 0 }}},
+ { Qt::Key_Direction_R, {0, { 0 }}},
+
+ { Qt::Key_unknown, {0, { 0 }}},
+};
+
+GlobalShortcutManager::KeyTrigger::KeyTrigger(const QKeySequence& key)
+{
+ d = new Impl(this, key);
+}
+
+GlobalShortcutManager::KeyTrigger::~KeyTrigger()
+{
+ delete d;
+ d = 0;
+}
+
+
+bool GlobalShortcutManager::KeyTrigger::isValid() const
+{
+ return d->isValid();
+}
+
diff --git a/tools/globalshortcut/globalshortcuttrigger.h b/tools/globalshortcut/globalshortcuttrigger.h
new file mode 100644
index 0000000..81828b0
--- /dev/null
+++ b/tools/globalshortcut/globalshortcuttrigger.h
@@ -0,0 +1,63 @@
+/*
+ * globalshortcuttrigger.h - Helper class activating global shortcut
+ * Copyright (C) 2006 Maciej Niedzielski
+ *
+ * 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef GLOBALSHORTCUTTRIGGER_H
+#define GLOBALSHORTCUTTRIGGER_H
+
+#include "globalshortcutmanager.h"
+#include <QObject>
+
+class GlobalShortcutManager::KeyTrigger : public QObject
+{
+ Q_OBJECT
+public:
+ /**
+ * Is there any slot connected to this hotkey?
+ */
+ bool isUsed() const
+ {
+ return QObject::receivers(SIGNAL(activated())) > 0;
+ }
+
+ bool isValid() const;
+
+signals:
+ void activated();
+
+private:
+ /**
+ * Registers the \a key.
+ */
+ KeyTrigger(const QKeySequence& key);
+ /**
+ * Unregisters the key.
+ */
+ ~KeyTrigger();
+
+ friend class GlobalShortcutManager;
+
+ /**
+ * Platform-specific helper
+ */
+ class Impl;
+ Impl* d;
+};
+
+#endif
diff --git a/tools/os.cpp b/tools/os.cpp
new file mode 100644
index 0000000..1e86e9b
--- /dev/null
+++ b/tools/os.cpp
@@ -0,0 +1,309 @@
+#include <QApplication>
+#include <QBitmap>
+#include <QDesktopWidget>
+#include <QDialog>
+#include <QDir>
+#include <QSettings>
+#include <QLibrary>
+#include <QPixmap>
+#include <QTextEdit>
+#include <QTranslator>
+#include <QTimer>
+#include <QTimeLine>
+#include <QWidget>
+#include <QGraphicsDropShadowEffect>
+#include <string>
+#include <QDesktopServices>
+#include <QPointer>
+#include <QProcess>
+#include <QUrl>
+#include <QDebug>
+
+#include <QMessageBox>
+
+#include "qtwin.h"
+
+#if defined(Q_WS_WIN)
+ #include <qt_windows.h>
+ #include <shlobj.h>
+#endif
+
+#include "os.h"
+
+void os::addToRecentDocuments(QString fileName)
+{
+#ifdef Q_WS_WIN
+ QT_WA ( {
+ SHAddToRecentDocs (0x00000003, QDir::toNativeSeparators(fileName).utf16());
+ } , {
+ SHAddToRecentDocs (0x00000002, QDir::toNativeSeparators(fileName).toLocal8Bit().data());
+ } ); // QT_WA
+#else
+ Q_UNUSED(fileName)
+#endif
+}
+
+bool os::aeroGlass(QWidget* target)
+{
+ if (QtWin::isCompositionEnabled()) {
+ QtWin::extendFrameIntoClientArea(target);
+ return true;
+ }
+
+ return false;
+}
+
+void os::setStartup(bool startup, bool hide)
+{
+ QString lightscreen = QDir::toNativeSeparators(qApp->applicationFilePath());
+
+ if (hide)
+ lightscreen.append(" -h");
+
+#ifdef Q_WS_WIN
+ // Windows startup settings
+ QSettings init("Microsoft", "Windows");
+ init.beginGroup("CurrentVersion");
+ init.beginGroup("Run");
+
+ if (startup) {
+ init.setValue("Lightscreen", lightscreen);
+ }
+ else {
+ init.remove("Lightscreen");
+ }
+
+ init.endGroup();
+ init.endGroup();
+#endif
+
+#if defined(Q_WS_X11)
+ QFile desktopFile(QDir::homePath() + "/.config/autostart/lightscreen.desktop");
+
+ desktopFile.remove();
+
+ if (startup) {
+ desktopFile.open(QIODevice::WriteOnly);
+ desktopFile.write(QString("[Desktop Entry]\nExec=%1\nType=Application").arg(lightscreen).toAscii());
+ }
+#endif
+}
+
+QString os::getDocumentsPath()
+{
+#ifdef Q_WS_WIN
+ TCHAR szPath[MAX_PATH];
+
+ if (SUCCEEDED(SHGetFolderPath(NULL,
+ CSIDL_PERSONAL|CSIDL_FLAG_CREATE,
+ NULL,
+ 0,
+ szPath)))
+ {
+ std::wstring path(szPath);
+
+ return QString::fromWCharArray(path.c_str());
+ }
+
+ return QDir::homePath() + QDir::separator() + "My Documents";
+#else
+ return QDir::homePath() + QDir::separator() + "Documents";
+#endif
+}
+
+QPixmap os::grabWindow(WId winId)
+{
+#ifdef Q_WS_WIN
+ RECT rcWindow;
+ GetWindowRect(winId, &rcWindow);
+
+ if (IsZoomed(winId)) {
+ if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA) {
+ // TODO: WTF!
+ rcWindow.right -= 8;
+ rcWindow.left += 8;
+ rcWindow.top += 8;
+ rcWindow.bottom -= 8;
+ }
+ else {
+ rcWindow.right += 4;
+ rcWindow.left -= 4;
+ rcWindow.top += 4;
+ rcWindow.bottom -= 4;
+ }
+ }
+
+ int width, height;
+ width = rcWindow.right - rcWindow.left;
+ height = rcWindow.bottom - rcWindow.top;
+
+ RECT rcScreen;
+ GetWindowRect(GetDesktopWindow(), &rcScreen);
+
+ RECT rcResult;
+ UnionRect(&rcResult, &rcWindow, &rcScreen);
+
+ QPixmap pixmap;
+
+ // Comparing the rects to determine if the window is outside the boundaries of the screen,
+ // the window DC method has the disadvantage that it does not show Aero glass transparency,
+ // so we'll avoid it for the screenshots that don't need it.
+
+ if (EqualRect(&rcScreen, &rcResult)) {
+ // Grabbing the window from the Screen DC.
+ HDC hdcScreen = GetDC(NULL);
+
+ BringWindowToTop(winId);
+
+ HDC hdcMem = CreateCompatibleDC(hdcScreen);
+ HBITMAP hbmCapture = CreateCompatibleBitmap(hdcScreen, width, height);
+ SelectObject(hdcMem, hbmCapture);
+
+ BitBlt(hdcMem, 0, 0, width, height, hdcScreen, rcWindow.left, rcWindow.top, SRCCOPY);
+
+ ReleaseDC(winId, hdcMem);
+ DeleteDC(hdcMem);
+
+ pixmap = QPixmap::fromWinHBITMAP(hbmCapture);
+
+ DeleteObject(hbmCapture);
+ }
+ else {
+ // Grabbing the window by its own DC
+ HDC hdcWindow = GetWindowDC(winId);
+
+ HDC hdcMem = CreateCompatibleDC(hdcWindow);
+ HBITMAP hbmCapture = CreateCompatibleBitmap(hdcWindow, width, height);
+ SelectObject(hdcMem, hbmCapture);
+
+ BitBlt(hdcMem, 0, 0, width, height, hdcWindow, 0, 0, SRCCOPY);
+
+ ReleaseDC(winId, hdcMem);
+ DeleteDC(hdcMem);
+
+ pixmap = QPixmap::fromWinHBITMAP(hbmCapture);
+
+ DeleteObject(hbmCapture);
+ }
+
+ return pixmap;
+#else
+ return QPixmap::grabWindow(winId);
+#endif
+}
+
+void os::setForegroundWindow(QWidget *window)
+{
+#ifdef Q_WS_WIN
+ ShowWindow(window->winId(), SW_RESTORE);
+ SetForegroundWindow(window->winId());
+#else
+ Q_UNUSED(window)
+#endif
+}
+
+QPixmap os::cursor()
+{
+#ifdef Q_WS_WIN
+ /*
+ * Taken from: git://github.com/arrai/mumble-record.git › src › mumble › Overlay.cpp
+ * BSD License.
+ */
+ QPixmap pm;
+
+ CURSORINFO cursorInfo;
+ cursorInfo.cbSize = sizeof(cursorInfo);
+ ::GetCursorInfo(&cursorInfo);
+
+ HICON c = cursorInfo.hCursor;
+
+ ICONINFO info;
+ ZeroMemory(&info, sizeof(info));
+ if (::GetIconInfo(c, &info)) {
+ if (info.hbmColor) {
+ pm = QPixmap::fromWinHBITMAP(info.hbmColor);
+ pm.setMask(QBitmap(QPixmap::fromWinHBITMAP(info.hbmMask)));
+ }
+ else {
+ QBitmap orig(QPixmap::fromWinHBITMAP(info.hbmMask));
+ QImage img = orig.toImage();
+
+ int h = img.height() / 2;
+ int w = img.bytesPerLine() / sizeof(quint32);
+
+ QImage out(img.width(), h, QImage::Format_MonoLSB);
+ QImage outmask(img.width(), h, QImage::Format_MonoLSB);
+
+ for (int i=0;i<h; ++i) {
+ const quint32 *srcimg = reinterpret_cast<const quint32 *>(img.scanLine(i + h));
+ const quint32 *srcmask = reinterpret_cast<const quint32 *>(img.scanLine(i));
+
+ quint32 *dstimg = reinterpret_cast<quint32 *>(out.scanLine(i));
+ quint32 *dstmask = reinterpret_cast<quint32 *>(outmask.scanLine(i));
+
+ for (int j=0;j<w;++j) {
+ dstmask[j] = srcmask[j];
+ dstimg[j] = srcimg[j];
+ }
+ }
+ pm = QBitmap::fromImage(out);
+ }
+
+ if (info.hbmMask)
+ ::DeleteObject(info.hbmMask);
+
+ if (info.hbmColor)
+ ::DeleteObject(info.hbmColor);
+ }
+
+ return pm;
+#else
+ return QPixmap();
+#endif
+}
+
+void os::translate(QString language)
+{
+ static QTranslator *translator = 0;
+
+ if ((language.compare("English", Qt::CaseInsensitive) == 0
+ || language.isEmpty()) && translator) {
+ qApp->removeTranslator(translator);
+ return;
+ }
+
+ if (translator)
+ delete translator;
+
+ translator = new QTranslator(qApp);
+
+ if (translator->load(language, ":/translations"))
+ qApp->installTranslator(translator);
+}
+
+void os::effect(QObject* target, const char *slot, int frames, int duration, const char* cleanup)
+{
+ QTimeLine* timeLine = new QTimeLine(duration);
+ timeLine->setFrameRange(0, frames);
+
+ timeLine->connect(timeLine, SIGNAL(frameChanged(int)), target, slot);
+
+ if (cleanup != 0)
+ timeLine->connect(timeLine, SIGNAL(finished()), target, SLOT(cleanup()));
+
+ timeLine->connect(timeLine, SIGNAL(finished()), timeLine, SLOT(deleteLater()));
+
+
+ timeLine->start();
+}
+
+QGraphicsEffect* os::shadow(QColor color, int blurRadius, int offset) {
+ QGraphicsDropShadowEffect* shadowEffect = new QGraphicsDropShadowEffect;
+ shadowEffect->setBlurRadius(blurRadius);
+ shadowEffect->setOffset(offset);
+ shadowEffect->setColor(color);
+
+ return shadowEffect;
+}
+
+
diff --git a/tools/os.h b/tools/os.h
new file mode 100644
index 0000000..c9f917c
--- /dev/null
+++ b/tools/os.h
@@ -0,0 +1,38 @@
+
+#ifndef OS_H_
+#define OS_H_
+
+#include <QWidget>
+
+struct QPixmap;
+struct QPoint;
+struct QString;
+struct QUrl;
+class QGraphicsEffect;
+
+namespace os
+{
+ // Gives the target widget a full aero glass background
+ bool aeroGlass(QWidget *target);
+ // Adds the filename to the Windows recent document list (useful for Windows 7 jump lists)
+ void addToRecentDocuments(QString fileName);
+ // Returns the cursor pixmap in Windows
+ QPixmap cursor();
+ // Adds lightscreen to the startup list in Windows & Linux (KDE, Gnome and Xfce for now).
+ void setStartup(bool startup, bool hide);
+ // Set the target window as the foreground window (Windows only)
+ void setForegroundWindow(QWidget *window);
+ // Returns the current users's Documents/My Documents folder
+ QString getDocumentsPath();
+ // Returns the pixmap of the given window id.
+ QPixmap grabWindow(WId winId);
+ // Translates the ui to the given language name.
+ void translate(QString language);
+ // A QTimeLine based effect for a slot (TODO: look at the new effect classes)
+ void effect(QObject* target, const char* slot, int frames, int duration = 400, const char* cleanup = 0);
+ // Creates a new QGraphicsDropShadowEffect to apply to widgets.
+ QGraphicsEffect* shadow(QColor color = Qt::black, int blurRadius = 6, int offset = 1);
+}
+
+
+#endif /*OS_H_*/ // Drop shadow around the preview, mind the margin.
diff --git a/tools/qtsingleapplication/QtLockedFile b/tools/qtsingleapplication/QtLockedFile
new file mode 100644
index 0000000..16b48ba
--- /dev/null
+++ b/tools/qtsingleapplication/QtLockedFile
@@ -0,0 +1 @@
+#include "qtlockedfile.h"
diff --git a/tools/qtsingleapplication/QtSingleApplication b/tools/qtsingleapplication/QtSingleApplication
new file mode 100644
index 0000000..d111bf7
--- /dev/null
+++ b/tools/qtsingleapplication/QtSingleApplication
@@ -0,0 +1 @@
+#include "qtsingleapplication.h"
diff --git a/tools/qtsingleapplication/qtlocalpeer.cpp b/tools/qtsingleapplication/qtlocalpeer.cpp
new file mode 100644
index 0000000..382d182
--- /dev/null
+++ b/tools/qtsingleapplication/qtlocalpeer.cpp
@@ -0,0 +1,199 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of a Qt Solutions component.
+**
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR 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."
+**
+****************************************************************************/
+
+
+#include "qtlocalpeer.h"
+#include <QtCore/QCoreApplication>
+#include <QtCore/QTime>
+
+#if defined(Q_OS_WIN)
+#include <QtCore/QLibrary>
+#include <QtCore/qt_windows.h>
+typedef BOOL(WINAPI*PProcessIdToSessionId)(DWORD,DWORD*);
+static PProcessIdToSessionId pProcessIdToSessionId = 0;
+#endif
+#if defined(Q_OS_UNIX)
+#include <time.h>
+#endif
+
+namespace QtLP_Private {
+#include "qtlockedfile.cpp"
+#if defined(Q_OS_WIN)
+#include "qtlockedfile_win.cpp"
+#else
+#include "qtlockedfile_unix.cpp"
+#endif
+}
+
+const char* QtLocalPeer::ack = "ack";
+
+QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
+ : QObject(parent), id(appId)
+{
+ QString prefix = id;
+ if (id.isEmpty()) {
+ id = QCoreApplication::applicationFilePath();
+#if defined(Q_OS_WIN)
+ id = id.toLower();
+#endif
+ prefix = id.section(QLatin1Char('/'), -1);
+ }
+ prefix.remove(QRegExp("[^a-zA-Z]"));
+ prefix.truncate(6);
+
+ QByteArray idc = id.toUtf8();
+ quint16 idNum = qChecksum(idc.constData(), idc.size());
+ socketName = QLatin1String("qtsingleapp-") + prefix
+ + QLatin1Char('-') + QString::number(idNum, 16);
+
+#if defined(Q_OS_WIN)
+ if (!pProcessIdToSessionId) {
+ QLibrary lib("kernel32");
+ pProcessIdToSessionId = (PProcessIdToSessionId)lib.resolve("ProcessIdToSessionId");
+ }
+ if (pProcessIdToSessionId) {
+ DWORD sessionId = 0;
+ pProcessIdToSessionId(GetCurrentProcessId(), &sessionId);
+ socketName += QLatin1Char('-') + QString::number(sessionId, 16);
+ }
+#else
+ socketName += QLatin1Char('-') + QString::number(::getuid(), 16);
+#endif
+
+ server = new QLocalServer(this);
+ QString lockName = QDir(QDir::tempPath()).absolutePath()
+ + QLatin1Char('/') + socketName
+ + QLatin1String("-lockfile");
+ lockFile.setFileName(lockName);
+ lockFile.open(QIODevice::ReadWrite);
+}
+
+
+
+bool QtLocalPeer::isClient()
+{
+ if (lockFile.isLocked())
+ return false;
+
+ if (!lockFile.lock(QtLP_Private::QtLockedFile::WriteLock, false))
+ return true;
+
+ bool res = server->listen(socketName);
+#if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(4,5,0))
+ // ### Workaround
+ if (!res && server->serverError() == QAbstractSocket::AddressInUseError) {
+ QFile::remove(QDir::cleanPath(QDir::tempPath())+QLatin1Char('/')+socketName);
+ res = server->listen(socketName);
+ }
+#endif
+ if (!res)
+ qWarning("QtSingleCoreApplication: listen on local socket failed, %s", qPrintable(server->errorString()));
+ QObject::connect(server, SIGNAL(newConnection()), SLOT(receiveConnection()));
+ return false;
+}
+
+
+bool QtLocalPeer::sendMessage(const QString &message, int timeout)
+{
+ if (!isClient())
+ return false;
+
+ QLocalSocket socket;
+ bool connOk = false;
+ for(int i = 0; i < 2; i++) {
+ // Try twice, in case the other instance is just starting up
+ socket.connectToServer(socketName);
+ connOk = socket.waitForConnected(timeout/2);
+ if (connOk || i)
+ break;
+ int ms = 250;
+#if defined(Q_OS_WIN)
+ Sleep(DWORD(ms));
+#else
+ struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
+ nanosleep(&ts, NULL);
+#endif
+ }
+ if (!connOk)
+ return false;
+
+ QByteArray uMsg(message.toUtf8());
+ QDataStream ds(&socket);
+ ds.writeBytes(uMsg.constData(), uMsg.size());
+ bool res = socket.waitForBytesWritten(timeout);
+ if (res) {
+ res &= socket.waitForReadyRead(timeout); // wait for ack
+ if (res)
+ res &= (socket.read(qstrlen(ack)) == ack);
+ }
+ return res;
+}
+
+
+void QtLocalPeer::receiveConnection()
+{
+ QLocalSocket* socket = server->nextPendingConnection();
+ if (!socket)
+ return;
+
+ while (socket->bytesAvailable() < (int)sizeof(quint32))
+ socket->waitForReadyRead();
+ QDataStream ds(socket);
+ QByteArray uMsg;
+ quint32 remaining;
+ ds >> remaining;
+ uMsg.resize(remaining);
+ int got = 0;
+ char* uMsgBuf = uMsg.data();
+ do {
+ got = ds.readRawData(uMsgBuf, remaining);
+ remaining -= got;
+ uMsgBuf += got;
+ } while (remaining && got >= 0 && socket->waitForReadyRead(2000));
+ if (got < 0) {
+ qWarning("QtLocalPeer: Message reception failed %s", socket->errorString().toLatin1().constData());
+ delete socket;
+ return;
+ }
+ QString message(QString::fromUtf8(uMsg));
+ socket->write(ack, qstrlen(ack));
+ socket->waitForBytesWritten(1000);
+ delete socket;
+ emit messageReceived(message); //### (might take a long time to return)
+}
diff --git a/tools/qtsingleapplication/qtlocalpeer.h b/tools/qtsingleapplication/qtlocalpeer.h
new file mode 100644
index 0000000..869af2a
--- /dev/null
+++ b/tools/qtsingleapplication/qtlocalpeer.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of a Qt Solutions component.
+**
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR 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."
+**
+****************************************************************************/
+
+
+#include <QtNetwork/QLocalServer>
+#include <QtNetwork/QLocalSocket>
+#include <QtCore/QDir>
+
+#include "qtlockedfile.h"
+
+class QtLocalPeer : public QObject
+{
+ Q_OBJECT
+
+public:
+ QtLocalPeer(QObject *parent = 0, const QString &appId = QString());
+ bool isClient();
+ bool sendMessage(const QString &message, int timeout);
+ QString applicationId() const
+ { return id; }
+
+Q_SIGNALS:
+ void messageReceived(const QString &message);
+
+protected Q_SLOTS:
+ void receiveConnection();
+
+protected:
+ QString id;
+ QString socketName;
+ QLocalServer* server;
+ QtLP_Private::QtLockedFile lockFile;
+
+private:
+ static const char* ack;
+};
diff --git a/tools/qtsingleapplication/qtlockedfile.cpp b/tools/qtsingleapplication/qtlockedfile.cpp
new file mode 100644
index 0000000..3e73ba6
--- /dev/null
+++ b/tools/qtsingleapplication/qtlockedfile.cpp
@@ -0,0 +1,192 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of a Qt Solutions component.
+**
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR 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."
+**
+****************************************************************************/
+
+#include "qtlockedfile.h"
+
+/*!
+ \class QtLockedFile
+
+ \brief The QtLockedFile class extends QFile with advisory locking
+ functions.
+
+ A file may be locked in read or write mode. Multiple instances of
+ \e QtLockedFile, created in multiple processes running on the same
+ machine, may have a file locked in read mode. Exactly one instance
+ may have it locked in write mode. A read and a write lock cannot
+ exist simultaneously on the same file.
+
+ The file locks are advisory. This means that nothing prevents
+ another process from manipulating a locked file using QFile or
+ file system functions offered by the OS. Serialization is only
+ guaranteed if all processes that access the file use
+ QLockedFile. Also, while holding a lock on a file, a process
+ must not open the same file again (through any API), or locks
+ can be unexpectedly lost.
+
+ The lock provided by an instance of \e QtLockedFile is released
+ whenever the program terminates. This is true even when the
+ program crashes and no destructors are called.
+*/
+
+/*! \enum QtLockedFile::LockMode
+
+ This enum describes the available lock modes.
+
+ \value ReadLock A read lock.
+ \value WriteLock A write lock.
+ \value NoLock Neither a read lock nor a write lock.
+*/
+
+/*!
+ Constructs an unlocked \e QtLockedFile object. This constructor
+ behaves in the same way as \e QFile::QFile().
+
+ \sa QFile::QFile()
+*/
+QtLockedFile::QtLockedFile()
+ : QFile()
+{
+#ifdef Q_OS_WIN
+ wmutex = 0;
+ rmutex = 0;
+#endif
+ m_lock_mode = NoLock;
+}
+
+/*!
+ Constructs an unlocked QtLockedFile object with file \a name. This
+ constructor behaves in the same way as \e QFile::QFile(const
+ QString&).
+
+ \sa QFile::QFile()
+*/
+QtLockedFile::QtLockedFile(const QString &name)
+ : QFile(name)
+{
+#ifdef Q_OS_WIN
+ wmutex = 0;
+ rmutex = 0;
+#endif
+ m_lock_mode = NoLock;
+}
+
+/*!
+ Opens the file in OpenMode \a mode.
+
+ This is identical to QFile::open(), with the one exception that the
+ Truncate mode flag is disallowed. Truncation would conflict with the
+ advisory file locking, since the file would be modified before the
+ write lock is obtained. If truncation is required, use resize(0)
+ after obtaining the write lock.
+
+ Returns true if successful; otherwise false.
+
+ \sa QFile::open(), QFile::resize()
+*/
+bool QtLockedFile::open(OpenMode mode)
+{
+ if (mode & QIODevice::Truncate) {
+ qWarning("QtLockedFile::open(): Truncate mode not allowed.");
+ return false;
+ }
+ return QFile::open(mode);
+}
+
+/*!
+ Returns \e true if this object has a in read or write lock;
+ otherwise returns \e false.
+
+ \sa lockMode()
+*/
+bool QtLockedFile::isLocked() const
+{
+ return m_lock_mode != NoLock;
+}
+
+/*!
+ Returns the type of lock currently held by this object, or \e
+ QtLockedFile::NoLock.
+
+ \sa isLocked()
+*/
+QtLockedFile::LockMode QtLockedFile::lockMode() const
+{
+ return m_lock_mode;
+}
+
+/*!
+ \fn bool QtLockedFile::lock(LockMode mode, bool block = true)
+
+ Obtains a lock of type \a mode. The file must be opened before it
+ can be locked.
+
+ If \a block is true, this function will block until the lock is
+ aquired. If \a block is false, this function returns \e false
+ immediately if the lock cannot be aquired.
+
+ If this object already has a lock of type \a mode, this function
+ returns \e true immediately. If this object has a lock of a
+ different type than \a mode, the lock is first released and then a
+ new lock is obtained.
+
+ This function returns \e true if, after it executes, the file is
+ locked by this object, and \e false otherwise.
+
+ \sa unlock(), isLocked(), lockMode()
+*/
+
+/*!
+ \fn bool QtLockedFile::unlock()
+
+ Releases a lock.
+
+ If the object has no lock, this function returns immediately.
+
+ This function returns \e true if, after it executes, the file is
+ not locked by this object, and \e false otherwise.
+
+ \sa lock(), isLocked(), lockMode()
+*/
+
+/*!
+ \fn QtLockedFile::~QtLockedFile()
+
+ Destroys the \e QtLockedFile object. If any locks were held, they
+ are released.
+*/
diff --git a/tools/qtsingleapplication/qtlockedfile.h b/tools/qtsingleapplication/qtlockedfile.h
new file mode 100644
index 0000000..07a42bf
--- /dev/null
+++ b/tools/qtsingleapplication/qtlockedfile.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of a Qt Solutions component.
+**
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR 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."
+**
+****************************************************************************/
+
+#ifndef QTLOCKEDFILE_H
+#define QTLOCKEDFILE_H
+
+#include <QtCore/QFile>
+#ifdef Q_OS_WIN
+#include <QtCore/QVector>
+#endif
+
+#if defined(Q_WS_WIN)
+# if !defined(QT_QTLOCKEDFILE_EXPORT) && !defined(QT_QTLOCKEDFILE_IMPORT)
+# define QT_QTLOCKEDFILE_EXPORT
+# elif defined(QT_QTLOCKEDFILE_IMPORT)
+# if defined(QT_QTLOCKEDFILE_EXPORT)
+# undef QT_QTLOCKEDFILE_EXPORT
+# endif
+# define QT_QTLOCKEDFILE_EXPORT __declspec(dllimport)
+# elif defined(QT_QTLOCKEDFILE_EXPORT)
+# undef QT_QTLOCKEDFILE_EXPORT
+# define QT_QTLOCKEDFILE_EXPORT __declspec(dllexport)
+# endif
+#else
+# define QT_QTLOCKEDFILE_EXPORT
+#endif
+
+namespace QtLP_Private {
+
+class QT_QTLOCKEDFILE_EXPORT QtLockedFile : public QFile
+{
+public:
+ enum LockMode { NoLock = 0, ReadLock, WriteLock };
+
+ QtLockedFile();
+ QtLockedFile(const QString &name);
+ ~QtLockedFile();
+
+ bool open(OpenMode mode);
+
+ bool lock(LockMode mode, bool block = true);
+ bool unlock();
+ bool isLocked() const;
+ LockMode lockMode() const;
+
+private:
+#ifdef Q_OS_WIN
+ Qt::HANDLE wmutex;
+ Qt::HANDLE rmutex;
+ QVector<Qt::HANDLE> rmutexes;
+ QString mutexname;
+
+ Qt::HANDLE getMutexHandle(int idx, bool doCreate);
+ bool waitMutex(Qt::HANDLE mutex, bool doBlock);
+
+#endif
+ LockMode m_lock_mode;
+};
+}
+#endif
diff --git a/tools/qtsingleapplication/qtlockedfile_unix.cpp b/tools/qtsingleapplication/qtlockedfile_unix.cpp
new file mode 100644
index 0000000..715c7d9
--- /dev/null
+++ b/tools/qtsingleapplication/qtlockedfile_unix.cpp
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of a Qt Solutions component.
+**
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR 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."
+**
+****************************************************************************/
+
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include "qtlockedfile.h"
+
+bool QtLockedFile::lock(LockMode mode, bool block)
+{
+ if (!isOpen()) {
+ qWarning("QtLockedFile::lock(): file is not opened");
+ return false;
+ }
+
+ if (mode == NoLock)
+ return unlock();
+
+ if (mode == m_lock_mode)
+ return true;
+
+ if (m_lock_mode != NoLock)
+ unlock();
+
+ struct flock fl;
+ fl.l_whence = SEEK_SET;
+ fl.l_start = 0;
+ fl.l_len = 0;
+ fl.l_type = (mode == ReadLock) ? F_RDLCK : F_WRLCK;
+ int cmd = block ? F_SETLKW : F_SETLK;
+ int ret = fcntl(handle(), cmd, &fl);
+
+ if (ret == -1) {
+ if (errno != EINTR && errno != EAGAIN)
+ qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno));
+ return false;
+ }
+
+
+ m_lock_mode = mode;
+ return true;
+}
+
+
+bool QtLockedFile::unlock()
+{
+ if (!isOpen()) {
+ qWarning("QtLockedFile::unlock(): file is not opened");
+ return false;
+ }
+
+ if (!isLocked())
+ return true;
+
+ struct flock fl;
+ fl.l_whence = SEEK_SET;
+ fl.l_start = 0;
+ fl.l_len = 0;
+ fl.l_type = F_UNLCK;
+ int ret = fcntl(handle(), F_SETLKW, &fl);
+
+ if (ret == -1) {
+ qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno));
+ return false;
+ }
+
+ m_lock_mode = NoLock;
+ return true;
+}
+
+QtLockedFile::~QtLockedFile()
+{
+ if (isOpen())
+ unlock();
+}
+
diff --git a/tools/qtsingleapplication/qtlockedfile_win.cpp b/tools/qtsingleapplication/qtlockedfile_win.cpp
new file mode 100644
index 0000000..4cd2003
--- /dev/null
+++ b/tools/qtsingleapplication/qtlockedfile_win.cpp
@@ -0,0 +1,206 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of a Qt Solutions component.
+**
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR 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."
+**
+****************************************************************************/
+
+#include "qtlockedfile.h"
+#include <qt_windows.h>
+#include <QtCore/QFileInfo>
+
+#define MUTEX_PREFIX "QtLockedFile mutex "
+// Maximum number of concurrent read locks. Must not be greater than MAXIMUM_WAIT_OBJECTS
+#define MAX_READERS MAXIMUM_WAIT_OBJECTS
+
+Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate)
+{
+ if (mutexname.isEmpty()) {
+ QFileInfo fi(*this);
+ mutexname = QString::fromLatin1(MUTEX_PREFIX)
+ + fi.absoluteFilePath().toLower();
+ }
+ QString mname(mutexname);
+ if (idx >= 0)
+ mname += QString::number(idx);
+
+ Qt::HANDLE mutex;
+ if (doCreate) {
+ QT_WA( { mutex = CreateMutexW(NULL, FALSE, (TCHAR*)mname.utf16()); },
+ { mutex = CreateMutexA(NULL, FALSE, mname.toLocal8Bit().constData()); } );
+ if (!mutex) {
+ qErrnoWarning("QtLockedFile::lock(): CreateMutex failed");
+ return 0;
+ }
+ }
+ else {
+ QT_WA( { mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, (TCHAR*)mname.utf16()); },
+ { mutex = OpenMutexA(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, mname.toLocal8Bit().constData()); } );
+ if (!mutex) {
+ if (GetLastError() != ERROR_FILE_NOT_FOUND)
+ qErrnoWarning("QtLockedFile::lock(): OpenMutex failed");
+ return 0;
+ }
+ }
+ return mutex;
+}
+
+bool QtLockedFile::waitMutex(Qt::HANDLE mutex, bool doBlock)
+{
+ Q_ASSERT(mutex);
+ DWORD res = WaitForSingleObject(mutex, doBlock ? INFINITE : 0);
+ switch (res) {
+ case WAIT_OBJECT_0:
+ case WAIT_ABANDONED:
+ return true;
+ break;
+ case WAIT_TIMEOUT:
+ break;
+ default:
+ qErrnoWarning("QtLockedFile::lock(): WaitForSingleObject failed");
+ }
+ return false;
+}
+
+
+
+bool QtLockedFile::lock(LockMode mode, bool block)
+{
+ if (!isOpen()) {
+ qWarning("QtLockedFile::lock(): file is not opened");
+ return false;
+ }
+
+ if (mode == NoLock)
+ return unlock();
+
+ if (mode == m_lock_mode)
+ return true;
+
+ if (m_lock_mode != NoLock)
+ unlock();
+
+ if (!wmutex && !(wmutex = getMutexHandle(-1, true)))
+ return false;
+
+ if (!waitMutex(wmutex, block))
+ return false;
+
+ if (mode == ReadLock) {
+ int idx = 0;
+ for (; idx < MAX_READERS; idx++) {
+ rmutex = getMutexHandle(idx, false);
+ if (!rmutex || waitMutex(rmutex, false))
+ break;
+ CloseHandle(rmutex);
+ }
+ bool ok = true;
+ if (idx >= MAX_READERS) {
+ qWarning("QtLockedFile::lock(): too many readers");
+ rmutex = 0;
+ ok = false;
+ }
+ else if (!rmutex) {
+ rmutex = getMutexHandle(idx, true);
+ if (!rmutex || !waitMutex(rmutex, false))
+ ok = false;
+ }
+ if (!ok && rmutex) {
+ CloseHandle(rmutex);
+ rmutex = 0;
+ }
+ ReleaseMutex(wmutex);
+ if (!ok)
+ return false;
+ }
+ else {
+ Q_ASSERT(rmutexes.isEmpty());
+ for (int i = 0; i < MAX_READERS; i++) {
+ Qt::HANDLE mutex = getMutexHandle(i, false);
+ if (mutex)
+ rmutexes.append(mutex);
+ }
+ if (rmutexes.size()) {
+ DWORD res = WaitForMultipleObjects(rmutexes.size(), rmutexes.constData(),
+ TRUE, block ? INFINITE : 0);
+ if (res != WAIT_OBJECT_0 && res != WAIT_ABANDONED) {
+ if (res != WAIT_TIMEOUT)
+ qErrnoWarning("QtLockedFile::lock(): WaitForMultipleObjects failed");
+ m_lock_mode = WriteLock; // trick unlock() to clean up - semiyucky
+ unlock();
+ return false;
+ }
+ }
+ }
+
+ m_lock_mode = mode;
+ return true;
+}
+
+bool QtLockedFile::unlock()
+{
+ if (!isOpen()) {
+ qWarning("QtLockedFile::unlock(): file is not opened");
+ return false;
+ }
+
+ if (!isLocked())
+ return true;
+
+ if (m_lock_mode == ReadLock) {
+ ReleaseMutex(rmutex);
+ CloseHandle(rmutex);
+ rmutex = 0;
+ }
+ else {
+ foreach(Qt::HANDLE mutex, rmutexes) {
+ ReleaseMutex(mutex);
+ CloseHandle(mutex);
+ }
+ rmutexes.clear();
+ ReleaseMutex(wmutex);
+ }
+
+ m_lock_mode = QtLockedFile::NoLock;
+ return true;
+}
+
+QtLockedFile::~QtLockedFile()
+{
+ if (isOpen())
+ unlock();
+ if (wmutex)
+ CloseHandle(wmutex);
+}
diff --git a/tools/qtsingleapplication/qtsingleapplication.cpp b/tools/qtsingleapplication/qtsingleapplication.cpp
new file mode 100644
index 0000000..5a8f1b0
--- /dev/null
+++ b/tools/qtsingleapplication/qtsingleapplication.cpp
@@ -0,0 +1,344 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of a Qt Solutions component.
+**
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR 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."
+**
+****************************************************************************/
+
+
+#include "qtsingleapplication.h"
+#include "qtlocalpeer.h"
+#include <QtGui/QWidget>
+
+
+/*!
+ \class QtSingleApplication qtsingleapplication.h
+ \brief The QtSingleApplication class provides an API to detect and
+ communicate with running instances of an application.
+
+ This class allows you to create applications where only one
+ instance should be running at a time. I.e., if the user tries to
+ launch another instance, the already running instance will be
+ activated instead. Another usecase is a client-server system,
+ where the first started instance will assume the role of server,
+ and the later instances will act as clients of that server.
+
+ By default, the full path of the executable file is used to
+ determine whether two processes are instances of the same
+ application. You can also provide an explicit identifier string
+ that will be compared instead.
+
+ The application should create the QtSingleApplication object early
+ in the startup phase, and call isRunning() to find out if another
+ instance of this application is already running. If isRunning()
+ returns false, it means that no other instance is running, and
+ this instance has assumed the role as the running instance. In
+ this case, the application should continue with the initialization
+ of the application user interface before entering the event loop
+ with exec(), as normal.
+
+ The messageReceived() signal will be emitted when the running
+ application receives messages from another instance of the same
+ application. When a message is received it might be helpful to the
+ user to raise the application so that it becomes visible. To
+ facilitate this, QtSingleApplication provides the
+ setActivationWindow() function and the activateWindow() slot.
+
+ If isRunning() returns true, another instance is already
+ running. It may be alerted to the fact that another instance has
+ started by using the sendMessage() function. Also data such as
+ startup parameters (e.g. the name of the file the user wanted this
+ new instance to open) can be passed to the running instance with
+ this function. Then, the application should terminate (or enter
+ client mode).
+
+ If isRunning() returns true, but sendMessage() fails, that is an
+ indication that the running instance is frozen.
+
+ Here's an example that shows how to convert an existing
+ application to use QtSingleApplication. It is very simple and does
+ not make use of all QtSingleApplication's functionality (see the
+ examples for that).
+
+ \code
+ // Original
+ int main(int argc, char **argv)
+ {
+ QApplication app(argc, argv);
+
+ MyMainWidget mmw;
+ mmw.show();
+ return app.exec();
+ }
+
+ // Single instance
+ int main(int argc, char **argv)
+ {
+ QtSingleApplication app(argc, argv);
+
+ if (app.isRunning())
+ return !app.sendMessage(someDataString);
+
+ MyMainWidget mmw;
+ app.setActivationWindow(&mmw);
+ mmw.show();
+ return app.exec();
+ }
+ \endcode
+
+ Once this QtSingleApplication instance is destroyed (normally when
+ the process exits or crashes), when the user next attempts to run the
+ application this instance will not, of course, be encountered. The
+ next instance to call isRunning() or sendMessage() will assume the
+ role as the new running instance.
+
+ For console (non-GUI) applications, QtSingleCoreApplication may be
+ used instead of this class, to avoid the dependency on the QtGui
+ library.
+
+ \sa QtSingleCoreApplication
+*/
+
+
+void QtSingleApplication::sysInit(const QString &appId)
+{
+ actWin = 0;
+ peer = new QtLocalPeer(this, appId);
+ connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
+}
+
+
+/*!
+ Creates a QtSingleApplication object. The application identifier
+ will be QCoreApplication::applicationFilePath(). \a argc, \a
+ argv, and \a GUIenabled are passed on to the QAppliation constructor.
+
+ If you are creating a console application (i.e. setting \a
+ GUIenabled to false), you may consider using
+ QtSingleCoreApplication instead.
+*/
+
+QtSingleApplication::QtSingleApplication(int &argc, char **argv, bool GUIenabled)
+ : QApplication(argc, argv, GUIenabled)
+{
+ sysInit();
+}
+
+
+/*!
+ Creates a QtSingleApplication object with the application
+ identifier \a appId. \a argc and \a argv are passed on to the
+ QAppliation constructor.
+*/
+
+QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char **argv)
+ : QApplication(argc, argv)
+{
+ sysInit(appId);
+}
+
+
+/*!
+ Creates a QtSingleApplication object. The application identifier
+ will be QCoreApplication::applicationFilePath(). \a argc, \a
+ argv, and \a type are passed on to the QAppliation constructor.
+*/
+QtSingleApplication::QtSingleApplication(int &argc, char **argv, Type type)
+ : QApplication(argc, argv, type)
+{
+ sysInit();
+}
+
+
+#if defined(Q_WS_X11)
+/*!
+ Special constructor for X11, ref. the documentation of
+ QApplication's corresponding constructor. The application identifier
+ will be QCoreApplication::applicationFilePath(). \a dpy, \a visual,
+ and \a cmap are passed on to the QApplication constructor.
+*/
+QtSingleApplication::QtSingleApplication(Display* dpy, Qt::HANDLE visual, Qt::HANDLE cmap)
+ : QApplication(dpy, visual, cmap)
+{
+ sysInit();
+}
+
+/*!
+ Special constructor for X11, ref. the documentation of
+ QApplication's corresponding constructor. The application identifier
+ will be QCoreApplication::applicationFilePath(). \a dpy, \a argc, \a
+ argv, \a visual, and \a cmap are passed on to the QApplication
+ constructor.
+*/
+QtSingleApplication::QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual, Qt::HANDLE cmap)
+ : QApplication(dpy, argc, argv, visual, cmap)
+{
+ sysInit();
+}
+
+/*!
+ Special constructor for X11, ref. the documentation of
+ QApplication's corresponding constructor. The application identifier
+ will be \a appId. \a dpy, \a argc, \a
+ argv, \a visual, and \a cmap are passed on to the QApplication
+ constructor.
+*/
+QtSingleApplication::QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual, Qt::HANDLE cmap)
+ : QApplication(dpy, argc, argv, visual, cmap)
+{
+ sysInit(appId);
+}
+#endif
+
+
+/*!
+ Returns true if another instance of this application is running;
+ otherwise false.
+
+ This function does not find instances of this application that are
+ being run by a different user (on Windows: that are running in
+ another session).
+
+ \sa sendMessage()
+*/
+
+bool QtSingleApplication::isRunning()
+{
+ return peer->isClient();
+}
+
+
+/*!
+ Tries to send the text \a message to the currently running
+ instance. The QtSingleApplication object in the running instance
+ will emit the messageReceived() signal when it receives the
+ message.
+
+ This function returns true if the message has been sent to, and
+ processed by, the current instance. If there is no instance
+ currently running, or if the running instance fails to process the
+ message within \a timeout milliseconds, this function return false.
+
+ \sa isRunning(), messageReceived()
+*/
+bool QtSingleApplication::sendMessage(const QString &message, int timeout)
+{
+ return peer->sendMessage(message, timeout);
+}
+
+
+/*!
+ Returns the application identifier. Two processes with the same
+ identifier will be regarded as instances of the same application.
+*/
+QString QtSingleApplication::id() const
+{
+ return peer->applicationId();
+}
+
+
+/*!
+ Sets the activation window of this application to \a aw. The
+ activation window is the widget that will be activated by
+ activateWindow(). This is typically the application's main window.
+
+ If \a activateOnMessage is true (the default), the window will be
+ activated automatically every time a message is received, just prior
+ to the messageReceived() signal being emitted.
+
+ \sa activateWindow(), messageReceived()
+*/
+
+void QtSingleApplication::setActivationWindow(QWidget* aw, bool activateOnMessage)
+{
+ actWin = aw;
+ if (activateOnMessage)
+ connect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow()));
+ else
+ disconnect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow()));
+}
+
+
+/*!
+ Returns the applications activation window if one has been set by
+ calling setActivationWindow(), otherwise returns 0.
+
+ \sa setActivationWindow()
+*/
+QWidget* QtSingleApplication::activationWindow() const
+{
+ return actWin;
+}
+
+
+/*!
+ De-minimizes, raises, and activates this application's activation window.
+ This function does nothing if no activation window has been set.
+
+ This is a convenience function to show the user that this
+ application instance has been activated when he has tried to start
+ another instance.
+
+ This function should typically be called in response to the
+ messageReceived() signal. By default, that will happen
+ automatically, if an activation window has been set.
+
+ \sa setActivationWindow(), messageReceived(), initialize()
+*/
+void QtSingleApplication::activateWindow()
+{
+ if (actWin) {
+ actWin->setWindowState(actWin->windowState() & ~Qt::WindowMinimized);
+ actWin->raise();
+ actWin->activateWindow();
+ }
+}
+
+
+/*!
+ \fn void QtSingleApplication::messageReceived(const QString& message)
+
+ This signal is emitted when the current instance receives a \a
+ message from another instance of this application.
+
+ \sa sendMessage(), setActivationWindow(), activateWindow()
+*/
+
+
+/*!
+ \fn void QtSingleApplication::initialize(bool dummy = true)
+
+ \obsolete
+*/
diff --git a/tools/qtsingleapplication/qtsingleapplication.h b/tools/qtsingleapplication/qtsingleapplication.h
new file mode 100644
index 0000000..7bf6837
--- /dev/null
+++ b/tools/qtsingleapplication/qtsingleapplication.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of a Qt Solutions component.
+**
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR 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."
+**
+****************************************************************************/
+
+
+#include <QtGui/QApplication>
+
+class QtLocalPeer;
+
+#if defined(Q_WS_WIN)
+# if !defined(QT_QTSINGLEAPPLICATION_EXPORT) && !defined(QT_QTSINGLEAPPLICATION_IMPORT)
+# define QT_QTSINGLEAPPLICATION_EXPORT
+# elif defined(QT_QTSINGLEAPPLICATION_IMPORT)
+# if defined(QT_QTSINGLEAPPLICATION_EXPORT)
+# undef QT_QTSINGLEAPPLICATION_EXPORT
+# endif
+# define QT_QTSINGLEAPPLICATION_EXPORT __declspec(dllimport)
+# elif defined(QT_QTSINGLEAPPLICATION_EXPORT)
+# undef QT_QTSINGLEAPPLICATION_EXPORT
+# define QT_QTSINGLEAPPLICATION_EXPORT __declspec(dllexport)
+# endif
+#else
+# define QT_QTSINGLEAPPLICATION_EXPORT
+#endif
+
+class QT_QTSINGLEAPPLICATION_EXPORT QtSingleApplication : public QApplication
+{
+ Q_OBJECT
+
+public:
+ QtSingleApplication(int &argc, char **argv, bool GUIenabled = true);
+ QtSingleApplication(const QString &id, int &argc, char **argv);
+ QtSingleApplication(int &argc, char **argv, Type type);
+#if defined(Q_WS_X11)
+ QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
+ QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0);
+ QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
+#endif
+
+ bool isRunning();
+ QString id() const;
+
+ void setActivationWindow(QWidget* aw, bool activateOnMessage = true);
+ QWidget* activationWindow() const;
+
+ // Obsolete:
+ void initialize(bool dummy = true)
+ { isRunning(); Q_UNUSED(dummy) }
+
+public Q_SLOTS:
+ bool sendMessage(const QString &message, int timeout = 5000);
+ void activateWindow();
+
+
+Q_SIGNALS:
+ void messageReceived(const QString &message);
+
+
+private:
+ void sysInit(const QString &appId = QString());
+ QtLocalPeer *peer;
+ QWidget *actWin;
+};
diff --git a/tools/qtsingleapplication/qtsingleapplication.pri b/tools/qtsingleapplication/qtsingleapplication.pri
new file mode 100644
index 0000000..02de47e
--- /dev/null
+++ b/tools/qtsingleapplication/qtsingleapplication.pri
@@ -0,0 +1,15 @@
+INCLUDEPATH += $$PWD
+DEPENDPATH += $$PWD
+QT *= network
+
+qtsingleapplication-uselib:!qtsingleapplication-buildlib {
+ LIBS += -L$$QTSINGLEAPPLICATION_LIBDIR -l$$QTSINGLEAPPLICATION_LIBNAME
+} else {
+ SOURCES += $$PWD/qtsingleapplication.cpp $$PWD/qtlocalpeer.cpp
+ HEADERS += $$PWD/qtsingleapplication.h $$PWD/qtlocalpeer.h
+}
+
+win32 {
+ contains(TEMPLATE, lib):contains(CONFIG, shared):DEFINES += QT_QTSINGLEAPPLICATION_EXPORT
+ else:qtsingleapplication-uselib:DEFINES += QT_QTSINGLEAPPLICATION_IMPORT
+}
diff --git a/tools/qtsingleapplication/qtsinglecoreapplication.cpp b/tools/qtsingleapplication/qtsinglecoreapplication.cpp
new file mode 100644
index 0000000..cf60771
--- /dev/null
+++ b/tools/qtsingleapplication/qtsinglecoreapplication.cpp
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of a Qt Solutions component.
+**
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR 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."
+**
+****************************************************************************/
+
+
+#include "qtsinglecoreapplication.h"
+#include "qtlocalpeer.h"
+
+/*!
+ \class QtSingleCoreApplication qtsinglecoreapplication.h
+ \brief A variant of the QtSingleApplication class for non-GUI applications.
+
+ This class is a variant of QtSingleApplication suited for use in
+ console (non-GUI) applications. It is an extension of
+ QCoreApplication (instead of QApplication). It does not require
+ the QtGui library.
+
+ The API and usage is identical to QtSingleApplication, except that
+ functions relating to the "activation window" are not present, for
+ obvious reasons. Please refer to the QtSingleApplication
+ documentation for explanation of the usage.
+
+ A QtSingleCoreApplication instance can communicate to a
+ QtSingleApplication instance if they share the same application
+ id. Hence, this class can be used to create a light-weight
+ command-line tool that sends commands to a GUI application.
+
+ \sa QtSingleApplication
+*/
+
+/*!
+ Creates a QtSingleCoreApplication object. The application identifier
+ will be QCoreApplication::applicationFilePath(). \a argc and \a
+ argv are passed on to the QCoreAppliation constructor.
+*/
+
+QtSingleCoreApplication::QtSingleCoreApplication(int &argc, char **argv)
+ : QCoreApplication(argc, argv)
+{
+ peer = new QtLocalPeer(this);
+ connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
+}
+
+
+/*!
+ Creates a QtSingleCoreApplication object with the application
+ identifier \a appId. \a argc and \a argv are passed on to the
+ QCoreAppliation constructor.
+*/
+QtSingleCoreApplication::QtSingleCoreApplication(const QString &appId, int &argc, char **argv)
+ : QCoreApplication(argc, argv)
+{
+ peer = new QtLocalPeer(this, appId);
+ connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
+}
+
+
+/*!
+ Returns true if another instance of this application is running;
+ otherwise false.
+
+ This function does not find instances of this application that are
+ being run by a different user (on Windows: that are running in
+ another session).
+
+ \sa sendMessage()
+*/
+
+bool QtSingleCoreApplication::isRunning()
+{
+ return peer->isClient();
+}
+
+
+/*!
+ Tries to send the text \a message to the currently running
+ instance. The QtSingleCoreApplication object in the running instance
+ will emit the messageReceived() signal when it receives the
+ message.
+
+ This function returns true if the message has been sent to, and
+ processed by, the current instance. If there is no instance
+ currently running, or if the running instance fails to process the
+ message within \a timeout milliseconds, this function return false.
+
+ \sa isRunning(), messageReceived()
+*/
+
+bool QtSingleCoreApplication::sendMessage(const QString &message, int timeout)
+{
+ return peer->sendMessage(message, timeout);
+}
+
+
+/*!
+ Returns the application identifier. Two processes with the same
+ identifier will be regarded as instances of the same application.
+*/
+
+QString QtSingleCoreApplication::id() const
+{
+ return peer->applicationId();
+}
+
+
+/*!
+ \fn void QtSingleCoreApplication::messageReceived(const QString& message)
+
+ This signal is emitted when the current instance receives a \a
+ message from another instance of this application.
+
+ \sa sendMessage()
+*/
diff --git a/tools/qtsingleapplication/qtsinglecoreapplication.h b/tools/qtsingleapplication/qtsinglecoreapplication.h
new file mode 100644
index 0000000..ef529a8
--- /dev/null
+++ b/tools/qtsingleapplication/qtsinglecoreapplication.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of a Qt Solutions component.
+**
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR 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."
+**
+****************************************************************************/
+
+
+#include <QtCore/QCoreApplication>
+
+class QtLocalPeer;
+
+class QtSingleCoreApplication : public QCoreApplication
+{
+ Q_OBJECT
+
+public:
+ QtSingleCoreApplication(int &argc, char **argv);
+ QtSingleCoreApplication(const QString &id, int &argc, char **argv);
+
+ bool isRunning();
+ QString id() const;
+
+public Q_SLOTS:
+ bool sendMessage(const QString &message, int timeout = 5000);
+
+
+Q_SIGNALS:
+ void messageReceived(const QString &message);
+
+
+private:
+ QtLocalPeer* peer;
+};
diff --git a/tools/qtsingleapplication/qtsinglecoreapplication.pri b/tools/qtsingleapplication/qtsinglecoreapplication.pri
new file mode 100644
index 0000000..d2d6cc3
--- /dev/null
+++ b/tools/qtsingleapplication/qtsinglecoreapplication.pri
@@ -0,0 +1,10 @@
+INCLUDEPATH += $$PWD
+DEPENDPATH += $$PWD
+HEADERS += $$PWD/qtsinglecoreapplication.h $$PWD/qtlocalpeer.h
+SOURCES += $$PWD/qtsinglecoreapplication.cpp $$PWD/qtlocalpeer.cpp
+
+QT *= network
+
+win32:contains(TEMPLATE, lib):contains(CONFIG, shared) {
+ DEFINES += QT_QTSINGLECOREAPPLICATION_EXPORT=__declspec(dllexport)
+}
diff --git a/tools/qtwin.cpp b/tools/qtwin.cpp
new file mode 100644
index 0000000..bb029bb
--- /dev/null
+++ b/tools/qtwin.cpp
@@ -0,0 +1,222 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Use, modification and distribution is allowed without limitation,
+** warranty, liability or support of any kind.
+**
+****************************************************************************/
+
+#include "qtwin.h"
+#include <QLibrary>
+#include <QApplication>
+#include <QWidget>
+#include <QList>
+#include <QPointer>
+
+#ifdef Q_WS_WIN
+
+#include <qt_windows.h>
+
+// Blur behind data structures
+#define DWM_BB_ENABLE 0x00000001 // fEnable has been specified
+#define DWM_BB_BLURREGION 0x00000002 // hRgnBlur has been specified
+#define DWM_BB_TRANSITIONONMAXIMIZED 0x00000004 // fTransitionOnMaximized has been specified
+#define WM_DWMCOMPOSITIONCHANGED 0x031E // Composition changed window message
+
+typedef struct _DWM_BLURBEHIND
+{
+ DWORD dwFlags;
+ BOOL fEnable;
+ HRGN hRgnBlur;
+ BOOL fTransitionOnMaximized;
+} DWM_BLURBEHIND, *PDWM_BLURBEHIND;
+
+typedef struct _MARGINS
+{
+ int cxLeftWidth;
+ int cxRightWidth;
+ int cyTopHeight;
+ int cyBottomHeight;
+} MARGINS, *PMARGINS;
+
+typedef HRESULT (WINAPI *PtrDwmIsCompositionEnabled)(BOOL* pfEnabled);
+typedef HRESULT (WINAPI *PtrDwmExtendFrameIntoClientArea)(HWND hWnd, const MARGINS* pMarInset);
+typedef HRESULT (WINAPI *PtrDwmEnableBlurBehindWindow)(HWND hWnd, const DWM_BLURBEHIND* pBlurBehind);
+typedef HRESULT (WINAPI *PtrDwmGetColorizationColor)(DWORD *pcrColorization, BOOL *pfOpaqueBlend);
+
+static PtrDwmIsCompositionEnabled pDwmIsCompositionEnabled= 0;
+static PtrDwmEnableBlurBehindWindow pDwmEnableBlurBehindWindow = 0;
+static PtrDwmExtendFrameIntoClientArea pDwmExtendFrameIntoClientArea = 0;
+static PtrDwmGetColorizationColor pDwmGetColorizationColor = 0;
+
+
+/*
+ * Internal helper class that notifies windows if the
+ * DWM compositing state changes and updates the widget
+ * flags correspondingly.
+ */
+class WindowNotifier : public QWidget
+{
+public:
+ WindowNotifier() { winId(); }
+ void addWidget(QWidget *widget) { widgets.append(widget); }
+ void removeWidget(QWidget *widget) { widgets.removeAll(widget); }
+ bool winEvent(MSG *message, long *result);
+
+private:
+ QWidgetList widgets;
+};
+
+static bool resolveLibs()
+{
+ if (!pDwmIsCompositionEnabled) {
+ QLibrary dwmLib(QString::fromAscii("dwmapi"));
+ pDwmIsCompositionEnabled =(PtrDwmIsCompositionEnabled)dwmLib.resolve("DwmIsCompositionEnabled");
+ pDwmExtendFrameIntoClientArea = (PtrDwmExtendFrameIntoClientArea)dwmLib.resolve("DwmExtendFrameIntoClientArea");
+ pDwmEnableBlurBehindWindow = (PtrDwmEnableBlurBehindWindow)dwmLib.resolve("DwmEnableBlurBehindWindow");
+ pDwmGetColorizationColor = (PtrDwmGetColorizationColor)dwmLib.resolve("DwmGetColorizationColor");
+ }
+ return pDwmIsCompositionEnabled != 0;
+}
+
+#endif
+
+/*!
+ * Chekcs and returns true if Windows DWM composition
+ * is currently enabled on the system.
+ *
+ * To get live notification on the availability of
+ * this feature, you will currently have to
+ * reimplement winEvent() on your widget and listen
+ * for the WM_DWMCOMPOSITIONCHANGED event to occur.
+ *
+ */
+bool QtWin::isCompositionEnabled()
+{
+#ifdef Q_WS_WIN
+ if (resolveLibs()) {
+ HRESULT hr = S_OK;
+ BOOL isEnabled = false;
+ hr = pDwmIsCompositionEnabled(&isEnabled);
+ if (SUCCEEDED(hr))
+ return isEnabled;
+ }
+#endif
+ return false;
+}
+
+/*!
+ * Enables Blur behind on a Widget.
+ *
+ * \a enable tells if the blur should be enabled or not
+ */
+bool QtWin::enableBlurBehindWindow(QWidget *widget, bool enable)
+{
+ Q_ASSERT(widget);
+ bool result = false;
+#ifdef Q_WS_WIN
+ if (resolveLibs()) {
+ DWM_BLURBEHIND bb = {0};
+ HRESULT hr = S_OK;
+ bb.fEnable = enable;
+ bb.dwFlags = DWM_BB_ENABLE;
+ bb.hRgnBlur = NULL;
+ widget->setAttribute(Qt::WA_TranslucentBackground, enable);
+ widget->setAttribute(Qt::WA_NoSystemBackground, enable);
+ hr = pDwmEnableBlurBehindWindow(widget->winId(), &bb);
+ if (SUCCEEDED(hr)) {
+ result = true;
+ windowNotifier()->addWidget(widget);
+ }
+ }
+#endif
+ return result;
+}
+
+/*!
+ * ExtendFrameIntoClientArea.
+ *
+ * This controls the rendering of the frame inside the window.
+ * Note that passing margins of -1 (the default value) will completely
+ * remove the frame from the window.
+ *
+ * \note you should not call enableBlurBehindWindow before calling
+ * this functions
+ *
+ * \a enable tells if the blur should be enabled or not
+ */
+bool QtWin::extendFrameIntoClientArea(QWidget *widget, int left, int top, int right, int bottom)
+{
+
+ Q_ASSERT(widget);
+ Q_UNUSED(left);
+ Q_UNUSED(top);
+ Q_UNUSED(right);
+ Q_UNUSED(bottom);
+
+ bool result = false;
+#ifdef Q_WS_WIN
+ if (resolveLibs()) {
+ QLibrary dwmLib(QString::fromAscii("dwmapi"));
+ HRESULT hr = S_OK;
+ MARGINS m = {left, top, right, bottom};
+ hr = pDwmExtendFrameIntoClientArea(widget->winId(), &m);
+ if (SUCCEEDED(hr)) {
+ result = true;
+ windowNotifier()->addWidget(widget);
+ }
+ widget->setAttribute(Qt::WA_TranslucentBackground, result);
+ }
+#endif
+ return result;
+}
+
+/*!
+ * Returns the current colorizationColor for the window.
+ *
+ * \a enable tells if the blur should be enabled or not
+ */
+QColor QtWin::colorizatinColor()
+{
+ QColor resultColor = QApplication::palette().window().color();
+
+#ifdef Q_WS_WIN
+ if (resolveLibs()) {
+ DWORD color = 0;
+ BOOL opaque = FALSE;
+ QLibrary dwmLib(QString::fromAscii("dwmapi"));
+ HRESULT hr = S_OK;
+ hr = pDwmGetColorizationColor(&color, &opaque);
+ if (SUCCEEDED(hr))
+ resultColor = QColor(color);
+ }
+#endif
+ return resultColor;
+}
+
+#ifdef Q_WS_WIN
+WindowNotifier *QtWin::windowNotifier()
+{
+ static WindowNotifier *windowNotifierInstance = 0;
+ if (!windowNotifierInstance)
+ windowNotifierInstance = new WindowNotifier;
+ return windowNotifierInstance;
+}
+
+
+/* Notify all enabled windows that the DWM state changed */
+bool WindowNotifier::winEvent(MSG *message, long *result)
+{
+ if (message && message->message == WM_DWMCOMPOSITIONCHANGED) {
+ bool compositionEnabled = QtWin::isCompositionEnabled();
+ foreach(QWidget * widget, widgets) {
+ if (widget) {
+ widget->setAttribute(Qt::WA_NoSystemBackground, compositionEnabled);
+ }
+ widget->update();
+ }
+ }
+ return QWidget::winEvent(message, result);
+}
+#endif
diff --git a/tools/qtwin.h b/tools/qtwin.h
new file mode 100644
index 0000000..4008c7f
--- /dev/null
+++ b/tools/qtwin.h
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Use, modification and distribution is allowed without limitation,
+** warranty, liability or support of any kind.
+**
+****************************************************************************/
+
+#ifndef QTWIN_H
+#define QTWIN_H
+
+#include <QColor>
+#include <QWidget>
+/**
+ * This is a helper class for using the Desktop Window Manager
+ * functionality on Windows 7 and Windows Vista. On other platforms
+ * these functions will simply not do anything.
+ */
+
+class WindowNotifier;
+
+class QtWin
+{
+public:
+ static bool enableBlurBehindWindow(QWidget *widget, bool enable = true);
+ static bool extendFrameIntoClientArea(QWidget *widget,
+ int left = -1, int top = -1,
+ int right = -1, int bottom = -1);
+ static bool isCompositionEnabled();
+ static QColor colorizatinColor();
+
+private:
+ static WindowNotifier *windowNotifier();
+};
+
+#endif // QTWIN_H
diff --git a/tools/screenshot.cpp b/tools/screenshot.cpp
new file mode 100644
index 0000000..53c040b
--- /dev/null
+++ b/tools/screenshot.cpp
@@ -0,0 +1,332 @@
+#include <QApplication>
+#include <QClipboard>
+#include <QDateTime>
+#include <QDesktopWidget>
+#include <QFileDialog>
+#include <QPainter>
+#include <QPixmap>
+#include <QDebug>
+
+#if defined(Q_WS_WIN)
+ #include <windows.h>
+#endif
+
+#include "../dialogs/AreaDialog.h"
+#include "windowpicker.h"
+#include "screenshot.h"
+
+#include "os.h"
+
+Screenshot::Screenshot(QObject *parent, Screenshot::Options options): QObject(parent), mOptions(options), mPixmapDelay(false) {
+}
+
+Screenshot::Options Screenshot::options()
+{
+ return mOptions;
+}
+
+QPixmap &Screenshot::pixmap()
+{
+ return mPixmap;
+}
+
+void Screenshot::activeWindow()
+{
+#if defined(Q_WS_WIN)
+ HWND fWindow = GetForegroundWindow();
+
+ if (fWindow == NULL)
+ return;
+
+ if (fWindow == GetDesktopWindow()) {
+ wholeScreen();
+ return;
+ }
+
+ mPixmap = os::grabWindow(GetForegroundWindow());
+#else
+ wholeScreen(); //TODO
+#endif
+}
+
+QString Screenshot::getName(NamingOptions options, QString prefix, QDir directory)
+{
+ QString naming;
+ int naming_largest = 0;
+
+ if (options.flip) {
+ naming = "%1" + prefix;
+ }
+ else {
+ naming = prefix + "%1";
+ }
+
+ switch (options.naming)
+ {
+ case Screenshot::Numeric: // Numeric
+ // Iterating through the folder to find the largest numeric naming.
+ foreach(QString file, directory.entryList(QDir::Files))
+ {
+ if (file.contains(prefix)) {
+ file.chop(file.size() - file.lastIndexOf("."));
+ file.remove(prefix);
+
+ if (file.toInt()> naming_largest) {
+ naming_largest = file.toInt();
+ }
+ }
+ }
+
+ if (options.leadingZeros > 0) {
+ //Pretty, huh?
+ QString format;
+ QTextStream (&format) << "%0" << (options.leadingZeros+1) << "d";
+
+ naming = naming.arg(QString().sprintf(format.toAscii(), naming_largest + 1));
+ }
+ else {
+ naming = naming.arg(naming_largest + 1);
+ }
+
+ break;
+ case Screenshot::Date: // Date
+ naming = naming.arg(QDateTime::currentDateTime().toString(options.dateFormat));
+ break;
+ case Screenshot::Timestamp: // Timestamp
+ naming = naming.arg(QDateTime::currentDateTime().toTime_t());
+ break;
+ case Screenshot::None:
+ naming = naming.arg("");
+ break;
+ }
+
+ return naming;
+}
+
+QString Screenshot::newFileName()
+{
+ if (!mOptions.directory.exists())
+ mOptions.directory.mkpath(mOptions.directory.path());
+
+ QString naming = Screenshot::getName(mOptions.namingOptions, mOptions.prefix, mOptions.directory);
+
+ QString fileName;
+
+ QString path = QDir::toNativeSeparators(mOptions.directory.path());
+
+ // Cleanup
+ if (path.at(path.size()-1) != QDir::separator() && !path.isEmpty())
+ path.append(QDir::separator());
+
+ fileName.append(path);
+ fileName.append(naming);
+
+ return fileName;
+}
+
+QString Screenshot::extension()
+{
+ switch (mOptions.format) {
+ case Screenshot::PNG:
+ return ".png";
+ break;
+ case Screenshot::BMP:
+ return ".bmp";
+ break;
+ case Screenshot::JPEG:
+ default:
+ return ".jpg";
+ break;
+ }
+}
+
+void Screenshot::selectedArea()
+{
+ static bool alreadySelecting = false; // Prevents multiple AreaDialog instances -- [Is this even possible anymore?]
+
+ if (alreadySelecting)
+ return;
+
+ alreadySelecting = true;
+
+ grabDesktop();
+
+ if (mPixmap.isNull())
+ return;
+
+ AreaDialog selector(this);
+ int result = selector.exec();
+
+ alreadySelecting = false;
+
+ if (result == QDialog::Accepted) {
+ mPixmap = mPixmap.copy(selector.resultRect());
+ }
+ else {
+ mPixmap = QPixmap();
+ }
+}
+
+
+void Screenshot::selectedWindow()
+{
+#if defined(Q_WS_WIN)
+ WindowPicker* windowPicker = new WindowPicker;
+ mPixmapDelay = true;
+
+ connect(windowPicker, SIGNAL(pixmap(QPixmap)), this, SLOT(setPixmap(QPixmap)));
+#else
+ wholeScreen();
+#endif
+}
+
+void Screenshot::wholeScreen()
+{
+ grabDesktop();
+}
+
+void Screenshot::grabDesktop()
+{
+ QRect geometry;
+
+ if (mOptions.currentMonitor) {
+ geometry = qApp->desktop()->screenGeometry(QCursor::pos());
+ }
+ else {
+ geometry = qApp->desktop()->geometry();
+ }
+
+ mPixmap = QPixmap::grabWindow(qApp->desktop()->winId(), geometry.x(), geometry.y(), geometry.width(), geometry.height());
+
+ if (mOptions.cursor && !mPixmap.isNull()) {
+ QPainter painter(&mPixmap);
+ painter.drawPixmap(QCursor::pos(), os::cursor());
+ }
+}
+
+void Screenshot::take()
+{
+ switch (mOptions.mode)
+ {
+ case Screenshot::WholeScreen:
+ wholeScreen();
+ break;
+
+ case Screenshot::SelectedArea:
+ selectedArea();
+ break;
+
+ case Screenshot::ActiveWindow:
+ activeWindow();
+ break;
+
+ case Screenshot::SelectedWindow:
+ selectedWindow();
+ break;
+ }
+
+ if (mPixmapDelay)
+ return;
+
+ if (mPixmap.isNull()) {
+ confirm(false);
+ }
+ else {
+ emit askConfirmation();
+ }
+}
+
+void Screenshot::confirm(bool result)
+{
+ if (result) {
+ save();
+ }
+ else {
+ mOptions.result = Screenshot::Cancel;
+ }
+
+ mPixmap = QPixmap(); // Cleanup just in case.
+ emit finished();
+}
+
+void Screenshot::discard()
+{
+ confirm(false);
+}
+
+void Screenshot::save()
+{
+ QString name = "";
+ QString fileName = "";
+ Screenshot::Result result = Screenshot::Fail;
+
+ if (mOptions.file && !mOptions.saveAs) {
+ name = newFileName();
+ }
+ else if (mOptions.file && mOptions.saveAs) {
+ name = QFileDialog::getSaveFileName(0, tr("Save as.."), newFileName(), "*" + extension());
+ }
+
+ if (!mOptions.replace && QFile::exists(name+extension())) {
+ // Ugly? You should see my wife!
+ int count = 0;
+ int cunt = 0;
+
+ QString naming = QFileInfo(name).fileName();
+
+ foreach(QString file, QFileInfo(name+extension()).dir().entryList(QDir::Files)) {
+ if (file.contains(naming)) {
+ file.remove(naming);
+ file.remove(" (");
+ file.remove(")");
+ file.remove(extension());
+
+ cunt = file.toInt();
+
+ if (cunt > count) {
+ count = cunt;
+ }
+ }
+ }
+
+ name = name + " (" + QString::number(count+1) + ")";
+ }
+
+ fileName = name + extension();
+
+ if (fileName.isEmpty()) {
+ result = Screenshot::Fail;
+ }
+ else if (mPixmap.save(fileName, 0, mOptions.quality)) {
+ result = Screenshot::Success;
+ }
+
+ if (mOptions.file) { // Windows only
+ os::addToRecentDocuments(fileName);
+ }
+
+ if (mOptions.clipboard) {
+ QApplication::clipboard()->setPixmap(mPixmap, QClipboard::Clipboard);
+
+ if (!mOptions.file) {
+ result = Screenshot::Success;
+ }
+ }
+
+ mPixmap = QPixmap();
+ mOptions.fileName = fileName;
+ mOptions.result = result;
+}
+
+void Screenshot::setPixmap(QPixmap pixmap)
+{
+ mPixmap = pixmap;
+ pixmap = QPixmap(); // ??
+
+ if (mPixmap.isNull()) {
+ emit confirm(false);
+ }
+ else {
+ emit askConfirmation();
+ }
+}
diff --git a/tools/screenshot.h b/tools/screenshot.h
new file mode 100644
index 0000000..07abb66
--- /dev/null
+++ b/tools/screenshot.h
@@ -0,0 +1,108 @@
+#ifndef SCREENSHOT_H
+#define SCREENSHOT_H
+
+#include <QObject>
+#include <QDir>
+#include <QPixmap>
+
+class Screenshot : public QObject
+{
+ Q_OBJECT
+
+public:
+ enum Format
+ {
+ PNG = 0,
+ JPEG = 1,
+ BMP = 2,
+ TIFF = 3
+ };
+
+ enum Naming
+ {
+ Numeric = 0,
+ Date = 1,
+ Timestamp = 2,
+ None = 3
+ };
+
+ enum Mode
+ {
+ WholeScreen = 0,
+ ActiveWindow = 1,
+ SelectedArea = 2,
+ SelectedWindow = 3
+ };
+
+ enum Result
+ {
+ Fail = 0,
+ Success = 1,
+ Cancel = 2
+ };
+
+ struct NamingOptions
+ {
+ Naming naming;
+ bool flip;
+ int leadingZeros;
+ QString dateFormat;
+ };
+
+ struct Options
+ {
+ QString fileName;
+ Result result;
+
+ Format format;
+ QString prefix;
+ NamingOptions namingOptions;
+ QDir directory;
+ int mode;
+ int quality;
+
+ bool currentMonitor;
+ bool clipboard;
+ bool file;
+ bool preview;
+ bool magnify;
+ bool cursor;
+ bool saveAs;
+ bool animations;
+ bool replace;
+ };
+
+ Screenshot(QObject *parent, Screenshot::Options options);
+
+ Screenshot::Options options();
+ QPixmap &pixmap();
+ static QString getName(NamingOptions options, QString prefix, QDir directory);
+
+public slots:
+ void take();
+ void confirm(bool result = true);
+ void discard();
+ void save();
+ void setPixmap(QPixmap pixmap);
+
+signals:
+ void askConfirmation();
+ void finished();
+
+private:
+ void activeWindow();
+ QString newFileName();
+ QString extension();
+ void selectedArea();
+ void selectedWindow();
+ void wholeScreen();
+ void grabDesktop();
+
+private:
+ Screenshot::Options mOptions;
+ QPixmap mPixmap;
+ bool mPixmapDelay;
+
+};
+
+#endif // SCREENSHOT_H
diff --git a/tools/screenshotmanager.cpp b/tools/screenshotmanager.cpp
new file mode 100644
index 0000000..aaf95a5
--- /dev/null
+++ b/tools/screenshotmanager.cpp
@@ -0,0 +1,49 @@
+#include "screenshotmanager.h"
+#include "screenshot.h"
+
+#include <QSettings>
+#include <QDebug>
+
+ScreenshotManager::ScreenshotManager(QObject *parent = 0) : QObject(parent), mCount(0)
+{
+ mSettings = new QSettings();
+}
+
+ScreenshotManager::~ScreenshotManager()
+{
+ delete mSettings;
+}
+
+void ScreenshotManager::take(Screenshot::Options options)
+{
+ Screenshot* newScreenshot = new Screenshot(this, options);
+
+ connect(newScreenshot, SIGNAL(askConfirmation()), this, SLOT(askConfirmation()));
+ connect(newScreenshot, SIGNAL(finished()) , this, SLOT(cleanup()));
+
+ newScreenshot->take();
+}
+
+void ScreenshotManager::askConfirmation()
+{
+ Screenshot* s = qobject_cast<Screenshot*>(sender());
+ emit confirm(s);
+}
+
+void ScreenshotManager::cleanup()
+{
+ Screenshot* s = qobject_cast<Screenshot*>(sender());
+ emit windowCleanup(s->options());
+ s->deleteLater();
+}
+
+// Singleton
+ScreenshotManager* ScreenshotManager::mInstance = 0;
+
+ScreenshotManager *ScreenshotManager::instance()
+{
+ if (!mInstance)
+ mInstance = new ScreenshotManager();
+
+ return mInstance;
+}
diff --git a/tools/screenshotmanager.h b/tools/screenshotmanager.h
new file mode 100644
index 0000000..5e83678
--- /dev/null
+++ b/tools/screenshotmanager.h
@@ -0,0 +1,47 @@
+#ifndef SCREENSHOTMANAGER_H
+#define SCREENSHOTMANAGER_H
+
+#include <QObject>
+#include <QList>
+
+#include "screenshot.h"
+
+class QSettings;
+class ScreenshotManager : public QObject
+{
+ Q_OBJECT
+
+public:
+ enum State
+ {
+ Idle = 0,
+ Busy = 1,
+ Disabled = 2
+ };
+
+public:
+ ScreenshotManager(QObject *parent);
+ ~ScreenshotManager();
+ static ScreenshotManager *instance();
+
+ void setCount(const unsigned int count){ mCount = count; }
+ unsigned int count() const { return mCount; }
+ QSettings *settings() const { return mSettings; }
+
+public slots:
+ void take(Screenshot::Options options);
+ void askConfirmation();
+ void cleanup();
+
+signals:
+ void confirm(Screenshot* screenshot);
+ void windowCleanup(Screenshot::Options options);
+
+private:
+ static ScreenshotManager* mInstance;
+ QSettings *mSettings;
+ int mCount; // Concurrent screenshot count.
+
+};
+
+#endif // SCREENSHOTMANAGER_H
diff --git a/tools/windowpicker.cpp b/tools/windowpicker.cpp
new file mode 100644
index 0000000..30c796c
--- /dev/null
+++ b/tools/windowpicker.cpp
@@ -0,0 +1,206 @@
+
+#include <QApplication>
+#include <QWidget>
+#include <QDesktopWidget>
+#include <QMouseEvent>
+#include <QVBoxLayout>
+#include <QLabel>
+#include <QDebug>
+#include <QRubberBand>
+#include <QPushButton>
+#include <QRubberBand>
+
+#include "windowpicker.h"
+#include "os.h"
+
+#ifdef Q_OS_WIN
+#include <windows.h>
+#endif
+
+
+WindowPicker::WindowPicker() : QWidget(0), mCrosshair(":/icons/picker"), mWindowLabel(0), mTaken(false)
+{
+ setWindowFlags(Qt::SplashScreen | Qt::WindowStaysOnTopHint);
+ setWindowTitle(tr("Lightscreen Window Picker"));
+ setStyleSheet("QWidget { color: #000; } #frame { padding: 7px 10px; border: 1px solid #898c95; background-color: qlineargradient(spread:pad, x1:1, y1:1, x2:0.988636, y2:0.608, stop:0 rgba(235, 235, 235, 255), stop:1 rgba(255, 255, 255, 255)); border-radius: 8px; }");
+
+ QLabel *helpLabel = new QLabel(tr("Grab the window picker by clicking and holding down the mouse button, then drag it to the window of your choice and release it to capture."), this);
+ helpLabel->setMinimumWidth(400);
+ helpLabel->setMaximumWidth(400);
+ helpLabel->setWordWrap(true);
+
+ mWindowIndicator = new QRubberBand(QRubberBand::Rectangle, 0);
+ mWindowIndicator->setWindowFlags(mWindowIndicator->windowFlags() & Qt::WindowStaysOnTopHint);
+ mWindowIndicator->setGeometry(0, 0, 0, 0);
+ mWindowIndicator->show();
+
+ mWindowIcon = new QLabel(this);
+ mWindowIcon->setMinimumSize(22, 22);
+ mWindowIcon->setMaximumSize(22, 22);
+ mWindowIcon->setScaledContents(true);
+
+ mWindowLabel = new QLabel(tr(" - Start dragging to select windows"), this);
+ mWindowLabel->setStyleSheet("font-weight: bold");
+
+ mCrosshairLabel = new QLabel(this);
+ mCrosshairLabel->setAlignment(Qt::AlignHCenter);
+ mCrosshairLabel->setPixmap(mCrosshair);
+
+ QPushButton *closeButton = new QPushButton(tr("Close"));
+ connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
+
+ QHBoxLayout *windowLayout = new QHBoxLayout;
+ windowLayout->addWidget(mWindowIcon);
+ windowLayout->addWidget(mWindowLabel);
+ windowLayout->setMargin(0);
+
+ QHBoxLayout *buttonLayout = new QHBoxLayout;
+ buttonLayout->addStretch(0);
+ buttonLayout->addWidget(closeButton);
+ buttonLayout->setMargin(0);
+
+ QHBoxLayout *crosshairLayout = new QHBoxLayout;
+ crosshairLayout->addStretch(0);
+ crosshairLayout->addWidget(mCrosshairLabel);
+ crosshairLayout->addStretch(0);
+ crosshairLayout->setMargin(0);
+
+ QVBoxLayout *fl = new QVBoxLayout;
+ fl->addWidget(helpLabel);
+ fl->addLayout(windowLayout);
+ fl->addLayout(crosshairLayout);
+ fl->addLayout(buttonLayout);
+ fl->setMargin(0);
+
+ QFrame *frame = new QFrame(this);
+ frame->setObjectName("frame");
+ frame->setLayout(fl);
+
+ QVBoxLayout *l = new QVBoxLayout;
+ l->setMargin(0);
+ l->addWidget(frame);
+
+ setLayout(l);
+
+ resize(sizeHint());
+ move(QApplication::desktop()->screenGeometry(QApplication::desktop()->screenNumber(QCursor::pos())).center()-QPoint(width()/2, height()/2));
+ show();
+}
+
+WindowPicker::~WindowPicker() {
+ delete mWindowIndicator;
+}
+
+void WindowPicker::cancel() {
+ mWindowIcon->setPixmap(QPixmap());
+ mCrosshairLabel->setPixmap(mCrosshair);
+ mWindowIndicator->setGeometry(0, 0, 0, 0);
+ qApp->restoreOverrideCursor();
+}
+
+void WindowPicker::mouseReleaseEvent(QMouseEvent *event)
+{
+ if (event->button() == Qt::LeftButton) {
+ POINT mousePos;
+ mousePos.x = event->globalX();
+ mousePos.y = event->globalY();
+
+ HWND window = GetAncestor(WindowFromPoint(mousePos), GA_ROOT);
+
+ if (window == winId()) {
+ cancel();
+ return;
+ }
+
+ mWindowIndicator->hide();
+ mTaken = true;
+
+ setWindowFlags(windowFlags() ^ Qt::WindowStaysOnTopHint);
+ close();
+
+ emit pixmap(os::grabWindow(window));
+
+ return;
+ }
+
+ mWindowIndicator->setGeometry(0, 0, 0, 0);
+
+ close();
+}
+
+void WindowPicker::mousePressEvent(QMouseEvent *event)
+{
+ qApp->setOverrideCursor(QCursor(mCrosshair));
+ mCrosshairLabel->setMinimumWidth(mCrosshairLabel->width());
+ mCrosshairLabel->setMinimumHeight(mCrosshairLabel->height());
+ mCrosshairLabel->setPixmap(QPixmap());
+ QWidget::mousePressEvent(event);
+}
+
+void WindowPicker::mouseMoveEvent(QMouseEvent *event)
+{
+ POINT mousePos;
+ mousePos.x = event->globalX();
+ mousePos.y = event->globalY();
+
+ HWND cWindow = GetAncestor(WindowFromPoint(mousePos), GA_ROOT);
+
+ if (cWindow == mWindowIndicator->winId()) {
+ return;
+ }
+
+ if (mCurrentWindow != cWindow) {
+ SetForegroundWindow(cWindow);
+ RECT rc;
+ GetWindowRect(cWindow, &rc);
+ mWindowIndicator->setGeometry(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
+ }
+
+ mCurrentWindow = cWindow;
+
+ if (mCurrentWindow == winId()) {
+ mWindowIcon->setPixmap(QPixmap());
+ mWindowLabel->setText("");
+ return;
+ }
+
+ // Text
+ WCHAR str[60];
+ HICON icon;
+
+ ::GetWindowText(mCurrentWindow, str, 60);
+ ///
+
+ // Retrieving the application icon
+ icon = (HICON)::GetClassLong(mCurrentWindow, GCL_HICON);
+
+ if (icon != NULL) {
+ mWindowIcon->setPixmap(QPixmap::fromWinHICON(icon));
+ }
+ else {
+ mWindowIcon->setPixmap(QPixmap());
+ }
+
+ QString windowText = QString(" - %1").arg(QString::fromWCharArray(str));
+
+ if (windowText == " - ") {
+ mWindowLabel->setText("");
+ return;
+ }
+
+ if (windowText.length() == 62) {
+ mWindowLabel->setText(windowText + "...");
+ }
+ else {
+ mWindowLabel->setText(windowText);
+ }
+}
+
+void WindowPicker::closeEvent(QCloseEvent*)
+{
+ if (!mTaken)
+ emit pixmap(QPixmap());
+
+ qApp->restoreOverrideCursor();
+ deleteLater();
+}
diff --git a/tools/windowpicker.h b/tools/windowpicker.h
new file mode 100644
index 0000000..badd49f
--- /dev/null
+++ b/tools/windowpicker.h
@@ -0,0 +1,40 @@
+#ifndef WINDOWPICKER_H
+#define WINDOWPICKER_H
+
+#include <QWidget>
+
+class QLabel;
+class QRect;
+class QRubberBand;
+class WindowPicker : public QWidget
+{
+ Q_OBJECT
+
+public:
+ WindowPicker();
+ ~WindowPicker();
+
+signals:
+ void pixmap(QPixmap pixmap);
+
+protected:
+ void mousePressEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ void closeEvent(QCloseEvent*);
+
+private:
+ void cancel();
+
+private:
+ QPixmap mCrosshair;
+ QLabel *mWindowLabel;
+ QLabel *mWindowIcon;
+ QLabel *mCrosshairLabel;
+ QRubberBand *mWindowIndicator;
+ HWND mCurrentWindow;
+ bool mTaken;
+
+};
+
+#endif // WINDOWPICKER_H
diff --git a/translations/chinese_simplified.qm b/translations/chinese_simplified.qm
new file mode 100644
index 0000000..45f8077
Binary files /dev/null and b/translations/chinese_simplified.qm differ
diff --git a/translations/dutch.qm b/translations/dutch.qm
new file mode 100644
index 0000000..367da4b
Binary files /dev/null and b/translations/dutch.qm differ
diff --git a/translations/dutch.ts b/translations/dutch.ts
new file mode 100644
index 0000000..d7e6c8e
--- /dev/null
+++ b/translations/dutch.ts
@@ -0,0 +1,899 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="nl">
+<context>
+ <name>AboutDialog</name>
+ <message>
+ <source>Version %1</source>
+ <translation type="obsolete">Versie %1</translation>
+ </message>
+</context>
+<context>
+ <name>AboutDialogClass</name>
+ <message>
+ <source>About - Lightscreen</source>
+ <translation type="obsolete">Over Lightscreen</translation>
+ </message>
+ <message>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/b&gt;.</source>
+ <translation type="obsolete">Lightscreen is een makkelijk programma om schermafdrukken te maken. &lt;br&gt;&lt;br&gt;
+&lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;ontwikkelde dit programma. De grafische interface gebruikt &lt;a href=&quot;#aboutqt&quot;&gt;Qt&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
+Lightscreen is beschikbaar onder de &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/b&gt;.</translation>
+ </message>
+ <message>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="obsolete">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Projectsite op Sourceforge bezoeken&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Website van Lightscreen bezoeken&lt;/a&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>AreaDialog</name>
+ <message>
+ <location filename="../dialogs/areadialog.cpp" line="127"/>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="unfinished">Schermafdruk van gebied:
+Teken een rechthoek met uw muis om een schermafdruk te maken. U kunt annuleren door
+op een toets te drukken of door te klikken met de rechter- of middelmuisknop.</translation>
+ </message>
+</context>
+<context>
+ <name>AreaSelector</name>
+ <message>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="obsolete">Schermafdruk van gebied:
+Teken een rechthoek met uw muis om een schermafdruk te maken. U kunt annuleren door
+op een toets te drukken of door te klikken met de rechter- of middelmuisknop.</translation>
+ </message>
+ <message>
+ <source>%1 x %2 px </source>
+ <translation type="obsolete">%1 x %2 px </translation>
+ </message>
+</context>
+<context>
+ <name>HotkeyWidget</name>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="15"/>
+ <source>Click to select hotkey...</source>
+ <translation>Klik om sneltoets in te stellen... </translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="47"/>
+ <source>Type your hotkey</source>
+ <translation>Sneltoets invoeren</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="56"/>
+ <source>Invalid hotkey</source>
+ <translation>Ongeldige sneltoets</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindow</name>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="97"/>
+ <location filename="../lightscreenwindow.cpp" line="258"/>
+ <location filename="../lightscreenwindow.cpp" line="482"/>
+ <location filename="../lightscreenwindow.cpp" line="682"/>
+ <source>Lightscreen</source>
+ <translation>Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="98"/>
+ <source>You have chosen to hide Lightscreen when there&apos;s no system tray icon, so you will not be able to access the program &lt;b&gt;unless you have selected a hotkey to do so&lt;/b&gt;.&lt;br&gt;What do you want to do?</source>
+ <translation>U koos ervoor om Lightscreen te verbergen terwijl er geen pictogram is in het systeemvak. Hierdoor kunt u het programma alleen openen &lt;b&gt;als u een sneltoets hebt ingesteld&lt;/b&gt;.&lt;br&gt;Wat wilt u doen?</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="101"/>
+ <source>Hide but enable tray</source>
+ <translation>Verbergen maar pictogram in systeemvak inschakelen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="103"/>
+ <source>Hide and don&apos;t warn</source>
+ <translation>Verbergen en niet waarschuwen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="105"/>
+ <source>Just hide</source>
+ <translation>Enkel verbergen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="385"/>
+ <source>Saved to %1%2</source>
+ <translation>Opgeslagen naar %1%2</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="391"/>
+ <source>The screenshot was not taken</source>
+ <translation>Er werd geen schermafdruk gemaakt</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="392"/>
+ <source>There was an error or you did not select a valid area.</source>
+ <translation>Er was een fout of u selecteerde een ongeldig gebied.</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="407"/>
+ <location filename="../lightscreenwindow.cpp" line="612"/>
+ <source>Active &amp;Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="410"/>
+ <location filename="../lightscreenwindow.cpp" line="615"/>
+ <source>&amp;Pick Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="442"/>
+ <source>Sucess!</source>
+ <translation>Gelukt!</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="447"/>
+ <source>Failed!</source>
+ <translation>Mislukt!</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="462"/>
+ <source>Some hotkeys could not be registered, they might already be in use</source>
+ <translation>Sommige sneltoetsen konden niet geregistreerd worden en zijn mogelijk al in gebruik</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="465"/>
+ <source>&lt;br&gt;The failed hotkeys are the following:</source>
+ <translation>&lt;b&gt;Dit zijn de mislukte sneltoetsen:</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="476"/>
+ <source>&lt;br&gt;The failed hotkey is &lt;b&gt;%1&lt;/b&gt;</source>
+ <translation>&lt;br&gt;De mislukte sneltoets is &lt;b&gt;%1&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="479"/>
+ <source>&lt;br&gt;&lt;i&gt;What do you want to do?&lt;/i&gt;</source>
+ <translation>&lt;br&gt;&lt;i&gt;Wat wilt u doen?&lt;/i&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="485"/>
+ <source>Change</source>
+ <translation>Veranderen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="486"/>
+ <source>Disable</source>
+ <translation>Uitzetten</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="487"/>
+ <source>Quit</source>
+ <translation>Afsluiten</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="683"/>
+ <source>There&apos;s a new version of Lightscreen available.&lt;br&gt;Would you like to see more information?&lt;br&gt;(&lt;em&gt;You can turn this notification off&lt;/em&gt;)</source>
+ <translation>Er is een nieuwe versie van Lightscreen beschikbaar.&lt;br&gt;Wilt u meer informatie?&lt;br&gt;(&lt;em&gt;U kunt deze melding uitschakelen&lt;/em&gt;)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="687"/>
+ <source>Turn Off</source>
+ <translation>Uitschakelen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="688"/>
+ <source>Remind Me Later</source>
+ <translation>Herinner mij later</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="404"/>
+ <location filename="../lightscreenwindow.cpp" line="609"/>
+ <source>&amp;Screen</source>
+ <translation>&amp;Bureaublad</translation>
+ </message>
+ <message>
+ <source>&amp;Window</source>
+ <translation type="obsolete">&amp;Venster</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="413"/>
+ <location filename="../lightscreenwindow.cpp" line="618"/>
+ <source>&amp;Area</source>
+ <translation>&amp;Gebied</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="416"/>
+ <location filename="../lightscreenwindow.cpp" line="632"/>
+ <source>&amp;Go to Folder</source>
+ <translation>Ga naar &amp;map</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="606"/>
+ <source>Show&amp;/Hide</source>
+ <translation>&amp;Tonen/Verbergen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="629"/>
+ <source>View &amp;Options</source>
+ <translation>&amp;Voorkeuren</translation>
+ </message>
+ <message>
+ <source>&amp;About Lightscreen</source>
+ <translation type="obsolete">&amp;Over Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="635"/>
+ <source>&amp;Quit</source>
+ <translation>&amp;Afsluiten</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindowClass</name>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="14"/>
+ <source>Lightscreen</source>
+ <translation>Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="35"/>
+ <source>Screenshot</source>
+ <translation>&amp;Schermafdruk</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="54"/>
+ <source>Configure Lightscreen</source>
+ <translation>Lightscreen instellen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="57"/>
+ <source>&amp;Options</source>
+ <translation>&amp;Voorkeuren</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="76"/>
+ <source>Hide Lightscreen </source>
+ <translation>Lightscreen verbergen </translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="82"/>
+ <source>&amp;Hide</source>
+ <translation>Verber&amp;gen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="104"/>
+ <source>&amp;Quit</source>
+ <translation>&amp;Aflsuiten</translation>
+ </message>
+</context>
+<context>
+ <name>NamingDialog</name>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="14"/>
+ <source>Naming Options - Lightscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="42"/>
+ <source>Leading zeros:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="94"/>
+ <source>Date Format:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="122"/>
+ <source> &lt;a href=&quot;http://lightscreen.sourceforge.net/help/date&quot;&gt;[?]&lt;/a&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="136"/>
+ <source>yyyy-MM-dd</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="141"/>
+ <source>yyyy-MM-dd HH.mm.ss</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="161"/>
+ <source>Flip naming.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OptionsDialog</name>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="67"/>
+ <source>Version %1</source>
+ <translation type="unfinished">Versie %1</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>Hotkey conflict</source>
+ <translation>Conflicterende sneltoetsen</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>You have assigned the same hotkeys to more than one action.</source>
+ <translation>U hebt dezelfde sneltoetsen toegewezen aan verschillende acties.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>Filename character error</source>
+ <translation>Tekenfout in bestandsnaam</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>The filename can&apos;t contain any of the following characters: ? : \ / * &quot; &lt; &gt; |</source>
+ <translation>De bestandsnaam kan volgende tekens niet bevatten: ? : \ / * &quot; &lt; &gt; |</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>Final Destination</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>You can&apos;t take screenshots unless you enable file saving or the clipboard.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="163"/>
+ <source>Select where you want to save the screenshots</source>
+ <translation>Selecteer waar u de schermafdrukken wilt opslaan</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="181"/>
+ <source>Lightscreen - Options</source>
+ <translation>Voorkeuren</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="182"/>
+ <source>Restoring the default options will cause you to lose all of your current configuration.</source>
+ <translation>U zult uw huidige voorkeuren verliezen als u de standaardwaarden herstelt.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="185"/>
+ <source>Restore</source>
+ <translation>Herstellen</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="186"/>
+ <source>Don&apos;t Restore</source>
+ <translation>Niet herstellen</translation>
+ </message>
+ <message>
+ <source> (OptiPNG not found)</source>
+ <translation type="obsolete"> (OptiPNG werd niet gevonden)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="14"/>
+ <source>Options - Lightscreen</source>
+ <translation>Voorkeuren</translation>
+ </message>
+ <message>
+ <source>&amp;General</source>
+ <translation type="obsolete">&amp;Algemeen</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="36"/>
+ <source>File</source>
+ <translation>Bestand</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="54"/>
+ <source>&amp;Directory:</source>
+ <translation>&amp;Map:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="94"/>
+ <source>The prefix for the screenshot file</source>
+ <translation>Het voorvoegsel voor het bestand met de schermafdruk</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="97"/>
+ <source>&amp;Filename:</source>
+ <translation>&amp;Bestandsnaam:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="115"/>
+ <source>The prefix will be inserted before the &lt;em&gt;Naming&lt;/em&gt; in the screenshot file and it is usually used to distinguish files. It can be left blank.</source>
+ <translation>Het voorvoegsel zal ingevoegd worden voor de &lt;em&gt;Naamgeving&lt;/em&gt; in het bestand met de schermafdruk. Het wordt gewoonlijk gebruikt om bestanden te onderscheiden. U kunt dit leeg laten.</translation>
+ </message>
+ <message>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3.
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp) that corresponds with the current time.
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss.</source>
+ <translation type="obsolete">De naamgeving wordt ingevoerd na het voorvoegsel en maakt elk bestand uniek zodat het niet wordt overschreven.&lt;br/&gt;
+&lt;b&gt;Numeriek&lt;/b&gt;: voegt een volgnummer in, 1, 2, 3.
+&lt;b&gt;Tijd&lt;/b&gt;: voegt een uniek nummer in dat overeenkomt met de huidige tijd.
+&lt;b&gt;Datum&lt;/b&gt;: voegt de huidige datum en tijd in (formaat: dd-MM-yyyy hh.mm.ss).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="132"/>
+ <source>(number)</source>
+ <translation>(nummer)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="137"/>
+ <source>(date)</source>
+ <translation>(datum)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="142"/>
+ <source>(timestamp)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="168"/>
+ <source>The file format for the screenshot</source>
+ <translation>Het bestandsformaat voor de schermafdruk</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="171"/>
+ <source>F&amp;ormat:</source>
+ <translation>&amp;Formaat:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="185"/>
+ <source>PNG</source>
+ <translation>PNG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="190"/>
+ <source>JPG</source>
+ <translation>JPG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="195"/>
+ <source>BMP</source>
+ <translation>BMP</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="267"/>
+ <source>&lt;i&gt;Preview&lt;/i&gt;:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="203"/>
+ <source>&amp;Quality:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="122"/>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3..&lt;br /&gt;
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date, in the form of dd-MM-yyyy..&lt;br /&gt;
+&lt;b&gt;Date &amp;amp; Time&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss..&lt;br /&gt;
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp, the number of seconds passed since 1970-1-1 00:00:00) that corresponds with the current time.&lt;br /&gt;
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="147"/>
+ <source>(none)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="306"/>
+ <source>System Startup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="359"/>
+ <source>Hotkeys</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="365"/>
+ <source>Captures</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="409"/>
+ <source>Capture the current window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="425"/>
+ <source>Capture a chosen window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="467"/>
+ <source>Lightscreen Control</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="531"/>
+ <source>Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="579"/>
+ <source>Interface</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="706"/>
+ <source>Screenshots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="715"/>
+ <source>Choose where to save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="760"/>
+ <source>Replace screenshots when there&apos;s an existing file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="776"/>
+ <source>D&amp;elay:</source>
+ <translation>V&amp;ertraging:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="789"/>
+ <source>Selecting anything other than 0 in this option will cause the program to &lt;b&gt;wait&lt;/b&gt; that amount of seconds before taking the screenshot.</source>
+ <translation>Het programma zal het hier opgegeven aantal seconden &lt;b&gt;wachten&lt;/b&gt; voor de schermafdruk wordt gemaakt.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="792"/>
+ <source>none</source>
+ <translation>geen</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="801"/>
+ <location filename="../dialogs/optionsdialog.ui" line="955"/>
+ <source> seconds</source>
+ <translation> seconden</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="847"/>
+ <source>Maximum Size:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="898"/>
+ <source>Position:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="968"/>
+ <source> and </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="982"/>
+ <source>save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="987"/>
+ <source>cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1055"/>
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1061"/>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
+Special thanks goes to the &lt;a href=&quot;http://lightscreen.sourceforge.net/about&quot;&gt;Donators and Translators&lt;/a&gt;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1090"/>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="unfinished">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Projectsite op Sourceforge bezoeken&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Website van Lightscreen bezoeken&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="318"/>
+ <source>&amp;Run Lightscreen at system startup.</source>
+ <translation>&amp;Lightscreen opstarten bij systeemstart.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="346"/>
+ <source>H&amp;ide the main window.</source>
+ <translation>&amp;Hoofdvenster verbergen.</translation>
+ </message>
+ <message>
+ <source>&amp;Hotkeys</source>
+ <translation type="obsolete">&amp;Sneltoetsen</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="386"/>
+ <source>Capture the screen</source>
+ <translation>Schermafdruk van b&amp;ureaublad</translation>
+ </message>
+ <message>
+ <source>Capture a window</source>
+ <translation type="obsolete">Schermafdruk van v&amp;enster</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="441"/>
+ <source>Capture a screen area</source>
+ <translation>Schermafdruk van ge&amp;bied</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="504"/>
+ <source>Open the directory</source>
+ <translation>&amp;Map openen</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="488"/>
+ <source>Open the program window</source>
+ <translation>&amp;Programmavenster openen</translation>
+ </message>
+ <message>
+ <source>&amp;Options</source>
+ <translation type="obsolete">&amp;Voorkeuren</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="591"/>
+ <source>Sho&amp;w a system tray icon.</source>
+ <translation>&amp;Pictogram tonen in systeemvak.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="598"/>
+ <source>&amp;Hide Lightscreen while taking a screenshot.</source>
+ <translation>&amp;Lightscreen verbergen bij aanmaak schermafdruk.</translation>
+ </message>
+ <message>
+ <source>Periodically check for updates.</source>
+ <translation type="obsolete">Automatisch &amp;controleren voor updates.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="743"/>
+ <source>&amp;Magnify around the mouse in Area mode.</source>
+ <translation>Vergr&amp;ootglas tonen bij schermafdruk van gebied.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="661"/>
+ <source>&amp;Language:</source>
+ <translation>&amp;Taal:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="678"/>
+ <source>Click here to go to the Lightscreen homepage to learn more about translations.</source>
+ <translation>Klik hier om de website van Lightscreen te bezoeken om meer te weten te komen over vertalingen.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="681"/>
+ <source>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;More information..&lt;/a&gt;</source>
+ <translation>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;Meer informatie.&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="617"/>
+ <source>&amp;Notify with:</source>
+ <translation>&amp;Notificeer met:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="24"/>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="627"/>
+ <source>Shows a completion message once the screenshot is saved, clicking this message takes you to the directory where the screenshot was saved.</source>
+ <translation>Toont een bericht wanneer de schermafdruk is opgeslagen. Als u op dit bericht klikt, dan wordt de map geöpend waarin de schermafdruk werd opgeslagen.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="630"/>
+ <source>Tray icon Popup</source>
+ <translation>Bericht bij systeemvakpictogram</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="637"/>
+ <source>&amp;Sound cue</source>
+ <translation>Gel&amp;uidsnotificatie</translation>
+ </message>
+ <message>
+ <source>Screenshot &amp;Quality:</source>
+ <translation type="obsolete">&amp;Kwaliteit van de schermafdruk:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="216"/>
+ <source>This slider goes from 0 to 100. 100 being the highest quality and 0 the lowest.&lt;br&gt;
+Quality is related to file size and of course to readability and overall quality of the image.</source>
+ <translation>Deze schuifbalk gaat van 0 (laagst) tot 100 (hoogst).&lt;br&gt;
+De kwaliteit heeft invloed op de bestandsgrootte en de duidelijkheid van de schermafdruk.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="246"/>
+ <source>100</source>
+ <translation>100</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="258"/>
+ <source>%</source>
+ <translation>%</translation>
+ </message>
+ <message>
+ <source>&amp;Advanced</source>
+ <translation type="obsolete">&amp;Geavanceerd</translation>
+ </message>
+ <message>
+ <source>Choose where and how to &amp;save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="obsolete">Steeds &quot;&amp;Opslaan als&quot;-venster tonen.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="722"/>
+ <source>&amp;Copy the screenshot to the clipboard.</source>
+ <translation>Schermafdruk &amp;kopiëren naar het klipbord.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="736"/>
+ <source>Inc&amp;lude the cursor in the screenshot.</source>
+ <translation>Cursor op&amp;nemen in de schermafdruk.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="729"/>
+ <source>&amp;Grab only the current monitor.</source>
+ <translation>&amp;Enkel schermafdruk maken op huidige beeldscherm.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="750"/>
+ <source>Opens a new process called OptiPNG which dramatically reduces the file size.</source>
+ <translation>Dit opent een nieuw proces &quot;OptiPNG&quot; dat de bestandsgrootte drastisch reduceert.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="753"/>
+ <source>O&amp;ptimize PNG screenshots.</source>
+ <translation>Schermafdrukken in &amp;PNG-formaat optimaliseren.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="605"/>
+ <source>Warn when hiding without a tra&amp;y icon.</source>
+ <translation>&amp;Waarschuwen bij verbergen zonder pictogram in systeemvak.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="767"/>
+ <source>Snap area screenshots automatically (no resizing).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="832"/>
+ <source>Screenshot Previews</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="912"/>
+ <source>Top Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="917"/>
+ <source>Top Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="922"/>
+ <source>Bottom Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="927"/>
+ <source>Bottom Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="948"/>
+ <source>Auto-close after</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1011"/>
+ <source>Updater</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1020"/>
+ <source>Check for updates regularly.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1040"/>
+ <source>Chec&amp;k Updates Now</source>
+ <translation>&amp;Controleren voor updates</translation>
+ </message>
+ <message>
+ <source>About Lightscreen</source>
+ <translation type="obsolete">Over &amp;Lightscreen</translation>
+ </message>
+</context>
+<context>
+ <name>PreviewDialog</name>
+ <message>
+ <location filename="../dialogs/previewdialog.cpp" line="308"/>
+ <source>Screenshot Preview: Closing in %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Screenshot</name>
+ <message>
+ <location filename="../tools/screenshot.cpp" line="272"/>
+ <source>Save as..</source>
+ <translation>Opslaan als...</translation>
+ </message>
+</context>
+<context>
+ <name>ScreenshotDialog</name>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="18"/>
+ <source>Lightscreen Screenshot Viewer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="20"/>
+ <source>You can zoom using the mouse wheel while holding the CTRL key. To return to the default zoom (100%) press &quot;Ctrl-0&quot;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>UpdaterDialog</name>
+ <message>
+ <source>Cancel</source>
+ <translation type="obsolete">Annuleren</translation>
+ </message>
+ <message>
+ <source>Updater - Lightscreen</source>
+ <translation type="obsolete">Updates</translation>
+ </message>
+ <message>
+ <source>Checking for updates</source>
+ <translation type="obsolete">Controleren voor updates</translation>
+ </message>
+ <message>
+ <source>There&apos;s a new version available,&lt;br&gt; please see &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;the Lighscreen website&lt;/a&gt;.</source>
+ <translation type="obsolete">Er is een nieuwe versie beschikbaar;&lt;br&gt; kijk op de &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;website van Lightscreen&lt;/a&gt;.</translation>
+ </message>
+ <message>
+ <source>No new versions available</source>
+ <translation type="obsolete">Geen nieuwe versie beschikbaar</translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="obsolete">Sluiten</translation>
+ </message>
+</context>
+<context>
+ <name>WindowPicker</name>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="24"/>
+ <source>Lightscreen Window Picker</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="26"/>
+ <source>Grab the picker by clicking and holding down the mouse button, then drag it to the window of your choice and release it to capture.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="41"/>
+ <source> - Start dragging to select windows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="50"/>
+ <source>Close</source>
+ <translation type="unfinished">Sluiten</translation>
+ </message>
+</context>
+</TS>
diff --git a/translations/italiano.qm b/translations/italiano.qm
new file mode 100644
index 0000000..87e51f4
Binary files /dev/null and b/translations/italiano.qm differ
diff --git a/translations/italiano.ts b/translations/italiano.ts
new file mode 100644
index 0000000..7ff0eae
--- /dev/null
+++ b/translations/italiano.ts
@@ -0,0 +1,899 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="it_IT">
+<context>
+ <name>AboutDialog</name>
+ <message>
+ <source>Version %1</source>
+ <translation type="obsolete">Versione %1</translation>
+ </message>
+</context>
+<context>
+ <name>AboutDialogClass</name>
+ <message>
+ <source>About - Lightscreen</source>
+ <translation type="obsolete">Informazioni su - Lightscreen</translation>
+ </message>
+ <message>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/b&gt;.</source>
+ <translation type="obsolete">Lightscreen è un semplice tool per creare screenshot. creato per essere personalizzabile e leggero.&lt;br&gt;&lt;br&gt;
+Creato da &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, usando il &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; per l&apos;interfaccia grafica.&lt;br&gt;&lt;br&gt;
+Rilasciato sotto la &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/b&gt;.</translation>
+ </message>
+ <message>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="obsolete">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visita la pagina del progetto su Sourceforge&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visita l&apos;home page di Lightscreen&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;i&gt;Tradotto da Sum90&lt;/i&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>AreaDialog</name>
+ <message>
+ <location filename="../dialogs/areadialog.cpp" line="127"/>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="unfinished">Lightscreen modalità area dello schermo:
+Usa il mouse per disegnare un rettangolo per lo screenshot o esci usando
+qualsiasi tato o usando il tasto destro o centrale del mouse.</translation>
+ </message>
+</context>
+<context>
+ <name>AreaSelector</name>
+ <message>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="obsolete">Lightscreen modalità area dello schermo:
+Usa il mouse per disegnare un rettangolo per lo screenshot o esci usando
+qualsiasi tato o usando il tasto destro o centrale del mouse.</translation>
+ </message>
+</context>
+<context>
+ <name>HotkeyWidget</name>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="15"/>
+ <source>Click to select hotkey...</source>
+ <translation>Clicca per selezionare la scorciatoia...</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="47"/>
+ <source>Type your hotkey</source>
+ <translation>Inserisci la scorciatoia</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="56"/>
+ <source>Invalid hotkey</source>
+ <translation>Scorciatoia non valida</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindow</name>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="97"/>
+ <location filename="../lightscreenwindow.cpp" line="258"/>
+ <location filename="../lightscreenwindow.cpp" line="482"/>
+ <location filename="../lightscreenwindow.cpp" line="682"/>
+ <source>Lightscreen</source>
+ <translation>Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="98"/>
+ <source>You have chosen to hide Lightscreen when there&apos;s no system tray icon, so you will not be able to access the program &lt;b&gt;unless you have selected a hotkey to do so&lt;/b&gt;.&lt;br&gt;What do you want to do?</source>
+ <translation>Hai scelto di nascondere Lightscreen quando non c&apos;è nessuna icona nel tray, perciò non potrai accedere al programma &lt;b&gt;a meno che non hai selezionato una scorciatoia per fare ciò&lt;/b&gt;.&lt;br&gt;Cosa vuoi fare?</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="101"/>
+ <source>Hide but enable tray</source>
+ <translation>Nascondi ma abilita tray</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="103"/>
+ <source>Hide and don&apos;t warn</source>
+ <translation>Nascondi e non avvisare</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="105"/>
+ <source>Just hide</source>
+ <translation>Nascondi</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="385"/>
+ <source>Saved to %1%2</source>
+ <translation>Salvato su %1%2</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="391"/>
+ <source>The screenshot was not taken</source>
+ <translation>Lo screenshot non è stato creato</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="392"/>
+ <source>There was an error or you did not select a valid area.</source>
+ <translation>C&apos;è stato un errore o non hai selezionato un area valida.</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="407"/>
+ <location filename="../lightscreenwindow.cpp" line="612"/>
+ <source>Active &amp;Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="410"/>
+ <location filename="../lightscreenwindow.cpp" line="615"/>
+ <source>&amp;Pick Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="442"/>
+ <source>Sucess!</source>
+ <translation>Successo!</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="447"/>
+ <source>Failed!</source>
+ <translation>Fallito!</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="462"/>
+ <source>Some hotkeys could not be registered, they might already be in use</source>
+ <translation>Alcune scorciatoie non possono essere registrate, potrebbero essere in uso</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="465"/>
+ <source>&lt;br&gt;The failed hotkeys are the following:</source>
+ <translation>&lt;br&gt;Le scorciatoie non accettate sono le seguenti:</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="476"/>
+ <source>&lt;br&gt;The failed hotkey is &lt;b&gt;%1&lt;/b&gt;</source>
+ <translation>&lt;br&gt;La scorciatoia non accettata è &lt;b&gt;%1&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="479"/>
+ <source>&lt;br&gt;&lt;i&gt;What do you want to do?&lt;/i&gt;</source>
+ <translation>&lt;br&gt;&lt;i&gt;Cosa vuoi fare?&lt;/i&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="485"/>
+ <source>Change</source>
+ <translation>Cambia</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="486"/>
+ <source>Disable</source>
+ <translation>Disabilita</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="487"/>
+ <source>Quit</source>
+ <translation>Esci</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="683"/>
+ <source>There&apos;s a new version of Lightscreen available.&lt;br&gt;Would you like to see more information?&lt;br&gt;(&lt;em&gt;You can turn this notification off&lt;/em&gt;)</source>
+ <translation>E&apos; disponibile una nuova versione di Lightscreen.&lt;br&gt;Vuoi vedere più informazioni?&lt;br&gt;(&lt;em&gt;Puoi disattivare questa notifica&lt;/em&gt;)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="687"/>
+ <source>Turn Off</source>
+ <translation>Spegni</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="688"/>
+ <source>Remind Me Later</source>
+ <translation>Ricordamelo più tardi</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="404"/>
+ <location filename="../lightscreenwindow.cpp" line="609"/>
+ <source>&amp;Screen</source>
+ <translation>&amp;Schermo</translation>
+ </message>
+ <message>
+ <source>&amp;Window</source>
+ <translation type="obsolete">&amp;Finestra</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="413"/>
+ <location filename="../lightscreenwindow.cpp" line="618"/>
+ <source>&amp;Area</source>
+ <translation>&amp;Area</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="416"/>
+ <location filename="../lightscreenwindow.cpp" line="632"/>
+ <source>&amp;Go to Folder</source>
+ <translation>&amp;Vai alla cartella</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="606"/>
+ <source>Show&amp;/Hide</source>
+ <translation>Mostra&amp;/Nascondi</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="629"/>
+ <source>View &amp;Options</source>
+ <translation>Visualizza &amp;Opzioni</translation>
+ </message>
+ <message>
+ <source>&amp;About Lightscreen</source>
+ <translation type="obsolete">&amp;Informazioni su Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="635"/>
+ <source>&amp;Quit</source>
+ <translation>&amp;Esci</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindowClass</name>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="14"/>
+ <source>Lightscreen</source>
+ <translation>Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="35"/>
+ <source>Screenshot</source>
+ <translation>Screenshot</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="54"/>
+ <source>Configure Lightscreen</source>
+ <translation>Configura Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="57"/>
+ <source>&amp;Options</source>
+ <translation>&amp;Opzioni</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="76"/>
+ <source>Hide Lightscreen </source>
+ <translation>Nascondi Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="82"/>
+ <source>&amp;Hide</source>
+ <translation>&amp;Nascondi</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="104"/>
+ <source>&amp;Quit</source>
+ <translation>&amp;Esci</translation>
+ </message>
+</context>
+<context>
+ <name>NamingDialog</name>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="14"/>
+ <source>Naming Options - Lightscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="42"/>
+ <source>Leading zeros:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="94"/>
+ <source>Date Format:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="122"/>
+ <source> &lt;a href=&quot;http://lightscreen.sourceforge.net/help/date&quot;&gt;[?]&lt;/a&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="136"/>
+ <source>yyyy-MM-dd</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="141"/>
+ <source>yyyy-MM-dd HH.mm.ss</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="161"/>
+ <source>Flip naming.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OptionsDialog</name>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="67"/>
+ <source>Version %1</source>
+ <translation type="unfinished">Versione %1</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>Hotkey conflict</source>
+ <translation>Conflitto di scorciatoie</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>You have assigned the same hotkeys to more than one action.</source>
+ <translation>Hai assegnato la stessa scorciatoia a più azioni.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>Filename character error</source>
+ <translation>Errore nei caratteri del nome del file</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>The filename can&apos;t contain any of the following characters: ? : \ / * &quot; &lt; &gt; |</source>
+ <translation>Il nome del file non può contenere nessuno dei seguenti caratteri: ? : \ / * &quot; &lt; &gt; |</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>Final Destination</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>You can&apos;t take screenshots unless you enable file saving or the clipboard.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="163"/>
+ <source>Select where you want to save the screenshots</source>
+ <translation>Seleziona dove vuoi salvare gli screenshot</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="181"/>
+ <source>Lightscreen - Options</source>
+ <translation>Lightscreen - Opzioni</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="182"/>
+ <source>Restoring the default options will cause you to lose all of your current configuration.</source>
+ <translation>Ripristinare le opzioni di default causerà la perdita della corrente configurazione.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="185"/>
+ <source>Restore</source>
+ <translation>Ripristina</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="186"/>
+ <source>Don&apos;t Restore</source>
+ <translation>Non ripristinare</translation>
+ </message>
+ <message>
+ <source> (OptiPNG not found)</source>
+ <translation type="obsolete">(OptiPNG non trovato)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="14"/>
+ <source>Options - Lightscreen</source>
+ <translation>Opzioni - Lightscreen</translation>
+ </message>
+ <message>
+ <source>&amp;General</source>
+ <translation type="obsolete">&amp;Generale</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="36"/>
+ <source>File</source>
+ <translation>File</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="54"/>
+ <source>&amp;Directory:</source>
+ <translation>&amp;Cartella:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="94"/>
+ <source>The prefix for the screenshot file</source>
+ <translation>Il prefisso per il file dello screenshot</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="97"/>
+ <source>&amp;Filename:</source>
+ <translation>&amp;Nome file:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="115"/>
+ <source>The prefix will be inserted before the &lt;em&gt;Naming&lt;/em&gt; in the screenshot file and it is usually used to distinguish files. It can be left blank.</source>
+ <translation>Il prefisso verrà inserito prima del &lt;em&gt;Nome&lt;/em&gt; nel file nome del file dello screenshot ed è solitamente usato per distinguere i file. Può essere lasciato vuoto.</translation>
+ </message>
+ <message>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3.
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp) that corresponds with the current time.
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss.</source>
+ <translation type="obsolete">Il nome è inseito dopo il prefisso ed è quello che fa ogni file univoco per evitare sovrascritture.&lt;br /&gt;
+&lt;b&gt;Numerico&lt;/b&gt;: inserisce un numero in sequenza, 1, 2, 3.
+&lt;b&gt;Timestamp&lt;/b&gt;: inserisce un numero (un timestamp Unix) che corrisponde al tempo corrent.
+&lt;b&gt;Data&lt;/b&gt;: inserisce l&apos;ora e la data corrente, nella forma di gg-MM-aaaa hh.mm.ss.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="132"/>
+ <source>(number)</source>
+ <translation>(numero)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="142"/>
+ <source>(timestamp)</source>
+ <translation>(timestamp)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="137"/>
+ <source>(date)</source>
+ <translation>(data)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="24"/>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="168"/>
+ <source>The file format for the screenshot</source>
+ <translation>Il formato del file dello screenshot</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="171"/>
+ <source>F&amp;ormat:</source>
+ <translation>F&amp;ormato:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="185"/>
+ <source>PNG</source>
+ <translation>PNG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="190"/>
+ <source>JPG</source>
+ <translation>JPG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="195"/>
+ <source>BMP</source>
+ <translation>BMP</translation>
+ </message>
+ <message>
+ <source>TIFF</source>
+ <translation type="obsolete">TIFF</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="776"/>
+ <source>D&amp;elay:</source>
+ <translation>&amp;Ritardo:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="789"/>
+ <source>Selecting anything other than 0 in this option will cause the program to &lt;b&gt;wait&lt;/b&gt; that amount of seconds before taking the screenshot.</source>
+ <translation>Selezionando qualsiasi numero oltre lo 0 &lt;b&gt;fermerà&lt;/b&gt; il programma per lo stesso numero di secondi prima di fare lo screenshot.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="792"/>
+ <source>none</source>
+ <translation>niente</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="801"/>
+ <location filename="../dialogs/optionsdialog.ui" line="955"/>
+ <source> seconds</source>
+ <translation> secondi</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="318"/>
+ <source>&amp;Run Lightscreen at system startup.</source>
+ <translation>Esegui &amp;Lightscreen all&apos;avvio del sistema.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="346"/>
+ <source>H&amp;ide the main window.</source>
+ <translation>Nas&amp;condi la finestra principale.</translation>
+ </message>
+ <message>
+ <source>&amp;Hotkeys</source>
+ <translation type="obsolete">&amp;Scorciatoie</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="386"/>
+ <source>Capture the screen</source>
+ <translation>Cattura lo schermo</translation>
+ </message>
+ <message>
+ <source>Capture a window</source>
+ <translation type="obsolete">Cattura una finestra</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="441"/>
+ <source>Capture a screen area</source>
+ <translation>Cattura un&apos;area dello schermo</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="504"/>
+ <source>Open the directory</source>
+ <translation>Apri la cartella</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="488"/>
+ <source>Open the program window</source>
+ <translation>Apri la finestra del programma</translation>
+ </message>
+ <message>
+ <source>&amp;Options</source>
+ <translation type="obsolete">&amp;Opzioni</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="591"/>
+ <source>Sho&amp;w a system tray icon.</source>
+ <translation>&amp;Mostra l&apos;icona nel tray.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="598"/>
+ <source>&amp;Hide Lightscreen while taking a screenshot.</source>
+ <translation>&amp;Nascondi Lightscreen mentre scatta lo screenshot.</translation>
+ </message>
+ <message>
+ <source>Periodically check for updates.</source>
+ <translation type="obsolete">Controlla periodicamente aggiornamenti.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="743"/>
+ <source>&amp;Magnify around the mouse in Area mode.</source>
+ <translation>&amp;Ingrandisci attorno il mouse nella modalità area.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="661"/>
+ <source>&amp;Language:</source>
+ <translation>&amp;Lingua:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="678"/>
+ <source>Click here to go to the Lightscreen homepage to learn more about translations.</source>
+ <translation>Clicca qui per andare nella Home page di Lightscreen e sapere di più sulla traduzione.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="681"/>
+ <source>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;More information..&lt;/a&gt;</source>
+ <translation>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;Maggiori informazioni..&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="617"/>
+ <source>&amp;Notify with:</source>
+ <translation>&amp;Notifica con:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="267"/>
+ <source>&lt;i&gt;Preview&lt;/i&gt;:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="203"/>
+ <source>&amp;Quality:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="122"/>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3..&lt;br /&gt;
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date, in the form of dd-MM-yyyy..&lt;br /&gt;
+&lt;b&gt;Date &amp;amp; Time&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss..&lt;br /&gt;
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp, the number of seconds passed since 1970-1-1 00:00:00) that corresponds with the current time.&lt;br /&gt;
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="147"/>
+ <source>(none)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="306"/>
+ <source>System Startup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="359"/>
+ <source>Hotkeys</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="365"/>
+ <source>Captures</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="409"/>
+ <source>Capture the current window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="425"/>
+ <source>Capture a chosen window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="467"/>
+ <source>Lightscreen Control</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="531"/>
+ <source>Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="579"/>
+ <source>Interface</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="627"/>
+ <source>Shows a completion message once the screenshot is saved, clicking this message takes you to the directory where the screenshot was saved.</source>
+ <translation>Mostra un messaggio di completamento quando lo screenshot è salvato, cliccando su questo messagio si aprirà la cartella in cui lo screenshot è salvato.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="630"/>
+ <source>Tray icon Popup</source>
+ <translation>Popup Icona Tray</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="637"/>
+ <source>&amp;Sound cue</source>
+ <translation>&amp;Suono</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="760"/>
+ <source>Replace screenshots when there&apos;s an existing file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="767"/>
+ <source>Snap area screenshots automatically (no resizing).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="847"/>
+ <source>Maximum Size:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="898"/>
+ <source>Position:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="968"/>
+ <source> and </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="982"/>
+ <source>save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="987"/>
+ <source>cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1055"/>
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1061"/>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
+Special thanks goes to the &lt;a href=&quot;http://lightscreen.sourceforge.net/about&quot;&gt;Donators and Translators&lt;/a&gt;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1090"/>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="unfinished">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visita la pagina del progetto su Sourceforge&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visita l&apos;home page di Lightscreen&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;i&gt;Tradotto da Sum90&lt;/i&gt;</translation>
+ </message>
+ <message>
+ <source>Screenshot &amp;Quality:</source>
+ <translation type="obsolete">&amp;Qualità screenshot:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="216"/>
+ <source>This slider goes from 0 to 100. 100 being the highest quality and 0 the lowest.&lt;br&gt;
+Quality is related to file size and of course to readability and overall quality of the image.</source>
+ <translation>Lo slider va da 0 a 100. 100 è la massima qualità e 0 la più bassa.&lt;bt&gt;
+La qualità determina la grandezza del file e naturalmente la leggibilità e la qualità generale dell&apos;imagine.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="246"/>
+ <source>100</source>
+ <translation>100</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="258"/>
+ <source>%</source>
+ <translation>%</translation>
+ </message>
+ <message>
+ <source>&amp;Advanced</source>
+ <translation type="obsolete">&amp;Avanzate</translation>
+ </message>
+ <message>
+ <source>Choose where and how to &amp;save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="obsolete">Scegli dove e come &amp;salvare ogni screenshot (&quot;&amp;Salva come&quot;).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="722"/>
+ <source>&amp;Copy the screenshot to the clipboard.</source>
+ <translation>&amp;Copia lo screenshot negli appunti.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="736"/>
+ <source>Inc&amp;lude the cursor in the screenshot.</source>
+ <translation>Inc&amp;ludi il cursore nello screenshot.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="706"/>
+ <source>Screenshots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="715"/>
+ <source>Choose where to save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="729"/>
+ <source>&amp;Grab only the current monitor.</source>
+ <translation>&amp;Scatta solo nel monitor corrente.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="750"/>
+ <source>Opens a new process called OptiPNG which dramatically reduces the file size.</source>
+ <translation>Apre un nuovo processo chiamato OptiPNG che riduce di molto la grandezza del file.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="753"/>
+ <source>O&amp;ptimize PNG screenshots.</source>
+ <translation>Ot&amp;timizza screenshot PNG.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="605"/>
+ <source>Warn when hiding without a tra&amp;y icon.</source>
+ <translation>Avvisa quando nascondi senza icona tra&amp;y.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="832"/>
+ <source>Screenshot Previews</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="912"/>
+ <source>Top Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="917"/>
+ <source>Top Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="922"/>
+ <source>Bottom Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="927"/>
+ <source>Bottom Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="948"/>
+ <source>Auto-close after</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1011"/>
+ <source>Updater</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1020"/>
+ <source>Check for updates regularly.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1040"/>
+ <source>Chec&amp;k Updates Now</source>
+ <translation>Con&amp;trolla aggiornamenti ora</translation>
+ </message>
+ <message>
+ <source>About Lightscreen</source>
+ <translation type="obsolete">Infomazioni su Lightscreen</translation>
+ </message>
+</context>
+<context>
+ <name>PreviewDialog</name>
+ <message>
+ <location filename="../dialogs/previewdialog.cpp" line="308"/>
+ <source>Screenshot Preview: Closing in %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Screenshot</name>
+ <message>
+ <location filename="../tools/screenshot.cpp" line="272"/>
+ <source>Save as..</source>
+ <translation>Salva come..</translation>
+ </message>
+</context>
+<context>
+ <name>ScreenshotDialog</name>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="18"/>
+ <source>Lightscreen Screenshot Viewer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="20"/>
+ <source>You can zoom using the mouse wheel while holding the CTRL key. To return to the default zoom (100%) press &quot;Ctrl-0&quot;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>UpdaterDialog</name>
+ <message>
+ <source>Cancel</source>
+ <translation type="obsolete">Annulla</translation>
+ </message>
+ <message>
+ <source>Updater - Lightscreen</source>
+ <translation type="obsolete">Aggiornamento - Lightscreen</translation>
+ </message>
+ <message>
+ <source>Checking for updates</source>
+ <translation type="obsolete">Controlla aggiornamenti</translation>
+ </message>
+ <message>
+ <source>There&apos;s a new version available,&lt;br&gt; please see &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;the Lighscreen website&lt;/a&gt;.</source>
+ <translation type="obsolete">C&apos;è una nuova versione disponibile,&lt;br&gt;per favore controlla &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;il sito web di Lightscreen&lt;/a&gt;.</translation>
+ </message>
+ <message>
+ <source>No new versions available</source>
+ <translation type="obsolete">Nessuna nuova versione disponibile</translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="obsolete">Chiudi</translation>
+ </message>
+</context>
+<context>
+ <name>WindowPicker</name>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="24"/>
+ <source>Lightscreen Window Picker</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="26"/>
+ <source>Grab the picker by clicking and holding down the mouse button, then drag it to the window of your choice and release it to capture.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="41"/>
+ <source> - Start dragging to select windows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="50"/>
+ <source>Close</source>
+ <translation type="unfinished">Chiudi</translation>
+ </message>
+</context>
+</TS>
diff --git a/translations/japanese.qm b/translations/japanese.qm
new file mode 100644
index 0000000..f012ae4
Binary files /dev/null and b/translations/japanese.qm differ
diff --git a/translations/japanese.ts b/translations/japanese.ts
new file mode 100644
index 0000000..9708409
--- /dev/null
+++ b/translations/japanese.ts
@@ -0,0 +1,898 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ja_JP">
+<context>
+ <name>AboutDialog</name>
+ <message>
+ <source>Version %1</source>
+ <translation type="obsolete">バージョン %1</translation>
+ </message>
+</context>
+<context>
+ <name>AboutDialogClass</name>
+ <message>
+ <source>About - Lightscreen</source>
+ <translation type="obsolete">Lightscreen について</translation>
+ </message>
+ <message>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/b&gt;.</source>
+ <translation type="obsolete">Lightscreen はスクリーンショットを採得するためのシンプルなツールです。 &lt;br&gt;&lt;br&gt;
+軽い動作とユーザーの好みに合わせたオプション設定を目指し、&lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt; によって &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; をもちいて作成されました。&lt;br&gt;&lt;br&gt;
+Lightscreen は &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/a&gt; にもとづいてリリースされています。.</translation>
+ </message>
+ <message>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="obsolete">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;SourceForge プロジェクト ページへ&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Lightscreen のホーム ページへ&lt;/a&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>AreaDialog</name>
+ <message>
+ <location filename="../dialogs/areadialog.cpp" line="127"/>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="unfinished">Lightscreen 指定範囲のキャプチャ モード:
+マウス ドラッグでキャプチャする範囲を指定してください。マウスの右か、中ボタンのクリック、
+または、キーボードの好きなキーを押せばこのモードを中止します。
+Ctrl キーを押下しながら矩形範囲を描きます。.</translation>
+ </message>
+</context>
+<context>
+ <name>AreaSelector</name>
+ <message>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="obsolete">Lightscreen 指定範囲のキャプチャ モード:
+マウス ドラッグでキャプチャする範囲を指定してください。マウスの右か、中ボタンのクリック、
+または、キーボードの好きなキーを押せばこのモードを中止します。
+Ctrl キーを押下しながら矩形範囲を描きます。.</translation>
+ </message>
+</context>
+<context>
+ <name>HotkeyWidget</name>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="15"/>
+ <source>Click to select hotkey...</source>
+ <translation>ボタンのクリックでホットキーの変更...</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="47"/>
+ <source>Type your hotkey</source>
+ <translation>ホットキーの指定</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="56"/>
+ <source>Invalid hotkey</source>
+ <translation>無効なホットキー</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindow</name>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="97"/>
+ <location filename="../lightscreenwindow.cpp" line="258"/>
+ <location filename="../lightscreenwindow.cpp" line="482"/>
+ <location filename="../lightscreenwindow.cpp" line="682"/>
+ <source>Lightscreen</source>
+ <translation>Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="98"/>
+ <source>You have chosen to hide Lightscreen when there&apos;s no system tray icon, so you will not be able to access the program &lt;b&gt;unless you have selected a hotkey to do so&lt;/b&gt;.&lt;br&gt;What do you want to do?</source>
+ <translation>トレイ アイコンを表示せずにウィンドウを隠すと &lt;b&gt;ホットキー&lt;/b&gt; 以外では Lightscreen を操作できなくなります。&lt;br&gt;どうしますか ?</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="101"/>
+ <source>Hide but enable tray</source>
+ <translation>トレイへ隠す</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="103"/>
+ <source>Hide and don&apos;t warn</source>
+ <translation>以降、確認せず隠す</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="105"/>
+ <source>Just hide</source>
+ <translation>今回は隠す</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="385"/>
+ <source>Saved to %1%2</source>
+ <translation type="unfinished">%1%2 へ保存しました</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="391"/>
+ <source>The screenshot was not taken</source>
+ <translation>キャプチャできませんでした</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="392"/>
+ <source>There was an error or you did not select a valid area.</source>
+ <translation>エラー、あるいは無効な範囲指定です。</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="407"/>
+ <location filename="../lightscreenwindow.cpp" line="612"/>
+ <source>Active &amp;Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="410"/>
+ <location filename="../lightscreenwindow.cpp" line="615"/>
+ <source>&amp;Pick Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="442"/>
+ <source>Sucess!</source>
+ <translation type="unfinished">成功 !</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="447"/>
+ <source>Failed!</source>
+ <translation type="unfinished">失敗 !</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="462"/>
+ <source>Some hotkeys could not be registered, they might already be in use</source>
+ <translation>既にホットキーに使用されている使用されているキーは指定できません</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="465"/>
+ <source>&lt;br&gt;The failed hotkeys are the following:</source>
+ <translation>&lt;br&gt;無効なホットキー:</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="476"/>
+ <source>&lt;br&gt;The failed hotkey is &lt;b&gt;%1&lt;/b&gt;</source>
+ <translation>&lt;br&gt;無効なホットキー:&lt;b&gt;%1&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="479"/>
+ <source>&lt;br&gt;&lt;i&gt;What do you want to do?&lt;/i&gt;</source>
+ <translation>&lt;br&gt;&lt;i&gt;どうしますか?&lt;/i&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="485"/>
+ <source>Change</source>
+ <translation>変更</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="486"/>
+ <source>Disable</source>
+ <translation>無効化</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="487"/>
+ <source>Quit</source>
+ <translation>終了</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="683"/>
+ <source>There&apos;s a new version of Lightscreen available.&lt;br&gt;Would you like to see more information?&lt;br&gt;(&lt;em&gt;You can turn this notification off&lt;/em&gt;)</source>
+ <translation>Lightscreen 新たなバージョンがリリースされています。&lt;br&gt;サイトに接続して情報をチェックしますか ?&lt;br&gt;(&lt;em&gt;この通知をオフにすることもできます。&lt;/em&gt;)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="687"/>
+ <source>Turn Off</source>
+ <translation>通知しない</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="688"/>
+ <source>Remind Me Later</source>
+ <translation>あとで通知</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="404"/>
+ <location filename="../lightscreenwindow.cpp" line="609"/>
+ <source>&amp;Screen</source>
+ <translation>画面全体(&amp;S)</translation>
+ </message>
+ <message>
+ <source>&amp;Window</source>
+ <translation type="obsolete">アクティブ ウィンドウ(&amp;W)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="413"/>
+ <location filename="../lightscreenwindow.cpp" line="618"/>
+ <source>&amp;Area</source>
+ <translation>指定範囲(&amp;A)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="416"/>
+ <location filename="../lightscreenwindow.cpp" line="632"/>
+ <source>&amp;Go to Folder</source>
+ <translation>保存フォルダを開く(&amp;G)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="606"/>
+ <source>Show&amp;/Hide</source>
+ <translation>表示/隠す(&amp;H)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="629"/>
+ <source>View &amp;Options</source>
+ <translation>オプションの表示(&amp;O)</translation>
+ </message>
+ <message>
+ <source>&amp;About Lightscreen</source>
+ <translation type="obsolete">Lightscreen について(&amp;A)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="635"/>
+ <source>&amp;Quit</source>
+ <translation>終了(&amp;X)</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindowClass</name>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="14"/>
+ <source>Lightscreen</source>
+ <translation>Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="35"/>
+ <source>Screenshot</source>
+ <translation>キャプチャー</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="54"/>
+ <source>Configure Lightscreen</source>
+ <translation>Lightscreen の設定</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="57"/>
+ <source>&amp;Options</source>
+ <translation>オプション(&amp;O)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="76"/>
+ <source>Hide Lightscreen </source>
+ <translation>Lightscreen を隠す</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="82"/>
+ <source>&amp;Hide</source>
+ <translation>隠す(&amp;H)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="104"/>
+ <source>&amp;Quit</source>
+ <translation>終了(&amp;X)</translation>
+ </message>
+</context>
+<context>
+ <name>NamingDialog</name>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="14"/>
+ <source>Naming Options - Lightscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="42"/>
+ <source>Leading zeros:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="94"/>
+ <source>Date Format:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="122"/>
+ <source> &lt;a href=&quot;http://lightscreen.sourceforge.net/help/date&quot;&gt;[?]&lt;/a&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="136"/>
+ <source>yyyy-MM-dd</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="141"/>
+ <source>yyyy-MM-dd HH.mm.ss</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="161"/>
+ <source>Flip naming.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OptionsDialog</name>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="67"/>
+ <source>Version %1</source>
+ <translation type="unfinished">バージョン %1</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>Hotkey conflict</source>
+ <translation>ホットキーの重複</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>You have assigned the same hotkeys to more than one action.</source>
+ <translation>同じキーが違う操作に重複指定されています。</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>Filename character error</source>
+ <translation>ファイル名のエラー</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>The filename can&apos;t contain any of the following characters: ? : \ / * &quot; &lt; &gt; |</source>
+ <translation>以下の文字はファイル名に使用できません: ? : \ / * &quot; &lt; &gt; |</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>Final Destination</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>You can&apos;t take screenshots unless you enable file saving or the clipboard.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="163"/>
+ <source>Select where you want to save the screenshots</source>
+ <translation>キャプチャ画像の保存先の選択</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="181"/>
+ <source>Lightscreen - Options</source>
+ <translation>Lightscreen - オプション</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="182"/>
+ <source>Restoring the default options will cause you to lose all of your current configuration.</source>
+ <translation>現在の設定をクリアして初期状態に戻します。</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="185"/>
+ <source>Restore</source>
+ <translation>復元</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="186"/>
+ <source>Don&apos;t Restore</source>
+ <translation>復元しない</translation>
+ </message>
+ <message>
+ <source> (OptiPNG not found)</source>
+ <translation type="obsolete"> (OptiPNG not found)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="14"/>
+ <source>Options - Lightscreen</source>
+ <translation>オプション - Lightscreen</translation>
+ </message>
+ <message>
+ <source>&amp;General</source>
+ <translation type="obsolete">全般(&amp;G)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="36"/>
+ <source>File</source>
+ <translation>ファイル</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="54"/>
+ <source>&amp;Directory:</source>
+ <translation>ディレクトリ(&amp;D):</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="94"/>
+ <source>The prefix for the screenshot file</source>
+ <translation>保存ファイル名のプリフィクス</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="97"/>
+ <source>&amp;Filename:</source>
+ <translation>ファイル名(&amp;F):</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="115"/>
+ <source>The prefix will be inserted before the &lt;em&gt;Naming&lt;/em&gt; in the screenshot file and it is usually used to distinguish files. It can be left blank.</source>
+ <translation>プリフィクスは画像の保存時に&lt;em&gt;ファイル名に常に使用&lt;/em&gt;される語句です。空欄にしておくこともできます。</translation>
+ </message>
+ <message>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3.
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp) that corresponds with the current time.
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss.</source>
+ <translation type="obsolete">画像ファイルの保存時に上書きを防止するために付加される識別可能な一意の数字です。&lt;br /&gt;
+&lt;b&gt;連番&lt;/b&gt;:: 連番を使用します。1, 2, 3&lt;/span&gt;.
+&lt;b&gt;タイムスタンプ&lt;/b&gt;: Unix タイムスタンプ形式の 現在時刻を使用します。
+&lt;b&gt;日時&lt;/b&gt;: 次の形式の現在時間を使用します。: dd-MM-yyyy hh.mm.ss.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="132"/>
+ <source>(number)</source>
+ <translation>(連番)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="137"/>
+ <source>(date)</source>
+ <translation>(日時)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="142"/>
+ <source>(timestamp)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="168"/>
+ <source>The file format for the screenshot</source>
+ <translation>画像ファイルの保存フォーマット</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="171"/>
+ <source>F&amp;ormat:</source>
+ <translation>フォーマット(&amp;O):</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="185"/>
+ <source>PNG</source>
+ <translation>PNG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="190"/>
+ <source>JPG</source>
+ <translation>JPG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="195"/>
+ <source>BMP</source>
+ <translation>BMP</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="267"/>
+ <source>&lt;i&gt;Preview&lt;/i&gt;:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="203"/>
+ <source>&amp;Quality:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="122"/>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3..&lt;br /&gt;
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date, in the form of dd-MM-yyyy..&lt;br /&gt;
+&lt;b&gt;Date &amp;amp; Time&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss..&lt;br /&gt;
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp, the number of seconds passed since 1970-1-1 00:00:00) that corresponds with the current time.&lt;br /&gt;
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="147"/>
+ <source>(none)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="306"/>
+ <source>System Startup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="359"/>
+ <source>Hotkeys</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="365"/>
+ <source>Captures</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="409"/>
+ <source>Capture the current window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="425"/>
+ <source>Capture a chosen window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="467"/>
+ <source>Lightscreen Control</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="531"/>
+ <source>Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="579"/>
+ <source>Interface</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="706"/>
+ <source>Screenshots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="715"/>
+ <source>Choose where to save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="760"/>
+ <source>Replace screenshots when there&apos;s an existing file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="776"/>
+ <source>D&amp;elay:</source>
+ <translation>遅延(&amp;E):</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="789"/>
+ <source>Selecting anything other than 0 in this option will cause the program to &lt;b&gt;wait&lt;/b&gt; that amount of seconds before taking the screenshot.</source>
+ <translation>プログラムがキャプチャーを行うときの&lt;b&gt;待機時間&lt;/b&gt;(秒)を設定します。0 より大きい数値で指定してください。</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="792"/>
+ <source>none</source>
+ <translation>なし</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="801"/>
+ <location filename="../dialogs/optionsdialog.ui" line="955"/>
+ <source> seconds</source>
+ <translation> 秒</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="847"/>
+ <source>Maximum Size:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="898"/>
+ <source>Position:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="968"/>
+ <source> and </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="982"/>
+ <source>save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="987"/>
+ <source>cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1055"/>
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1061"/>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
+Special thanks goes to the &lt;a href=&quot;http://lightscreen.sourceforge.net/about&quot;&gt;Donators and Translators&lt;/a&gt;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1090"/>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="unfinished">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;SourceForge プロジェクト ページへ&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Lightscreen のホーム ページへ&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="318"/>
+ <source>&amp;Run Lightscreen at system startup.</source>
+ <translation>Lightscreen を Windows のスタートアップに登録(&amp;R).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="346"/>
+ <source>H&amp;ide the main window.</source>
+ <translation>メイン ウィンドウを表示しない(&amp;I).</translation>
+ </message>
+ <message>
+ <source>&amp;Hotkeys</source>
+ <translation type="obsolete">ホットキー(&amp;H)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="386"/>
+ <source>Capture the screen</source>
+ <translation>画面全体のキャプチャー</translation>
+ </message>
+ <message>
+ <source>Capture a window</source>
+ <translation type="obsolete">アクティブ ウィンドウのキャプチャー</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="441"/>
+ <source>Capture a screen area</source>
+ <translation>指定範囲のキャプチャー</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="504"/>
+ <source>Open the directory</source>
+ <translation>画像の保存先を開く</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="488"/>
+ <source>Open the program window</source>
+ <translation>プログラムのウィンドウを表示</translation>
+ </message>
+ <message>
+ <source>&amp;Options</source>
+ <translation type="obsolete">オプション(&amp;O)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="591"/>
+ <source>Sho&amp;w a system tray icon.</source>
+ <translation>システム トレイにアイコンを表示(&amp;W).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="598"/>
+ <source>&amp;Hide Lightscreen while taking a screenshot.</source>
+ <translation>キャプチャー後に Lightscreen を隠す(&amp;H).</translation>
+ </message>
+ <message>
+ <source>Periodically check for updates.</source>
+ <translation type="obsolete">一定期間ごとにアップデートをチェック.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="743"/>
+ <source>&amp;Magnify around the mouse in Area mode.</source>
+ <translation>指定範囲モードでカーソルの周辺を拡大(&amp;M).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="661"/>
+ <source>&amp;Language:</source>
+ <translation>使用言語(&amp;L):</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="678"/>
+ <source>Click here to go to the Lightscreen homepage to learn more about translations.</source>
+ <translation>ここをクリックして、Lightscreen のホームページで翻訳情報を確認。</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="681"/>
+ <source>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;More information..&lt;/a&gt;</source>
+ <translation>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;情報をチェック..&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="617"/>
+ <source>&amp;Notify with:</source>
+ <translation>通知方法(&amp;N):</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="24"/>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="627"/>
+ <source>Shows a completion message once the screenshot is saved, clicking this message takes you to the directory where the screenshot was saved.</source>
+ <translation>スクリーンショットの保存後にメッセージが表示されます。メッセージ バルーンをクリックすれば保存先を開くことができます。</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="630"/>
+ <source>Tray icon Popup</source>
+ <translation>トレイにポップアップ</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="637"/>
+ <source>&amp;Sound cue</source>
+ <translation>通知音(&amp;S)</translation>
+ </message>
+ <message>
+ <source>Screenshot &amp;Quality:</source>
+ <translation type="obsolete">画像の品質(&amp;Q):</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="216"/>
+ <source>This slider goes from 0 to 100. 100 being the highest quality and 0 the lowest.&lt;br&gt;
+Quality is related to file size and of course to readability and overall quality of the image.</source>
+ <translation>このスライダでキャプチャの品質を変更します。0 から 100 まで。低品質は左へ、高品質は右はへ。&lt;br&gt;
+品質は画像のファイル サイズと見映えに影響を及ぼします。</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="246"/>
+ <source>100</source>
+ <translation>100</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="258"/>
+ <source>%</source>
+ <translation>%</translation>
+ </message>
+ <message>
+ <source>&amp;Advanced</source>
+ <translation type="obsolete">上級オプション(&amp;A)</translation>
+ </message>
+ <message>
+ <source>Choose where and how to &amp;save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="obsolete">スクリーンショットごとに保存先を確認 [名づけて保存] (&amp;S).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="722"/>
+ <source>&amp;Copy the screenshot to the clipboard.</source>
+ <translation>スナップショットをクリップボードにコピー(&amp;C).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="736"/>
+ <source>Inc&amp;lude the cursor in the screenshot.</source>
+ <translation>カーソルもキャプチャーする(&amp;L).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="729"/>
+ <source>&amp;Grab only the current monitor.</source>
+ <translatorcomment>?</translatorcomment>
+ <translation>現在のモニターだけを対象に(&amp;G).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="750"/>
+ <source>Opens a new process called OptiPNG which dramatically reduces the file size.</source>
+ <translation>ファイルサイズを劇的に節約する OptiPNG プロセスを使用する。</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="753"/>
+ <source>O&amp;ptimize PNG screenshots.</source>
+ <translation>最適化 PNG スクリーンショットを使用(&amp;P).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="605"/>
+ <source>Warn when hiding without a tra&amp;y icon.</source>
+ <translation>トレイ アイコンを非表示のままウィンドウを隠そうとしたとき警告(&amp;Y).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="767"/>
+ <source>Snap area screenshots automatically (no resizing).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="832"/>
+ <source>Screenshot Previews</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="912"/>
+ <source>Top Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="917"/>
+ <source>Top Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="922"/>
+ <source>Bottom Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="927"/>
+ <source>Bottom Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="948"/>
+ <source>Auto-close after</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1011"/>
+ <source>Updater</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1020"/>
+ <source>Check for updates regularly.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1040"/>
+ <source>Chec&amp;k Updates Now</source>
+ <translation>アップデート チェック(&amp;K)</translation>
+ </message>
+ <message>
+ <source>About Lightscreen</source>
+ <translation type="obsolete">Lightscreen について</translation>
+ </message>
+</context>
+<context>
+ <name>PreviewDialog</name>
+ <message>
+ <location filename="../dialogs/previewdialog.cpp" line="308"/>
+ <source>Screenshot Preview: Closing in %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Screenshot</name>
+ <message>
+ <location filename="../tools/screenshot.cpp" line="272"/>
+ <source>Save as..</source>
+ <translation>名づけて保存..</translation>
+ </message>
+</context>
+<context>
+ <name>ScreenshotDialog</name>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="18"/>
+ <source>Lightscreen Screenshot Viewer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="20"/>
+ <source>You can zoom using the mouse wheel while holding the CTRL key. To return to the default zoom (100%) press &quot;Ctrl-0&quot;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>UpdaterDialog</name>
+ <message>
+ <source>Cancel</source>
+ <translation type="obsolete">キャンセル</translation>
+ </message>
+ <message>
+ <source>Updater - Lightscreen</source>
+ <translation type="obsolete">アップデーター - Lightscreen</translation>
+ </message>
+ <message>
+ <source>Checking for updates</source>
+ <translation type="obsolete">アップデート チェック</translation>
+ </message>
+ <message>
+ <source>There&apos;s a new version available,&lt;br&gt; please see &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;the Lighscreen website&lt;/a&gt;.</source>
+ <translation type="obsolete">新しいバージョンがリリースされています。&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;Lighscreen のウェブサイト&lt;/a&gt;で確認してください。</translation>
+ </message>
+ <message>
+ <source>No new versions available</source>
+ <translation type="obsolete">最新版を使用しています</translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="obsolete">閉じる</translation>
+ </message>
+</context>
+<context>
+ <name>WindowPicker</name>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="24"/>
+ <source>Lightscreen Window Picker</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="26"/>
+ <source>Grab the picker by clicking and holding down the mouse button, then drag it to the window of your choice and release it to capture.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="41"/>
+ <source> - Start dragging to select windows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="50"/>
+ <source>Close</source>
+ <translation type="unfinished">閉じる</translation>
+ </message>
+</context>
+</TS>
diff --git a/translations/polish.qm b/translations/polish.qm
new file mode 100644
index 0000000..e8a8919
Binary files /dev/null and b/translations/polish.qm differ
diff --git a/translations/polish.ts b/translations/polish.ts
new file mode 100644
index 0000000..060894d
--- /dev/null
+++ b/translations/polish.ts
@@ -0,0 +1,904 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="pl_PL">
+<context>
+ <name>AboutDialog</name>
+ <message>
+ <source>Version %1</source>
+ <translation type="obsolete">Wersja %1</translation>
+ </message>
+</context>
+<context>
+ <name>AboutDialogClass</name>
+ <message>
+ <source>About - Lightscreen</source>
+ <translation type="obsolete">O - Lightscreen</translation>
+ </message>
+ <message>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/b&gt;.</source>
+ <translation type="obsolete">Lightscreen jest prostym narzędziem które wykonuje zrzuty ekranu, ma mały rozmiar i łatwo je dostosować.&lt;br&gt;&lt;br&gt;
+Napisane przez &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, wykorzystując &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; dla graficznego interfejsu użytkownika.&lt;br&gt;&lt;br&gt;
+Wydany na &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;Powszechnej Licencji Publicznej GNU&lt;/b&gt;.</translation>
+ </message>
+ <message>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="obsolete">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Odwiedź stronę projektu na Sourceforge&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Odwieź główną stronę Lightscreen&lt;/a&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>AreaDialog</name>
+ <message>
+ <location filename="../dialogs/areadialog.cpp" line="127"/>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="unfinished">Tryb obszaru ekranu Lightscreen:
+Rozciągnij myszką prostokąt dla rzutu ekranu albo zakończ naciskając
+jakikolwiek klawisz lub prawy albo środkowy przycisk myszki.</translation>
+ </message>
+</context>
+<context>
+ <name>AreaSelector</name>
+ <message>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="obsolete">Tryb obszaru ekranu Lightscreen:
+Rozciągnij myszką prostokąt dla rzutu ekranu albo zakończ naciskając
+jakikolwiek klawisz lub prawy albo środkowy przycisk myszki.</translation>
+ </message>
+ <message>
+ <source>%1 x %2 px </source>
+ <translation type="obsolete">%1 x %2 pikseli </translation>
+ </message>
+</context>
+<context>
+ <name>HotkeyWidget</name>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="15"/>
+ <source>Click to select hotkey...</source>
+ <translation>Kliknij aby wybrać klawisz skrótu...</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="47"/>
+ <source>Type your hotkey</source>
+ <translation>Wpisz twój klawisz skrótu</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="56"/>
+ <source>Invalid hotkey</source>
+ <translation>Błąd klawisza skrótu</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindow</name>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="97"/>
+ <location filename="../lightscreenwindow.cpp" line="258"/>
+ <location filename="../lightscreenwindow.cpp" line="482"/>
+ <location filename="../lightscreenwindow.cpp" line="682"/>
+ <source>Lightscreen</source>
+ <translation>Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="98"/>
+ <source>You have chosen to hide Lightscreen when there&apos;s no system tray icon, so you will not be able to access the program &lt;b&gt;unless you have selected a hotkey to do so&lt;/b&gt;.&lt;br&gt;What do you want to do?</source>
+ <translation>Wybrałeś ukrycie programu Lightscreen bez ikony w zasobniku systemowym, dlatego program będzie niedostępny &lt;b&gt;chyba że ustawiłeś dla niego klawisz skrótu&lt;/b&gt;.&lt;br&gt;Czy chcesz to wykonać?</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="101"/>
+ <source>Hide but enable tray</source>
+ <translation>Ukryj ale włącz zasobnik</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="103"/>
+ <source>Hide and don&apos;t warn</source>
+ <translation>Ukryj i nie ostrzegaj</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="105"/>
+ <source>Just hide</source>
+ <translation>Tylko ukryj</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="385"/>
+ <source>Saved to %1%2</source>
+ <translation>Zapisane w %1%2</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="391"/>
+ <source>The screenshot was not taken</source>
+ <translation>Nie zrobiono zrzutu ekranu</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="392"/>
+ <source>There was an error or you did not select a valid area.</source>
+ <translation>Nastąpił błąd albo nie wybrałeś właściwego obszaru.</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="407"/>
+ <location filename="../lightscreenwindow.cpp" line="612"/>
+ <source>Active &amp;Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="410"/>
+ <location filename="../lightscreenwindow.cpp" line="615"/>
+ <source>&amp;Pick Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="442"/>
+ <source>Sucess!</source>
+ <translation>Sukces!</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="447"/>
+ <source>Failed!</source>
+ <translation>Błąd!</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="462"/>
+ <source>Some hotkeys could not be registered, they might already be in use</source>
+ <translation>Nie można zarejestrować niektórych klawiszy skrótu, mogą już być w użytku</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="465"/>
+ <source>&lt;br&gt;The failed hotkeys are the following:</source>
+ <translatorcomment>&lt;br&gt;Błędne klawisze skrótu to:</translatorcomment>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="476"/>
+ <source>&lt;br&gt;The failed hotkey is &lt;b&gt;%1&lt;/b&gt;</source>
+ <translation>&lt;br&gt;Błędny klawisz skrótu to &lt;b&gt;%1&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="479"/>
+ <source>&lt;br&gt;&lt;i&gt;What do you want to do?&lt;/i&gt;</source>
+ <translation>&lt;br&gt;&lt;i&gt;Co chcesz wykonać?&lt;/i&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="485"/>
+ <source>Change</source>
+ <translation>Zmień</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="486"/>
+ <source>Disable</source>
+ <translation>Wyłącz</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="487"/>
+ <source>Quit</source>
+ <translation>Zakończ</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="683"/>
+ <source>There&apos;s a new version of Lightscreen available.&lt;br&gt;Would you like to see more information?&lt;br&gt;(&lt;em&gt;You can turn this notification off&lt;/em&gt;)</source>
+ <translation>Dostępna jest nowa wersja programu Lightscreen.&lt;br&gt;Czy chcesz zobaczyć dalsze informacje?&lt;br&gt;(&lt;em&gt;Możesz wyłączyć ten komunikat&lt;/em&gt;)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="687"/>
+ <source>Turn Off</source>
+ <translation>Wyłącz</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="688"/>
+ <source>Remind Me Later</source>
+ <translation>Przypominaj później</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="404"/>
+ <location filename="../lightscreenwindow.cpp" line="609"/>
+ <source>&amp;Screen</source>
+ <translation>&amp;Ekran</translation>
+ </message>
+ <message>
+ <source>&amp;Window</source>
+ <translation type="obsolete">&amp;Okno</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="413"/>
+ <location filename="../lightscreenwindow.cpp" line="618"/>
+ <source>&amp;Area</source>
+ <translation>Obsz&amp;ar</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="416"/>
+ <location filename="../lightscreenwindow.cpp" line="632"/>
+ <source>&amp;Go to Folder</source>
+ <translation>&amp;Przejdź do folderu</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="606"/>
+ <source>Show&amp;/Hide</source>
+ <translation>Pokaż&amp;/Ukryj</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="629"/>
+ <source>View &amp;Options</source>
+ <translation>Pokaż &amp;Opcje</translation>
+ </message>
+ <message>
+ <source>&amp;About Lightscreen</source>
+ <translation type="obsolete">O &amp;Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="635"/>
+ <source>&amp;Quit</source>
+ <translation>&amp;Zakończ</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindowClass</name>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="14"/>
+ <source>Lightscreen</source>
+ <translation>Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="35"/>
+ <source>Screenshot</source>
+ <translation>Zrzut ekranu</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="54"/>
+ <source>Configure Lightscreen</source>
+ <translation>Skonfiguruj Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="57"/>
+ <source>&amp;Options</source>
+ <translation>&amp;Opcje</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="76"/>
+ <source>Hide Lightscreen </source>
+ <translation>Ukryj Lightscreen </translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="82"/>
+ <source>&amp;Hide</source>
+ <translation>&amp;Ukryj</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="104"/>
+ <source>&amp;Quit</source>
+ <translation>&amp;Zakończ</translation>
+ </message>
+</context>
+<context>
+ <name>NamingDialog</name>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="14"/>
+ <source>Naming Options - Lightscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="42"/>
+ <source>Leading zeros:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="94"/>
+ <source>Date Format:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="122"/>
+ <source> &lt;a href=&quot;http://lightscreen.sourceforge.net/help/date&quot;&gt;[?]&lt;/a&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="136"/>
+ <source>yyyy-MM-dd</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="141"/>
+ <source>yyyy-MM-dd HH.mm.ss</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="161"/>
+ <source>Flip naming.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OptionsDialog</name>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="67"/>
+ <source>Version %1</source>
+ <translation type="unfinished">Wersja %1</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>Hotkey conflict</source>
+ <translation>Konflikt z klawiszami skrótu</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>You have assigned the same hotkeys to more than one action.</source>
+ <translation>Ustawiłeś te same skróty klawiszy dla więcej niż jednej akcji.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>Filename character error</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>The filename can&apos;t contain any of the following characters: ? : \ / * &quot; &lt; &gt; |</source>
+ <translation></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>Final Destination</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>You can&apos;t take screenshots unless you enable file saving or the clipboard.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="163"/>
+ <source>Select where you want to save the screenshots</source>
+ <translation>Wybierz gdzie chcesz zapisywać zrzuty ekranu</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="181"/>
+ <source>Lightscreen - Options</source>
+ <translation>Lightscreen - Opcje</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="182"/>
+ <source>Restoring the default options will cause you to lose all of your current configuration.</source>
+ <translation>Odtworzenie domyślnych opcji powoduje utratę aktualnej konfiguracji.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="185"/>
+ <source>Restore</source>
+ <translation>Odtwórz</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="186"/>
+ <source>Don&apos;t Restore</source>
+ <translation>Nie Odtwarzaj</translation>
+ </message>
+ <message>
+ <source> (OptiPNG not found)</source>
+ <translation type="obsolete"> (nie znaleziono OptiPNG)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="14"/>
+ <source>Options - Lightscreen</source>
+ <translation>Opcje - Lightscreen</translation>
+ </message>
+ <message>
+ <source>&amp;General</source>
+ <translation type="obsolete">O&amp;gólne</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="36"/>
+ <source>File</source>
+ <translation>&amp;Plik</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="54"/>
+ <source>&amp;Directory:</source>
+ <translation>K&amp;atalog:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="94"/>
+ <source>The prefix for the screenshot file</source>
+ <translation>Prefiks dla pliku zrzutu ekranu</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="97"/>
+ <source>&amp;Filename:</source>
+ <translation>&amp;Nazwa pliku:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="115"/>
+ <source>The prefix will be inserted before the &lt;em&gt;Naming&lt;/em&gt; in the screenshot file and it is usually used to distinguish files. It can be left blank.</source>
+ <translation>Prefiks zostanie wstawiony przed nadaniem nazwy pliku zrzutu ekranu i jest zwykle używany do odróżnienia plików. Może być pusty.</translation>
+ </message>
+ <message>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3.
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp) that corresponds with the current time.
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss.</source>
+ <translation type="obsolete">Nazwa wstawiona będzie po prefiksie, co sprawia, że każdy plik jest unikalny, aby uniknąć nadpisania.&lt;br /&gt;
+&lt;b&gt;Numer&lt;/b&gt;: wstawia numer w sekwencji 1, 2, 3.
+&lt;b&gt;Czas&lt;/b&gt;: wstawia unikalny numer (stempel czasu Unixa), który odpowiada obecnemu czasu.
+&lt;b&gt;Data&lt;/b&gt;: wstawia aktualną datę i czas, w formie dd-MM-rrrr gg.mm.ss.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="132"/>
+ <source>(number)</source>
+ <translation>(numer)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="142"/>
+ <source>(timestamp)</source>
+ <translation>(czas)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="137"/>
+ <source>(date)</source>
+ <translation>(data)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="24"/>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="168"/>
+ <source>The file format for the screenshot</source>
+ <translation>Format pliku dla zrzutu ekranu</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="171"/>
+ <source>F&amp;ormat:</source>
+ <translation>&amp;Format:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="185"/>
+ <source>PNG</source>
+ <translation>PNG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="190"/>
+ <source>JPG</source>
+ <translation>JPG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="195"/>
+ <source>BMP</source>
+ <translation>BMP</translation>
+ </message>
+ <message>
+ <source>TIFF</source>
+ <translation type="obsolete">TIFF</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="776"/>
+ <source>D&amp;elay:</source>
+ <translation>Opóźni&amp;enie:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="789"/>
+ <source>Selecting anything other than 0 in this option will cause the program to &lt;b&gt;wait&lt;/b&gt; that amount of seconds before taking the screenshot.</source>
+ <translation>Wybór wartości tej opcji innej niż 0 spowoduje, że program &lt;b&gt;czeka&lt;/b&gt; podaną ilość sekund przed podjęciem zrzutu ekranu.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="792"/>
+ <source>none</source>
+ <translation>brak</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="801"/>
+ <location filename="../dialogs/optionsdialog.ui" line="955"/>
+ <source> seconds</source>
+ <translation> sekund(y)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="318"/>
+ <source>&amp;Run Lightscreen at system startup.</source>
+ <translation>Uruchom Lightscreen przy &amp;starcie systemu.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="346"/>
+ <source>H&amp;ide the main window.</source>
+ <translation>&amp;Ukryj główne okno.</translation>
+ </message>
+ <message>
+ <source>&amp;Hotkeys</source>
+ <translation type="obsolete">&amp;Klawisze skrótu</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="386"/>
+ <source>Capture the screen</source>
+ <translation>Chwyć ekran</translation>
+ </message>
+ <message>
+ <source>Capture a window</source>
+ <translation type="obsolete">Chwyć okno</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="441"/>
+ <source>Capture a screen area</source>
+ <translation>Chwyć obszar ekranu</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="504"/>
+ <source>Open the directory</source>
+ <translation>Otwórz katalog</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="488"/>
+ <source>Open the program window</source>
+ <translation>Otwórz okno programu</translation>
+ </message>
+ <message>
+ <source>&amp;Options</source>
+ <translation type="obsolete">&amp;Opcje</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="591"/>
+ <source>Sho&amp;w a system tray icon.</source>
+ <translation>&amp;Pokaż ikonę w zasobniku systemowym.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="598"/>
+ <source>&amp;Hide Lightscreen while taking a screenshot.</source>
+ <translation>&amp;Ukryj Lightscreen podczas zrzutu ekranu.</translation>
+ </message>
+ <message>
+ <source>Periodically check for updates.</source>
+ <translation type="obsolete">Okresowo sprawdzaj &amp;aktualizacje.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="743"/>
+ <source>&amp;Magnify around the mouse in Area mode.</source>
+ <translation>&amp;Szkło powiększające wokół myszy w trybie obszaru.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="661"/>
+ <source>&amp;Language:</source>
+ <translation>&amp;Język:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="678"/>
+ <source>Click here to go to the Lightscreen homepage to learn more about translations.</source>
+ <translation>Kliknij tutaj aby przejść do strony głównej Lightscreen, aby dowiedzieć się więcej na temat tłumaczeń.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="681"/>
+ <source>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;More information..&lt;/a&gt;</source>
+ <translation>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;Więcej informacji..&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="617"/>
+ <source>&amp;Notify with:</source>
+ <translation>Zawiadom przez:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="267"/>
+ <source>&lt;i&gt;Preview&lt;/i&gt;:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="203"/>
+ <source>&amp;Quality:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="122"/>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3..&lt;br /&gt;
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date, in the form of dd-MM-yyyy..&lt;br /&gt;
+&lt;b&gt;Date &amp;amp; Time&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss..&lt;br /&gt;
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp, the number of seconds passed since 1970-1-1 00:00:00) that corresponds with the current time.&lt;br /&gt;
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="147"/>
+ <source>(none)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="306"/>
+ <source>System Startup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="359"/>
+ <source>Hotkeys</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="365"/>
+ <source>Captures</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="409"/>
+ <source>Capture the current window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="425"/>
+ <source>Capture a chosen window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="467"/>
+ <source>Lightscreen Control</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="531"/>
+ <source>Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="579"/>
+ <source>Interface</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="627"/>
+ <source>Shows a completion message once the screenshot is saved, clicking this message takes you to the directory where the screenshot was saved.</source>
+ <translation>Pokazuje komunikat po zapisaniu zrzutu ekranu, kliknięcie na tą wiadomość przenosi cię do katalogu, w którym został zapisany zrzut ekranu.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="630"/>
+ <source>Tray icon Popup</source>
+ <translation>&amp;Ikonę Popup w zasobniku</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="637"/>
+ <source>&amp;Sound cue</source>
+ <translation>Efekt &amp;dźwiękowy</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="760"/>
+ <source>Replace screenshots when there&apos;s an existing file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="767"/>
+ <source>Snap area screenshots automatically (no resizing).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="847"/>
+ <source>Maximum Size:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="898"/>
+ <source>Position:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="968"/>
+ <source> and </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="982"/>
+ <source>save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="987"/>
+ <source>cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1055"/>
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1061"/>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
+Special thanks goes to the &lt;a href=&quot;http://lightscreen.sourceforge.net/about&quot;&gt;Donators and Translators&lt;/a&gt;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1090"/>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="unfinished">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Odwiedź stronę projektu na Sourceforge&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Odwieź główną stronę Lightscreen&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <source>Screenshot &amp;Quality:</source>
+ <translation type="obsolete">Jakość zrzutu &amp;ekranu:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="216"/>
+ <source>This slider goes from 0 to 100. 100 being the highest quality and 0 the lowest.&lt;br&gt;
+Quality is related to file size and of course to readability and overall quality of the image.</source>
+ <translation>Ten suwak ma wartości od 0 do 100. 100 to najwyższa jakość a 0 najniższa.&lt;br&gt;
+Różnica jakości związana jest z rozmiarem pliku, jego czytelnością i ogólnym wyglądem obrazu.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="246"/>
+ <source>100</source>
+ <translation>100</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="258"/>
+ <source>%</source>
+ <translation>%</translation>
+ </message>
+ <message>
+ <source>&amp;Advanced</source>
+ <translation type="obsolete">&amp;Zaawansowane</translation>
+ </message>
+ <message>
+ <source>Choose where and how to &amp;save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="obsolete">&amp;Wybierz gdzie i jak zapisać każdego zrzutu ekranu (&quot;Zapisz jako&quot;).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="722"/>
+ <source>&amp;Copy the screenshot to the clipboard.</source>
+ <translation>Kopiuj zrzut ekranu do &amp;schowka.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="736"/>
+ <source>Inc&amp;lude the cursor in the screenshot.</source>
+ <translation>&amp;Dołącz kursor w zrzucie ekranu.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="706"/>
+ <source>Screenshots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="715"/>
+ <source>Choose where to save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="729"/>
+ <source>&amp;Grab only the current monitor.</source>
+ <translation>&amp;Chwyć tylko bieżący monitor.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="750"/>
+ <source>Opens a new process called OptiPNG which dramatically reduces the file size.</source>
+ <translation>Otwiera nowy proces zwany OptiPNG który poważnie zmniejsza rozmiar pliku.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="753"/>
+ <source>O&amp;ptimize PNG screenshots.</source>
+ <translation>&amp;Polepsz pliki PNG.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="605"/>
+ <source>Warn when hiding without a tra&amp;y icon.</source>
+ <translation>Ostrzegaj gdy chowasz bez ikony w &amp;trayu.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="832"/>
+ <source>Screenshot Previews</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="912"/>
+ <source>Top Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="917"/>
+ <source>Top Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="922"/>
+ <source>Bottom Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="927"/>
+ <source>Bottom Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="948"/>
+ <source>Auto-close after</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1011"/>
+ <source>Updater</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1020"/>
+ <source>Check for updates regularly.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1040"/>
+ <source>Chec&amp;k Updates Now</source>
+ <translation>Sprawdź teraz &amp;aktualizacje</translation>
+ </message>
+ <message>
+ <source>About Lightscreen</source>
+ <translation type="obsolete">O Lightscreen</translation>
+ </message>
+</context>
+<context>
+ <name>PreviewDialog</name>
+ <message>
+ <location filename="../dialogs/previewdialog.cpp" line="308"/>
+ <source>Screenshot Preview: Closing in %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Screenshot</name>
+ <message>
+ <location filename="../tools/screenshot.cpp" line="272"/>
+ <source>Save as..</source>
+ <translation>Zapisz jako..</translation>
+ </message>
+</context>
+<context>
+ <name>ScreenshotDialog</name>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="18"/>
+ <source>Lightscreen Screenshot Viewer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="20"/>
+ <source>You can zoom using the mouse wheel while holding the CTRL key. To return to the default zoom (100%) press &quot;Ctrl-0&quot;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>UpdaterDialog</name>
+ <message>
+ <source>Cancel</source>
+ <translation type="obsolete">Anuluj</translation>
+ </message>
+ <message>
+ <source>Updater - Lightscreen</source>
+ <translation type="obsolete">Aktualizator - Lightscreen</translation>
+ </message>
+ <message>
+ <source>Checking for updates</source>
+ <translation type="obsolete">Trwa sprawdzanie dostępnych aktualizacji</translation>
+ </message>
+ <message>
+ <source>There&apos;s a new version available,&lt;br&gt; please see &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;the Lighscreen website&lt;/a&gt;.</source>
+ <translation type="obsolete">Jest dostępna nowa wersja,&lt;br&gt; można znaleźć ją na &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;stronie internetowej Lighscreen&lt;/a&gt;.</translation>
+ </message>
+ <message>
+ <source>No new versions available</source>
+ <translation type="obsolete">Nie ma nowych wersji programu</translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="obsolete">Zamknij</translation>
+ </message>
+</context>
+<context>
+ <name>WindowPicker</name>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="24"/>
+ <source>Lightscreen Window Picker</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="26"/>
+ <source>Grab the picker by clicking and holding down the mouse button, then drag it to the window of your choice and release it to capture.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="41"/>
+ <source> - Start dragging to select windows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="50"/>
+ <source>Close</source>
+ <translation type="unfinished">Zamknij</translation>
+ </message>
+</context>
+</TS>
diff --git a/translations/portugues.qm b/translations/portugues.qm
new file mode 100644
index 0000000..bb0d7ab
Binary files /dev/null and b/translations/portugues.qm differ
diff --git a/translations/portugues.ts b/translations/portugues.ts
new file mode 100644
index 0000000..b497bfa
--- /dev/null
+++ b/translations/portugues.ts
@@ -0,0 +1,899 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="pt_BR" sourcelanguage="en">
+<context>
+ <name>AboutDialog</name>
+ <message>
+ <source>Version %1</source>
+ <translation type="obsolete">Versão %1</translation>
+ </message>
+</context>
+<context>
+ <name>AboutDialogClass</name>
+ <message>
+ <source>About - Lightscreen</source>
+ <translation type="obsolete">Sobre - Lightscreen</translation>
+ </message>
+ <message>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/b&gt;.</source>
+ <translation type="obsolete">Lightscreen é uma ferramenta simnples para fazer screenshots, desenvolvida para ser leve e customizável.&lt;br&gt;&lt;br&gt;
+Criado por &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, usando o &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; para a interface gráfica.&lt;br&gt;&lt;br&gt;
+Lançado sob a licensa &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/b&gt;.</translation>
+ </message>
+ <message>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="obsolete">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visite o site do projeto na Sourceforge&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visite o site do Lightscreen&lt;/a&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>AreaDialog</name>
+ <message>
+ <location filename="../dialogs/areadialog.cpp" line="127"/>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="unfinished">Modo área do Lightscreen
+Use o mause para desenhar um retângulo para tirar screenshot ou cancele
+pressionando qualquer tecla.</translation>
+ </message>
+</context>
+<context>
+ <name>AreaSelector</name>
+ <message>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="obsolete">Modo área do Lightscreen
+Use o mause para desenhar um retângulo para tirar screenshot ou cancele
+pressionando qualquer tecla.</translation>
+ </message>
+ <message>
+ <source>%1 x %2 px </source>
+ <translation type="obsolete">%1 x %2 px </translation>
+ </message>
+</context>
+<context>
+ <name>HotkeyWidget</name>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="15"/>
+ <source>Click to select hotkey...</source>
+ <translation>Clique para selecionar uma hotkey...</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="47"/>
+ <source>Type your hotkey</source>
+ <translation>Pressione sua hotkey</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="56"/>
+ <source>Invalid hotkey</source>
+ <translation>Hotkey inválida</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindow</name>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="97"/>
+ <location filename="../lightscreenwindow.cpp" line="258"/>
+ <location filename="../lightscreenwindow.cpp" line="482"/>
+ <location filename="../lightscreenwindow.cpp" line="682"/>
+ <source>Lightscreen</source>
+ <translation>Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="98"/>
+ <source>You have chosen to hide Lightscreen when there&apos;s no system tray icon, so you will not be able to access the program &lt;b&gt;unless you have selected a hotkey to do so&lt;/b&gt;.&lt;br&gt;What do you want to do?</source>
+ <translation>Você escolheu esconder o lightscreen mesmo sem o ícone na área de notificaçao, então você não terá acesso ao programa &lt;b&gt;a menos que você selecione uma hotkey para isso&lt;/b&gt;.&lt;br&gt;O que você deseja fazer?</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="101"/>
+ <source>Hide but enable tray</source>
+ <translation>Esconder e habilitar o ícone na área de notificaçao</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="103"/>
+ <source>Hide and don&apos;t warn</source>
+ <translation>Esconder e não avisar</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="105"/>
+ <source>Just hide</source>
+ <translation>Apenas esconda</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="385"/>
+ <source>Saved to %1%2</source>
+ <translation>Salvo para %1%2</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="391"/>
+ <source>The screenshot was not taken</source>
+ <translation>A screenshot não foi feita</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="392"/>
+ <source>There was an error or you did not select a valid area.</source>
+ <translation>Ocorreu um erro ou você não selecionou uma área válida.</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="407"/>
+ <location filename="../lightscreenwindow.cpp" line="612"/>
+ <source>Active &amp;Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="410"/>
+ <location filename="../lightscreenwindow.cpp" line="615"/>
+ <source>&amp;Pick Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="442"/>
+ <source>Sucess!</source>
+ <translation>Pronto!</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="447"/>
+ <source>Failed!</source>
+ <translation>Falhou!</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="462"/>
+ <source>Some hotkeys could not be registered, they might already be in use</source>
+ <translation>Alguma(s) hotkey(s) não pode(puderam) ser registrada(s), ela(s) pode(m) estar em uso</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="465"/>
+ <source>&lt;br&gt;The failed hotkeys are the following:</source>
+ <translation>&lt;br&gt;A(s) hotkey(s) é(são):</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="476"/>
+ <source>&lt;br&gt;The failed hotkey is &lt;b&gt;%1&lt;/b&gt;</source>
+ <translation>&lt;br&gt;A hotkey é &lt;b&gt;%1&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="479"/>
+ <source>&lt;br&gt;&lt;i&gt;What do you want to do?&lt;/i&gt;</source>
+ <translation>&lt;br&gt;&lt;i&gt;O que você deseja fazer?&lt;/i&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="485"/>
+ <source>Change</source>
+ <translation>Trocar</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="486"/>
+ <source>Disable</source>
+ <translation>Desabilitar</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="487"/>
+ <source>Quit</source>
+ <translation>Sair</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="683"/>
+ <source>There&apos;s a new version of Lightscreen available.&lt;br&gt;Would you like to see more information?&lt;br&gt;(&lt;em&gt;You can turn this notification off&lt;/em&gt;)</source>
+ <translation>Existe uma nova versão do Lightscreen.&lt;br&gt;Você gostaria de mais informaçoes?&lt;br&gt;(&lt;em&gt;Você pode desligar essa notificação&lt;/em&gt;)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="687"/>
+ <source>Turn Off</source>
+ <translation>Desligar</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="688"/>
+ <source>Remind Me Later</source>
+ <translation>Lembrar mais tarde</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="404"/>
+ <location filename="../lightscreenwindow.cpp" line="609"/>
+ <source>&amp;Screen</source>
+ <translation>T&amp;ela</translation>
+ </message>
+ <message>
+ <source>&amp;Window</source>
+ <translation type="obsolete">&amp;Janela</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="413"/>
+ <location filename="../lightscreenwindow.cpp" line="618"/>
+ <source>&amp;Area</source>
+ <translation>Áre&amp;a</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="416"/>
+ <location filename="../lightscreenwindow.cpp" line="632"/>
+ <source>&amp;Go to Folder</source>
+ <translation>&amp;Ir para a pasta</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="606"/>
+ <source>Show&amp;/Hide</source>
+ <translation>Mostrar/Escond&amp;er</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="629"/>
+ <source>View &amp;Options</source>
+ <translation>Ver &amp;Opções</translation>
+ </message>
+ <message>
+ <source>&amp;About Lightscreen</source>
+ <translation type="obsolete">&amp;Sobre o Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="635"/>
+ <source>&amp;Quit</source>
+ <translation>Sa&amp;ir</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindowClass</name>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="14"/>
+ <source>Lightscreen</source>
+ <translation>Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="35"/>
+ <source>Screenshot</source>
+ <translation>Screenshot</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="54"/>
+ <source>Configure Lightscreen</source>
+ <translation>Configurar o Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="57"/>
+ <source>&amp;Options</source>
+ <translation>&amp;Opções</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="76"/>
+ <source>Hide Lightscreen </source>
+ <translation>Esconder o Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="82"/>
+ <source>&amp;Hide</source>
+ <translation>&amp;Esconder</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="104"/>
+ <source>&amp;Quit</source>
+ <translation>Sa&amp;ir</translation>
+ </message>
+</context>
+<context>
+ <name>NamingDialog</name>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="14"/>
+ <source>Naming Options - Lightscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="42"/>
+ <source>Leading zeros:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="94"/>
+ <source>Date Format:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="122"/>
+ <source> &lt;a href=&quot;http://lightscreen.sourceforge.net/help/date&quot;&gt;[?]&lt;/a&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="136"/>
+ <source>yyyy-MM-dd</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="141"/>
+ <source>yyyy-MM-dd HH.mm.ss</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="161"/>
+ <source>Flip naming.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OptionsDialog</name>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="67"/>
+ <source>Version %1</source>
+ <translation type="unfinished">Versão %1</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>Hotkey conflict</source>
+ <translation>Conflito entre Hotkeys</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>You have assigned the same hotkeys to more than one action.</source>
+ <translation>Você designou a mesma hotkey para mais de uma ação.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>Filename character error</source>
+ <translation>Caractere não permitido no nome do arquivo</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>The filename can&apos;t contain any of the following characters: ? : \ / * &quot; &lt; &gt; |</source>
+ <translation>O nome do arquivo não pode conter os seguintes caracteres: ? : \ / * &quot; &lt; &gt; |</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>Final Destination</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>You can&apos;t take screenshots unless you enable file saving or the clipboard.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="163"/>
+ <source>Select where you want to save the screenshots</source>
+ <translation>Selecione um local para salvar as screenshots</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="181"/>
+ <source>Lightscreen - Options</source>
+ <translation>Opções do Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="182"/>
+ <source>Restoring the default options will cause you to lose all of your current configuration.</source>
+ <translation>Restaurando as opções padrão causará a perda das configurações atuais.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="185"/>
+ <source>Restore</source>
+ <translation>Restaurar</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="186"/>
+ <source>Don&apos;t Restore</source>
+ <translation>Não restaurar</translation>
+ </message>
+ <message>
+ <source> (OptiPNG not found)</source>
+ <translation type="obsolete">(OptiPNG não encontrado)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="14"/>
+ <source>Options - Lightscreen</source>
+ <translation>Opções do Lightscreen</translation>
+ </message>
+ <message>
+ <source>&amp;General</source>
+ <translation type="obsolete">&amp;Geral</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="36"/>
+ <source>File</source>
+ <translation>Arquivo</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="54"/>
+ <source>&amp;Directory:</source>
+ <translation>&amp;Pasta:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="94"/>
+ <source>The prefix for the screenshot file</source>
+ <translation>O prefixo para o nome do arquivo</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="97"/>
+ <source>&amp;Filename:</source>
+ <translation>&amp;Nome do arquivo:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="115"/>
+ <source>The prefix will be inserted before the &lt;em&gt;Naming&lt;/em&gt; in the screenshot file and it is usually used to distinguish files. It can be left blank.</source>
+ <translation>The prefix will be inserted before the &lt;em&gt;Naming&lt;/em&gt; in the screenshot file and it is usually used to distinguish files. It can be left blank.</translation>
+ </message>
+ <message>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3.
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp) that corresponds with the current time.
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss.</source>
+ <translation type="obsolete">The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3.
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp) that corresponds with the current time.
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="132"/>
+ <source>(number)</source>
+ <translation>(número)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="137"/>
+ <source>(date)</source>
+ <translation>(data)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="142"/>
+ <source>(timestamp)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="168"/>
+ <source>The file format for the screenshot</source>
+ <translation>Formato de arquivo</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="171"/>
+ <source>F&amp;ormat:</source>
+ <translation>F&amp;ormato:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="185"/>
+ <source>PNG</source>
+ <translation>PNG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="190"/>
+ <source>JPG</source>
+ <translation>JPG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="195"/>
+ <source>BMP</source>
+ <translation>BMP</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="267"/>
+ <source>&lt;i&gt;Preview&lt;/i&gt;:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="203"/>
+ <source>&amp;Quality:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="122"/>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3..&lt;br /&gt;
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date, in the form of dd-MM-yyyy..&lt;br /&gt;
+&lt;b&gt;Date &amp;amp; Time&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss..&lt;br /&gt;
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp, the number of seconds passed since 1970-1-1 00:00:00) that corresponds with the current time.&lt;br /&gt;
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="147"/>
+ <source>(none)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="306"/>
+ <source>System Startup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="359"/>
+ <source>Hotkeys</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="365"/>
+ <source>Captures</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="409"/>
+ <source>Capture the current window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="425"/>
+ <source>Capture a chosen window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="467"/>
+ <source>Lightscreen Control</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="531"/>
+ <source>Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="579"/>
+ <source>Interface</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="706"/>
+ <source>Screenshots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="715"/>
+ <source>Choose where to save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="760"/>
+ <source>Replace screenshots when there&apos;s an existing file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="776"/>
+ <source>D&amp;elay:</source>
+ <translation>Atras&amp;o:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="789"/>
+ <source>Selecting anything other than 0 in this option will cause the program to &lt;b&gt;wait&lt;/b&gt; that amount of seconds before taking the screenshot.</source>
+ <translation>Selecting anything other than 0 in this option will cause the program to &lt;b&gt;wait&lt;/b&gt; that amount of seconds before taking the screenshot.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="792"/>
+ <source>none</source>
+ <translation>nenhum</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="801"/>
+ <location filename="../dialogs/optionsdialog.ui" line="955"/>
+ <source> seconds</source>
+ <translation> segundos</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="847"/>
+ <source>Maximum Size:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="898"/>
+ <source>Position:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="968"/>
+ <source> and </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="982"/>
+ <source>save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="987"/>
+ <source>cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1055"/>
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1061"/>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
+Special thanks goes to the &lt;a href=&quot;http://lightscreen.sourceforge.net/about&quot;&gt;Donators and Translators&lt;/a&gt;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1090"/>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="unfinished">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visite o site do projeto na Sourceforge&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visite o site do Lightscreen&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="318"/>
+ <source>&amp;Run Lightscreen at system startup.</source>
+ <translation>&amp;Abrir o Lighscreen na inicialização do sistema.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="346"/>
+ <source>H&amp;ide the main window.</source>
+ <translation>Esconder a janela pr&amp;incipal.</translation>
+ </message>
+ <message>
+ <source>&amp;Hotkeys</source>
+ <translation type="obsolete">&amp;Hotkeys</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="386"/>
+ <source>Capture the screen</source>
+ <translation>Capturar a tela</translation>
+ </message>
+ <message>
+ <source>Capture a window</source>
+ <translation type="obsolete">Capturar uma janela</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="441"/>
+ <source>Capture a screen area</source>
+ <translation>Capturar uma área da tela</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="504"/>
+ <source>Open the directory</source>
+ <translation>Abrir pasta</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="488"/>
+ <source>Open the program window</source>
+ <translation>Abrir a janela do programa</translation>
+ </message>
+ <message>
+ <source>&amp;Options</source>
+ <translation type="obsolete">&amp;Opções</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="591"/>
+ <source>Sho&amp;w a system tray icon.</source>
+ <translation>Mostrar ícone na área de n&amp;otificação.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="598"/>
+ <source>&amp;Hide Lightscreen while taking a screenshot.</source>
+ <translation>&amp;Esconder o Lighscreen durande a screenshot.</translation>
+ </message>
+ <message>
+ <source>Periodically check for updates.</source>
+ <translation type="obsolete">Verificar por atualizaçoes periódicamente.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="743"/>
+ <source>&amp;Magnify around the mouse in Area mode.</source>
+ <translation>Zoom da área do &amp;mouse.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="661"/>
+ <source>&amp;Language:</source>
+ <translation>&amp;Idioma:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="678"/>
+ <source>Click here to go to the Lightscreen homepage to learn more about translations.</source>
+ <translation>Clique aqui para ir até a página no Lightscreen e aprenda mais sobre atualizações.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="681"/>
+ <source>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;More information..&lt;/a&gt;</source>
+ <translation>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;Mais informações...&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="617"/>
+ <source>&amp;Notify with:</source>
+ <translation>&amp;Notificar com:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="24"/>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="627"/>
+ <source>Shows a completion message once the screenshot is saved, clicking this message takes you to the directory where the screenshot was saved.</source>
+ <translation>Mostrar mensagem quando uma screenshot for capturada.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="630"/>
+ <source>Tray icon Popup</source>
+ <translation>Balão na área de notificação</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="637"/>
+ <source>&amp;Sound cue</source>
+ <translation>&amp;Som</translation>
+ </message>
+ <message>
+ <source>Screenshot &amp;Quality:</source>
+ <translation type="obsolete">&amp;Qualidade da imagem:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="216"/>
+ <source>This slider goes from 0 to 100. 100 being the highest quality and 0 the lowest.&lt;br&gt;
+Quality is related to file size and of course to readability and overall quality of the image.</source>
+ <translation>This slider goes from 0 to 100. 100 being the highest quality and 0 the lowest.&lt;br&gt;
+Quality is related to file size and of course to readability and overall quality of the image.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="246"/>
+ <source>100</source>
+ <translation>100</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="258"/>
+ <source>%</source>
+ <translation>%</translation>
+ </message>
+ <message>
+ <source>&amp;Advanced</source>
+ <translation type="obsolete">&amp;Avançado</translation>
+ </message>
+ <message>
+ <source>Choose where and how to &amp;save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="obsolete">Escolha quando e como &amp;Salvar cada screenshot.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="722"/>
+ <source>&amp;Copy the screenshot to the clipboard.</source>
+ <translation>&amp;Copiar a Screenshot para a área de transferência.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="736"/>
+ <source>Inc&amp;lude the cursor in the screenshot.</source>
+ <translation>Inc&amp;luir o cursor do mouse na screenshot.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="729"/>
+ <source>&amp;Grab only the current monitor.</source>
+ <translation>Capturar apenas do mo&amp;nitor atual.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="750"/>
+ <source>Opens a new process called OptiPNG which dramatically reduces the file size.</source>
+ <translation>Abrir um novo processo chamado OptiPNG, que diminui dramaticamante o tamanho do arquivo.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="753"/>
+ <source>O&amp;ptimize PNG screenshots.</source>
+ <translation>O&amp;ptimizar as screenshots salvas como PNG.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="605"/>
+ <source>Warn when hiding without a tra&amp;y icon.</source>
+ <translation>Avisar quando esconder sem um ícone na área de noti&amp;ficaçao.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="767"/>
+ <source>Snap area screenshots automatically (no resizing).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="832"/>
+ <source>Screenshot Previews</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="912"/>
+ <source>Top Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="917"/>
+ <source>Top Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="922"/>
+ <source>Bottom Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="927"/>
+ <source>Bottom Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="948"/>
+ <source>Auto-close after</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1011"/>
+ <source>Updater</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1020"/>
+ <source>Check for updates regularly.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1040"/>
+ <source>Chec&amp;k Updates Now</source>
+ <translation>Verificar por at&amp;ualizações agora</translation>
+ </message>
+ <message>
+ <source>About Lightscreen</source>
+ <translation type="obsolete">Sobre o Lightscreen</translation>
+ </message>
+</context>
+<context>
+ <name>PreviewDialog</name>
+ <message>
+ <location filename="../dialogs/previewdialog.cpp" line="308"/>
+ <source>Screenshot Preview: Closing in %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Screenshot</name>
+ <message>
+ <location filename="../tools/screenshot.cpp" line="272"/>
+ <source>Save as..</source>
+ <translation>Salvar como..</translation>
+ </message>
+</context>
+<context>
+ <name>ScreenshotDialog</name>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="18"/>
+ <source>Lightscreen Screenshot Viewer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="20"/>
+ <source>You can zoom using the mouse wheel while holding the CTRL key. To return to the default zoom (100%) press &quot;Ctrl-0&quot;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>UpdaterDialog</name>
+ <message>
+ <source>Cancel</source>
+ <translation type="obsolete">Cancelar</translation>
+ </message>
+ <message>
+ <source>Updater - Lightscreen</source>
+ <translation type="obsolete">Atualizador do Lightscreen</translation>
+ </message>
+ <message>
+ <source>Checking for updates</source>
+ <translation type="obsolete">Verificar por atualizações</translation>
+ </message>
+ <message>
+ <source>There&apos;s a new version available,&lt;br&gt; please see &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;the Lighscreen website&lt;/a&gt;.</source>
+ <translation type="obsolete">Existe uma nova versão disponível,&lt;br&gt; por favor veja no &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;Site do Lightscreen&lt;/a&gt;.</translation>
+ </message>
+ <message>
+ <source>No new versions available</source>
+ <translation type="obsolete">Nenhuma nova versão disponível</translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="obsolete">Fechar</translation>
+ </message>
+</context>
+<context>
+ <name>WindowPicker</name>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="24"/>
+ <source>Lightscreen Window Picker</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="26"/>
+ <source>Grab the picker by clicking and holding down the mouse button, then drag it to the window of your choice and release it to capture.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="41"/>
+ <source> - Start dragging to select windows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="50"/>
+ <source>Close</source>
+ <translation type="unfinished">Fechar</translation>
+ </message>
+</context>
+</TS>
diff --git a/translations/russian.qm b/translations/russian.qm
new file mode 100644
index 0000000..6ba7fbd
Binary files /dev/null and b/translations/russian.qm differ
diff --git a/translations/russian.ts b/translations/russian.ts
new file mode 100644
index 0000000..25c7b84
--- /dev/null
+++ b/translations/russian.ts
@@ -0,0 +1,903 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ru_RU">
+<context>
+ <name>AboutDialog</name>
+ <message>
+ <source>Version %1</source>
+ <translation type="obsolete">Версия %1</translation>
+ </message>
+</context>
+<context>
+ <name>AboutDialogClass</name>
+ <message>
+ <source>About - Lightscreen</source>
+ <translation type="obsolete">О Lightscreen</translation>
+ </message>
+ <message>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/b&gt;.</source>
+ <translation type="obsolete">Lightscreen это простой инструмент для создания скриншотов, гибкий и лёгкий.&lt;br&gt;&lt;br&gt;
+Создан &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, с использованием &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; для графического интерфейса.&lt;br&gt;&lt;br&gt;
+Выпущен по &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/b&gt;.</translation>
+ </message>
+ <message>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="obsolete">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Посетить сайт Sourceforge project&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Посетитьдомашнюю страницу Lightscreen&lt;/a&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>AreaDialog</name>
+ <message>
+ <location filename="../dialogs/areadialog.cpp" line="127"/>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="unfinished">Режим Lightscreen выбора области экрана:
+Используйте мышку, чтобы выделить прямоугольную область захвата экрана
+или нажмите любую клавишу, правую или среднюю кнопку мыши для выхода из режима.</translation>
+ </message>
+</context>
+<context>
+ <name>AreaSelector</name>
+ <message>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="obsolete">Режим Lightscreen выбора области экрана:
+Используйте мышку, чтобы выделить прямоугольную область захвата экрана
+или нажмите любую клавишу, правую или среднюю кнопку мыши для выхода из режима.</translation>
+ </message>
+ <message>
+ <source>%1 x %2 px </source>
+ <translation type="obsolete">%1 x %2 px </translation>
+ </message>
+</context>
+<context>
+ <name>HotkeyWidget</name>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="15"/>
+ <source>Click to select hotkey...</source>
+ <translation type="unfinished">Нажмите для выбора горячей клавиши...</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="47"/>
+ <source>Type your hotkey</source>
+ <translation type="unfinished">Нажмите Ваши горячие клавиши</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="56"/>
+ <source>Invalid hotkey</source>
+ <translation type="unfinished">Недействительная горячая клавиша</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindow</name>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="97"/>
+ <location filename="../lightscreenwindow.cpp" line="258"/>
+ <location filename="../lightscreenwindow.cpp" line="482"/>
+ <location filename="../lightscreenwindow.cpp" line="682"/>
+ <source>Lightscreen</source>
+ <translation type="unfinished">Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="98"/>
+ <source>You have chosen to hide Lightscreen when there&apos;s no system tray icon, so you will not be able to access the program &lt;b&gt;unless you have selected a hotkey to do so&lt;/b&gt;.&lt;br&gt;What do you want to do?</source>
+ <translation type="unfinished">Вы выбрали скрыть Lightscreen так, что иконка в системном трее не будет отображаться, и Вы не сможете получить доступ к программе, &lt;b&gt;если не определены горячие клавиши&lt;/b&gt;.&lt;br&gt;Что Вы хотите сделать?</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="101"/>
+ <source>Hide but enable tray</source>
+ <translation type="unfinished">Скрыть, но оставить в системном трее</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="103"/>
+ <source>Hide and don&apos;t warn</source>
+ <translation type="unfinished">Скрыть не предупреждая</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="105"/>
+ <source>Just hide</source>
+ <translation type="unfinished">Просто скрыть</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="385"/>
+ <source>Saved to %1%2</source>
+ <translation type="unfinished">Сохранено в %1%2</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="391"/>
+ <source>The screenshot was not taken</source>
+ <translation type="unfinished">Скриншот не сделан</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="392"/>
+ <source>There was an error or you did not select a valid area.</source>
+ <translation type="unfinished">Произошла ошибка или область была выбрана не правильно.</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="407"/>
+ <location filename="../lightscreenwindow.cpp" line="612"/>
+ <source>Active &amp;Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="410"/>
+ <location filename="../lightscreenwindow.cpp" line="615"/>
+ <source>&amp;Pick Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="442"/>
+ <source>Sucess!</source>
+ <translation type="unfinished">Успешно!</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="447"/>
+ <source>Failed!</source>
+ <translation type="unfinished">Ошибка!</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="462"/>
+ <source>Some hotkeys could not be registered, they might already be in use</source>
+ <translation type="unfinished">Некоторые клавиши не зарегистрированы, поскольку уже могут быть в эксплуатации</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="465"/>
+ <source>&lt;br&gt;The failed hotkeys are the following:</source>
+ <translation type="unfinished">&lt;br&gt; Следующие клавиши не верны:</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="476"/>
+ <source>&lt;br&gt;The failed hotkey is &lt;b&gt;%1&lt;/b&gt;</source>
+ <translation type="unfinished">&lt;br&gt;Неверная горячая клавиша&lt;b&gt;%1&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="479"/>
+ <source>&lt;br&gt;&lt;i&gt;What do you want to do?&lt;/i&gt;</source>
+ <translation type="unfinished">&lt;br&gt;&lt;i&gt;Что Вы хотите сделать?&lt;/i&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="485"/>
+ <source>Change</source>
+ <translation type="unfinished">Изменить</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="486"/>
+ <source>Disable</source>
+ <translation type="unfinished">Отключить</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="487"/>
+ <source>Quit</source>
+ <translation type="unfinished">Выход</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="683"/>
+ <source>There&apos;s a new version of Lightscreen available.&lt;br&gt;Would you like to see more information?&lt;br&gt;(&lt;em&gt;You can turn this notification off&lt;/em&gt;)</source>
+ <translation type="unfinished">В новой версии Lightscreen.&lt;br&gt;Вы хотели бы увидеть больше информации?&lt;br&gt;(&lt;em&gt;Вы можете просто выключить это уведомление&lt;/em&gt;)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="687"/>
+ <source>Turn Off</source>
+ <translation type="unfinished">Отключить</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="688"/>
+ <source>Remind Me Later</source>
+ <translation type="unfinished">Напомнить позже</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="404"/>
+ <location filename="../lightscreenwindow.cpp" line="609"/>
+ <source>&amp;Screen</source>
+ <translation type="unfinished">&amp;Экран</translation>
+ </message>
+ <message>
+ <source>&amp;Window</source>
+ <translation type="obsolete">О&amp;кно</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="413"/>
+ <location filename="../lightscreenwindow.cpp" line="618"/>
+ <source>&amp;Area</source>
+ <translation type="unfinished">О&amp;бласть</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="416"/>
+ <location filename="../lightscreenwindow.cpp" line="632"/>
+ <source>&amp;Go to Folder</source>
+ <translation type="unfinished">&amp;Перейти в папку</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="606"/>
+ <source>Show&amp;/Hide</source>
+ <translation type="unfinished">Показать&amp;/Скрыть</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="629"/>
+ <source>View &amp;Options</source>
+ <translation type="unfinished">Просмотр &amp;Настроек</translation>
+ </message>
+ <message>
+ <source>&amp;About Lightscreen</source>
+ <translation type="obsolete">&amp;О Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="635"/>
+ <source>&amp;Quit</source>
+ <translation type="unfinished">Выхо&amp;д</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindowClass</name>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="14"/>
+ <source>Lightscreen</source>
+ <translation type="unfinished">Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="35"/>
+ <source>Screenshot</source>
+ <translation type="unfinished">Скриншот</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="54"/>
+ <source>Configure Lightscreen</source>
+ <translation type="unfinished">Конфигурация Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="57"/>
+ <source>&amp;Options</source>
+ <translation type="unfinished">&amp;Настройки</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="76"/>
+ <source>Hide Lightscreen </source>
+ <translation type="unfinished">Скрыть Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="82"/>
+ <source>&amp;Hide</source>
+ <translation type="unfinished">&amp;Скрыть</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="104"/>
+ <source>&amp;Quit</source>
+ <translation type="unfinished">Выхо&amp;д</translation>
+ </message>
+</context>
+<context>
+ <name>NamingDialog</name>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="14"/>
+ <source>Naming Options - Lightscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="42"/>
+ <source>Leading zeros:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="94"/>
+ <source>Date Format:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="122"/>
+ <source> &lt;a href=&quot;http://lightscreen.sourceforge.net/help/date&quot;&gt;[?]&lt;/a&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="136"/>
+ <source>yyyy-MM-dd</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="141"/>
+ <source>yyyy-MM-dd HH.mm.ss</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="161"/>
+ <source>Flip naming.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OptionsDialog</name>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="67"/>
+ <source>Version %1</source>
+ <translation type="unfinished">Версия %1</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>Hotkey conflict</source>
+ <translation type="unfinished">Конфликт горячих клавиш</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>You have assigned the same hotkeys to more than one action.</source>
+ <translation type="unfinished">Вы присвоили одинаковые горячие клавиши для более одного действия.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>Filename character error</source>
+ <translation type="unfinished">Ошибка в символе имени файла</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>The filename can&apos;t contain any of the following characters: ? : \ / * &quot; &lt; &gt; |</source>
+ <translation type="unfinished">Имя файла не может содержать любой из следующих символов: ? : \ / * &quot; &lt; &gt; |</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>Final Destination</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>You can&apos;t take screenshots unless you enable file saving or the clipboard.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="163"/>
+ <source>Select where you want to save the screenshots</source>
+ <translation type="unfinished">Выберите, где вы хотите сохранить скриншот</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="181"/>
+ <source>Lightscreen - Options</source>
+ <translation type="unfinished">Lightscreen - Настройки</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="182"/>
+ <source>Restoring the default options will cause you to lose all of your current configuration.</source>
+ <translation type="unfinished">Восстановление настроек по умолчанию приведет к потере всей вашей текущей конфигурации.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="185"/>
+ <source>Restore</source>
+ <translation type="unfinished">Восстановить</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="186"/>
+ <source>Don&apos;t Restore</source>
+ <translation type="unfinished">Не восстанавливать</translation>
+ </message>
+ <message>
+ <source> (OptiPNG not found)</source>
+ <translation type="obsolete"> (OptiPNG не найден)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="14"/>
+ <source>Options - Lightscreen</source>
+ <translation type="unfinished">Настройки - Lightscreen</translation>
+ </message>
+ <message>
+ <source>&amp;General</source>
+ <translation type="obsolete">&amp;Общие</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="36"/>
+ <source>File</source>
+ <translation type="unfinished">Файл</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="54"/>
+ <source>&amp;Directory:</source>
+ <translation type="unfinished">&amp;Папка:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="94"/>
+ <source>The prefix for the screenshot file</source>
+ <translation type="unfinished">Префикс в имени файла скиншота</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="97"/>
+ <source>&amp;Filename:</source>
+ <translation type="unfinished">Имя &amp;файла:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="115"/>
+ <source>The prefix will be inserted before the &lt;em&gt;Naming&lt;/em&gt; in the screenshot file and it is usually used to distinguish files. It can be left blank.</source>
+ <translation type="unfinished">Префикс будет вставлен в &lt;em&gt;Имя&lt;/em&gt; файла скриншота и он,обычно, используется для индентификации фалов. Он может остаться пустым.</translation>
+ </message>
+ <message>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3.
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp) that corresponds with the current time.
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss.</source>
+ <translation type="obsolete">Вставляется в название после префикса и делает каждый файл скриншота уникальным во избежание перезаписи.&lt;br /&gt;
+&lt;b&gt;Номер&lt;/b&gt;:вставляет последовательный номер, 1, 2, 3.
+&lt;b&gt;Timestamp&lt;/b&gt;: вставляет уникальный номер (Unix timestamp), соответствующий текущему времени.
+&lt;b&gt;Дата&lt;/b&gt;: вставляет текущие дату и время, в формате дд-ММ-гггг чч.мм.сс.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="132"/>
+ <source>(number)</source>
+ <translation type="unfinished">(номер)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="142"/>
+ <source>(timestamp)</source>
+ <translation type="unfinished">(timestamp)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="137"/>
+ <source>(date)</source>
+ <translation type="unfinished">(дата)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="24"/>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="168"/>
+ <source>The file format for the screenshot</source>
+ <translation type="unfinished">Формат файла для скриншота</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="171"/>
+ <source>F&amp;ormat:</source>
+ <translation type="unfinished">&amp;Формат:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="185"/>
+ <source>PNG</source>
+ <translation type="unfinished">PNG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="190"/>
+ <source>JPG</source>
+ <translation type="unfinished">JPG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="195"/>
+ <source>BMP</source>
+ <translation type="unfinished">BMP</translation>
+ </message>
+ <message>
+ <source>TIFF</source>
+ <translation type="obsolete">TIFF</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="776"/>
+ <source>D&amp;elay:</source>
+ <translation type="unfinished">Пау&amp;за:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="789"/>
+ <source>Selecting anything other than 0 in this option will cause the program to &lt;b&gt;wait&lt;/b&gt; that amount of seconds before taking the screenshot.</source>
+ <translation type="unfinished">Выбор любого значения кроме 0, заставит программу подождать прежде, чем сделать скриншот.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="792"/>
+ <source>none</source>
+ <translation type="unfinished">нет</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="801"/>
+ <location filename="../dialogs/optionsdialog.ui" line="955"/>
+ <source> seconds</source>
+ <translation type="unfinished">секунд</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="318"/>
+ <source>&amp;Run Lightscreen at system startup.</source>
+ <translation type="unfinished">&amp;Запустить Lightscreen при запуске системы.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="346"/>
+ <source>H&amp;ide the main window.</source>
+ <translation type="unfinished">Скр&amp;ыть главное окно.</translation>
+ </message>
+ <message>
+ <source>&amp;Hotkeys</source>
+ <translation type="obsolete">&amp;Горячие клавишы</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="386"/>
+ <source>Capture the screen</source>
+ <translation type="unfinished">Захват экрана</translation>
+ </message>
+ <message>
+ <source>Capture a window</source>
+ <translation type="obsolete">Захватить окно</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="441"/>
+ <source>Capture a screen area</source>
+ <translation type="unfinished">Захватить область</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="504"/>
+ <source>Open the directory</source>
+ <translation type="unfinished">Открыть папку</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="488"/>
+ <source>Open the program window</source>
+ <translation type="unfinished">Открыть окно программы</translation>
+ </message>
+ <message>
+ <source>&amp;Options</source>
+ <translation type="obsolete">&amp;Настройки</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="591"/>
+ <source>Sho&amp;w a system tray icon.</source>
+ <translation type="unfinished">Показывать иконку в &amp;системном трее.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="598"/>
+ <source>&amp;Hide Lightscreen while taking a screenshot.</source>
+ <translation type="unfinished">C&amp;крыть Lightscreen при создании скриншота.</translation>
+ </message>
+ <message>
+ <source>Periodically check for updates.</source>
+ <translation type="obsolete">Переодически проверять обновления.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="743"/>
+ <source>&amp;Magnify around the mouse in Area mode.</source>
+ <translation type="unfinished">Пре&amp;увеличить область захвата вокруг курсора в режиме захвата области.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="661"/>
+ <source>&amp;Language:</source>
+ <translation type="unfinished">&amp;Язык:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="678"/>
+ <source>Click here to go to the Lightscreen homepage to learn more about translations.</source>
+ <translation type="unfinished">Нажмите здесь, чтобы перейти на домашнюю страницу Lightscreen и получить больше информацию о переводе.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="681"/>
+ <source>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;More information..&lt;/a&gt;</source>
+ <translation type="unfinished">&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;Больше информации..&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="617"/>
+ <source>&amp;Notify with:</source>
+ <translation type="unfinished">&amp;Уведомлять:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="267"/>
+ <source>&lt;i&gt;Preview&lt;/i&gt;:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="203"/>
+ <source>&amp;Quality:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="122"/>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3..&lt;br /&gt;
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date, in the form of dd-MM-yyyy..&lt;br /&gt;
+&lt;b&gt;Date &amp;amp; Time&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss..&lt;br /&gt;
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp, the number of seconds passed since 1970-1-1 00:00:00) that corresponds with the current time.&lt;br /&gt;
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="147"/>
+ <source>(none)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="306"/>
+ <source>System Startup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="359"/>
+ <source>Hotkeys</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="365"/>
+ <source>Captures</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="409"/>
+ <source>Capture the current window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="425"/>
+ <source>Capture a chosen window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="467"/>
+ <source>Lightscreen Control</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="531"/>
+ <source>Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="579"/>
+ <source>Interface</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="627"/>
+ <source>Shows a completion message once the screenshot is saved, clicking this message takes you to the directory where the screenshot was saved.</source>
+ <translation type="unfinished">Показывать сообщение о выполнении, после сохранении скриншота, нажав на это сообщение Вы перейдёте в папку, где был сохранён скриншот.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="630"/>
+ <source>Tray icon Popup</source>
+ <translation type="unfinished">Всплывающее сообщение</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="637"/>
+ <source>&amp;Sound cue</source>
+ <translation type="unfinished">Зв&amp;уковой сигнал</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="760"/>
+ <source>Replace screenshots when there&apos;s an existing file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="767"/>
+ <source>Snap area screenshots automatically (no resizing).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="847"/>
+ <source>Maximum Size:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="898"/>
+ <source>Position:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="968"/>
+ <source> and </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="982"/>
+ <source>save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="987"/>
+ <source>cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1055"/>
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1061"/>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
+Special thanks goes to the &lt;a href=&quot;http://lightscreen.sourceforge.net/about&quot;&gt;Donators and Translators&lt;/a&gt;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1090"/>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="unfinished">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Посетить сайт Sourceforge project&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Посетитьдомашнюю страницу Lightscreen&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <source>Screenshot &amp;Quality:</source>
+ <translation type="obsolete">Ка&amp;чество скриншота:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="216"/>
+ <source>This slider goes from 0 to 100. 100 being the highest quality and 0 the lowest.&lt;br&gt;
+Quality is related to file size and of course to readability and overall quality of the image.</source>
+ <translation type="unfinished">Бегунок перемещается от 0 до 100. 100 - это наивысшее качество, а 0 - самое низкое.&lt;br&gt;
+От качества зависит размер файла, читабельность и общее качество изображения.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="246"/>
+ <source>100</source>
+ <translation type="unfinished">100</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="258"/>
+ <source>%</source>
+ <translation type="unfinished">%</translation>
+ </message>
+ <message>
+ <source>&amp;Advanced</source>
+ <translation type="obsolete">Рас&amp;ширенно</translation>
+ </message>
+ <message>
+ <source>Choose where and how to &amp;save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="obsolete">Выбрать где и как &amp;сохранить скриншот (&quot;&amp;Сохранить как&quot;).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="722"/>
+ <source>&amp;Copy the screenshot to the clipboard.</source>
+ <translation type="unfinished">&amp;Копировать скриншот в буфер.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="736"/>
+ <source>Inc&amp;lude the cursor in the screenshot.</source>
+ <translation type="unfinished">Вк&amp;лючить курсор в скриншот.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="706"/>
+ <source>Screenshots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="715"/>
+ <source>Choose where to save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="729"/>
+ <source>&amp;Grab only the current monitor.</source>
+ <translation type="unfinished">За&amp;хватить только текущий монитор.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="750"/>
+ <source>Opens a new process called OptiPNG which dramatically reduces the file size.</source>
+ <translation type="unfinished">Открывается новый процесс OptiPNG, который значительно уменьшит размер файла.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="753"/>
+ <source>O&amp;ptimize PNG screenshots.</source>
+ <translation type="unfinished">О&amp;птимизация PNG скриншота.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="605"/>
+ <source>Warn when hiding without a tra&amp;y icon.</source>
+ <translation type="unfinished">Предупреждать, когда программа скрывается без &amp;иконки в системном трее.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="832"/>
+ <source>Screenshot Previews</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="912"/>
+ <source>Top Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="917"/>
+ <source>Top Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="922"/>
+ <source>Bottom Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="927"/>
+ <source>Bottom Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="948"/>
+ <source>Auto-close after</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1011"/>
+ <source>Updater</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1020"/>
+ <source>Check for updates regularly.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1040"/>
+ <source>Chec&amp;k Updates Now</source>
+ <translation type="unfinished">Прове&amp;рить обновления сейчас</translation>
+ </message>
+ <message>
+ <source>About Lightscreen</source>
+ <translation type="obsolete">О Lightscreen</translation>
+ </message>
+</context>
+<context>
+ <name>PreviewDialog</name>
+ <message>
+ <location filename="../dialogs/previewdialog.cpp" line="308"/>
+ <source>Screenshot Preview: Closing in %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Screenshot</name>
+ <message>
+ <location filename="../tools/screenshot.cpp" line="272"/>
+ <source>Save as..</source>
+ <translation type="unfinished">Сохранить как..</translation>
+ </message>
+</context>
+<context>
+ <name>ScreenshotDialog</name>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="18"/>
+ <source>Lightscreen Screenshot Viewer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="20"/>
+ <source>You can zoom using the mouse wheel while holding the CTRL key. To return to the default zoom (100%) press &quot;Ctrl-0&quot;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>UpdaterDialog</name>
+ <message>
+ <source>Cancel</source>
+ <translation type="obsolete">Отмена</translation>
+ </message>
+ <message>
+ <source>Updater - Lightscreen</source>
+ <translation type="obsolete">Поиск обновлений Lightscreen</translation>
+ </message>
+ <message>
+ <source>Checking for updates</source>
+ <translation type="obsolete">Проверить обновления</translation>
+ </message>
+ <message>
+ <source>There&apos;s a new version available,&lt;br&gt; please see &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;the Lighscreen website&lt;/a&gt;.</source>
+ <translation type="obsolete">Доступна новая версия,&lt;br&gt; посетите &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;сайт Lighscreen&lt;/a&gt;.</translation>
+ </message>
+ <message>
+ <source>No new versions available</source>
+ <translation type="obsolete">Вы используете последнюю версию</translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="obsolete">Закрыть</translation>
+ </message>
+</context>
+<context>
+ <name>WindowPicker</name>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="24"/>
+ <source>Lightscreen Window Picker</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="26"/>
+ <source>Grab the picker by clicking and holding down the mouse button, then drag it to the window of your choice and release it to capture.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="41"/>
+ <source> - Start dragging to select windows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="50"/>
+ <source>Close</source>
+ <translation type="unfinished">Закрыть</translation>
+ </message>
+</context>
+</TS>
diff --git a/translations/spanish.qm b/translations/spanish.qm
new file mode 100644
index 0000000..fd72357
Binary files /dev/null and b/translations/spanish.qm differ
diff --git a/translations/spanish.ts b/translations/spanish.ts
new file mode 100644
index 0000000..b5605f9
--- /dev/null
+++ b/translations/spanish.ts
@@ -0,0 +1,924 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="es">
+<context>
+ <name>AboutDialog</name>
+ <message>
+ <source>Version %1</source>
+ <translation type="obsolete">Versión %1</translation>
+ </message>
+</context>
+<context>
+ <name>AboutDialogClass</name>
+ <message>
+ <source>About - Lightscreen</source>
+ <translation type="obsolete">Acerca De - Lightscreen</translation>
+ </message>
+ <message>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/b&gt;.</source>
+ <translation type="obsolete">Lightscreen es una simple herramienta para tomar capturas de pantalla, diseñada para ser simple y configurable.&lt;br&gt;&lt;br&gt;
+Creada por &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, usando las &lt;a href=&quot;#aboutqt&quot;&gt;herramientas Qt&lt;a/&gt; para la interface gráfica.&lt;br&gt;&lt;br&gt;
+Liberado bajo la &lt;a href=&quot;http://www.garaitia.com/new/gpl-spanish.php&quot;&gt;licencia GNU GPL&lt;/a&gt;.</translation>
+ </message>
+ <message>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="obsolete">&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visite la pagina del proyecto en SourceForge&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visite la pagina principal del Lightscreen&lt;/a&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>AreaDialog</name>
+ <message>
+ <location filename="../dialogs/areadialog.cpp" line="127"/>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="unfinished">Modo de área de pantalla:Usa el mouse para dibujar un rectangulo para capturar. Presiona cualquiertecla para salir, o usa el botón derecho o del medio del mouse.</translation>
+ </message>
+</context>
+<context>
+ <name>AreaSelector</name>
+ <message>
+ <source>%1 x %2 px </source>
+ <translation type="obsolete">%1 x %2 px</translation>
+ </message>
+ <message>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="obsolete">Modo de área de pantalla:Usa el mouse para dibujar un rectangulo para capturar. Presiona cualquiertecla para salir, o usa el botón derecho o del medio del mouse.</translation>
+ </message>
+</context>
+<context>
+ <name>HotkeyWidget</name>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="15"/>
+ <source>Click to select hotkey...</source>
+ <translation>Click para elegir atajo...</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="47"/>
+ <source>Type your hotkey</source>
+ <translation>Escriba su atajo</translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="56"/>
+ <source>Invalid hotkey</source>
+ <translation>Atajo invalido</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindow</name>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="97"/>
+ <location filename="../lightscreenwindow.cpp" line="258"/>
+ <location filename="../lightscreenwindow.cpp" line="482"/>
+ <location filename="../lightscreenwindow.cpp" line="682"/>
+ <source>Lightscreen</source>
+ <translation>Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="98"/>
+ <source>You have chosen to hide Lightscreen when there&apos;s no system tray icon, so you will not be able to access the program &lt;b&gt;unless you have selected a hotkey to do so&lt;/b&gt;.&lt;br&gt;What do you want to do?</source>
+ <translation>Ha elegido cerrar Lightscreen cuando este no tiene un ícono en la barra de tareas, por lo que no podrá acceder al programa &lt;b&gt;a menos que haya seleccionado un atajo para hacerlo.&lt;/b&gt;.&lt;br&gt;Que desea hacer?</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="101"/>
+ <source>Hide but enable tray</source>
+ <translation>Esconder pero habilitar icono</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="103"/>
+ <source>Hide and don&apos;t warn</source>
+ <translation>Esconder y no advertir</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="105"/>
+ <source>Just hide</source>
+ <translation>Solo esconder</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="391"/>
+ <source>The screenshot was not taken</source>
+ <translation>La captura no fue realizada</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="392"/>
+ <source>There was an error or you did not select a valid area.</source>
+ <translation>Ha habido un error o no ha seleccionado un área valida.</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="407"/>
+ <location filename="../lightscreenwindow.cpp" line="612"/>
+ <source>Active &amp;Window</source>
+ <translation>&amp;Ventana Activa</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="410"/>
+ <location filename="../lightscreenwindow.cpp" line="615"/>
+ <source>&amp;Pick Window</source>
+ <translation>&amp;Elegir Ventana</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="462"/>
+ <source>Some hotkeys could not be registered, they might already be in use</source>
+ <translation>Algunos atajos no pudieron ser registrados, puede que ya estén en uso</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="479"/>
+ <source>&lt;br&gt;&lt;i&gt;What do you want to do?&lt;/i&gt;</source>
+ <translation>&lt;br&gt;&lt;i&gt;Que desea hacer?&lt;/i&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="606"/>
+ <source>Show&amp;/Hide</source>
+ <translation>Mostrar&amp;/Esconder</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="404"/>
+ <location filename="../lightscreenwindow.cpp" line="609"/>
+ <source>&amp;Screen</source>
+ <translation>&amp;Pantalla</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="442"/>
+ <source>Sucess!</source>
+ <translation>Éxito!</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="447"/>
+ <source>Failed!</source>
+ <translation>Error!</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="465"/>
+ <source>&lt;br&gt;The failed hotkeys are the following:</source>
+ <translation>&lt;br&gt;Las hotkeys en uso son las siguientes:</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="476"/>
+ <source>&lt;br&gt;The failed hotkey is &lt;b&gt;%1&lt;/b&gt;</source>
+ <translation>&lt;br&gt;La hotkey que ha fallado es &lt;b&gt;%1&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="485"/>
+ <source>Change</source>
+ <translation>Cambiar</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="486"/>
+ <source>Disable</source>
+ <translation>Deshabilitar</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="487"/>
+ <source>Quit</source>
+ <translation>Salir</translation>
+ </message>
+ <message>
+ <source>&amp;Window</source>
+ <translation type="obsolete">&amp;Ventana</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="413"/>
+ <location filename="../lightscreenwindow.cpp" line="618"/>
+ <source>&amp;Area</source>
+ <translation>&amp;Área</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="629"/>
+ <source>View &amp;Options</source>
+ <translation>Ver las &amp;Opciones</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="416"/>
+ <location filename="../lightscreenwindow.cpp" line="632"/>
+ <source>&amp;Go to Folder</source>
+ <translation>&amp;Ir a la carpeta</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="635"/>
+ <source>&amp;Quit</source>
+ <translation>&amp;Salir</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="385"/>
+ <source>Saved to %1%2</source>
+ <translation>Guardada en %1%2</translation>
+ </message>
+ <message>
+ <source>&amp;About Lightscreen</source>
+ <translation type="obsolete">Acerca de &amp;Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="683"/>
+ <source>There&apos;s a new version of Lightscreen available.&lt;br&gt;Would you like to see more information?&lt;br&gt;(&lt;em&gt;You can turn this notification off&lt;/em&gt;)</source>
+ <translation>Hay una nueva versión de Lightscreen disponible.&lt;br&gt;Desea ver más información?&lt;br&gt;(&lt;em&gt;Puede desactivar esta notificación&lt;/em&gt;)</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="687"/>
+ <source>Turn Off</source>
+ <translation>Desactivar</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="688"/>
+ <source>Remind Me Later</source>
+ <translation>Más Tarde</translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindowClass</name>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="14"/>
+ <source>Lightscreen</source>
+ <translation>Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="35"/>
+ <source>Screenshot</source>
+ <translation>Captura</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="54"/>
+ <source>Configure Lightscreen</source>
+ <translation>Configurar Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="57"/>
+ <source>&amp;Options</source>
+ <translation>&amp;Opciones</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="76"/>
+ <source>Hide Lightscreen </source>
+ <translation>Esconder Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="82"/>
+ <source>&amp;Hide</source>
+ <translation>&amp;Esconder</translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="104"/>
+ <source>&amp;Quit</source>
+ <translation>&amp;Salir</translation>
+ </message>
+</context>
+<context>
+ <name>NamingDialog</name>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="14"/>
+ <source>Naming Options - Lightscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="42"/>
+ <source>Leading zeros:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="94"/>
+ <source>Date Format:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="122"/>
+ <source> &lt;a href=&quot;http://lightscreen.sourceforge.net/help/date&quot;&gt;[?]&lt;/a&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="136"/>
+ <source>yyyy-MM-dd</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="141"/>
+ <source>yyyy-MM-dd HH.mm.ss</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="161"/>
+ <source>Flip naming.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OptionsDialog</name>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="67"/>
+ <source>Version %1</source>
+ <translation>Versión %1</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>Hotkey conflict</source>
+ <translation>Conflicto de atajos</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>You have assigned the same hotkeys to more than one action.</source>
+ <translation>Has asignado el mismo atajo a más de una acción.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>Filename character error</source>
+ <translation>Error de nombre de archivo</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>The filename can&apos;t contain any of the following characters: ? : \ / * &quot; &lt; &gt; |</source>
+ <translation>El nombre de archivo no puede contener ninguno de los siguientes caracteres: ? : \ / * &quot; &lt; &gt; |</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>Final Destination</source>
+ <translation>Destino Final</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>You can&apos;t take screenshots unless you enable file saving or the clipboard.</source>
+ <translation>No puede realizar capturas a menos que active guardar archivos o copiar al portapeles.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="163"/>
+ <source>Select where you want to save the screenshots</source>
+ <translation>Seleccione donde quiere guardar las capturas</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="181"/>
+ <source>Lightscreen - Options</source>
+ <translation>Lightscreen - Opciones</translation>
+ </message>
+ <message>
+ <source> (OptiPNG not found)</source>
+ <translation type="obsolete"> (OptiPNG no fue encontrado)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="14"/>
+ <source>Options - Lightscreen</source>
+ <translation>Opciones - Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="24"/>
+ <source>General</source>
+ <translation>General</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="94"/>
+ <source>The prefix for the screenshot file</source>
+ <translation>El prefijo para la captura</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="132"/>
+ <source>(number)</source>
+ <translation>(numero)</translation>
+ </message>
+ <message>
+ <source>(date &amp; time)</source>
+ <translation type="obsolete">(fecha &amp; hora)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="142"/>
+ <source>(timestamp)</source>
+ <translation>(tiempo unix)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="168"/>
+ <source>The file format for the screenshot</source>
+ <translation>El formato de la captura</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="185"/>
+ <source>PNG</source>
+ <translation>PNG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="190"/>
+ <source>JPG</source>
+ <translation>JPG</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="195"/>
+ <source>BMP</source>
+ <translation>BMP</translation>
+ </message>
+ <message>
+ <source>screenshot.1.png</source>
+ <translation type="obsolete">captura.1.png</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="267"/>
+ <source>&lt;i&gt;Preview&lt;/i&gt;:</source>
+ <translation>&lt;i&gt;Vista Previa&lt;/i&gt;:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="203"/>
+ <source>&amp;Quality:</source>
+ <translation>Cali&amp;dad:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="122"/>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3..&lt;br /&gt;
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date, in the form of dd-MM-yyyy..&lt;br /&gt;
+&lt;b&gt;Date &amp;amp; Time&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss..&lt;br /&gt;
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp, the number of seconds passed since 1970-1-1 00:00:00) that corresponds with the current time.&lt;br /&gt;
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="147"/>
+ <source>(none)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="306"/>
+ <source>System Startup</source>
+ <translation>Inicio del Sistema</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="359"/>
+ <source>Hotkeys</source>
+ <translation>Atajos</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="365"/>
+ <source>Captures</source>
+ <translation>Capturas</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="409"/>
+ <source>Capture the current window</source>
+ <translation>Capturar la ventana activa</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="425"/>
+ <source>Capture a chosen window</source>
+ <translation>Capturar una ventana a elección</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="467"/>
+ <source>Lightscreen Control</source>
+ <translation>Control del Lightscreen</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="531"/>
+ <source>Options</source>
+ <translation>Opciones</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="579"/>
+ <source>Interface</source>
+ <translation>Interface</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="706"/>
+ <source>Screenshots</source>
+ <translation>Capturas</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="715"/>
+ <source>Choose where to save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation>Elegir cuando y &amp;donde guardar cada captura (&quot;Guardar como&quot;).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="750"/>
+ <source>Opens a new process called OptiPNG which dramatically reduces the file size.</source>
+ <translation>Abre un nuevo programa llamado OptiPNG que reduce el tamaño del archivo.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="760"/>
+ <source>Replace screenshots when there&apos;s an existing file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="767"/>
+ <source>Snap area screenshots automatically (no resizing).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="847"/>
+ <source>Maximum Size:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="898"/>
+ <source>Position:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="968"/>
+ <source> and </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="982"/>
+ <source>save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="987"/>
+ <source>cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1055"/>
+ <source>About</source>
+ <translation>Acerca De</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1061"/>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
+Special thanks goes to the &lt;a href=&quot;http://lightscreen.sourceforge.net/about&quot;&gt;Donators and Translators&lt;/a&gt;.</source>
+ <translation>Lightscreen es una simple herramienta para tomar capturas de pantalla, diseñada para ser liviana y configurable.&lt;br&gt;&lt;br&gt;
+Creada por &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, usando las &lt;a href=&quot;#aboutqt&quot;&gt;herramientas Qt&lt;/a&gt; para la interface gráfica.&lt;br&gt;&lt;br&gt;
+Liberado bajo la &lt;a href=&quot;http://www.garaitia.com/new/gpl-spanish.php&quot;&gt;licencia GNU GPL&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
+Un agradecimiento especial a los &lt;a href=&quot;http://lightscreen.sourceforge.net/about&quot;&gt;Donadores y Traductores&lt;/a&gt;.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1090"/>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visite la pagina del proyecto en SourceForge&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visite la pagina principal del Lightscreen&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="182"/>
+ <source>Restoring the default options will cause you to lose all of your current configuration.</source>
+ <translation>Restaurar las opciones por defecto hara que pierda toda su configuración actual.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="185"/>
+ <source>Restore</source>
+ <translation>Restaurar</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="186"/>
+ <source>Don&apos;t Restore</source>
+ <translation>No Restaurar</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="801"/>
+ <location filename="../dialogs/optionsdialog.ui" line="955"/>
+ <source> seconds</source>
+ <translation> segundos</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="386"/>
+ <source>Capture the screen</source>
+ <translation>Capturar la pantalla</translation>
+ </message>
+ <message>
+ <source>Capture a window</source>
+ <translation type="obsolete">Capturar una ventana</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="441"/>
+ <source>Capture a screen area</source>
+ <translation>Capturar un área</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="488"/>
+ <source>Open the program window</source>
+ <translation>Abrir la ventana del programa</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="504"/>
+ <source>Open the directory</source>
+ <translation>Abrir el directorio</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="591"/>
+ <source>Sho&amp;w a system tray icon.</source>
+ <translation>Mo&amp;strar un ícono de sistema.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="598"/>
+ <source>&amp;Hide Lightscreen while taking a screenshot.</source>
+ <translation>Esconder Lig&amp;htscreen mientras se captura.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="678"/>
+ <source>Click here to go to the Lightscreen homepage to learn more about translations.</source>
+ <translation>Haz click aquí para ir a la página del Lightscreen y aprender mas sobre traducciones.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="681"/>
+ <source>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;More information..&lt;/a&gt;</source>
+ <translation>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;Más información..&lt;/a&gt;</translation>
+ </message>
+ <message>
+ <source>Screenshot &amp;Quality:</source>
+ <translation type="obsolete">Calida&amp;d de Screenshot:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="216"/>
+ <source>This slider goes from 0 to 100. 100 being the highest quality and 0 the lowest.&lt;br&gt;
+Quality is related to file size and of course to readability and overall quality of the image.</source>
+ <translation>Este slider va desde a 0 a 100. 100 siendo la mayor calidad y 0 la más baja.&lt;br&gt;
+La calidad tiene relacion con el tamaño del archivo y la legibilidad/calidad general de la imagen.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="115"/>
+ <source>The prefix will be inserted before the &lt;em&gt;Naming&lt;/em&gt; in the screenshot file and it is usually used to distinguish files. It can be left blank.</source>
+ <translation>El prefijo sera insertado antes del &lt;em&gt;Nombre&lt;/em&gt; en la captura y es generalmente usado para distinguir los archivos. Puede ser dejado en blanco.</translation>
+ </message>
+ <message>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3.
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp) that corresponds with the current time.
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss.</source>
+ <translation type="obsolete">El nombre es insertado antes del prefijo y es lo que hace a cada captura unica para evitar ser sobreescrita.&lt;br /&gt;
+&lt;b&gt;Numero&lt;/b&gt;: inserta un numbero en secuencia, 1, 2, 3.
+&lt;b&gt;Tiemestamp&lt;/b&gt;: inserta un numero único (una timestamp de Unix) que corresponde al tiempo actual.
+&lt;b&gt;Fecha&lt;/b&gt;: inserta la fecha y hora actual, en la forma de dia-mes-año hora.minuto.segundo.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="789"/>
+ <source>Selecting anything other than 0 in this option will cause the program to &lt;b&gt;wait&lt;/b&gt; that amount of seconds before taking the screenshot.</source>
+ <translation>Seleccionar algo que no sea 0 causara que el programa &lt;b&gt;espere&lt;/b&gt; esa cantidad de segundos antes de sacar la captura.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="743"/>
+ <source>&amp;Magnify around the mouse in Area mode.</source>
+ <translation>Aumentar el area alrededor del &amp;mouse en Area.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="661"/>
+ <source>&amp;Language:</source>
+ <translation>&amp;Idioma:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="617"/>
+ <source>&amp;Notify with:</source>
+ <translation>&amp;Noficar con:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="630"/>
+ <source>Tray icon Popup</source>
+ <translation>Popup en el ícono de sistema</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="637"/>
+ <source>&amp;Sound cue</source>
+ <translation>&amp;Sonido</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="36"/>
+ <source>File</source>
+ <translation>Archivo</translation>
+ </message>
+ <message>
+ <source>&amp;General</source>
+ <translation type="obsolete">&amp;General</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="54"/>
+ <source>&amp;Directory:</source>
+ <translation>&amp;Directorio:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="97"/>
+ <source>&amp;Filename:</source>
+ <translation>&amp;Archivo:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="137"/>
+ <source>(date)</source>
+ <translation>(fecha)</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="171"/>
+ <source>F&amp;ormat:</source>
+ <translation>F&amp;ormato:</translation>
+ </message>
+ <message>
+ <source>Snap area screenshots automatically (no resizing)</source>
+ <translation type="obsolete">Capturar areas automaticamente (sin cambio de tamaño).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="776"/>
+ <source>D&amp;elay:</source>
+ <translation>R&amp;etraso:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="792"/>
+ <source>none</source>
+ <translation>ninguno</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="318"/>
+ <source>&amp;Run Lightscreen at system startup.</source>
+ <translation>Ejecuta&amp;r Lightscreen cuando inicia el sistema.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="346"/>
+ <source>H&amp;ide the main window.</source>
+ <translation>Esconder la ventana pr&amp;incipal.</translation>
+ </message>
+ <message>
+ <source>&amp;Hotkeys</source>
+ <translation type="obsolete">Ata&amp;jos</translation>
+ </message>
+ <message>
+ <source>&amp;Options</source>
+ <translation type="obsolete">&amp;Opciones</translation>
+ </message>
+ <message>
+ <source>Periodically check for updates.</source>
+ <translation type="obsolete">Buscar actualizaciones periodicamente.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="246"/>
+ <source>100</source>
+ <translation>100</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="258"/>
+ <source>%</source>
+ <translation>%</translation>
+ </message>
+ <message>
+ <source>&amp;Advanced</source>
+ <translation type="obsolete">&amp;Avanzado</translation>
+ </message>
+ <message>
+ <source>Choose where and how to &amp;save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="obsolete">Elegir cuando y &amp;donde guardar cada captura (&quot;Guardar como&quot;).</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="722"/>
+ <source>&amp;Copy the screenshot to the clipboard.</source>
+ <translation>&amp;Copiar la captura al portapeles.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="736"/>
+ <source>Inc&amp;lude the cursor in the screenshot.</source>
+ <translation>Inc&amp;luir el cursor en la captura.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="729"/>
+ <source>&amp;Grab only the current monitor.</source>
+ <translation>Capturar &amp;solo el monitor actual.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="753"/>
+ <source>O&amp;ptimize PNG screenshots.</source>
+ <translation>O&amp;ptimizar capturas PNG.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="605"/>
+ <source>Warn when hiding without a tra&amp;y icon.</source>
+ <translation>A&amp;visar al esconder sin un ícono de sistema.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="832"/>
+ <source>Screenshot Previews</source>
+ <translation>Vista Previa de Capturas</translation>
+ </message>
+ <message>
+ <source>Preview size:</source>
+ <translation type="obsolete">Tamaño de vista previa:</translation>
+ </message>
+ <message>
+ <source>Preview position:</source>
+ <translation type="obsolete">Posición de la vista previa:</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="912"/>
+ <source>Top Left</source>
+ <translation>Arriba-Izquierda</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="917"/>
+ <source>Top Right</source>
+ <translation>Abajo-Derecha</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="922"/>
+ <source>Bottom Left</source>
+ <translation>Abajo-Izquierda</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="927"/>
+ <source>Bottom Right</source>
+ <translation>Abajo-Derecha</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="948"/>
+ <source>Auto-close after</source>
+ <translation>Cerrar automaticamente despues de</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1011"/>
+ <source>Updater</source>
+ <translation>Actualizador</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1020"/>
+ <source>Check for updates regularly.</source>
+ <translation>Buscar actualizaciones periodicamente.</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1040"/>
+ <source>Chec&amp;k Updates Now</source>
+ <translation>Buscar Actualizaciónes A&amp;hora</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="627"/>
+ <source>Shows a completion message once the screenshot is saved, clicking this message takes you to the directory where the screenshot was saved.</source>
+ <translation>Muestra un mensaje al completar una captura, clickear en este mensaje lleva al directorio donde la misma fue guardada.</translation>
+ </message>
+ <message>
+ <source>About Lightscreen</source>
+ <translation type="obsolete">Acerca de Lightscreen</translation>
+ </message>
+</context>
+<context>
+ <name>PreviewDialog</name>
+ <message>
+ <location filename="../dialogs/previewdialog.cpp" line="308"/>
+ <source>Screenshot Preview: Closing in %1</source>
+ <translation>Vista Previa: Cerrando en %1</translation>
+ </message>
+</context>
+<context>
+ <name>Screenshot</name>
+ <message>
+ <location filename="../tools/screenshot.cpp" line="272"/>
+ <source>Save as..</source>
+ <translation>Guardar como..</translation>
+ </message>
+</context>
+<context>
+ <name>ScreenshotDialog</name>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="18"/>
+ <source>Lightscreen Screenshot Viewer</source>
+ <translation>Lightscreen: Visor de Capturas</translation>
+ </message>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="20"/>
+ <source>You can zoom using the mouse wheel while holding the CTRL key. To return to the default zoom (100%) press &quot;Ctrl-0&quot;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>UpdaterDialog</name>
+ <message>
+ <source>Cancel</source>
+ <translation type="obsolete">Cancelar</translation>
+ </message>
+ <message>
+ <source>Updater - Lightscreen</source>
+ <translation type="obsolete">Actualizador- Lightscreen</translation>
+ </message>
+ <message>
+ <source>Checking for updates</source>
+ <translation type="obsolete">Buscando actualizaciones</translation>
+ </message>
+ <message>
+ <source>There&apos;s a new version available,&lt;br&gt; please see &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;the Lighscreen website&lt;/a&gt;.</source>
+ <translation type="obsolete">Hay una nueva version disponible, &lt;br&gt; por favor vea &lt;a href=&quot;http://lightscreen.sourceforge.net/new-version&quot;&gt;el sitio web de Lighscreen&lt;/a&gt;.</translation>
+ </message>
+ <message>
+ <source>No new versions available</source>
+ <translation type="obsolete">Ninguna version nueva disponible</translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="obsolete">Cerrar</translation>
+ </message>
+</context>
+<context>
+ <name>WindowPicker</name>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="24"/>
+ <source>Lightscreen Window Picker</source>
+ <translation>Lightscreen: Eligiendo Ventana</translation>
+ </message>
+ <message>
+ <source>Grab the picker by clicking and holding down the mouse button,
+then drag it to the window of your choice and release it to capture.</source>
+ <translation type="obsolete">Tome el selector haciendo click en el mismo y sosteniendo el botón del mouse
+luego arrastrelo a la ventana de su elección y suelte el botón para capturar.</translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="26"/>
+ <source>Grab the picker by clicking and holding down the mouse button, then drag it to the window of your choice and release it to capture.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="41"/>
+ <source> - Start dragging to select windows</source>
+ <translation> - Comienze a arrastrar para seleccionar ventanas</translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="50"/>
+ <source>Close</source>
+ <translation>Cerrar</translation>
+ </message>
+</context>
+</TS>
diff --git a/translations/untranslated.ts b/translations/untranslated.ts
new file mode 100644
index 0000000..389c98f
--- /dev/null
+++ b/translations/untranslated.ts
@@ -0,0 +1,770 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>AreaDialog</name>
+ <message>
+ <location filename="../dialogs/areadialog.cpp" line="127"/>
+ <source>Lightscreen screen area mode:
+Use your mouse to draw a rectangle to screenshot or exit pressing
+any key or using the right or middle mouse buttons.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>HotkeyWidget</name>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="15"/>
+ <source>Click to select hotkey...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="47"/>
+ <source>Type your hotkey</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../widgets/hotkeywidget.cpp" line="56"/>
+ <source>Invalid hotkey</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindow</name>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="97"/>
+ <location filename="../lightscreenwindow.cpp" line="258"/>
+ <location filename="../lightscreenwindow.cpp" line="482"/>
+ <location filename="../lightscreenwindow.cpp" line="682"/>
+ <source>Lightscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="98"/>
+ <source>You have chosen to hide Lightscreen when there&apos;s no system tray icon, so you will not be able to access the program &lt;b&gt;unless you have selected a hotkey to do so&lt;/b&gt;.&lt;br&gt;What do you want to do?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="101"/>
+ <source>Hide but enable tray</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="103"/>
+ <source>Hide and don&apos;t warn</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="105"/>
+ <source>Just hide</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="385"/>
+ <source>Saved to %1%2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="391"/>
+ <source>The screenshot was not taken</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="392"/>
+ <source>There was an error or you did not select a valid area.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="407"/>
+ <location filename="../lightscreenwindow.cpp" line="612"/>
+ <source>Active &amp;Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="410"/>
+ <location filename="../lightscreenwindow.cpp" line="615"/>
+ <source>&amp;Pick Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="442"/>
+ <source>Sucess!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="447"/>
+ <source>Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="462"/>
+ <source>Some hotkeys could not be registered, they might already be in use</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="465"/>
+ <source>&lt;br&gt;The failed hotkeys are the following:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="476"/>
+ <source>&lt;br&gt;The failed hotkey is &lt;b&gt;%1&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="479"/>
+ <source>&lt;br&gt;&lt;i&gt;What do you want to do?&lt;/i&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="485"/>
+ <source>Change</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="486"/>
+ <source>Disable</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="487"/>
+ <source>Quit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="683"/>
+ <source>There&apos;s a new version of Lightscreen available.&lt;br&gt;Would you like to see more information?&lt;br&gt;(&lt;em&gt;You can turn this notification off&lt;/em&gt;)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="687"/>
+ <source>Turn Off</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="688"/>
+ <source>Remind Me Later</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="404"/>
+ <location filename="../lightscreenwindow.cpp" line="609"/>
+ <source>&amp;Screen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="413"/>
+ <location filename="../lightscreenwindow.cpp" line="618"/>
+ <source>&amp;Area</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="416"/>
+ <location filename="../lightscreenwindow.cpp" line="632"/>
+ <source>&amp;Go to Folder</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="606"/>
+ <source>Show&amp;/Hide</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="629"/>
+ <source>View &amp;Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.cpp" line="635"/>
+ <source>&amp;Quit</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>LightscreenWindowClass</name>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="14"/>
+ <source>Lightscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="35"/>
+ <source>Screenshot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="54"/>
+ <source>Configure Lightscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="57"/>
+ <source>&amp;Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="76"/>
+ <source>Hide Lightscreen </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="82"/>
+ <source>&amp;Hide</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../lightscreenwindow.ui" line="104"/>
+ <source>&amp;Quit</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>NamingDialog</name>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="14"/>
+ <source>Naming Options - Lightscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="42"/>
+ <source>Leading zeros:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="94"/>
+ <source>Date Format:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="122"/>
+ <source> &lt;a href=&quot;http://lightscreen.sourceforge.net/help/date&quot;&gt;[?]&lt;/a&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="136"/>
+ <source>yyyy-MM-dd</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="141"/>
+ <source>yyyy-MM-dd HH.mm.ss</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/namingdialog.ui" line="161"/>
+ <source>Flip naming.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OptionsDialog</name>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="67"/>
+ <source>Version %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>Hotkey conflict</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="142"/>
+ <source>You have assigned the same hotkeys to more than one action.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>Filename character error</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="147"/>
+ <source>The filename can&apos;t contain any of the following characters: ? : \ / * &quot; &lt; &gt; |</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>Final Destination</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="152"/>
+ <source>You can&apos;t take screenshots unless you enable file saving or the clipboard.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="163"/>
+ <source>Select where you want to save the screenshots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="181"/>
+ <source>Lightscreen - Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="182"/>
+ <source>Restoring the default options will cause you to lose all of your current configuration.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="185"/>
+ <source>Restore</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.cpp" line="186"/>
+ <source>Don&apos;t Restore</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="14"/>
+ <source>Options - Lightscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="36"/>
+ <source>File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="54"/>
+ <source>&amp;Directory:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="94"/>
+ <source>The prefix for the screenshot file</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="97"/>
+ <source>&amp;Filename:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="115"/>
+ <source>The prefix will be inserted before the &lt;em&gt;Naming&lt;/em&gt; in the screenshot file and it is usually used to distinguish files. It can be left blank.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="132"/>
+ <source>(number)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="137"/>
+ <source>(date)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="142"/>
+ <source>(timestamp)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="168"/>
+ <source>The file format for the screenshot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="171"/>
+ <source>F&amp;ormat:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="185"/>
+ <source>PNG</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="190"/>
+ <source>JPG</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="195"/>
+ <source>BMP</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="267"/>
+ <source>&lt;i&gt;Preview&lt;/i&gt;:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="203"/>
+ <source>&amp;Quality:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="122"/>
+ <source>The naming is inserted after the prefix and is what makes each screenshot file unique to avoid overwriting.&lt;br /&gt;
+&lt;b&gt;Numeric&lt;/b&gt;: inserts a number in sequence, 1, 2, 3..&lt;br /&gt;
+&lt;b&gt;Date&lt;/b&gt;: inserts the current date, in the form of dd-MM-yyyy..&lt;br /&gt;
+&lt;b&gt;Date &amp;amp; Time&lt;/b&gt;: inserts the current date and time, in the form of dd-MM-yyyy hh.mm.ss..&lt;br /&gt;
+&lt;b&gt;Timestamp&lt;/b&gt;: inserts a unique number (a Unix timestamp, the number of seconds passed since 1970-1-1 00:00:00) that corresponds with the current time.&lt;br /&gt;
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="147"/>
+ <source>(none)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="306"/>
+ <source>System Startup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="359"/>
+ <source>Hotkeys</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="365"/>
+ <source>Captures</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="409"/>
+ <source>Capture the current window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="425"/>
+ <source>Capture a chosen window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="467"/>
+ <source>Lightscreen Control</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="531"/>
+ <source>Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="579"/>
+ <source>Interface</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="706"/>
+ <source>Screenshots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="715"/>
+ <source>Choose where to save each screenshot (&quot;&amp;Save as&quot;).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="760"/>
+ <source>Replace screenshots when there&apos;s an existing file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="776"/>
+ <source>D&amp;elay:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="789"/>
+ <source>Selecting anything other than 0 in this option will cause the program to &lt;b&gt;wait&lt;/b&gt; that amount of seconds before taking the screenshot.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="792"/>
+ <source>none</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="801"/>
+ <location filename="../dialogs/optionsdialog.ui" line="955"/>
+ <source> seconds</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="847"/>
+ <source>Maximum Size:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="898"/>
+ <source>Position:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="968"/>
+ <source> and </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="982"/>
+ <source>save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="987"/>
+ <source>cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1055"/>
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1061"/>
+ <source>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.&lt;br&gt;&lt;br&gt;
+Created by &lt;a href=&quot;http://ckaiser.com.ar&quot;&gt;Christian Kaiser&lt;/a&gt;, using the &lt;a href=&quot;#aboutqt&quot;&gt;Qt toolkit&lt;/a&gt; for the graphical user interface.&lt;br&gt;&lt;br&gt;
+Released under the &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.html&quot;&gt;GNU General Public License&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
+Special thanks goes to the &lt;a href=&quot;http://lightscreen.sourceforge.net/about&quot;&gt;Donators and Translators&lt;/a&gt;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1090"/>
+ <source>&lt;a href=&quot;https://sourceforge.net/projects/lightscreen/&quot;&gt;Visit Sourceforge project site&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lightscreen.sourceforge.net/&quot;&gt;Visit Lightscreen home page&lt;/a&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="318"/>
+ <source>&amp;Run Lightscreen at system startup.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="346"/>
+ <source>H&amp;ide the main window.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="386"/>
+ <source>Capture the screen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="441"/>
+ <source>Capture a screen area</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="504"/>
+ <source>Open the directory</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="488"/>
+ <source>Open the program window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="591"/>
+ <source>Sho&amp;w a system tray icon.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="598"/>
+ <source>&amp;Hide Lightscreen while taking a screenshot.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="743"/>
+ <source>&amp;Magnify around the mouse in Area mode.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="661"/>
+ <source>&amp;Language:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="678"/>
+ <source>Click here to go to the Lightscreen homepage to learn more about translations.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="681"/>
+ <source>&lt;a href=&quot;http://lightscreen.sourceforge.net/translation&quot;&gt;More information..&lt;/a&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="617"/>
+ <source>&amp;Notify with:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="24"/>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="627"/>
+ <source>Shows a completion message once the screenshot is saved, clicking this message takes you to the directory where the screenshot was saved.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="630"/>
+ <source>Tray icon Popup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="637"/>
+ <source>&amp;Sound cue</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="216"/>
+ <source>This slider goes from 0 to 100. 100 being the highest quality and 0 the lowest.&lt;br&gt;
+Quality is related to file size and of course to readability and overall quality of the image.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="246"/>
+ <source>100</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="258"/>
+ <source>%</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="722"/>
+ <source>&amp;Copy the screenshot to the clipboard.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="736"/>
+ <source>Inc&amp;lude the cursor in the screenshot.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="729"/>
+ <source>&amp;Grab only the current monitor.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="750"/>
+ <source>Opens a new process called OptiPNG which dramatically reduces the file size.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="753"/>
+ <source>O&amp;ptimize PNG screenshots.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="605"/>
+ <source>Warn when hiding without a tra&amp;y icon.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="767"/>
+ <source>Snap area screenshots automatically (no resizing).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="832"/>
+ <source>Screenshot Previews</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="912"/>
+ <source>Top Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="917"/>
+ <source>Top Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="922"/>
+ <source>Bottom Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="927"/>
+ <source>Bottom Right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="948"/>
+ <source>Auto-close after</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1011"/>
+ <source>Updater</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1020"/>
+ <source>Check for updates regularly.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/optionsdialog.ui" line="1040"/>
+ <source>Chec&amp;k Updates Now</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PreviewDialog</name>
+ <message>
+ <location filename="../dialogs/previewdialog.cpp" line="308"/>
+ <source>Screenshot Preview: Closing in %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Screenshot</name>
+ <message>
+ <location filename="../tools/screenshot.cpp" line="272"/>
+ <source>Save as..</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ScreenshotDialog</name>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="18"/>
+ <source>Lightscreen Screenshot Viewer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../dialogs/screenshotdialog.cpp" line="20"/>
+ <source>You can zoom using the mouse wheel while holding the CTRL key. To return to the default zoom (100%) press &quot;Ctrl-0&quot;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>WindowPicker</name>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="24"/>
+ <source>Lightscreen Window Picker</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="26"/>
+ <source>Grab the picker by clicking and holding down the mouse button, then drag it to the window of your choice and release it to capture.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="41"/>
+ <source> - Start dragging to select windows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../tools/windowpicker.cpp" line="50"/>
+ <source>Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/updater/updater.cpp b/updater/updater.cpp
new file mode 100644
index 0000000..641e7f4
--- /dev/null
+++ b/updater/updater.cpp
@@ -0,0 +1,53 @@
+#include <QDate>
+#include <QHttp>
+#include <QApplication>
+
+#include "updater.h"
+#include "../dialogs/updaterdialog.cpp"
+
+Updater::Updater(QObject *parent) :
+ QObject(parent)
+{
+ connect(&mHttp, SIGNAL(done(bool)), this, SLOT(httpDone(bool)));
+}
+
+void Updater::check()
+{
+ if (mHttp.hasPendingRequests())
+ return;
+
+ mHttp.setHost("lightscreen.sourceforge.net");
+ mHttp.get("/version");
+}
+
+void Updater::checkWithFeedback()
+{
+ UpdaterDialog updaterDialog;
+ connect(this, SIGNAL(done(bool)), &updaterDialog, SLOT(updateDone(bool)));
+
+ check();
+ updaterDialog.exec();
+}
+
+void Updater::httpDone(bool result)
+{
+ if (result) {
+ QByteArray data = mHttp.readAll();
+ double version = QString(data).toDouble();
+
+ emit done((version > qApp->applicationVersion().toDouble()));
+ }
+ else {
+ emit done(false);
+ }
+}
+
+Updater* Updater::mInstance = 0;
+
+Updater *Updater::instance()
+{
+ if (!mInstance)
+ mInstance = new Updater();
+
+ return mInstance;
+}
diff --git a/updater/updater.h b/updater/updater.h
new file mode 100644
index 0000000..f8badbb
--- /dev/null
+++ b/updater/updater.h
@@ -0,0 +1,31 @@
+#ifndef UPDATER_H_
+#define UPDATER_H_
+
+#include <QObject>
+#include <QHttp>
+
+class Updater : public QObject
+{
+ Q_OBJECT
+public:
+ Updater(QObject *parent = 0);
+
+ static Updater *instance();
+
+signals:
+ void done(bool result);
+
+public slots:
+ void checkWithFeedback();
+ void check();
+
+private slots:
+ void httpDone(bool result);
+
+private:
+ QHttp mHttp;
+ static Updater* mInstance;
+
+};
+
+#endif /*UPDATER_H_*/
diff --git a/widgets/hotkeywidget.cpp b/widgets/hotkeywidget.cpp
new file mode 100644
index 0000000..0165eb0
--- /dev/null
+++ b/widgets/hotkeywidget.cpp
@@ -0,0 +1,140 @@
+#include <QApplication>
+#include <QFocusEvent>
+#include <QKeyEvent>
+#include <QKeySequence>
+#include <QTimer>
+
+#include <QDebug>
+
+#include "hotkeywidget.h"
+
+HotkeyWidget::HotkeyWidget(QWidget *parent) :
+ QPushButton(parent), mHotkey(QKeySequence()), mShowingError(false), mKeyboardFocus(false)
+{
+ setStyleSheet("text-align: left; padding: 3px 6px;");
+ setText(tr("Click to select hotkey..."));
+ setMinimumWidth(110);
+}
+
+void HotkeyWidget::setHotkey(QKeySequence hotkey)
+{
+ mHotkey = hotkey;
+ setHotkeyText();
+}
+
+QKeySequence HotkeyWidget::hotkey()
+{
+ return mHotkey;
+}
+
+void HotkeyWidget::setHotkeyText()
+{
+ QString hotkeyText = mHotkey.toString(QKeySequence::NativeText);
+
+ setText(hotkeyText);
+ parentWidget()->setFocus();
+}
+
+bool HotkeyWidget::event(QEvent *event)
+{
+ if (event->type() == QEvent::LanguageChange) {
+ setHotkeyText();
+ }
+ else if (event->type() == QEvent::FocusIn) {
+ QFocusEvent* focusEvent = static_cast<QFocusEvent*>(event);
+
+ if (focusEvent->reason() != Qt::TabFocusReason) {
+ setText(tr("Type your hotkey"));
+ mKeyboardFocus = false;
+ grabKeyboard();
+ }
+ else {
+ mKeyboardFocus = true;
+ }
+ }
+ else if (event->type() == QEvent::FocusOut) {
+ if (text() == tr("Invalid hotkey")) {
+ emit invalidHotkeyError();
+ showError();
+ }
+
+ releaseKeyboard();
+ setHotkeyText(); // Reset the text
+ }
+
+ return QPushButton::event(event);
+}
+
+void HotkeyWidget::keyPressEvent(QKeyEvent *event)
+{
+ if (mKeyboardFocus)
+ return;
+
+ if (isModifier(event->key()))
+ return;
+
+ mHotkey = getKeySequence(event);
+
+ setHotkeyText();
+
+ event->ignore();
+}
+
+void HotkeyWidget::showError()
+{
+ if (mShowingError)
+ return;
+
+ mShowingError = true;
+
+ setStyleSheet("color: #d90000;");
+ QTimer::singleShot(500, this, SLOT(hideError()));
+}
+
+void HotkeyWidget::hideError()
+{
+ setStyleSheet("");
+ mShowingError = false;
+}
+
+QKeySequence HotkeyWidget::getKeySequence(QKeyEvent* event) const
+{
+ return QKeySequence((isValid(event->key()) ? event->key() : 0)
+ + (event->modifiers() & ~Qt::KeypadModifier));
+}
+
+/**
+ * Returns true if \param key could be used in a shortcut.
+ */
+bool HotkeyWidget::isValid(int key) const
+{
+ switch (key)
+ {
+ case 0:
+ case Qt::Key_unknown:
+ return false;
+ }
+
+ return !isModifier(key);
+}
+
+/**
+ * Returns true if \param key is modifier.
+ */
+bool HotkeyWidget::isModifier(int key) const
+{
+ switch (key)
+ {
+ case Qt::Key_Shift:
+ case Qt::Key_Control:
+ case Qt::Key_Meta:
+ case Qt::Key_Alt:
+ case Qt::Key_AltGr:
+ case Qt::Key_Super_L:
+ case Qt::Key_Super_R:
+ case Qt::Key_Menu:
+ return true;
+ }
+ return false;
+}
+
diff --git a/widgets/hotkeywidget.h b/widgets/hotkeywidget.h
new file mode 100644
index 0000000..7b4be53
--- /dev/null
+++ b/widgets/hotkeywidget.h
@@ -0,0 +1,42 @@
+#ifndef HOTKEYWIDGET_H
+#define HOTKEYWIDGET_H
+
+#include <QPushButton>
+
+class HotkeyWidget : public QPushButton
+{
+ Q_OBJECT
+
+public:
+ HotkeyWidget(QWidget *parent = 0);
+
+ void setHotkey(QKeySequence hotkey);
+ QKeySequence hotkey();
+
+signals:
+ void invalidHotkeyError();
+
+private:
+ void setHotkeyText();
+ void showError();
+
+private slots:
+ void hideError();
+
+protected:
+ // Event overrides:
+ bool event(QEvent* event);
+ void keyPressEvent(QKeyEvent* event);
+
+private:
+ QKeySequence mHotkey;
+ bool mShowingError;
+ bool mKeyboardFocus;
+
+ QKeySequence getKeySequence(QKeyEvent* event) const;
+ bool isValid(int key) const;
+ bool isModifier(int key) const;
+
+};
+
+#endif // HOTKEYWIDGET_H

File Metadata

Mime Type
text/x-diff
Expires
Wed, Jun 17, 9:23 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
71270
Default Alt Text
(645 KB)

Event Timeline