Merge branch 'master' of github.com:Atheros1/PyBitmessage
This commit is contained in:
commit
daa058528f
62
Makefile
62
Makefile
|
@ -2,6 +2,7 @@ APP=pybitmessage
|
||||||
VERSION=0.3.4
|
VERSION=0.3.4
|
||||||
RELEASE=1
|
RELEASE=1
|
||||||
ARCH_TYPE=`uname -m`
|
ARCH_TYPE=`uname -m`
|
||||||
|
PREFIX?=/usr/local
|
||||||
|
|
||||||
all:
|
all:
|
||||||
debug:
|
debug:
|
||||||
|
@ -9,37 +10,42 @@ source:
|
||||||
tar -cvzf ../${APP}_${VERSION}.orig.tar.gz ../${APP}-${VERSION} --exclude-vcs
|
tar -cvzf ../${APP}_${VERSION}.orig.tar.gz ../${APP}-${VERSION} --exclude-vcs
|
||||||
install:
|
install:
|
||||||
mkdir -p ${DESTDIR}/usr
|
mkdir -p ${DESTDIR}/usr
|
||||||
mkdir -p ${DESTDIR}/usr/bin
|
mkdir -p ${DESTDIR}${PREFIX}
|
||||||
mkdir -m 755 -p ${DESTDIR}/usr/share
|
mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||||
mkdir -m 755 -p ${DESTDIR}/usr/share/man
|
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share
|
||||||
mkdir -m 755 -p ${DESTDIR}/usr/share/man/man1
|
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/man
|
||||||
install -m 644 man/${APP}.1.gz ${DESTDIR}/usr/share/man/man1
|
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/man/man1
|
||||||
mkdir -m 755 -p ${DESTDIR}/usr/share/${APP}
|
install -m 644 man/${APP}.1.gz ${DESTDIR}${PREFIX}/share/man/man1
|
||||||
mkdir -m 755 -p ${DESTDIR}/usr/share/applications
|
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/${APP}
|
||||||
mkdir -m 755 -p ${DESTDIR}/usr/share/pixmaps
|
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/applications
|
||||||
mkdir -m 755 -p ${DESTDIR}/usr/share/icons
|
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/pixmaps
|
||||||
mkdir -m 755 -p ${DESTDIR}/usr/share/icons/hicolor
|
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/icons
|
||||||
mkdir -m 755 -p ${DESTDIR}/usr/share/icons/hicolor/scalable
|
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/icons/hicolor
|
||||||
mkdir -m 755 -p ${DESTDIR}/usr/share/icons/hicolor/scalable/apps
|
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable
|
||||||
mkdir -m 755 -p ${DESTDIR}/usr/share/icons/hicolor/24x24
|
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps
|
||||||
mkdir -m 755 -p ${DESTDIR}/usr/share/icons/hicolor/24x24/apps
|
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/icons/hicolor/24x24
|
||||||
install -m 644 desktop/${APP}.desktop ${DESTDIR}/usr/share/applications/${APP}.desktop
|
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/icons/hicolor/24x24/apps
|
||||||
install -m 644 desktop/icon24.png ${DESTDIR}/usr/share/icons/hicolor/24x24/apps/${APP}.png
|
install -m 644 desktop/${APP}.desktop ${DESTDIR}${PREFIX}/share/applications/${APP}.desktop
|
||||||
cp -rf src/* ${DESTDIR}/usr/share/${APP}
|
install -m 644 desktop/icon24.png ${DESTDIR}${PREFIX}/share/icons/hicolor/24x24/apps/${APP}.png
|
||||||
echo '#!/bin/sh' > ${DESTDIR}/usr/bin/${APP}
|
cp -rf src/* ${DESTDIR}${PREFIX}/share/${APP}
|
||||||
echo 'cd /usr/share/pybitmessage' >> ${DESTDIR}/usr/bin/${APP}
|
echo '#!/bin/sh' > ${DESTDIR}${PREFIX}/bin/${APP}
|
||||||
echo 'LD_LIBRARY_PATH="/opt/openssl-compat-bitcoin/lib/" exec python2 bitmessagemain.py' >> ${DESTDIR}/usr/bin/${APP}
|
echo 'if [ -d /usr/local/share/${APP} ]; then' >> ${DESTDIR}${PREFIX}/bin/${APP}
|
||||||
chmod +x ${DESTDIR}/usr/bin/${APP}
|
echo ' cd /usr/local/share/${APP}' >> ${DESTDIR}${PREFIX}/bin/${APP}
|
||||||
|
echo 'else' >> ${DESTDIR}${PREFIX}/bin/${APP}
|
||||||
|
echo ' cd /usr/share/pybitmessage' >> ${DESTDIR}${PREFIX}/bin/${APP}
|
||||||
|
echo 'fi' >> ${DESTDIR}${PREFIX}/bin/${APP}
|
||||||
|
echo 'LD_LIBRARY_PATH="/opt/openssl-compat-bitcoin/lib/" exec python2 bitmessagemain.py' >> ${DESTDIR}${PREFIX}/bin/${APP}
|
||||||
|
chmod +x ${DESTDIR}${PREFIX}/bin/${APP}
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f /usr/share/man/man1/${APP}.1.gz
|
rm -f ${PREFIX}/share/man/man1/${APP}.1.gz
|
||||||
rm -rf /usr/share/${APP}
|
rm -rf ${PREFIX}/share/${APP}
|
||||||
rm -f /usr/bin/${APP}
|
rm -f ${PREFIX}/bin/${APP}
|
||||||
rm -f /usr/share/applications/${APP}.desktop
|
rm -f ${PREFIX}/share/applications/${APP}.desktop
|
||||||
rm -f /usr/share/icons/hicolor/scalable/apps/${APP}.svg
|
rm -f ${PREFIX}/share/icons/hicolor/scalable/apps/${APP}.svg
|
||||||
/usr/share/pixmaps/${APP}.svg
|
rm -f ${PREFIX}/share/pixmaps/${APP}.svg
|
||||||
clean:
|
clean:
|
||||||
rm -f ${APP} \#* \.#* gnuplot* *.png debian/*.substvars debian/*.log
|
rm -f ${APP} \#* \.#* gnuplot* *.png debian/*.substvars debian/*.log
|
||||||
rm -fr deb.* debian/${APP} rpmpackage/${ARCH_TYPE}
|
rm -fr deb.* debian/${APP} rpmpackage/${ARCH_TYPE}
|
||||||
rm -f ../${APP}*.deb ../${APP}*.changes ../${APP}*.asc ../${APP}*.dsc
|
rm -f ../${APP}*.deb ../${APP}*.changes ../${APP}*.asc ../${APP}*.dsc
|
||||||
rm -f rpmpackage/*.src.rpm archpackage/*.gz archpackage/*.xz
|
rm -f rpmpackage/*.src.rpm archpackage/*.gz archpackage/*.xz
|
||||||
rm -f puppypackage/*.gz puppypackage/*.pet slackpackage/*.txz
|
rm -f puppypackage/*.gz puppypackage/*.pet slackpackage/*.txz
|
||||||
|
|
|
@ -7,7 +7,7 @@ arch=('i686' 'x86_64')
|
||||||
url="https://github.com/Bitmessage/PyBitmessage"
|
url="https://github.com/Bitmessage/PyBitmessage"
|
||||||
license=('MIT')
|
license=('MIT')
|
||||||
groups=()
|
groups=()
|
||||||
depends=('python2' 'qt4' 'python2-pyqt4' 'sqlite' 'openssl')
|
depends=('python2' 'qt4' 'python2-pyqt4' 'sqlite' 'openssl' 'gst123')
|
||||||
makedepends=()
|
makedepends=()
|
||||||
optdepends=('python2-gevent')
|
optdepends=('python2-gevent')
|
||||||
provides=()
|
provides=()
|
||||||
|
@ -27,5 +27,5 @@ build() {
|
||||||
}
|
}
|
||||||
package() {
|
package() {
|
||||||
cd "$srcdir/$pkgname-$pkgver"
|
cd "$srcdir/$pkgname-$pkgver"
|
||||||
make DESTDIR="$pkgdir/" install
|
make DESTDIR="$pkgdir/" PREFIX="/usr" install
|
||||||
}
|
}
|
||||||
|
|
4
debian/control
vendored
4
debian/control
vendored
|
@ -4,12 +4,12 @@ Maintainer: Bob Mottram (4096 bits) <bob@robotics.uk.to>
|
||||||
Build-Depends: debhelper (>= 9.0.0)
|
Build-Depends: debhelper (>= 9.0.0)
|
||||||
Standards-Version: 3.9.4
|
Standards-Version: 3.9.4
|
||||||
Homepage: https://github.com/Bitmessage/PyBitmessage
|
Homepage: https://github.com/Bitmessage/PyBitmessage
|
||||||
Vcs-Git: https://github.com/fuzzgun/fin.git
|
Vcs-Git: https://github.com/Bitmessage/PyBitmessage.git
|
||||||
|
|
||||||
Package: pybitmessage
|
Package: pybitmessage
|
||||||
Section: mail
|
Section: mail
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, python (>= 2.7.0), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev
|
Depends: ${shlibs:Depends}, ${misc:Depends}, python (>= 2.7.0), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, gst123
|
||||||
Suggests: libmessaging-menu-dev
|
Suggests: libmessaging-menu-dev
|
||||||
Description: Send encrypted messages
|
Description: Send encrypted messages
|
||||||
Bitmessage is a P2P communications protocol used to send encrypted
|
Bitmessage is a P2P communications protocol used to send encrypted
|
||||||
|
|
3
debian/rules
vendored
3
debian/rules
vendored
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/make -f
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
APP=pybitmessage
|
APP=pybitmessage
|
||||||
|
PREFIX=/usr
|
||||||
build: build-stamp
|
build: build-stamp
|
||||||
make
|
make
|
||||||
build-arch: build-stamp
|
build-arch: build-stamp
|
||||||
|
@ -20,7 +21,7 @@ install: build clean
|
||||||
dh_testroot
|
dh_testroot
|
||||||
dh_prep
|
dh_prep
|
||||||
dh_installdirs
|
dh_installdirs
|
||||||
${MAKE} install -B DESTDIR=${CURDIR}/debian/${APP}
|
${MAKE} install -B DESTDIR=${CURDIR}/debian/${APP} PREFIX=/usr
|
||||||
binary-indep: build install
|
binary-indep: build install
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_testroot
|
dh_testroot
|
||||||
|
|
|
@ -1,22 +1,32 @@
|
||||||
# $Header: $
|
# $Header: $
|
||||||
|
|
||||||
EAPI=4
|
EAPI=5
|
||||||
|
|
||||||
|
inherit git-2 python-r1
|
||||||
|
|
||||||
|
PYTHON_COMPAT=( python2_7 )
|
||||||
|
PYTHON_REQ_USE="sqlite"
|
||||||
|
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||||
DESCRIPTION="Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide "non-content" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs."
|
DESCRIPTION="Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide "non-content" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs."
|
||||||
HOMEPAGE="https://github.com/Bitmessage/PyBitmessage"
|
HOMEPAGE="https://github.com/Bitmessage/PyBitmessage"
|
||||||
SRC_URI="${PN}/${P}.tar.gz"
|
EGIT_REPO_URI="https://github.com/Bitmessage/PyBitmessage.git"
|
||||||
LICENSE="MIT"
|
LICENSE="MIT"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
KEYWORDS="x86"
|
KEYWORDS="x86"
|
||||||
RDEPEND="dev-libs/popt"
|
DEPEND="dev-libs/popt
|
||||||
DEPEND="${RDEPEND}"
|
${PYTHON_DEPS}"
|
||||||
|
RDEPEND="${DEPEND}
|
||||||
|
dev-libs/openssl
|
||||||
|
dev-python/PyQt4[]"
|
||||||
|
|
||||||
src_configure() {
|
src_configure() {
|
||||||
econf --with-popt
|
econf --with-popt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
src_compile() { :; }
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
emake DESTDIR="${D}" install
|
emake DESTDIR="${D}" PREFIX="/usr" install
|
||||||
# Install README and (Debian) changelog
|
# Install README and (Debian) changelog
|
||||||
dodoc README.md debian/changelog
|
dodoc README.md debian/changelog
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
|
|
||||||
rm -f Makefile rpmpackage/*.spec
|
rm -f Makefile rpmpackage/*.spec
|
||||||
|
|
||||||
packagemonkey -n "PyBitmessage" --version "0.3.4" --dir "." -l "mit" -e "Bob Mottram (4096 bits) <bob@robotics.uk.to>" --brief "Send encrypted messages" --desc "Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide \"non-content\" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs." --homepage "https://github.com/Bitmessage/PyBitmessage" --section "mail" --categories "Office/Email" --dependsdeb "python (>= 2.7.0), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev" --dependsrpm "python, PyQt4, openssl-compat-bitcoin-libs" --mainscript "bitmessagemain.py" --librarypath "/opt/openssl-compat-bitcoin/lib/" --suggestsdeb "libmessaging-menu-dev" --dependspuppy "openssl, python-qt4, sqlite3, sqlite3-dev, python-openssl, python-sip" --dependsarch "python2, qt4, python2-pyqt4, sqlite, openssl" --suggestsarch "python2-gevent" --pythonversion 2
|
packagemonkey -n "PyBitmessage" --version "0.3.4" --dir "." -l "mit" -e "Bob Mottram (4096 bits) <bob@robotics.uk.to>" --brief "Send encrypted messages" --desc "Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide \"non-content\" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs." --homepage "https://github.com/Bitmessage/PyBitmessage" --section "mail" --categories "Office/Email" --dependsdeb "python (>= 2.7.0), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, gst123" --dependsrpm "python, PyQt4, openssl-compat-bitcoin-libs, gst123" --mainscript "bitmessagemain.py" --librarypath "/opt/openssl-compat-bitcoin/lib/" --suggestsdeb "libmessaging-menu-dev" --dependspuppy "openssl, python-qt4, sqlite3, sqlite3-dev, python-openssl, python-sip, gst123" --dependsarch "python2, qt4, python2-pyqt4, sqlite, openssl, gst123" --suggestsarch "python2-gevent" --pythonversion 2 --dependsebuild "dev-libs/openssl, dev-python/PyQt4[${PYTHON_USEDEP}]" --buildebuild "\${PYTHON_DEPS}" --pythonreq "sqlite" --repository "https://github.com/Bitmessage/PyBitmessage.git"
|
||||||
|
|
2
puppy.sh
2
puppy.sh
|
@ -27,7 +27,7 @@ mkdir -p ${PROJECTDIR}
|
||||||
# Build the project
|
# Build the project
|
||||||
make clean
|
make clean
|
||||||
make
|
make
|
||||||
make install -B DESTDIR=${PROJECTDIR}
|
make install -B DESTDIR=${PROJECTDIR} PREFIX=/usr
|
||||||
|
|
||||||
# Alter the desktop file categories
|
# Alter the desktop file categories
|
||||||
sed -i "s/Categories=Office;Email;/Categories=Internet;mailnews;/g" ${PROJECTDIR}/usr/share/applications/${APP}.desktop
|
sed -i "s/Categories=Office;Email;/Categories=Internet;mailnews;/g" ${PROJECTDIR}/usr/share/applications/${APP}.desktop
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
pybitmessage-0.3.4-1|PyBitmessage|0.3.4|1|Internet;mailnews;|5.1M||pybitmessage-0.3.4-1.pet|+openssl,+python-qt4,+sqlite3,+sqlite3-dev,+python-openssl,+python-sip|Send encrypted messages|ubuntu|precise|5|
|
pybitmessage-0.3.4-1|PyBitmessage|0.3.4|1|Internet;mailnews;|5.8M||pybitmessage-0.3.4-1.pet|+openssl,+python-qt4,+sqlite3,+sqlite3-dev,+python-openssl,+python-sip,+gst123|Send encrypted messages|ubuntu|precise|5|
|
||||||
|
|
|
@ -8,7 +8,7 @@ Packager: Bob Mottram (4096 bits) <bob@robotics.uk.to>
|
||||||
Source0: http://yourdomainname.com/src/%{name}_%{version}.orig.tar.gz
|
Source0: http://yourdomainname.com/src/%{name}_%{version}.orig.tar.gz
|
||||||
Group: Office/Email
|
Group: Office/Email
|
||||||
|
|
||||||
Requires: python, PyQt4, openssl-compat-bitcoin-libs
|
Requires: python, PyQt4, openssl-compat-bitcoin-libs, gst123
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
|
@ -48,7 +48,7 @@ mkdir -p %{buildroot}/usr/share/pixmaps
|
||||||
mkdir -p %{buildroot}/usr/share/icons/hicolor/scalable
|
mkdir -p %{buildroot}/usr/share/icons/hicolor/scalable
|
||||||
mkdir -p %{buildroot}/usr/share/icons/hicolor/scalable/apps
|
mkdir -p %{buildroot}/usr/share/icons/hicolor/scalable/apps
|
||||||
# Make install but to the RPM BUILDROOT directory
|
# Make install but to the RPM BUILDROOT directory
|
||||||
make install -B DESTDIR=%{buildroot}
|
make install -B DESTDIR=%{buildroot} PREFIX=/usr
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc README.md LICENSE
|
%doc README.md LICENSE
|
||||||
|
|
2
slack.sh
2
slack.sh
|
@ -28,7 +28,7 @@ mkdir -p ${PROJECTDIR}
|
||||||
# Build the project
|
# Build the project
|
||||||
make clean
|
make clean
|
||||||
make
|
make
|
||||||
make install -B DESTDIR=${PROJECTDIR}
|
make install -B DESTDIR=${PROJECTDIR} PREFIX=/usr
|
||||||
|
|
||||||
# Copy the slack-desc and doinst.sh files into the build install directory
|
# Copy the slack-desc and doinst.sh files into the build install directory
|
||||||
mkdir ${PROJECTDIR}/install
|
mkdir ${PROJECTDIR}/install
|
||||||
|
|
|
@ -32,11 +32,14 @@ import pickle
|
||||||
import platform
|
import platform
|
||||||
import debug
|
import debug
|
||||||
from debug import logger
|
from debug import logger
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
from PyQt4.QtCore import *
|
from PyQt4.QtCore import *
|
||||||
from PyQt4.QtGui import *
|
from PyQt4.QtGui import *
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print 'PyBitmessage requires PyQt unless you want to run it as a daemon and interact with it using the API. You can download it from http://www.riverbankcomputing.com/software/pyqt/download or by searching Google for \'PyQt Download\' (without quotes).'
|
print 'PyBitmessage requires PyQt unless you want to run it as a daemon and interact with it using the API. You can download it from http://www.riverbankcomputing.com/software/pyqt/download or by searching Google for \'PyQt Download\' (without quotes).'
|
||||||
print 'Error message:', err
|
print 'Error message:', err
|
||||||
|
@ -53,6 +56,14 @@ def _translate(context, text):
|
||||||
|
|
||||||
class MyForm(QtGui.QMainWindow):
|
class MyForm(QtGui.QMainWindow):
|
||||||
|
|
||||||
|
# sound type constants
|
||||||
|
SOUND_NONE = 0
|
||||||
|
SOUND_KNOWN = 1
|
||||||
|
SOUND_UNKNOWN = 2
|
||||||
|
SOUND_CONNECTED = 3
|
||||||
|
SOUND_DISCONNECTED = 4
|
||||||
|
SOUND_CONNECTION_GREEN = 5
|
||||||
|
|
||||||
str_broadcast_subscribers = '[Broadcast subscribers]'
|
str_broadcast_subscribers = '[Broadcast subscribers]'
|
||||||
str_chan = '[chan]'
|
str_chan = '[chan]'
|
||||||
|
|
||||||
|
@ -965,6 +976,57 @@ class MyForm(QtGui.QMainWindow):
|
||||||
# update the menu entries
|
# update the menu entries
|
||||||
self.ubuntuMessagingMenuUnread(drawAttention)
|
self.ubuntuMessagingMenuUnread(drawAttention)
|
||||||
|
|
||||||
|
# play a sound
|
||||||
|
def playSound(self, category, label):
|
||||||
|
soundFilename = None
|
||||||
|
|
||||||
|
if label is not None:
|
||||||
|
# does a sound file exist for this particular contact?
|
||||||
|
if (os.path.isfile(shared.appdata + 'sounds/' + label + '.wav') or
|
||||||
|
os.path.isfile(shared.appdata + 'sounds/' + label + '.mp3')):
|
||||||
|
soundFilename = shared.appdata + 'sounds/' + label
|
||||||
|
|
||||||
|
if soundFilename is None:
|
||||||
|
if category is self.SOUND_KNOWN:
|
||||||
|
soundFilename = shared.appdata + 'sounds/known'
|
||||||
|
elif category is self.SOUND_UNKNOWN:
|
||||||
|
soundFilename = shared.appdata + 'sounds/unknown'
|
||||||
|
elif category is self.SOUND_CONNECTED:
|
||||||
|
soundFilename = shared.appdata + 'sounds/connected'
|
||||||
|
elif category is self.SOUND_DISCONNECTED:
|
||||||
|
soundFilename = shared.appdata + 'sounds/disconnected'
|
||||||
|
elif category is self.SOUND_CONNECTION_GREEN:
|
||||||
|
soundFilename = shared.appdata + 'sounds/green'
|
||||||
|
|
||||||
|
if soundFilename is not None:
|
||||||
|
# if not wav then try mp3 format
|
||||||
|
if not os.path.isfile(soundFilename + '.wav'):
|
||||||
|
soundFilename = soundFilename + '.mp3'
|
||||||
|
else:
|
||||||
|
soundFilename = soundFilename + '.wav'
|
||||||
|
|
||||||
|
if os.path.isfile(soundFilename):
|
||||||
|
if 'linux' in sys.platform:
|
||||||
|
# Note: QSound was a nice idea but it didn't work
|
||||||
|
if '.mp3' in soundFilename:
|
||||||
|
try:
|
||||||
|
subprocess.call(["gst123", soundFilename],
|
||||||
|
stdin=subprocess.PIPE,
|
||||||
|
stdout=subprocess.PIPE)
|
||||||
|
except:
|
||||||
|
print "WARNING: gst123 must be installed in order to play mp3 sounds"
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
subprocess.call(["aplay", soundFilename],
|
||||||
|
stdin=subprocess.PIPE,
|
||||||
|
stdout=subprocess.PIPE)
|
||||||
|
except:
|
||||||
|
print "WARNING: aplay must be installed in order to play WAV sounds"
|
||||||
|
elif sys.platform[0:3] == 'win':
|
||||||
|
# use winsound on Windows
|
||||||
|
import winsound
|
||||||
|
winsound.PlaySound(soundFilename, winsound.SND_FILENAME)
|
||||||
|
|
||||||
# initialise the message notifier
|
# initialise the message notifier
|
||||||
def notifierInit(self):
|
def notifierInit(self):
|
||||||
global withMessagingMenu
|
global withMessagingMenu
|
||||||
|
@ -972,8 +1034,11 @@ class MyForm(QtGui.QMainWindow):
|
||||||
Notify.init('pybitmessage')
|
Notify.init('pybitmessage')
|
||||||
|
|
||||||
# shows a notification
|
# shows a notification
|
||||||
def notifierShow(self, title, subtitle):
|
def notifierShow(self, title, subtitle, fromCategory, label):
|
||||||
global withMessagingMenu
|
global withMessagingMenu
|
||||||
|
|
||||||
|
self.playSound(fromCategory, label);
|
||||||
|
|
||||||
if withMessagingMenu:
|
if withMessagingMenu:
|
||||||
n = Notify.Notification.new(
|
n = Notify.Notification.new(
|
||||||
title, subtitle, 'notification-message-email')
|
title, subtitle, 'notification-message-email')
|
||||||
|
@ -1090,7 +1155,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
"MainWindow", "Could not add chan because it appears to already be one of your identities."))
|
"MainWindow", "Could not add chan because it appears to already be one of your identities."))
|
||||||
return
|
return
|
||||||
createdAddress = addressGeneratorReturnValue[0]
|
createdAddress = addressGeneratorReturnValue[0]
|
||||||
self.addEntryToAddressBook(createdAddress, self.str_chan + ' ' + self.str_chan + ' ' + str(self.newChanDialogInstance.ui.lineEditChanNameJoin.text()))
|
self.addEntryToAddressBook(createdAddress, self.str_chan + ' ' + str(self.newChanDialogInstance.ui.lineEditChanNameJoin.text()))
|
||||||
QMessageBox.about(self, _translate("MainWindow", "Success"), _translate(
|
QMessageBox.about(self, _translate("MainWindow", "Success"), _translate(
|
||||||
"MainWindow", "Successfully joined chan. "))
|
"MainWindow", "Successfully joined chan. "))
|
||||||
self.ui.tabWidget.setCurrentIndex(3)
|
self.ui.tabWidget.setCurrentIndex(3)
|
||||||
|
@ -1198,7 +1263,8 @@ class MyForm(QtGui.QMainWindow):
|
||||||
# if the connection is lost then show a notification
|
# if the connection is lost then show a notification
|
||||||
if self.connected:
|
if self.connected:
|
||||||
self.notifierShow('Bitmessage', unicode(_translate(
|
self.notifierShow('Bitmessage', unicode(_translate(
|
||||||
"MainWindow", "Connection lost").toUtf8(),'utf-8'))
|
"MainWindow", "Connection lost").toUtf8(),'utf-8'),
|
||||||
|
self.SOUND_DISCONNECTED, None)
|
||||||
self.connected = False
|
self.connected = False
|
||||||
|
|
||||||
if self.actionStatus is not None:
|
if self.actionStatus is not None:
|
||||||
|
@ -1215,7 +1281,8 @@ class MyForm(QtGui.QMainWindow):
|
||||||
# if a new connection has been established then show a notification
|
# if a new connection has been established then show a notification
|
||||||
if not self.connected:
|
if not self.connected:
|
||||||
self.notifierShow('Bitmessage', unicode(_translate(
|
self.notifierShow('Bitmessage', unicode(_translate(
|
||||||
"MainWindow", "Connected").toUtf8(),'utf-8'))
|
"MainWindow", "Connected").toUtf8(),'utf-8'),
|
||||||
|
self.SOUND_CONNECTED, None)
|
||||||
self.connected = True
|
self.connected = True
|
||||||
|
|
||||||
if self.actionStatus is not None:
|
if self.actionStatus is not None:
|
||||||
|
@ -1231,7 +1298,8 @@ class MyForm(QtGui.QMainWindow):
|
||||||
shared.statusIconColor = 'green'
|
shared.statusIconColor = 'green'
|
||||||
if not self.connected:
|
if not self.connected:
|
||||||
self.notifierShow('Bitmessage', unicode(_translate(
|
self.notifierShow('Bitmessage', unicode(_translate(
|
||||||
"MainWindow", "Connected").toUtf8(),'utf-8'))
|
"MainWindow", "Connected").toUtf8(),'utf-8'),
|
||||||
|
self.SOUND_CONNECTION_GREEN, None)
|
||||||
self.connected = True
|
self.connected = True
|
||||||
|
|
||||||
if self.actionStatus is not None:
|
if self.actionStatus is not None:
|
||||||
|
@ -1338,7 +1406,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
self.ui.tableWidgetInbox.item(i, 0).setTextColor(QtGui.QColor(137, 04, 177))
|
self.ui.tableWidgetInbox.item(i, 0).setTextColor(QtGui.QColor(137, 04, 177))
|
||||||
else:
|
else:
|
||||||
self.ui.tableWidgetInbox.item(
|
self.ui.tableWidgetInbox.item(
|
||||||
i, 0).setTextColor(QtGui.QColor(0, 0, 0))
|
i, 0).setTextColor(QApplication.palette().text().color())
|
||||||
|
|
||||||
def rerenderSentFromLabels(self):
|
def rerenderSentFromLabels(self):
|
||||||
for i in range(self.ui.tableWidgetSent.rowCount()):
|
for i in range(self.ui.tableWidgetSent.rowCount()):
|
||||||
|
@ -1714,12 +1782,12 @@ class MyForm(QtGui.QMainWindow):
|
||||||
newItem = QtGui.QTableWidgetItem(unicode(fromAddress, 'utf-8'))
|
newItem = QtGui.QTableWidgetItem(unicode(fromAddress, 'utf-8'))
|
||||||
newItem.setToolTip(unicode(fromAddress, 'utf-8'))
|
newItem.setToolTip(unicode(fromAddress, 'utf-8'))
|
||||||
if shared.config.getboolean('bitmessagesettings', 'showtraynotifications'):
|
if shared.config.getboolean('bitmessagesettings', 'showtraynotifications'):
|
||||||
self.notifierShow(unicode(_translate("MainWindow",'New Message').toUtf8(),'utf-8'), unicode(_translate("MainWindow",'From ').toUtf8(),'utf-8') + unicode(fromAddress, 'utf-8'))
|
self.notifierShow(unicode(_translate("MainWindow",'New Message').toUtf8(),'utf-8'), unicode(_translate("MainWindow",'From ').toUtf8(),'utf-8') + unicode(fromAddress, 'utf-8'), self.SOUND_UNKNOWN, None)
|
||||||
else:
|
else:
|
||||||
newItem = QtGui.QTableWidgetItem(unicode(fromLabel, 'utf-8'))
|
newItem = QtGui.QTableWidgetItem(unicode(fromLabel, 'utf-8'))
|
||||||
newItem.setToolTip(unicode(unicode(fromLabel, 'utf-8')))
|
newItem.setToolTip(unicode(unicode(fromLabel, 'utf-8')))
|
||||||
if shared.config.getboolean('bitmessagesettings', 'showtraynotifications'):
|
if shared.config.getboolean('bitmessagesettings', 'showtraynotifications'):
|
||||||
self.notifierShow(unicode(_translate("MainWindow",'New Message').toUtf8(),'utf-8'), unicode(_translate("MainWindow",'From ').toUtf8(),'utf-8') + unicode(fromLabel, 'utf-8'))
|
self.notifierShow(unicode(_translate("MainWindow",'New Message').toUtf8(),'utf-8'), unicode(_translate("MainWindow",'From ').toUtf8(),'utf-8') + unicode(fromLabel, 'utf-8'), self.SOUND_KNOWN, unicode(fromLabel, 'utf-8'))
|
||||||
newItem.setData(Qt.UserRole, str(fromAddress))
|
newItem.setData(Qt.UserRole, str(fromAddress))
|
||||||
newItem.setFont(font)
|
newItem.setFont(font)
|
||||||
self.ui.tableWidgetInbox.setItem(0, 1, newItem)
|
self.ui.tableWidgetInbox.setItem(0, 1, newItem)
|
||||||
|
@ -2074,7 +2142,8 @@ class MyForm(QtGui.QMainWindow):
|
||||||
# Set the color to either black or grey
|
# Set the color to either black or grey
|
||||||
if shared.config.getboolean(addressAtCurrentRow, 'enabled'):
|
if shared.config.getboolean(addressAtCurrentRow, 'enabled'):
|
||||||
self.ui.tableWidgetYourIdentities.item(
|
self.ui.tableWidgetYourIdentities.item(
|
||||||
currentRow, 1).setTextColor(QtGui.QColor(0, 0, 0))
|
currentRow, 1).setTextColor(QApplication.palette()
|
||||||
|
.text().color())
|
||||||
else:
|
else:
|
||||||
self.ui.tableWidgetYourIdentities.item(
|
self.ui.tableWidgetYourIdentities.item(
|
||||||
currentRow, 1).setTextColor(QtGui.QColor(128, 128, 128))
|
currentRow, 1).setTextColor(QtGui.QColor(128, 128, 128))
|
||||||
|
@ -2464,9 +2533,9 @@ class MyForm(QtGui.QMainWindow):
|
||||||
shared.sqlSubmitQueue.put('commit')
|
shared.sqlSubmitQueue.put('commit')
|
||||||
shared.sqlLock.release()
|
shared.sqlLock.release()
|
||||||
self.ui.tableWidgetSubscriptions.item(
|
self.ui.tableWidgetSubscriptions.item(
|
||||||
currentRow, 0).setTextColor(QtGui.QColor(0, 0, 0))
|
currentRow, 0).setTextColor(QApplication.palette().text().color())
|
||||||
self.ui.tableWidgetSubscriptions.item(
|
self.ui.tableWidgetSubscriptions.item(
|
||||||
currentRow, 1).setTextColor(QtGui.QColor(0, 0, 0))
|
currentRow, 1).setTextColor(QApplication.palette().text().color())
|
||||||
shared.reloadBroadcastSendersForWhichImWatching()
|
shared.reloadBroadcastSendersForWhichImWatching()
|
||||||
|
|
||||||
def on_action_SubscriptionsDisable(self):
|
def on_action_SubscriptionsDisable(self):
|
||||||
|
@ -2535,9 +2604,9 @@ class MyForm(QtGui.QMainWindow):
|
||||||
addressAtCurrentRow = self.ui.tableWidgetBlacklist.item(
|
addressAtCurrentRow = self.ui.tableWidgetBlacklist.item(
|
||||||
currentRow, 1).text()
|
currentRow, 1).text()
|
||||||
self.ui.tableWidgetBlacklist.item(
|
self.ui.tableWidgetBlacklist.item(
|
||||||
currentRow, 0).setTextColor(QtGui.QColor(0, 0, 0))
|
currentRow, 0).setTextColor(QApplication.palette().text().color())
|
||||||
self.ui.tableWidgetBlacklist.item(
|
self.ui.tableWidgetBlacklist.item(
|
||||||
currentRow, 1).setTextColor(QtGui.QColor(0, 0, 0))
|
currentRow, 1).setTextColor(QApplication.palette().text().color())
|
||||||
t = (str(addressAtCurrentRow),)
|
t = (str(addressAtCurrentRow),)
|
||||||
shared.sqlLock.acquire()
|
shared.sqlLock.acquire()
|
||||||
if shared.config.get('bitmessagesettings', 'blackwhitelist') == 'black':
|
if shared.config.get('bitmessagesettings', 'blackwhitelist') == 'black':
|
||||||
|
@ -2588,11 +2657,11 @@ class MyForm(QtGui.QMainWindow):
|
||||||
with open(shared.appdata + 'keys.dat', 'wb') as configfile:
|
with open(shared.appdata + 'keys.dat', 'wb') as configfile:
|
||||||
shared.config.write(configfile)
|
shared.config.write(configfile)
|
||||||
self.ui.tableWidgetYourIdentities.item(
|
self.ui.tableWidgetYourIdentities.item(
|
||||||
currentRow, 0).setTextColor(QtGui.QColor(0, 0, 0))
|
currentRow, 0).setTextColor(QApplication.palette().text().color())
|
||||||
self.ui.tableWidgetYourIdentities.item(
|
self.ui.tableWidgetYourIdentities.item(
|
||||||
currentRow, 1).setTextColor(QtGui.QColor(0, 0, 0))
|
currentRow, 1).setTextColor(QApplication.palette().text().color())
|
||||||
self.ui.tableWidgetYourIdentities.item(
|
self.ui.tableWidgetYourIdentities.item(
|
||||||
currentRow, 2).setTextColor(QtGui.QColor(0, 0, 0))
|
currentRow, 2).setTextColor(QApplication.palette().text().color())
|
||||||
if shared.safeConfigGetBoolean(addressAtCurrentRow, 'mailinglist'):
|
if shared.safeConfigGetBoolean(addressAtCurrentRow, 'mailinglist'):
|
||||||
self.ui.tableWidgetYourIdentities.item(currentRow, 1).setTextColor(QtGui.QColor(137, 04, 177))
|
self.ui.tableWidgetYourIdentities.item(currentRow, 1).setTextColor(QtGui.QColor(137, 04, 177))
|
||||||
if shared.safeConfigGetBoolean(addressAtCurrentRow, 'chan'):
|
if shared.safeConfigGetBoolean(addressAtCurrentRow, 'chan'):
|
||||||
|
|
Reference in New Issue
Block a user