Commit bfafb429 authored by Atsuhito Kohda's avatar Atsuhito Kohda

Imported Upstream version 0.5~svn939

parent d5b5c64e
<!DOCTYPE plist PUBLIC
"-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>tex</string>
<string>ltx</string>
<string>sty</string>
<string>cls</string>
<string>dtx</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>TeXworks-doc.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>text/plain</string>
</array>
<key>CFBundleTypeName</key>
<string>TeX Document</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSIsAppleDefaultForType</key>
<true/>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>pdf</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>TeXworks-doc.icns</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/pdf</string>
</array>
<key>LSItemContentTypes</key>
<array>
<string>com.adobe.pdf</string>
</array>
<key>CFBundleTypeName</key>
<string>PDF Document</string>
</dict>
</array>
<key>CFBundleIconFile</key>
<string>TeXworks.icns</string>
<key>CFBundleGetInfoString</key>
<string>TeXworks version 0.5 (r.1)&#xA;(C) 2007-2011 Jonathan Kew, Stefan L&#xF6;ffler&#xA;Released under GPL (v2.0 or later)</string>
<key>CFBundleExecutable</key>
<string>TeXworks</string>
<key>CFBundleIdentifier</key>
<string>org.tug.texworks</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>0.5 (r.1)</string>
<key>CFBundleVersion</key>
<string>0.5 (r.1)</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>
......@@ -51,7 +51,7 @@
<key>CFBundleIconFile</key>
<string>TeXworks.icns</string>
<key>CFBundleGetInfoString</key>
<string>TeXworks version 0.5 (r.930)&#xA;(C) 2007-2011 Jonathan Kew, Stefan L&#xF6;ffler&#xA;Released under GPL (v2.0 or later)</string>
<string>TeXworks version 0.5 (r.939)&#xA;(C) 2007-2011 Jonathan Kew, Stefan L&#xF6;ffler&#xA;Released under GPL (v2.0 or later)</string>
<key>CFBundleExecutable</key>
<string>TeXworks</string>
<key>CFBundleIdentifier</key>
......@@ -63,9 +63,9 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>0.5 (r.930)</string>
<string>0.5 (r.939)</string>
<key>CFBundleVersion</key>
<string>0.5 (r.930)</string>
<string>0.5 (r.939)</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
......
......@@ -15,7 +15,7 @@
# 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/>.
# see <http://www.tug.org/texworks/>.
TEMPLATE = app
DEPENDPATH += ./src
......
......@@ -6,7 +6,7 @@
svn update
# get the current revision number
REV=`svn info | fgrep Revision: | cut -d ' ' -f 2`
REV=`LANG=C svn info | fgrep Revision: | cut -d ' ' -f 2`
if [ `svn status | grep -c "^[^?]"` == 0 ]; then
# make a new SvnRev.h file
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "TWLuaPlugin.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef TW_LUA_PLUGIN_H
......
......@@ -15,7 +15,7 @@
# 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/>.
# see <http://www.tug.org/texworks/>.
TEMPLATE = lib
CONFIG += plugin
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "TWPythonPlugin.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef TW_PYTHON_PLUGIN_H
......
......@@ -15,7 +15,7 @@
# 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/>.
# see <http://www.tug.org/texworks/>.
TEMPLATE = lib
CONFIG += plugin
......
// TeXworksScript
// Title: Open in default viewer
// Description: Attempts to open the PDF file using the system's default viewer
// Author: Jonathan Kew
// Version: 0.2
// Date: 2010-01-26
// Author: Stefan Löffler & Jonathan Kew
// Version: 0.2.1
// Date: 2011-09-12
// Script-Type: standalone
// Context: PDFDocument
TW.launchFile(TW.target.fileName);
retVal = TW.launchFile(TW.target.fileName);
if (retVal["status"] != 0)
{
TW.information(TW.target, "Error", retVal["message"]);
}
undefined;
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef ClickableLabel_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "CommandlineParser.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef COMMANDLINE_PARSER_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "CompletingEdit.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef COMPLETING_EDIT_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef ConfigurableApp_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "ConfirmDelete.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef ConfirmDelete_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
// Default paths to TeX binaries on Windows, for TeXworks
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "FindDialog.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef FindDialog_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "HardWrapDialog.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef HardWrapDialog_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
// Based on code by Pino Toscano from Poppler / qt4 / Demos, released under GPL 2 or later
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef PDFDOCKS_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "PDFDocument.h"
......@@ -1241,13 +1241,10 @@ PDFDocument::init()
connect(actionFind_Again, SIGNAL(triggered()), this, SLOT(doFindAgain()));
menuRecent = new QMenu(tr("Open Recent"), this);
updateRecentFileActions();
menuFile->insertMenu(actionOpen_Recent, menuRecent);
menuFile->removeAction(actionOpen_Recent);
connect(qApp, SIGNAL(recentFileActionsChanged()), this, SLOT(updateRecentFileActions()));
connect(qApp, SIGNAL(windowListChanged()), this, SLOT(updateWindowMenu()));
connect(actionClear_Recent_Files, SIGNAL(triggered()), this, SLOT(clearRecentFiles()));
connect(qApp, SIGNAL(hideFloatersExcept(QWidget*)), this, SLOT(hideFloatersUnlessThis(QWidget*)));
connect(this, SIGNAL(activatedWindow(QWidget*)), qApp, SLOT(activatedWindow(QWidget*)));
......@@ -1301,7 +1298,6 @@ void PDFDocument::changeEvent(QEvent *event)
if (event->type() == QEvent::LanguageChange) {
QString title = windowTitle();
retranslateUi(this);
menuRecent->setTitle(tr("Open Recent"));
TWUtils::insertHelpMenuItems(menuHelp);
setWindowTitle(title);
if (pdfWidget)
......@@ -1333,7 +1329,7 @@ void PDFDocument::texClosed(QObject *obj)
void PDFDocument::updateRecentFileActions()
{
TWUtils::updateRecentFileActions(this, recentFileActions, menuRecent);
TWUtils::updateRecentFileActions(this, recentFileActions, menuOpen_Recent, actionClear_Recent_Files);
}
void PDFDocument::updateWindowMenu()
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef PDFDocument_H
......@@ -33,6 +33,7 @@
#include <QTimer>
#include <QMouseEvent>
#include "TWApp.h"
#include "FindDialog.h"
#include "poppler-qt4.h"
#include "synctex_parser.h"
......@@ -265,6 +266,7 @@ public slots:
private slots:
void updateRecentFileActions();
void clearRecentFiles() { TWApp::instance()->clearRecentFiles(); }
void updateWindowMenu();
void enablePageActions(int);
void enableZoomActions(qreal);
......@@ -299,7 +301,6 @@ private:
QLabel *pageLabel;
QLabel *scaleLabel;
QList<QAction*> recentFileActions;
QMenu *menuRecent;
QShortcut *exitFullscreen;
QFileSystemWatcher *watcher;
......
......@@ -40,10 +40,16 @@
<property name="title">
<string>File</string>
</property>
<widget class="QMenu" name="menuOpen_Recent">
<property name="title">
<string>Open Recent</string>
</property>
<addaction name="actionClear_Recent_Files"/>
</widget>
<addaction name="actionNew"/>
<addaction name="actionNew_from_Template"/>
<addaction name="actionOpen"/>
<addaction name="actionOpen_Recent"/>
<addaction name="menuOpen_Recent"/>
<addaction name="separator"/>
<addaction name="actionPrintPdf"/>
<addaction name="actionClose"/>
......@@ -372,14 +378,6 @@
<enum>QAction::NoRole</enum>
</property>
</action>
<action name="actionOpen_Recent">
<property name="text">
<string>Open Recent</string>
</property>
<property name="menuRole">
<enum>QAction::NoRole</enum>
</property>
</action>
<action name="actionClose">
<property name="text">
<string>Close</string>
......@@ -747,6 +745,14 @@
<enum>QAction::NoRole</enum>
</property>
</action>
<action name="actionClear_Recent_Files">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Clear Recent Files</string>
</property>
</action>
</widget>
<resources>
<include location="../res/resources.qrc"/>
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "PrefsDialog.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef PrefsDialog_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "ResourcesDialog.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef ResourcesDialog_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "ScriptManager.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef ScriptManager_H
......
#define SVN_REVISION 930
#define SVN_REVISION_STR "930"
#define SVN_REVISION 939
#define SVN_REVISION_STR "939"
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "TWApp.h"
......@@ -220,6 +220,9 @@ void TWApp::init()
connect(actionOpen, SIGNAL(triggered()), this, SLOT(open()));
menuRecent = new QMenu(tr("Open Recent"));
actionClear_Recent_Files = menuRecent->addAction(tr("Clear Recent Files"));
actionClear_Recent_Files->setEnabled(false);
connect(actionClear_Recent_Files, SIGNAL(triggered()), this, SLOT(clearRecentFiles()));
updateRecentFileActions();
menuFile->addMenu(menuRecent);
......@@ -308,7 +311,7 @@ void TWApp::openUrl(const QUrl& url)
void TWApp::goToHomePage()
{
openUrl(QUrl("http://texworks.org/"));
openUrl(QUrl("http://www.tug.org/texworks/"));
}
#ifdef Q_WS_WIN
......@@ -718,7 +721,7 @@ void TWApp::setMaxRecentFiles(int value)
void TWApp::updateRecentFileActions()
{
#ifdef Q_WS_MAC
TWUtils::updateRecentFileActions(this, recentFileActions, menuRecent);
TWUtils::updateRecentFileActions(this, recentFileActions, menuRecent, actionClear_Recent_Files);
#endif
emit recentFileActionsChanged();
}
......@@ -1069,6 +1072,14 @@ void TWApp::addToRecentFiles(const QMap<QString,QVariant>& fileProperties)
updateRecentFileActions();
}
void TWApp::clearRecentFiles()
{
QSETTINGS_OBJECT(settings);
QList<QVariant> fileList;
settings.setValue("recentFiles", QVariant::fromValue(fileList));
updateRecentFileActions();
}
QMap<QString,QVariant> TWApp::getFileProperties(const QString& path)
{
QSETTINGS_OBJECT(settings);
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef TWApp_H
......@@ -78,6 +78,7 @@ public:
int maxRecentFiles() const;
void setMaxRecentFiles(int value);
void addToRecentFiles(const QMap<QString,QVariant>& fileProperties);
void clearRecentFiles();
void emitHighlightLineOptionChanged();
......@@ -160,6 +161,7 @@ private:
QAction *actionPreferences;
QMenu *menuRecent;
QAction *actionClear_Recent_Files;
QList<QAction*> recentFileActions;
QMenu *menuHelp;
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "TWScript.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef TWScript_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "TWScriptAPI.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef TWScriptAPI_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "TWScriptable.h"
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef TWScriptable_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef TWSystemCmd_H
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#include "TWUtils.h"
......@@ -489,7 +489,7 @@ QString TWUtils::strippedName(const QString &fullFileName)
return QFileInfo(fullFileName).fileName();
}
void TWUtils::updateRecentFileActions(QObject *parent, QList<QAction*> &actions, QMenu *menu) /* static */
void TWUtils::updateRecentFileActions(QObject *parent, QList<QAction*> &actions, QMenu *menu, QAction * clearAction) /* static */
{
QSETTINGS_OBJECT(settings);
QStringList fileList;
......@@ -517,13 +517,18 @@ void TWUtils::updateRecentFileActions(QObject *parent, QList<QAction*> &actions,
}
int numRecentFiles = fileList.size();
foreach(QAction * sep, menu->actions()) {
if (sep->isSeparator())
delete sep;
}
while (actions.size() < numRecentFiles) {
QAction *act = new QAction(parent);
act->setVisible(false);
QObject::connect(act, SIGNAL(triggered()), qApp, SLOT(openRecentFile()));
actions.append(act);
menu->addAction(act);
menu->insertAction(clearAction, act);
}
while (actions.size() > numRecentFiles) {
......@@ -538,6 +543,11 @@ void TWUtils::updateRecentFileActions(QObject *parent, QList<QAction*> &actions,
actions[i]->setData(path);
actions[i]->setVisible(true);
}
if (numRecentFiles > 0)
menu->insertSeparator(clearAction);
if (clearAction)
clearAction->setEnabled(numRecentFiles > 0);
}
void TWUtils::updateWindowMenu(QWidget *window, QMenu *menu) /* static */
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.
*/
#ifndef TWUtils_H
......@@ -74,7 +74,7 @@ public:
static QString chooseDefaultFilter(const QString & filename, const QStringList & filters);
// perform the updates to a menu; used by the documents to update their own menus
static void updateRecentFileActions(QObject *parent, QList<QAction*> &actions, QMenu *menu);
static void updateRecentFileActions(QObject *parent, QList<QAction*> &actions, QMenu *menu, QAction * clearAction);
// update the SelWinActions in a menu, used by the documents
static void updateWindowMenu(QWidget *window, QMenu *menu);
......
......@@ -16,7 +16,7 @@
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/>.
see <http://www.tug.org/texworks/>.