The Zulip desktop app is a C++ application written with the Qt toolkit. It is a lightweight wrapper around a Webkit web view: it loads the zulip webapp as a single page full-screen webpage. The desktop app provides some native integrations: tray icon and Dock support, notifications, and more.
- cmake >= 2.10
- Qt4 OR Qt5
- qjson
- Qt4 with Phonon
- Sparkle.framework
- Growl.framework (both should be installed to
/Library/Frameworks
)
- NSIS
mkdir build
cd build
cmake ..
make
To build with Qt5, pass -DBUILD_WITH_QT5=On
to cmake
.
Though the desktop app is written in C++ using the Qt toolkit, the Mac version of the desktop app does not use the QtWebkit included with Qt: it instead uses a native Cocoa WebView that is embedded inside the main Qt app with a QMacCocoaViewContainer bridge.
The HWebView
class provides an abstraction around the platforms-specific pieces that comprise this web view: on Mac, HWebView_mac.mm
is the Objective-C++ file that integrate with the native Cocoa webview. On Windows and Linux, HWebView.cpp
uses QtWebkit to render the display.
On OS X we can generate a packaged .dmg with a bundled Zulip Desktop.app
.
Run ./admin/mac/make_package.sh CODESIGN_NAME ZULIP_VERSION
where:
- CODESIGN_NAME is the name of the developer ID that should be used to codesign the resulting .app
- ZULIP_VERSION is the version string you want for this build of Zulip.
Our OS X app uses Sparkle as an auto-updating mechanism. Sparkle is configured as an RSS feed on our server that the desktop app checks daily---if there is a new release in the RSS feed, Sparkle will prompt the user to upgrade, and if the user confirms it will automatically download, install, and restart the Zulip app.
The sparkle RSS feeds and Changelogs are configured in the sparkle
puppet files in the main zulip
server repository. The make-package.sh
build script above will also output the Sparkle codesign signature that should be included in the Sparkle RSS file.
This requires a MSVC build toolchain and the Zulip dependencies built with the same version of MSVC. The windows build requires Qt5.
See your favorite distribution package management system for how to distribute a binary Zulip package on linux.
It is possible to attach a web inspector to the QtWebkit page that is used in the Linux/Windows desktop app. Here are the steps:
- Run zulip with zulip --debug
- Download and extract http://files.lfranchi.com/QtTestBrowser.tar.bz2 (the version of webkit used to connect to the remote developer tools must be the same as the version of webkit in zulip)
- In the extracted folder, run
qmake && make
- Run the webkit browser with bin/QtTestBrowser
- Navigate to
localhost:8888
in your test browser
The Cocoa WebView in the Mac app natively supports opening the Safari web inspector.
- Run
Zulip.app/Contents/MacOS/Zulip --debug
- Right-click on an element on the page and select "Inspect Element"