Commit e3f6d233 authored by Atsuhito Kohda's avatar Atsuhito Kohda

Imported Upstream version 0.3~svn741

parent eae65317
......@@ -48,7 +48,7 @@
<key>CFBundleIconFile</key>
<string>TeXworks.icns</string>
<key>CFBundleGetInfoString</key>
<string>TeXworks version 0.3 (r.)&#xA;(c) 2007-2010 Jonathan Kew&#xA;Released under GPL v2.0</string>
<string>TeXworks version 0.3 (r.1)&#xA;(C) 2007-2011 Jonathan Kew, Stefan L&#xF6;ffler&#xA;Released under GPL v2.0</string>
<key>CFBundleExecutable</key>
<string>TeXworks</string>
<key>CFBundleIdentifier</key>
......@@ -60,9 +60,9 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>0.3 (r.)</string>
<string>0.3 (r.1)</string>
<key>CFBundleVersion</key>
<string>0.3 (r.)</string>
<string>0.3 (r.1)</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
......
License
=======
TeXworks is copyright (c) 2007-09 by Jonathan Kew.
TeXworks is copyright (C) 2007-2011 by Jonathan Kew and Stefan Löffler.
Distributed under the terms of the GNU General Public License, version 2 or (at your option) any later version.
See the file COPYING for details.
......
......@@ -48,7 +48,7 @@
<key>CFBundleIconFile</key>
<string>TeXworks.icns</string>
<key>CFBundleGetInfoString</key>
<string>TeXworks version 0.3 (r.)&#xA;(c) 2007-2010 Jonathan Kew&#xA;Released under GPL v2.0</string>
<string>TeXworks version 0.3 (r.1)&#xA;(C) 2007-2011 Jonathan Kew, Stefan L&#xF6;ffler&#xA;Released under GPL v2.0</string>
<key>CFBundleExecutable</key>
<string>TeXworks</string>
<key>CFBundleIdentifier</key>
......@@ -60,9 +60,9 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>0.3 (r.)</string>
<string>0.3 (r.1)</string>
<key>CFBundleVersion</key>
<string>0.3 (r.)</string>
<string>0.3 (r.1)</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
......
......@@ -48,7 +48,7 @@
<key>CFBundleIconFile</key>
<string>TeXworks.icns</string>
<key>CFBundleGetInfoString</key>
<string>TeXworks version @VER@ (r.@REV@)&#xA;(c) 2007-2010 Jonathan Kew&#xA;Released under GPL v2.0</string>
<string>TeXworks version @VER@ (r.@REV@)&#xA;(C) 2007-2011 Jonathan Kew, Stefan L&#xF6;ffler&#xA;Released under GPL v2.0</string>
<key>CFBundleExecutable</key>
<string>TeXworks</string>
<key>CFBundleIdentifier</key>
......
# This is part of TeXworks, an environment for working with TeX documents
# Copyright (C) 2007-09 Jonathan Kew
# Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
#
# 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
......@@ -163,7 +163,9 @@ HEADERS += src/TWApp.h \
src/TWVersion.h \
src/SvnRev.h \
src/synctex_parser.h \
src/synctex_parser_utils.h
src/synctex_parser_utils.h \
src/ConfigurableApp.h \
src/TWSystemCmd.h
FORMS += src/TeXDocument.ui \
src/PDFDocument.ui \
......
/*
This is part of TeXworks, an environment for working with TeX documents
Copyright (C) 2007-09 Stefan Löffler & Jonathan Kew
Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
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
......@@ -88,7 +88,7 @@ bool LuaScript::execute(TWScriptAPI *tw) const
}
/*static*/
int LuaScript::pushQObject(lua_State * L, QObject * obj, const bool throwError /*= true*/)
int LuaScript::pushQObject(lua_State * L, QObject * obj, const bool throwError /* = true */)
{
Q_UNUSED(throwError)
......@@ -122,7 +122,7 @@ int LuaScript::pushQObject(lua_State * L, QObject * obj, const bool throwError /
}
/*static*/
int LuaScript::pushVariant(lua_State * L, const QVariant & v, const bool throwError /*= true*/)
int LuaScript::pushVariant(lua_State * L, const QVariant & v, const bool throwError /* = true */)
{
int i;
QVariantList::const_iterator iList;
......@@ -317,7 +317,7 @@ int LuaScript::setProperty(lua_State * L)
}
/*static*/
QVariant LuaScript::getLuaStackValue(lua_State * L, int idx, const bool throwError /*= true*/)
QVariant LuaScript::getLuaStackValue(lua_State * L, int idx, const bool throwError /* = true */)
{
bool isArray = true, isMap = true, isQObject = false;
QVariantList vl;
......
/*
This is part of TeXworks, an environment for working with TeX documents
Copyright (C) 2007-09 Stefan Löffler & Jonathan Kew
Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
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
......
# This is part of TeXworks, an environment for working with TeX documents
# Copyright (C) 2007-09 Stefan Löffler and Jonathan Kew
# Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
#
# 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
......@@ -63,7 +63,9 @@ win32 { # paths here are specific to my setup
# Input
HEADERS += TWLuaPlugin.h \
../../src/TWScript.h \
../../src/TWScriptAPI.h
../../src/TWScriptAPI.h \
../../src/ConfigurableApp.h \
../../src/TWSystemCmd.h
SOURCES += TWLuaPlugin.cpp \
../../src/TWScript.cpp \
......
/*
This is part of TeXworks, an environment for working with TeX documents
Copyright (C) 2007-09 Stefan Löffler & Jonathan Kew
Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
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
......
/*
This is part of TeXworks, an environment for working with TeX documents
Copyright (C) 2007-09 Stefan Löffler & Jonathan Kew
Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
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
......@@ -89,7 +89,7 @@ public:
*
* Does nothing
*/
PythonScript(TWScriptLanguageInterface *interface, const QString& fileName)
PythonScript(TWPythonPlugin * interface, const QString& fileName)
: TWScript(interface, fileName) { }
/** \brief Parse the script header
......
# This is part of TeXworks, an environment for working with TeX documents
# Copyright (C) 2007-09 Stefan Löffler and Jonathan Kew
# Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
#
# 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
......@@ -71,7 +71,9 @@ win32 { # paths here are specific to my setup
# Input
HEADERS += TWPythonPlugin.h \
../../src/TWScript.h \
../../src/TWScriptAPI.h
../../src/TWScriptAPI.h \
../../src/ConfigurableApp.h \
../../src/TWSystemCmd.h
SOURCES += TWPythonPlugin.cpp \
../../src/TWScript.cpp \
......
......@@ -22,7 +22,7 @@ BEGIN
VALUE "FileDescription", "TeXworks editor & previewer"
VALUE "FileVersion", TEXWORKS_VERSION ".r" SVN_REVISION_STR
VALUE "InternalName", "TeXworks"
VALUE "LegalCopyright", "Copyright (c) 2007-2009 Jonathan Kew"
VALUE "LegalCopyright", "Copyright (C) 2007-2011 Jonathan Kew, Stefan Lffler"
VALUE "OriginalFilename", "TeXworks.exe"
VALUE "ProductName", "TeXworks"
VALUE "ProductVersion", "TeXworks " TEXWORKS_VERSION
......
......@@ -27,16 +27,22 @@
<file>resfiles/templates/More LaTeX classes/KOMA-letter.tex</file>
<file>resfiles/templates/More LaTeX classes/memoir.tex</file>
<file>resfiles/templates/XeLaTeX documents/article-fontspec.tex</file>
<file>resfiles/translations/qt_ar.qm</file>
<file>resfiles/translations/qt_de.qm</file>
<file>resfiles/translations/qt_es.qm</file>
<file>resfiles/translations/qt_fr.qm</file>
<file>resfiles/translations/qt_ja.qm</file>
<file>resfiles/translations/qt_ko.qm</file>
<file>resfiles/translations/qt_nl.qm</file>
<file>resfiles/translations/qt_pl.qm</file>
<file>resfiles/translations/qt_ru.qm</file>
<file>resfiles/translations/qt_zh_CN.qm</file>
<file alias="resfiles/translations/qt_ar.qm">../trans/qt/qt_ar.qm</file>
<file alias="resfiles/translations/qt_ca.qm">../trans/qt/qt_ca.qm</file>
<file alias="resfiles/translations/qt_cs.qm">../trans/qt/qt_cs.qm</file>
<file alias="resfiles/translations/qt_de.qm">../trans/qt/qt_de.qm</file>
<file alias="resfiles/translations/qt_es.qm">../trans/qt/qt_es.qm</file>
<file alias="resfiles/translations/qt_fr.qm">../trans/qt/qt_fr.qm</file>
<file alias="resfiles/translations/qt_it.qm">../trans/qt/qt_it.qm</file>
<file alias="resfiles/translations/qt_ja.qm">../trans/qt/qt_ja.qm</file>
<file alias="resfiles/translations/qt_ko.qm">../trans/qt/qt_ko.qm</file>
<file alias="resfiles/translations/qt_nl.qm">../trans/qt/qt_nl.qm</file>
<file alias="resfiles/translations/qt_pl.qm">../trans/qt/qt_pl.qm</file>
<file alias="resfiles/translations/qt_pt_BR.qm">../trans/qt/qt_pt_BR.qm</file>
<file alias="resfiles/translations/qt_ru.qm">../trans/qt/qt_ru.qm</file>
<file alias="resfiles/translations/qt_sl.qm">../trans/qt/qt_sl.qm</file>
<file alias="resfiles/translations/qt_tr.qm">../trans/qt/qt_tr.qm</file>
<file alias="resfiles/translations/qt_zh_CN.qm">../trans/qt/qt_zh_CN.qm</file>
<file alias="resfiles/translations/TeXworks_af.qm">../trans/TeXworks_af.qm</file>
<file alias="resfiles/translations/TeXworks_ar.qm">../trans/TeXworks_ar.qm</file>
<file alias="resfiles/translations/TeXworks_ca.qm">../trans/TeXworks_ca.qm</file>
......
......@@ -33,7 +33,6 @@ bf:=\textbf{#INS#}
bfd:=\bfseries
bfig:=\begin{figure}#RET##INS##RET#\end{figure}•
bfigo:=\begin{figure}[#INS#]#RET#•#RET#\end{figure}•
bmult:=\begin{multline}#RET##INS##RET#\end{multline}•
bflalig:=\begin{flalign}#RET##INS##RET#\end{flalign}•
bflaligs:=\begin{flalign*}#RET##INS##RET#\end{flalign*}•
bfll:=\begin{flushleft}#RET##INS##RET#\end{flushleft}•
......@@ -100,7 +99,6 @@ dxio:=\(\iota\)
dxl:=\(\lambda\)
dxcl:=\(\Lambda\)
dxm:=\(\mu\)
dxm:=\(\mu\)
dxn:=\(\nu\)
dxo:=\(\omega\)
dxco:=\(\Omega\)
......
......@@ -14,7 +14,9 @@
# The color fields <fgcolor> and <bgcolor> are either:
# *) a color name from the list defined in the SVG standard;
# see http://www.w3.org/TR/SVG/types.html#ColorKeywords
# *) a hexadecimal color value of the form #rrggbb
# *) a hexadecimal color value of the form #rrggbb; note that if this is used at
# the beginning of a line, a space " " must be added in front of it so the
# line is not interpreted as a comment (e.g., " #aabbcc" instead of "#aabbcc")
#
# The <fontflags> field is a combination of the letters
# B (bold)
......
......@@ -2,8 +2,8 @@
// Title: LaTeX errors
// Description: Looks for errors in the LaTeX terminal output
// Author: Jonathan Kew & Stefan Löffler
// Version: 0.3
// Date: 2010-01-09
// Version: 0.4
// Date: 2010-11-02
// Script-Type: hook
// Hook: AfterTypeset
......@@ -11,12 +11,25 @@
// Switching the engines to use the FILE:LINE-style error messages could help a lot.
parenRE = new RegExp("[()]");
newFileRE = new RegExp("^\\(([\\./][^ )]+)");
// Should catch filenames of the following forms:
// * ./abc, "./abc"
// * /abc, "/abc"
// * .\abc, ".\abc"
// * C:\abc, "C:\abc"
// * \\server\abc, "\\server\abc"
// Caveats: filenames with escaped " or space in the filename don't work (correctly)
newFileRE = new RegExp("^\\(\"?((?:\\./|/|.\\\\|[a-zA-Z]:\\\\|\\\\\\\\[^\\\" )]+\\\\)[^\" )]+)");
lineNumRE = new RegExp("^l\\.(\\d+)");
badLineRE = new RegExp("^(?:Over|Under)full \\\\hbox.*at lines (\\d+)");
warnLineRE = new RegExp("^(?:LaTeX|Package (?:.*)) Warning: .*");
warnLineNumRE = new RegExp("on input line (\\d+).");
result = [];
errors = [];
warnings = [];
infos = [];
function trim (zeichenkette) {
return zeichenkette.replace (/^\s+/, '').replace (/\s+$/, '');
}
// get the text from the standard console output
txt = TW.target.consoleOutput;
......@@ -40,13 +53,13 @@ for (i = 0; i < lines.length; ++i) {
error[1] = 0;
while (++i < lines.length) {
line = lines[i];
if(trim(line) == '') break;
matched = lineNumRE.exec(line);
if (matched) {
if (matched)
error[1] = matched[1];
break;
}
error[2] += "\n" + line;
}
result.push(error);
errors.push(error);
continue;
}
......@@ -57,7 +70,7 @@ for (i = 0; i < lines.length; ++i) {
error[0] = curFile;
error[1] = matched[1];
error[2] = line;
result.push(error);
infos.push(error);
continue;
}
......@@ -67,16 +80,17 @@ for (i = 0; i < lines.length; ++i) {
var error = [];
error[0] = curFile;
error[1] = "?";
matched = warnLineNumRE.exec(line);
if (matched)
error[1] = matched[1];
error[2] = "";
while (line != "" && i < lines.length) {
error[2] += line;
i++;
error[2] = line;
while (++i < lines.length) {
line = lines[i];
if(line == '') break;
error[2] += "\n" + line;
}
result.push(error);
matched = warnLineNumRE.exec(error[2].replace(/\n/, ""));
if (matched)
error[1] = matched[1];
warnings.push(error);
continue;
}
......@@ -113,7 +127,44 @@ for (i = 0; i < lines.length; ++i) {
}
}
function htmlize(str) {
var html = str;
html = html.replace(/&/g, "&amp;");
html = html.replace(/</g, "&lt;");
html = html.replace(/>/g, "&gt;");
html = html.replace(/\n /g, "\n&nbsp;");
html = html.replace(/ /g, "&nbsp;&nbsp;");
html = html.replace(/&nbsp; /g, "&nbsp;&nbsp;");
return html.replace(/\n/g, "<br />\n");
}
function makeResultRow(data, color) {
var html = '';
var url = 'texworks:' + data[0] + (data[1] != '?' && data[1] != 0 ? '#' + data[1] : '');
html += '<tr>';
html += '<td width="10" style="background-color: ' + color + '"></td>';
html += '<td valign="top"><a href="' + url + '">' + data[0] + '</a></td>';
html += '<td valign="top">' + data[1] + '</td>';
html += '<td valign="top" style="font-family: monospace;">' + htmlize(data[2]) + '</td>';
html += '</tr>';
return html;
}
// finally, return our result (if any)
if (result.length > 0) {
TW.result = result;
if (errors.length > 0 || warnings.length > 0 || infos.length > 0) {
html = '<html><body>';
html += '<table border="1" cellspacing="0" cellpadding="4">';
for(i = 0; i < errors.length; ++i)
html += makeResultRow(errors[i], 'red');
for(i = 0; i < warnings.length; ++i)
html += makeResultRow(warnings[i], 'yellow');
for(i = 0; i < infos.length; ++i)
html += makeResultRow(infos[i], '#8080ff');
html += "</table>";
html += "</body></html>";
TW.result = html;
}
undefined;
......@@ -7,4 +7,4 @@
// Script-Type: standalone
// Context: PDFDocument
TW.app.launchFile(TW.target.fileName);
TW.launchFile(TW.target.fileName);
......@@ -9,8 +9,11 @@
var cmd = TW.target.selection;
if (cmd != "") {
var result = TW.app.system(cmd);
if (result != null) {
TW.target.insertText(result);
var result = TW.system(cmd);
if (result.status == 0) {
TW.target.insertText(result.output);
}
else {
TW.target.insertText("ERROR: " + result.message);
}
}
......@@ -15,7 +15,7 @@
%%% PAGE DIMENSIONS
\usepackage{geometry} % to change the page dimensions
\geometry{a4paper} % or letterpaper (US) or a5paper or....
% \geometry{margins=2in} % for example, change the margins to 2 inches all round
% \geometry{margin=2in} % for example, change the margins to 2 inches all round
% \geometry{landscape} % set up the page for landscape
% read geometry.pdf for detailed page layout information
......
/*
This is part of TeXworks, an environment for working with TeX documents
Copyright (C) 2007-2010 Jonathan Kew
Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
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
......@@ -101,7 +101,7 @@ void CommandlineParser::printUsage(QTextStream & stream)
stream.flush();
}
int CommandlineParser::getNextArgument(int index /*= -1*/, CommandlineGetItemFlags flags /*= GetFlag_Default*/) const
int CommandlineParser::getNextArgument(int index /* = -1 */, CommandlineGetItemFlags flags /* = GetFlag_Default */) const
{
for (++index; index < m_items.size(); ++index) {
if (m_items[index].type == Commandline_Argument) {
......@@ -112,7 +112,7 @@ int CommandlineParser::getNextArgument(int index /*= -1*/, CommandlineGetItemFla
return -1;
}
int CommandlineParser::getPrevArgument(int index /*= -1*/, CommandlineGetItemFlags flags /*= GetFlag_Default*/) const
int CommandlineParser::getPrevArgument(int index /* = -1 */, CommandlineGetItemFlags flags /* = GetFlag_Default */) const
{
for (--index; index >= 0; --index) {
if (m_items[index].type == Commandline_Argument) {
......@@ -124,9 +124,9 @@ int CommandlineParser::getPrevArgument(int index /*= -1*/, CommandlineGetItemFla
}
int CommandlineParser::getNextOption(
const QString longName /*= QString()*/,
int index /*= -1*/,
CommandlineGetItemFlags flags /*= GetFlag_Default*/
const QString longName /* = QString() */,
int index /* = -1 */,
CommandlineGetItemFlags flags /* = GetFlag_Default */
) const
{
for (++index; index < m_items.size(); ++index) {
......@@ -139,9 +139,9 @@ int CommandlineParser::getNextOption(
}
int CommandlineParser::getPrevOption(
const QString longName /*= QString()*/,
int index /*= -1*/,
CommandlineGetItemFlags flags /*= GetFlag_Default*/
const QString longName /* = QString() */,
int index /* = -1 */,
CommandlineGetItemFlags flags /* = GetFlag_Default */
) const
{
for (--index; index >= 0; --index) {
......@@ -154,9 +154,9 @@ int CommandlineParser::getPrevOption(
}
int CommandlineParser::getNextSwitch(
const QString longName /*= QString()*/,
int index /*= -1*/,
CommandlineGetItemFlags flags /*= GetFlag_Default*/
const QString longName /* = QString() */,
int index /* = -1 */,
CommandlineGetItemFlags flags /* = GetFlag_Default */
) const
{
for (++index; index < m_items.size(); ++index) {
......@@ -169,9 +169,9 @@ int CommandlineParser::getNextSwitch(
}
int CommandlineParser::getPrevSwitch(
const QString longName /*= QString()*/,
int index /*= -1*/,
CommandlineGetItemFlags flags /*= GetFlag_Default*/
const QString longName /* = QString() */,
int index /* = -1 */,
CommandlineGetItemFlags flags /* = GetFlag_Default */
) const
{
for (--index; index >= 0; --index) {
......
/*
This is part of TeXworks, an environment for working with TeX documents
Copyright (C) 2007-2010 Jonathan Kew
Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
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
......
/*
This is part of TeXworks, an environment for working with TeX documents
Copyright (C) 2007-2010 Jonathan Kew
Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
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
......@@ -55,17 +55,24 @@ CompletingEdit::CompletingEdit(QWidget *parent)
pHunspell(NULL), spellingCodec(NULL)
{
if (sharedCompleter == NULL) { // initialize shared (static) members
qreal bgR, bgG, bgB;
qreal fgR, fgG, fgB;
sharedCompleter = new QCompleter(qApp);
sharedCompleter->setCompletionMode(QCompleter::InlineCompletion);
sharedCompleter->setCaseSensitivity(Qt::CaseInsensitive);
loadCompletionFiles(sharedCompleter);
palette().color(QPalette::Active, QPalette::Base).getRgbF(&bgR, &bgG, &bgB);
palette().color(QPalette::Active, QPalette::Text).getRgbF(&fgR, &fgG, &fgB);
currentCompletionFormat = new QTextCharFormat;
currentCompletionFormat->setBackground(QColor("yellow").lighter(160));
currentCompletionFormat->setBackground(QColor::fromRgbF(.75 * bgR + .25 * fgR, .75 * bgG + .25 * fgG, .75 * bgB + .25 * fgB));
braceMatchingFormat = new QTextCharFormat;
braceMatchingFormat->setBackground(QColor("orange"));
currentLineFormat = new QTextCharFormat;
currentLineFormat->setBackground(QColor("yellow").lighter(180));
currentLineFormat->setBackground(QColor::fromRgbF(.9 * bgR + .1 * fgR, .9 * bgG + .1 * fgG, .9 * bgB + .1 * fgB));
currentLineFormat->setProperty(QTextFormat::FullWidthSelection, true);
QSETTINGS_OBJECT(settings);
......@@ -597,6 +604,7 @@ void CompletingEdit::maybeSmartenQuote(int offset)
if (smartQuotesMode < 0 || smartQuotesMode >= quotesModes->count())
return;
const QuoteMapping& mappings = quotesModes->at(smartQuotesMode).mappings;
QString replacement;
const QString& text = document()->toPlainText();
if (offset < 0 || offset >= text.length())
......@@ -610,8 +618,21 @@ void CompletingEdit::maybeSmartenQuote(int offset)
if (iter == mappings.end())
return;
cursor.insertText(offset == 0 || text[offset - 1].isSpace() ?
iter.value().first : iter.value().second);
replacement = iter.value().second;
if (offset == 0) {
// always use opening quotes at the beginning of the document
replacement = iter.value().first;
}
else {
if (text[offset - 1].isSpace())
replacement = iter.value().first;
// after opening brackets, also use opening quotes
if (text[offset - 1] == '{' || text[offset - 1] == '[' || text[offset - 1] == '(')
replacement = iter.value().first;
}
cursor.insertText(replacement);
}
void CompletingEdit::smartenQuotes()
......
/*
This is part of TeXworks, an environment for working with TeX documents
Copyright (C) 2007-2010 Jonathan Kew
Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
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
......
/*
This is part of TeXworks, an environment for working with TeX documents
Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
For links to further information, or to contact the author,
see <http://texworks.org/>.
*/
#ifndef ConfigurableApp_H
#define ConfigurableApp_H
#include <QApplication>
#include <QSettings>
#ifdef Q_WS_MAC
#define QSETTINGS_OBJECT(s) \
QSettings s(ConfigurableApp::instance()->getSettingsFormat(), QSettings::UserScope, \
ConfigurableApp::instance()->organizationDomain(), ConfigurableApp::instance()->applicationName())
#else
#define QSETTINGS_OBJECT(s) \
QSettings s(ConfigurableApp::instance()->getSettingsFormat(), QSettings::UserScope, \
ConfigurableApp::instance()->organizationName(), ConfigurableApp::instance()->applicationName())
#endif
class ConfigurableApp : public QApplication
{
Q_OBJECT
public:
ConfigurableApp(int &argc, char **argv) : QApplication(argc, argv), settingsFormat(QSettings::NativeFormat) { }
virtual ~ConfigurableApp() { }
static ConfigurableApp * instance() { return qobject_cast<ConfigurableApp*>(QApplication::instance()); }
QSettings::Format getSettingsFormat() const { return settingsFormat; }
void setSettingsFormat(QSettings::Format fmt) { settingsFormat = fmt; }
protected:
QSettings::Format settingsFormat;
};
#endif // !defined(ConfigurableApp)
/*
This is part of TeXworks, an environment for working with TeX documents
Copyright (C) 2007-2010 Jonathan Kew
Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
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
......
/*
This is part of TeXworks, an environment for working with TeX documents
Copyright (C) 2007-2010 Jonathan Kew
Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
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
......
/*
This is part of TeXworks, an environment for working with TeX documents
Copyright (C) 2007-2010 Jonathan Kew
Copyright (C) 2007-2011 Jonathan Kew, Stefan Löffler
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
......@@ -423,13 +423,14 @@ SearchResults::SearchResults(QWidget* parent)
{
setupUi(this);