mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Have the donate button go to calibre-ebook.com instead fo a custom HTML page
This commit is contained in:
parent
32703cb261
commit
4c5a6213d9
@ -12,18 +12,17 @@ __docformat__ = 'restructuredtext en'
|
|||||||
import collections, os, sys, textwrap, time, gc
|
import collections, os, sys, textwrap, time, gc
|
||||||
from Queue import Queue, Empty
|
from Queue import Queue, Empty
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from PyQt4.Qt import Qt, SIGNAL, QTimer, QHelpEvent, QAction, \
|
from PyQt4.Qt import (Qt, SIGNAL, QTimer, QHelpEvent, QAction,
|
||||||
QMenu, QIcon, pyqtSignal, \
|
QMenu, QIcon, pyqtSignal, QUrl,
|
||||||
QDialog, QSystemTrayIcon, QApplication, QKeySequence
|
QDialog, QSystemTrayIcon, QApplication, QKeySequence)
|
||||||
|
|
||||||
from calibre import prints
|
from calibre import prints
|
||||||
from calibre.constants import __appname__, isosx
|
from calibre.constants import __appname__, isosx
|
||||||
from calibre.ptempfile import PersistentTemporaryFile
|
|
||||||
from calibre.utils.config import prefs, dynamic
|
from calibre.utils.config import prefs, dynamic
|
||||||
from calibre.utils.ipc.server import Server
|
from calibre.utils.ipc.server import Server
|
||||||
from calibre.library.database2 import LibraryDatabase2
|
from calibre.library.database2 import LibraryDatabase2
|
||||||
from calibre.customize.ui import interface_actions
|
from calibre.customize.ui import interface_actions
|
||||||
from calibre.gui2 import error_dialog, GetMetadata, open_local_file, \
|
from calibre.gui2 import error_dialog, GetMetadata, open_url, \
|
||||||
gprefs, max_available_height, config, info_dialog, Dispatcher, \
|
gprefs, max_available_height, config, info_dialog, Dispatcher, \
|
||||||
question_dialog
|
question_dialog
|
||||||
from calibre.gui2.cover_flow import CoverFlowMixin
|
from calibre.gui2.cover_flow import CoverFlowMixin
|
||||||
@ -567,37 +566,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
|||||||
QApplication.instance().quit()
|
QApplication.instance().quit()
|
||||||
|
|
||||||
def donate(self, *args):
|
def donate(self, *args):
|
||||||
BUTTON = '''
|
open_url(QUrl('http://calibre-ebook.com/donate'))
|
||||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
|
||||||
<input type="hidden" name="cmd" value="_s-xclick" />
|
|
||||||
<input type="hidden" name="hosted_button_id" value="3029467" />
|
|
||||||
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="Donate to support calibre development" />
|
|
||||||
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
|
|
||||||
</form>
|
|
||||||
'''
|
|
||||||
MSG = _('is the result of the efforts of many volunteers from all '
|
|
||||||
'over the world. If you find it useful, please consider '
|
|
||||||
'donating to support its development. Your donation helps '
|
|
||||||
'keep calibre development going.')
|
|
||||||
HTML = u'''
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
|
||||||
<title>Donate to support calibre</title>
|
|
||||||
</head>
|
|
||||||
<body style="background:white">
|
|
||||||
<div><a href="http://calibre-ebook.com"><img style="border:0px"
|
|
||||||
src="file://%s" alt="calibre" /></a></div>
|
|
||||||
<p>Calibre %s</p>
|
|
||||||
%s
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
'''%(P('content_server/calibre_banner.png').replace(os.sep, '/'), MSG, BUTTON)
|
|
||||||
pt = PersistentTemporaryFile('_donate.htm')
|
|
||||||
pt.write(HTML.encode('utf-8'))
|
|
||||||
pt.close()
|
|
||||||
open_local_file(pt.name)
|
|
||||||
|
|
||||||
|
|
||||||
def confirm_quit(self):
|
def confirm_quit(self):
|
||||||
if self.job_manager.has_jobs():
|
if self.job_manager.has_jobs():
|
||||||
|
@ -26,7 +26,7 @@ class cmd_commit(_cmd_commit):
|
|||||||
close_bug_pat = re.compile(close_bug, re.IGNORECASE)
|
close_bug_pat = re.compile(close_bug, re.IGNORECASE)
|
||||||
match = close_bug_pat.search(msg)
|
match = close_bug_pat.search(msg)
|
||||||
if not match:
|
if not match:
|
||||||
return msg, None, None, None
|
return msg, None, None
|
||||||
action, bug = match.group(1), match.group(2)
|
action, bug = match.group(1), match.group(2)
|
||||||
summary = ''
|
summary = ''
|
||||||
raw = urllib.urlopen('https://bugs.launchpad.net/calibre/+bug/' +
|
raw = urllib.urlopen('https://bugs.launchpad.net/calibre/+bug/' +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user