// 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.
<string>The prefix will be inserted before the <em>Naming</em> 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.<br />
<b>Numeric</b>: inserts a number in sequence, 1, 2, 3..<br />
<b>Date</b>: inserts the current date and time, in the form of dd-MM-yyyy, click the "wrench" button on the right to customize the format.<br />
<b>Timestamp</b>: inserts a number, a Unix timestamp, which is the number of seconds passed since 1970-1-1 00:00:00.<br />
<string>C&losing hides the main window.</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hideCheckBox">
<property name="text">
<string>&Hide Lightscreen while taking a screenshot.</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="notifyLayout">
<property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item row="1" column="1">
<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>
<string>Selecting anything other than 0 in this option will cause the program to <b>wait</b> that amount of seconds before taking the screenshot.</string>
<string>Lightscreen is a simple tool to take screenshots, designed to be customizable and lightweight.<br><br>
Created by <a href="http://ckaiser.com.ar">Christian Kaiser</a>, using the <a href="#aboutqt">Qt toolkit</a> for the graphical user interface.</string>
<string>Released under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU General Public License</a>.<br><br>
Special thanks goes to the <a href="http://lightscreen.sourceforge.net/about">Donators and Translators</a>.</string>
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.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>)"));
+ Convert Cocoa modifer flags to Carbon modifier flags.
+ @param modifierFlags one or more of the flags <tt>NSShiftKeyMask</tt>, <tt>NSControlKeyMask</tt>, <tt>NSAlternateKeyMask</tt>, <tt>NSCommandKeyMask</tt>
+ @abstract Class for translating between key codes and key characters.
+ @discussion The key code for each key character can change between hardware and with localisation, <tt>NDKeyboardLayout</tt> handles translation between key codes and key characters as well as for generating strings for display purposes.
+ initialise a keyboard layout for the current keyboard, if that fails a keyboard layout for one of the languages
+ returned from <tt>[NSLocale preferredLanguages]</tt> is attempted and if finally if that fails a keyboard layout
+ for the most recently used ASCII-capable keyboard is created. If that fails then this method returns <tt>nil</tt>.
+ */
+- (id)init;
+/*!
+ @method initWithLanguage:
+ @abstract initialise a keyboard layout.
+ @discussion Initialises a KeyboardLayout with an <tt>TISInputSourceRef</tt> for the supplied language.
+ */
+- (id)initWithLanguage:(NSString *)langauge;
+/*!
+ @method initWithInputSource:
+ @abstract initialise a keyboard layout.
+ @discussion Initialises a KeyboardLayout with an <tt>TISInputSourceRef</tt>, this method is called with the result from <tt>initWithInputSource:TISCopyCurrentKeyboardInputSource()</tt>.
+ @discussion <tt>stringForCharacter:modifierFlags:</tt> returns a string that can be displayed to the user, For example command-z would produce ⌘Z, shift-T would produce ⇧T.
+ @param character The unmodified character on the keyboard.
+ @discussion <tt>stringForKeyCode:modifierFlags:</tt> returns a string that can be displayed to the user. This method is called by <tt>stringForCharacter::modifierFlags</tt> and is problem more useful most of the time.
+ @param keyCode A value specifying the virtual key code that is to be translated. For ADB keyboards, virtual key codes are in the range from 0 to 127.
+ @abstract Get the key character for a given key code.
+ @discussion The character returned is the unmodified version on the keyboard.
+ @param keyCode A value specifying the virtual key code that is to be translated. For ADB keyboards, virtual key codes are in the range from 0 to 127.
+ @result The character for the unmodified version of the key.
+ */
+- (unichar)characterForKeyCode:(UInt16)keyCode;
+/*!
+ @method keyCodeForCharacter:numericPad:
+ @abstract Get the key code for a given key character.
+ @discussion The character pass in must be the unshifter character for the key, for example to get the key code for the '?' on keyboards where you type shift-/ to get '?' you should pass in the character '/"
+ @param character The unmodified character on the keyboard.
+ @param numericPad For the keycode of a key on the keypad where the same character is also on the main keyboard this flag needs to be <tt>YES</tt>.
if (!mSettings->value("/options/history", true).toBool())
return;
QSqlQuery query;
query.prepare("SELECT fileName FROM history WHERE URL IS NOT EMPTY AND fileName = ?");
query.addBindValue(fileName);
query.exec();
if (query.record().count() > 0 && !url.isEmpty()) {
// Makes sure to only update the latest file, in case something weird happened with the files (deleted screenshots, etc). Though that might still happen in some edge cases that I'm too lazy to account for.
QSqlQuery updateQuery;
updateQuery.prepare("UPDATE history SET URL = ?, deleteURL = ?, time = ? WHERE fileName = ?");
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);
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"));