Commit ebd20c82 authored by Atsuhito Kohda's avatar Atsuhito Kohda

Imported Debian patch 0.5~svn843-1

parents 34b4aa3a 2e56753d
......@@ -10,6 +10,9 @@
<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>
......
Release 0.4.0
Release 0.4.1 (TL'11 RC) [May 2011]
* Add option to always close the output panel after sucessful typesetting
(regardless of its previous state)
* Invoke "Goto page" and "Goto line" from the status bar widgets
* Implement pdf zoom menu from the status bar widget
* Allow to reload a file with selectable encoding
* Implement "Help > Settings and Resources..." for easy access, in
particular to customizable resources
* Speed up program start-up
* Add \begin{document} to the auto-completion
* Work around the almost invisible highlighting when searching with the
"Find all occurences" option
* Improve highlighting of auto-completed text
* Let typeset combobox adjust size dynamically
* Remove the "+" from the zoom tool icon in the PDF preview
* Reduce size of packages
* Fix handling of non-existent files in automatic resource updates
* Fix handling of TEXEDIT environment variable; add support for the
MIKTEX_EDITOR environment variable
* [Win] Add installer icon
* [Win] Add shortcut to manual to the start menu during setup
* [Win] Fix cropping of tooltips
* [*nix] Fix invisible icons in application switcher with compiz
* Fix several compile time and runtime warnings
* Rename default ConTeXt tools
* Add more extensions for associating files with TeXworks
* Add support for Python 3.2
* Clean up unused code & files
Release 0.4.0 [March 2011]
* Scripting (QtScript, Lua, Python)
* New "Follow focus" mode (experimental)
* New %!TeX header (spellcheck)
......@@ -29,7 +60,6 @@ Release 0.4.0
* [Win/*nix] Set TeXworks as the default editor when hitting 'e' after a
TeX error
* [Win] Fix handling of "All Files" in the "Save As" dialog (issue 257)
Release 0.2.3 (TL'09 DVD release)
* Fix potential crash in Balance Delimiters
......
......@@ -93,8 +93,10 @@ tricky.
To avoid having to build the poppler dependencies for Windows, you can get
precompiled libraries from the KDE on Windows project.
On the Mac, required libraries can be obtained, e.g., using Homebrew.
Further tips on building TeXworks from source are available on some of the wiki
pages:
- http://code.google.com/p/texworks/wiki/Building
- http://code.google.com/p/texworks/wiki/BuildingOnWindowsMinGW
- http://code.google.com/p/texworks/issues/detail?id=107
- http://code.google.com/p/texworks/wiki/BuildingOnMacOSXHomebrew
......@@ -10,6 +10,9 @@
<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>
......
......@@ -10,6 +10,9 @@
<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>
......
......@@ -29,10 +29,6 @@ OBJECTS_DIR = ./obj
UI_DIR = ./ui
RCC_DIR = ./rcc
# packagers should override this to identify the source of the particular TeXworks build;
# avoid spaces or other chars that would need quoting on the command line
QMAKE_CXXFLAGS += -DTW_BUILD_ID=personal
# comment this out if poppler's xpdf headers are not available on the build system
QMAKE_CXXFLAGS += -DHAVE_POPPLER_XPDF_HEADERS
......@@ -51,12 +47,22 @@ QMAKE_CXXFLAGS_WARN_ON += -Wno-unknown-pragmas
unix:!macx {
TARGET = texworks
isEmpty(INSTALL_PREFIX):INSTALL_PREFIX = /usr/local
isEmpty(DATA_DIR):DATA_DIR = $$INSTALL_PREFIX/share
isEmpty(TW_HELPPATH):TW_HELPPATH = $$DATA_DIR/texworks-help
isEmpty(TW_PLUGINPATH):TW_PLUGINPATH = $$INSTALL_PREFIX/lib/texworks
isEmpty(TW_DICPATH):TW_DICPATH = /usr/share/myspell/dicts
} else {
TARGET = TeXworks
QMAKE_CXXFLAGS += -fexceptions
QMAKE_LFLAGS += -fexceptions
}
# packagers should override this to identify the source of the particular TeXworks build;
# avoid spaces or other chars that would need quoting on the command line
isEmpty(TW_BUILD_ID):TW_BUILD_ID = personal
QMAKE_CXXFLAGS += -DTW_BUILD_ID=$$TW_BUILD_ID
QT += xml script scripttools
CONFIG += rtti uitools
......@@ -97,20 +103,19 @@ unix:!macx { # on Unix-ish platforms we rely on pkgconfig, and use dbus
CONFIG += link_pkgconfig
PKGCONFIG += hunspell
PKGCONFIG += poppler-qt4
PKGCONFIG += zlib
# Enclose the path in \\\" (which later gets expanded to \", which in turn
# gets expanded to " in the c++ code)
QMAKE_CXXFLAGS += -DTW_HELPPATH=\\\"/usr/local/share/texworks-help\\\"
QMAKE_CXXFLAGS += -DTW_PLUGINPATH=\\\"/usr/local/lib/texworks\\\"
QMAKE_CXXFLAGS += -DTW_DICPATH=\\\"/usr/share/myspell/dicts\\\"
QMAKE_CXXFLAGS += -DTW_HELPPATH=\\\"$$TW_HELPPATH\\\"
QMAKE_CXXFLAGS += -DTW_PLUGINPATH=\\\"$$TW_PLUGINPATH\\\"
QMAKE_CXXFLAGS += -DTW_DICPATH=\\\"$$TW_DICPATH\\\"
}
linux-g++ {
# Qt/dbus config on Debian is broken, hence the lines below
LIBS += -lQtDBus
INCLUDEPATH += /usr/include/qt4/QtDBus
# needed to link successfully on Fedora, apparently
LIBS += -lz
}
openbsd-g++ {
......@@ -235,22 +240,22 @@ TRANSLATIONS += trans/TeXworks_af.ts \
trans/TeXworks_zh_CN.ts
unix:!macx { # installation on Unix-ish platforms
isEmpty(INSTALL_PREFIX):INSTALL_PREFIX = /usr/local
isEmpty(BIN_DIR):BIN_DIR = $$INSTALL_PREFIX/bin
isEmpty(DATA_DIR):DATA_DIR = $$INSTALL_PREFIX/share
isEmpty(DOCS_DIR):DOCS_DIR = $$DATA_DIR/doc/texworks
isEmpty(ICON_DIR):ICON_DIR = $$DATA_DIR/pixmaps
isEmpty(MAN_DIR):MAN_DIR = $$DATA_DIR/man/man1
isEmpty(DESKTOP_DIR):DESKTOP_DIR = $$DATA_DIR/applications
target.path = $$BIN_DIR
documentation.files = COPYING README
documentation.files = COPYING README NEWS
documentation.path = $$DOCS_DIR
manual.files = manual/*
manual.path = $$TW_HELPPATH
icon.files = res/images/TeXworks.png
icon.path = $$ICON_DIR
man.files = man/texworks.1
man.path = $$MAN_DIR
desktop.files = texworks.desktop
desktop.path = $$DESKTOP_DIR
INSTALLS = target documentation icon man desktop
INSTALLS = target documentation manual icon man desktop
}
texworks (0.5~svn843-1) unstable; urgency=low
* New upstream release (rev. 846).
I tested to build the package on AMD64 and found no problem.
(Closes: #628276)
-- Atsuhito KOHDA <kohda@debian.org> Mon, 13 Jun 2011 17:50:43 +0900
texworks (0.5~svn808-1) unstable; urgency=low
* New Upstream Release (rev. 808). (Closes: #625543)
......
......@@ -17,7 +17,7 @@ configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
patch -p1 < ./debian/patch-luatex
# patch -p1 < ./debian/patch-luatex
# qmake-qt4
touch configure-stamp
......@@ -74,7 +74,7 @@ clean:
if [ -d $(PLIPYT)/obj ]; then rmdir $(PLIPYT)/obj; fi
if [ -d $(PLIPYT)/rcc ]; then rmdir $(PLIPYT)/rcc; fi
if [ -d $(PLIPYT)/ui ]; then rmdir $(PLIPYT)/ui; fi
patch -NRp1 < ./debian/patch-luatex || true
# patch -NRp1 < ./debian/patch-luatex || true
rm -f $(PLIDIR)/libTWLuaPlugin.so $(PLIDIR)/Makefile
rm -f $(PLIPYT)/libTWPythonPlugin.so $(PLIPYT)/Makefile
......
......@@ -20,7 +20,10 @@ the TeXworks 0.4 release.
Provides support for a "local" poppler-data.
* poppler-*-font-handling.patch
Adds/enhances font support for different platforms. (Only the patch relevant
for you platform is needed)
for your platform is needed)
* poppler-bogus-memory-allocation-fix.patch
Fixes warning messages generated by glyphs of height zero (e.g., for space
glyphs in some Mac fonts)
......
diff --git a/splash/SplashFTFont.cc b/splash/SplashFTFont.cc
index 3e84cbf..e6435f7 100644
--- a/splash/SplashFTFont.cc
+++ b/splash/SplashFTFont.cc
@@ -241,6 +241,9 @@ GBool SplashFTFont::makeGlyph(int c, int xFrac, int yFrac,
} else {
rowSize = (bitmap->w + 7) >> 3;
}
+ if (rowSize == 0 || bitmap->h == 0) {
+ return gFalse;
+ }
bitmap->data = (Guchar *)gmallocn_checkoverflow(rowSize, bitmap->h);
if (!bitmap->data) {
return gFalse;
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8d8cf83..f144ddf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,15 +45,20 @@ set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
if(WIN32)
set(_default_fontconfiguration "win32")
+elseif(APPLE)
+ set(_default_fontconfiguration "mac")
else(WIN32)
set(_default_fontconfiguration "fontconfig")
endif(WIN32)
-set(FONT_CONFIGURATION "${_default_fontconfiguration}" CACHE STRING "The font configuration backend (win32|fontconfig).")
+set(FONT_CONFIGURATION "${_default_fontconfiguration}" CACHE STRING "The font configuration backend (win32|mac|fontconfig).")
string(TOLOWER "${FONT_CONFIGURATION}" font_configuration)
set(WITH_FONTCONFIGURATION_WIN32 OFF)
+set(WITH_FONTCONFIGURATION_MAC OFF)
set(WITH_FONTCONFIGURATION_FONTCONFIG OFF)
if(font_configuration STREQUAL "win32")
set(WITH_FONTCONFIGURATION_WIN32 ON)
+elseif(font_configuration STREQUAL "mac")
+ set(WITH_FONTCONFIGURATION_MAC ON)
elseif(font_configuration STREQUAL "fontconfig")
set(WITH_FONTCONFIGURATION_FONTCONFIG ON)
else(font_configuration STREQUAL "win32")
@@ -153,6 +158,11 @@ if(WITH_FONTCONFIGURATION_WIN32)
add_definitions(-D_WIN32_IE=0x0500)
endif(MINGW)
endif(WITH_FONTCONFIGURATION_WIN32)
+
+if(WITH_FONTCONFIGURATION_MAC)
+ set(CMAKE_SHARED_LINKER_FLAGS "-framework ApplicationServices ${CMAKE_SHARED_LINKER_FLAGS}")
+endif(WITH_FONTCONFIGURATION_MAC)
+
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/fofi
diff --git a/config.h.cmake b/config.h.cmake
index 5d27156..3a65771 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -189,6 +189,9 @@
/* Use win32 font configuration backend */
#cmakedefine WITH_FONTCONFIGURATION_WIN32 1
+/* Use Mac font configuration backend */
+#cmakedefine WITH_FONTCONFIGURATION_MAC 1
+
/* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */
diff --git a/configure.ac b/configure.ac
index 75f173b..6f7f96f 100644
index 471f909..f7a9783 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,9 @@ case "$host_os" in
......@@ -48,9 +100,8 @@ index 75f173b..6f7f96f 100644
AC_DEFINE([WITH_FONTCONFIGURATION_FONTCONFIG],
[1],[Use fontconfig font configuration backend])
diff --git a/m4/mac-framework.m4 b/m4/mac-framework.m4
new file mode 100644
index 0000000..8a060ee
--- /dev/null
index e69de29..8a060ee 100644
--- a/m4/mac-framework.m4
+++ b/m4/mac-framework.m4
@@ -0,0 +1,30 @@
+# based on kpse-macos-framework.m4 from the TeX Live source tree
......@@ -147,11 +198,10 @@ index 941a536..e7bc266 100644
GBool psShrinkLarger; // shrink larger pages to fit paper
GBool psCenter; // center pages on the paper
diff --git a/poppler/GlobalParamsMac.cc b/poppler/GlobalParamsMac.cc
new file mode 100644
index 0000000..fdb10e7
--- /dev/null
index e69de29..ce3cf81 100644
--- a/poppler/GlobalParamsMac.cc
+++ b/poppler/GlobalParamsMac.cc
@@ -0,0 +1,290 @@
@@ -0,0 +1,297 @@
+//========================================================================
+//
+// GlobalParamsMac.cc
......@@ -230,6 +280,13 @@ index 0000000..fdb10e7
+ *cp = '\0';
+ continue;
+ }
+ if ( strcmp(myName, "ZapfDingbats") == 0 ) {
+ // On OS X 10.5.0 -- 10.6.7 (plus or minus a few versions?) the
+ // PostScript name of ZapfDingbats is ZapfDingbatsITC
+ gfree(myName);
+ myName = copyString("ZapfDingbatsITC");
+ continue;
+ }
+ break;
+ }
+ gfree(myName);
......@@ -238,7 +295,7 @@ index 0000000..fdb10e7
+
+ // Currently support only TrueType fonts: check for presence of 'glyf' table
+ // TODO: what about OpenType/CFF? DisplayFontParam doesn't seem to allow for this
+#define TAG(a,b,c,d) (UInt32)((a)<<24) | (UInt32)((b)<<16) | (UInt32)((c)<<8) | (UInt32)(d)
+#define TAG(a,b,c,d) ( (UInt32)((a)<<24) | (UInt32)((b)<<16) | (UInt32)((c)<<8) | (UInt32)(d) )
+
+ ByteCount tableSize;
+ if (ATSFontGetTable(fontRef, TAG('g','l','y','f'), 0, 0, NULL, &tableSize) != noErr ||
......@@ -292,8 +349,8 @@ index 0000000..fdb10e7
+ struct sfntHeader * header = (struct sfntHeader *) new Byte[headerSize];
+ ATSFontGetTableDirectory(fontRef, headerSize, (Byte *) header, &headerSize);
+
+#define READ16(x) (UInt16)(((UInt8*)&(x))[0]<<8) + (UInt16)((UInt8*)&(x))[1]
+#define READ32(x) (UInt32)(((UInt8*)&(x))[0]<<24) + (UInt32)(((UInt8*)&(x))[1]<<16) + (UInt32)(((UInt8*)&(x))[2]<<8) + (UInt32)((UInt8*)&(x))[3]
+#define READ16(x) ( (UInt16)(((UInt8*)&(x))[0]<<8) + (UInt16)((UInt8*)&(x))[1] )
+#define READ32(x) ( (UInt32)(((UInt8*)&(x))[0]<<24) + (UInt32)(((UInt8*)&(x))[1]<<16) + (UInt32)(((UInt8*)&(x))[2]<<8) + (UInt32)((UInt8*)&(x))[3] )
+
+ UInt32 version = READ32(header->version);
+ if (version != 0x00010000 &&
......@@ -442,6 +499,22 @@ index 0000000..fdb10e7
+ unlockGlobalParams;
+ return dfp;
+}
diff --git a/poppler/poppler-config.h.cmake b/poppler/poppler-config.h.cmake
index 2c47ab3..05eb474 100644
--- a/poppler/poppler-config.h.cmake
+++ b/poppler/poppler-config.h.cmake
@@ -44,6 +44,11 @@
#cmakedefine WITH_FONTCONFIGURATION_WIN32 1
#endif
+/* Use Mac font configuration backend */
+#ifndef WITH_FONTCONFIGURATION_MAC
+#cmakedefine WITH_FONTCONFIGURATION_MAC 1
+#endif
+
/* Support for curl is compiled in. */
#ifndef POPPLER_HAS_CURL_SUPPORT
#cmakedefine POPPLER_HAS_CURL_SUPPORT 1
diff --git a/poppler/poppler-config.h.in b/poppler/poppler-config.h.in
index f2b70cc..d93bb13 100644
--- a/poppler/poppler-config.h.in
......
......@@ -48,7 +48,9 @@ unix:!macx { # on Unix-ish platforms we rely on pkgconfig
CONFIG += link_pkgconfig
PKGCONFIG += lua5.1
target.path = /usr/local/lib/texworks
isEmpty(INSTALL_PREFIX):INSTALL_PREFIX = /usr/local
isEmpty(TW_PLUGINPATH):TW_PLUGINPATH = $$INSTALL_PREFIX/lib/texworks
target.path = $$TW_PLUGINPATH
INSTALLS += target
}
......
......@@ -58,7 +58,9 @@ unix:!macx { # on Unix-ish platforms we should rely on pkgconfig
# QMAKE_CXXFLAGS += -DPy_UNICODE_WIDE
# PKGCONFIG += python3
target.path = /usr/local/lib/texworks
isEmpty(INSTALL_PREFIX):INSTALL_PREFIX = /usr/local
isEmpty(TW_PLUGINPATH):TW_PLUGINPATH = $$INSTALL_PREFIX/lib/texworks
target.path = $$TW_PLUGINPATH
INSTALLS += target
}
......
<RCC>
<qresource prefix="/images" >
<file>images/TeXworks.png</file>
<file>images/TeXworks-doc.png</file>
<file>images/TeXworks-doc-48.png</file>
<file>images/actualsize.png</file>
<file>tango/go-previous.png</file>
<file>tango/go-down.png</file>
<file>tango/edit-copy.png</file>
<file>tango/edit-cut.png</file>
<file>images/editgrid.png</file>
<file>images/edithlayout.png</file>
<file>images/editlower.png</file>
<file>tango/edit-paste.png</file>
<file>tango/edit-redo.png</file>
<file>tango/edit-undo.png</file>
<file>images/editvlayout.png</file>
<file>tango/document-new.png</file>
<file>tango/document-open.png</file>
<file>images/fileprint.png</file>
<file>tango/document-save.png</file>
<file>tango/go-first.png</file>
<file>images/fitwidth.png</file>
<file>images/fitwindow.png</file>
<file>tango/go-next.png</file>
<file>tango/go-last.png</file>
<file>tango/list-remove.png</file>
<file>tango/list-add.png</file>
<file>images/pdfdoc.png</file>
<file>tango/edit-find.png</file>
<file>tango/edit-find-replace.png</file>
<file>images/texdoc.png</file>
<file>tango/process-stop.png</file>
<file>tango/go-up.png</file>
<file>images/zoomin.png</file>
<file>images/zoomout.png</file>
<file>images/magnifiercursor.png</file>
<file>images/zoomincursor.png</file>
<file>images/zoomoutcursor.png</file>
<qresource prefix="/images">
<file>images/TeXworks.png</file>
<file>images/TeXworks-128.png</file>
<file>images/TeXworks-doc.png</file>
<file>images/TeXworks-doc-128.png</file>
<file>images/TeXworks-doc-48.png</file>
<file>images/actualsize.png</file>
<file>tango/go-previous.png</file>
<file>tango/go-down.png</file>
<file>tango/edit-copy.png</file>
<file>tango/edit-cut.png</file>
<file>images/editgrid.png</file>
<file>images/edithlayout.png</file>
<file>images/editlower.png</file>
<file>tango/edit-paste.png</file>
<file>tango/edit-redo.png</file>
<file>tango/edit-undo.png</file>
<file>images/editvlayout.png</file>
<file>tango/document-new.png</file>
<file>tango/document-open.png</file>
<file>images/fileprint.png</file>
<file>tango/document-save.png</file>
<file>tango/go-first.png</file>
<file>images/fitwidth.png</file>
<file>images/fitwindow.png</file>
<file>tango/go-next.png</file>
<file>tango/go-last.png</file>
<file>tango/list-remove.png</file>
<file>tango/list-add.png</file>
<file>images/pdfdoc.png</file>
<file>tango/edit-find.png</file>
<file>tango/edit-find-replace.png</file>
<file>images/texdoc.png</file>
<file>tango/process-stop.png</file>
<file>tango/go-up.png</file>
<file>images/zoom.png</file>
<file>images/zoomin.png</file>
<file>images/zoomout.png</file>
<file>images/magnifiercursor.png</file>
<file>images/zoomincursor.png</file>
<file>images/zoomoutcursor.png</file>
<file>images/hand.png</file>
<file>images/rect-select.png</file>
<file>images/text-tool.png</file>
<file>tango/preferences-system.png</file>
<file>tango/format-indent-less.png</file>
<file>tango/format-indent-more.png</file>
<file>images/runtool.png</file>
</qresource>
<file>tango/format-indent-more.png</file>
<file>images/runtool.png</file>
</qresource>
</RCC>
......@@ -87,14 +87,14 @@ CompletingEdit::CompletingEdit(QWidget *parent)
lineNumberArea = new LineNumberArea(this);
connect(document(), SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));
connect(document(), SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)), Qt::QueuedConnection);
connect(this, SIGNAL(updateRequest(const QRect&, int)), this, SLOT(updateLineNumberArea(const QRect&, int)));
connect(this, SIGNAL(textChanged()), lineNumberArea, SLOT(update()));
connect(TWApp::instance(), SIGNAL(highlightLineOptionChanged()), this, SLOT(resetExtraSelections()));
cursorPositionChangedSlot();
updateLineNumberAreaWidth(0);
updateLineNumberAreaWidth();
}
CompletingEdit::~CompletingEdit()
......@@ -1057,7 +1057,7 @@ bool CompletingEdit::canInsertFromMimeData(const QMimeData *source) const
void CompletingEdit::setLineNumberDisplay(bool displayNumbers)
{
lineNumberArea->setVisible(displayNumbers);
updateLineNumberAreaWidth(0);
QTimer::singleShot(1, this, SLOT(updateLineNumberAreaWidth()));
}
int CompletingEdit::lineNumberAreaWidth()
......@@ -1074,7 +1074,7 @@ int CompletingEdit::lineNumberAreaWidth()
return space;
}
void CompletingEdit::updateLineNumberAreaWidth(int /* newBlockCount */)
void CompletingEdit::updateLineNumberAreaWidth(int /* newBlockCount = 0 */)
{
if (lineNumberArea->isVisible()) {
setViewportMargins(lineNumberAreaWidth(), 0, 0, 0);
......@@ -1093,7 +1093,7 @@ void CompletingEdit::updateLineNumberArea(const QRect &rect, int dy)
lineNumberArea->update(0, rect.y(), lineNumberArea->width(), rect.height());
if (rect.contains(viewport()->rect()))
updateLineNumberAreaWidth(0);
QTimer::singleShot(1, this, SLOT(updateLineNumberAreaWidth()));
}
void CompletingEdit::resizeEvent(QResizeEvent *e)
......
......@@ -68,7 +68,7 @@ public slots:
void setAutoIndentMode(int index);
void setSmartQuotesMode(int index);
void smartenQuotes();
void updateLineNumberAreaWidth(int newBlockCount);
void updateLineNumberAreaWidth(int newBlockCount = 0);
signals:
void syncClick(int);
......
......@@ -1152,7 +1152,15 @@ PDFDocument::init()
setAttribute(Qt::WA_DeleteOnClose, true);
setAttribute(Qt::WA_MacNoClickThrough, true);
setWindowIcon(QIcon(":/images/images/TeXworks-doc.png"));
QIcon winIcon;
#ifdef Q_WS_X11
// The Compiz window manager doesn't seem to support icons larger than
// 128x128, so we add a suitable one first
winIcon.addFile(":/images/images/TeXworks-doc-128.png");
#endif
winIcon.addFile(":/images/images/TeXworks-doc.png");
setWindowIcon(winIcon);
setContextMenuPolicy(Qt::NoContextMenu);
......@@ -1381,7 +1389,7 @@ void PDFDocument::loadFile(const QString &fileName)
reload();
if (watcher) {
const QStringList files = watcher->files();
if (files.isEmpty())
if (!files.isEmpty())
watcher->removePaths(files); // in case we ever load different files into the same widget
watcher->addPath(curFile);
}
......
......@@ -586,7 +586,7 @@
</property>
<property name="icon">
<iconset resource="../res/resources.qrc">
<normaloff>:/images/images/zoomin.png</normaloff>:/images/images/zoomin.png</iconset>
<normaloff>:/images/images/zoom.png</normaloff>:/images/images/zoom.png</iconset>
</property>
<property name="text">
<string>Magnify</string>
......@@ -743,6 +743,9 @@
<property name="text">
<string>Settings and Resources...</string>
</property>
<property name="menuRole">
<enum>QAction::NoRole</enum>
</property>
</action>
</widget>
<resources>
......
......@@ -104,8 +104,15 @@ TWApp::~TWApp()
void TWApp::init()
{
setWindowIcon(QIcon(":/images/images/TeXworks.png"));
QIcon appIcon;
#ifdef Q_WS_X11
// The Compiz window manager doesn't seem to support icons larger than
// 128x128, so we add a suitable one first
appIcon.addFile(":/images/images/TeXworks-128.png");
#endif
appIcon.addFile(":/images/images/TeXworks.png");
setWindowIcon(appIcon);
setOrganizationName("TUG");
setOrganizationDomain("tug.org");
setApplicationName(TEXWORKS_NAME);
......@@ -565,7 +572,7 @@ void TWApp::newFile()
{
TeXDocument *doc = new TeXDocument;
doc->show();
doc->editor()->updateLineNumberAreaWidth(0);
QTimer::singleShot(1, doc->editor(), SLOT(updateLineNumberAreaWidth()));
doc->runHooks("NewFile");
}
......@@ -577,7 +584,7 @@ void TWApp::newFromTemplate()
if (doc != NULL) {
doc->makeUntitled();
doc->selectWindow();
doc->editor()->updateLineNumberAreaWidth(0);
QTimer::singleShot(1, doc->editor(), SLOT(updateLineNumberAreaWidth()));
doc->runHooks("NewFromTemplate");
}
}
......@@ -832,8 +839,9 @@ void TWApp::setDefaultEngineList()
<< Engine("pdfLaTeX", "pdflatex" EXE, QStringList("$synctexoption") << "$fullname", true)
<< Engine("XeTeX", "xetex" EXE, QStringList("$synctexoption") << "$fullname", true)
<< Engine("XeLaTeX", "xelatex" EXE, QStringList("$synctexoption") << "$fullname", true)
<< Engine("ConTeXt (MKII)", "texmfstart" EXE, QStringList("texexec") << "--synctex" << "$fullname", true)
<< Engine("XeConTeXt (MKII)", "texmfstart" EXE, QStringList("texexec") << "--xtx" << "--synctex" << "$fullname", true)
<< Engine("ConTeXt (LuaTeX)", "context" EXE, QStringList("--synctex") << "$fullname", true)
<< Engine("ConTeXt (pdfTeX)", "texexec" EXE, QStringList("--synctex") << "$fullname", true)
<< Engine("ConTeXt (XeTeX)", "texexec" EXE, QStringList("--synctex") << "--xtx" << "$fullname", true)
<< Engine("BibTeX", "bibtex" EXE, QStringList("$basename"), false)
<< Engine("MakeIndex", "makeindex" EXE, QStringList("$basename"), false);
defaultEngineIndex = 1;
......
......@@ -265,7 +265,7 @@ inline TWApp *TWApp::instance()
return theAppInstance;
}
#ifdef Q_WS_X11
#ifdef QT_DBUS_LIB
#include <QtDBus>
#define TW_SERVICE_NAME "org.tug.texworks.application"
......@@ -291,7 +291,7 @@ public slots:
Q_NOREPLY void bringToFront()
{ app->bringToFront(); }
};
#endif // Q_WS_X11
#endif // defined(QT_DBUS_LIB)
#endif // TWApp_H
......@@ -275,7 +275,7 @@ void TeXDocument::init()
setLineNumbers(b);
highlighter = new TeXHighlighter(textEdit->document(), this);
connect(textEdit, SIGNAL(rehighlight()), highlighter, SLOT(rehighlight()));
connect(textEdit, SIGNAL(rehighlight()), highlighter, SLOT(rehighlight()), Qt::QueuedConnection);
QString syntaxOption = settings.value("syntaxColoring").toString();
QStringList options = TeXHighlighter::syntaxOptions();
......@@ -287,6 +287,8 @@ void TeXDocument::init()
QActionGroup *syntaxGroup = new QActionGroup(this);
syntaxGroup->addAction(actionSyntaxColoring_None);
if (syntaxOption == "")
QTimer::singleShot(1, actionSyntaxColoring_None, SLOT(trigger()));
int index = 0;
foreach (const QString& opt, options) {
......@@ -295,8 +297,7 @@ void TeXDocument::init()
syntaxGroup->addAction(action);
syntaxMapper->setMapping(action, index);
if (opt == syntaxOption) {
action->setChecked(true);