Skip to content

Commit

Permalink
Merge pull request #282 from mitchellcash/uri
Browse files Browse the repository at this point in the history
Add support for opening paycoin: URIs directly.
  • Loading branch information
scroogemcdev committed Feb 16, 2016
2 parents f7d58d5 + f687b68 commit 6f5e188
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 16 deletions.
1 change: 1 addition & 0 deletions contrib/debian/bitcoin-qt.install
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
paycoin (0.3.3.0) precise; urgency=low

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

-- Mitchell Cash (mitchellcash) <[email protected]> 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
Original file line number Diff line number Diff line change
@@ -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
Loading
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 @@ -277,8 +274,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 @@ -297,7 +292,7 @@ int main(int argc, char *argv[])
}
}
}
#endif

app.exec();

window.hide();
Expand Down
17 changes: 11 additions & 6 deletions src/qt/qtipcserver.cpp
Original file line number Diff line number Diff line change
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 "qtipcserver.h"
Expand Down Expand Up @@ -49,12 +60,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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6f5e188

Please sign in to comment.