resloved conflict

This commit is contained in:
unknown 2014-06-22 13:18:23 -04:00
commit 14276dd9ac
3 changed files with 30 additions and 8 deletions

View File

@ -3,9 +3,18 @@ from PyQt4.QtCore import *
from PyQt4.QtGui import * from PyQt4.QtGui import *
from PyQt4.QtWebKit import * from PyQt4.QtWebKit import *
from os import path <<<<<<< HEAD
sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) =======
import onionshare, webapp onionshare_gui_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
try:
import onionshare
except ImportError:
sys.path.append(os.path.abspath(onionshare_gui_dir+"/.."))
import onionshare
import webapp
>>>>>>> 272092f877ade0ada63fc1b7b43f7837e73adede
window_icon = None window_icon = None
@ -81,8 +90,7 @@ def main():
return return
# create the onionshare icon # create the onionshare icon
global window_icon global window_icon, onionshare_gui_dir
onionshare_gui_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
window_icon = QIcon("{0}/onionshare-icon.png".format(onionshare_gui_dir)) window_icon = QIcon("{0}/onionshare-icon.png".format(onionshare_gui_dir))
# try starting hidden service # try starting hidden service

View File

@ -3,7 +3,7 @@ $(function(){
function update($msg) { function update($msg) {
var $line = $('<li>').append($msg); var $line = $('<li>').append($msg);
$('#log').append($line); $('#log').prepend($line);
} }
function copy_to_clipboard() { function copy_to_clipboard() {

View File

@ -65,8 +65,22 @@ def start_onionshare():
@app.route("/copy_url") @app.route("/copy_url")
def copy_url(): def copy_url():
global clipboard if platform.system() == 'Windows':
clipboard.setText(url) # Qt's QClipboard isn't working in Windows
# https://github.com/micahflee/onionshare/issues/46
import ctypes
GMEM_DDESHARE = 0x2000
ctypes.windll.user32.OpenClipboard(None)
ctypes.windll.user32.EmptyClipboard()
hcd = ctypes.windll.kernel32.GlobalAlloc(GMEM_DDESHARE, len(bytes(url))+1)
pch_data = ctypes.windll.kernel32.GlobalLock(hcd)
ctypes.cdll.msvcrt.strcpy(ctypes.c_char_p(pch_data), bytes(url))
ctypes.windll.kernel32.GlobalUnlock(hcd)
ctypes.windll.user32.SetClipboardData(1, hcd)
ctypes.windll.user32.CloseClipboard()
else:
global clipboard
clipboard.setText(url)
return '' return ''
@app.route("/heartbeat") @app.route("/heartbeat")