Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for opening paycoin: URIs directly. #282

Merged
merged 1 commit into from Feb 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions contrib/debian/bitcoin-qt.install
Expand Up @@ -2,5 +2,6 @@ debian/bin/bitcoin-qt usr/bin
bitcoin-qt usr/lib/bitcoin
share/pixmaps/bitcoin32.xpm usr/share/pixmaps
share/pixmaps/bitcoin80.xpm usr/share/pixmaps
share/pixmaps/paycoin128.png usr/share/pixmaps
debian/bitcoin-qt.desktop usr/share/applications
debian/bitcoin-qt.protocol usr/share/kde4/services/
16 changes: 16 additions & 0 deletions debian/README.md
@@ -0,0 +1,16 @@
Debian
======
This directory contains files used to package bitcoind/bitcoin-qt for Debian-based Linux systems. If you compile bitcoind/bitcoin-qt yourself, there are some useful files here.

## paycoin: URI support ##


bitcoin-qt.desktop (Gnome / Open Desktop)
To install:

sudo desktop-file-install bitcoin-qt.desktop
sudo update-desktop-database

If you build yourself, you will either need to modify the paths in the .desktop file or copy or symlink your paycoin-qt binary to `/usr/bin` and the `../../share/pixmaps/paycoin128.png` to `/usr/share/pixmaps`

bitcoin-qt.protocol (KDE)
6 changes: 6 additions & 0 deletions debian/changelog
@@ -1,3 +1,9 @@
paycoin (0.3.3.0) precise; urgency=low

* Fix support for paycoin-qt’s paycoin: URI support.

-- Mitchell Cash (mitchellcash) <mitchell@fastmail.com.au> Tue, 16 Feb 2016 09:17:00 +1000

paycoin (0.1.2.26) stable; urgency=low

* Bring package version number inline with application
Expand Down
6 changes: 4 additions & 2 deletions debian/paycoin-qt.desktop
@@ -1,10 +1,12 @@
[Desktop Entry]
Encoding=UTF-8
Name=Paycoin
Comment=Paycoin
Comment=Paycoin P2P Cryptocurrency
Comment[fr]=Paycoin, monnaie virtuelle cryptographique pair à pair
Comment[tr]=Paycoin, eşten eşe kriptografik sanal para birimi
Exec=/usr/bin/paycoin-qt %u
Terminal=false
Type=Application
Icon=paycoin
Icon=/usr/share/pixmaps/paycoin128.png
MimeType=x-scheme-handler/paycoin;
Categories=Office;
Binary file added share/pixmaps/paycoin128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions share/setup.nsi
Expand Up @@ -107,6 +107,10 @@ Section -post SEC0001
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
WriteRegStr HKCR "paycoin" "URL Protocol" ""
WriteRegStr HKCR "paycoin" "" "URL:Paycoin"
WriteRegStr HKCR "paycoin\DefaultIcon" "" $INSTDIR\paycoin.exe
WriteRegStr HKCR "paycoin\shell\open\command" "" '"$INSTDIR\paycoin.exe" "%1"'
SectionEnd

# Macro for selecting uninstaller sections
Expand Down
7 changes: 1 addition & 6 deletions src/qt/bitcoin.cpp
Expand Up @@ -135,8 +135,6 @@ static void handleRunawayException(std::exception *e)
#ifndef BITCOIN_QT_TEST
int main(int argc, char *argv[])
{
#if !defined(MAC_OSX) && !defined(WIN32)
// TODO: implement qtipcserver.cpp for Mac and Windows

// Do this early as we don't want to bother initializing if we are just calling IPC
for (int i = 1; i < argc; i++)
Expand All @@ -156,7 +154,6 @@ int main(int argc, char *argv[])
}
}
}
#endif

// Internal string conversion is all UTF-8
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
Expand Down Expand Up @@ -262,8 +259,6 @@ int main(int argc, char *argv[])
{
window.show();
}
#if !defined(MAC_OSX) && !defined(WIN32)
// TODO: implement qtipcserver.cpp for Mac and Windows

// Place this here as guiref has to be defined if we don't want to lose URIs
ipcInit();
Expand All @@ -282,7 +277,7 @@ int main(int argc, char *argv[])
}
}
}
#endif

app.exec();

window.hide();
Expand Down
17 changes: 11 additions & 6 deletions src/qt/qtipcserver.cpp
Expand Up @@ -2,10 +2,21 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <boost/version.hpp>
#if defined(WIN32) && BOOST_VERSION == 104900
#define BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME
#define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
#endif

#include <boost/algorithm/string.hpp>
#include <boost/interprocess/ipc/message_queue.hpp>
#include <boost/tokenizer.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/version.hpp>

#if defined(WIN32) && (!defined(BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME) || !defined(BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME) || BOOST_VERSION < 104900)
#warning Compiling without BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME and BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME uncommented in boost/interprocess/detail/tmp_dir_helpers.hpp or using a boost version before 1.49 may have unintended results see svn.boost.org/trac/boost/ticket/5392
#endif

#include "ui_interface.h"
#include "util.h"
Expand Down Expand Up @@ -50,12 +61,6 @@ void ipcInit()
// TODO: implement bitcoin: URI handling the Mac Way
return;
#endif
#ifdef WIN32
// TODO: THOROUGHLY test boost::interprocess fix,
// and make sure there are no Windows argument-handling exploitable
// problems.
return;
#endif

message_queue* mq;
char strBuf[257];
Expand Down
4 changes: 2 additions & 2 deletions src/qt/qtipcserver.h
@@ -1,8 +1,8 @@
#ifndef QTIPCSERVER_H
#define QTIPCSERVER_H

// Define Bitcoin-Qt message queue name
#define BITCOINURI_QUEUE_NAME "BitcoinURI"
// Define Paycoin-Qt message queue name
#define BITCOINURI_QUEUE_NAME "PaycoinURI"

void ipcInit();
void ipcShutdown();
Expand Down