From 7a526fcb131bd67da3090073f2d6427281f8532c Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Thu, 9 Aug 2012 20:16:38 +0200 Subject: [PATCH 1/6] Use the github page for the kodos project page url --- kodos | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kodos b/kodos index 8446047..5a433ae 100755 --- a/kodos +++ b/kodos @@ -983,7 +983,8 @@ class Kodos(KodosBA): def kodos_website(self): - self.launch_browser_wrapper("http://kodos.sourceforge.net") + self.launch_browser_wrapper('https://github.com/luksan/kodos', + message=self.tr('Launch web browser to go to the kodos project page?')) def check_for_update(self): From 0db86656064c8a9a530463b3866c2cd1ff4c3107 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Thu, 9 Aug 2012 19:23:21 +0200 Subject: [PATCH 2/6] Remove the check_for_updates functionality --- kodos | 42 ------------------------------------------ modules/kodosBA.ui | 17 ----------------- 2 files changed, 59 deletions(-) diff --git a/kodos b/kodos index 5a433ae..f7797ed 100755 --- a/kodos +++ b/kodos @@ -987,48 +987,6 @@ class Kodos(KodosBA): message=self.tr('Launch web browser to go to the kodos project page?')) - def check_for_update(self): - url = "http://sourceforge.net/project/showfiles.php?group_id=43860" - try: - fp = urllib.urlopen(url) - except: - self.status_bar.set_message(self.tr("Failed to open url"), - 5, - TRUE) - return - - lines = fp.readlines() - html = string.join(lines) - - rawstr = r"""kodos-(?P.*?)\.\w{3,4}\<""" - match_obj = re.search(rawstr, html) - if match_obj: - latest_version = match_obj.group('version') - if latest_version == VERSION: - QMessageBox.information(None, - self.tr("No Update is Available"), - unicode(self.tr("You are currently using the latest version of Kodos")) + " (%s)" % VERSION) - else: - message = "%s\n\n%s: %s.\n%s: %s.\n\n%s\n" % \ - (unicode(self.tr("There is a newer version of Kodos available.")), - unicode(self.tr("You are using version:")), - VERSION, - unicode(self.tr("The latest version is:")), - latest_version, - unicode(self.tr("Press OK to launch browser"))) - - self.launch_browser_wrapper(url, - self.tr("Kodos Update Available"), - message) - else: - message = "%s.\n\n%s" % \ - (unicode(self.tr("Unable to get version info from Sourceforge")), - unicode(self.tr("Press OK to launch browser"))) - self.launch_browser_wrapper(url, - self.tr("Unknown version available"), - message) - - def launch_browser_wrapper(self, url, caption=None, message=None): if launch_browser(url, caption, message): self.status_bar.set_message(self.tr("Launching web browser"), diff --git a/modules/kodosBA.ui b/modules/kodosBA.ui index a600de2..14139b3 100644 --- a/modules/kodosBA.ui +++ b/modules/kodosBA.ui @@ -406,7 +406,6 @@ database. New in Python version 2.0. - @@ -1285,22 +1284,6 @@ database. New in Python version 2.0. - - helpCheckForUpdateAction - activated() - KodosBA - check_for_update() - - - -1 - -1 - - - 20 - 20 - - - replaceTextEdit textChanged() From 1aa7811ddf46b66c6b682d903a719e05bfc5b6ae Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Thu, 9 Aug 2012 19:53:21 +0200 Subject: [PATCH 3/6] Remove the reportbug functionality and send the user to github instead --- kodos | 4 +- modules/reportBug.py | 104 --------------- modules/reportBugBA.ui | 290 ----------------------------------------- 3 files changed, 2 insertions(+), 396 deletions(-) delete mode 100644 modules/reportBug.py delete mode 100644 modules/reportBugBA.ui diff --git a/kodos b/kodos index f7797ed..49ead1b 100755 --- a/kodos +++ b/kodos @@ -33,7 +33,6 @@ import modules.help as help from modules.status_bar import * from modules.reference import * from modules.prefs import * -from modules.reportBug import reportBugWindow from modules.version import VERSION from modules.recent_files import RecentFiles from modules.urlDialog import URLDialog @@ -1005,7 +1004,8 @@ class Kodos(KodosBA): def report_bug(self): - self.bug_report_win = reportBugWindow(self) + self.launch_browser_wrapper('https://github.com/luksan/kodos/issues', + message=self.tr("Launch web browser to report a bug in kodos?")) ############################################################################## diff --git a/modules/reportBug.py b/modules/reportBug.py deleted file mode 100644 index e4351e4..0000000 --- a/modules/reportBug.py +++ /dev/null @@ -1,104 +0,0 @@ -# -*- coding: utf-8 -*- -# reportBug.py: -*- Python -*- DESCRIPTIVE TEXT. - -from reportBugBA import reportBugBA -from util import * -from PyQt4.QtGui import * -from PyQt4.QtCore import * -from PyQt4 import * -import sys -import string -import smtplib -from version import VERSION - -AUTHOR_ADDR = "phil_schwartz@users.sourceforge.net" - -class reportBug(reportBugBA): - def __init__(self, parent=None, name=None): - reportBugBA.__init__(self, parent) - self.parent = parent - self.kodos_main = parent.kodos_main - self.populate() - - - def populate(self): - self.OSEdit.setText(sys.platform) - pyvers = string.replace(sys.version, "\n", " - ") - self.pythonVersionEdit.setText(pyvers) - self.PyQtVersionEdit.setText(QT_VERSION_STR) - self.regexMultiLineEdit.setPlainText(self.kodos_main.regexMultiLineEdit.toPlainText()) - self.stringMultiLineEdit.setPlainText(self.kodos_main.stringMultiLineEdit.toPlainText()) - - - def cancel_slot(self): - self.parent.close() - - def submit_slot(self): - addr = str(self.emailAddressEdit.text()) - if not addr: - msg = self.tr( - "An email address is necessary so that the author " - "can contact you. Your email address will not " - "be used for any other purposes.") - - QMessageBox.information(None, - self.tr("You must supply a valid email address"), - msg) - return - - msg = "Subject: Kodos bug report\n\n" - msg += "Kodos Version: %s\n" % VERSION - msg += "Operating System: %s\n" % unicode(self.OSEdit.text()) - msg += "Python Version: %s\n" % unicode(self.pythonVersionEdit.text()) - msg += "PyQt Version: %s\n" % unicode(self.PyQtVersionEdit.text()) - msg += "\n" + "=" * 70 + "\n" - msg += "Regex:\n%s\n" % unicode(self.regexMultiLineEdit.text()) - msg += "=" * 70 + "\n" - msg += "String:\n%s\n" % unicode(self.stringMultiLineEdit.text()) - msg += "=" * 70 + "\n" - msg += "Comments:\n%s\n" % unicode(self.commentsMultiLineEdit.text()) - email_server = unicode(self.kodos_main.prefs.emailServerEdit.text()) or "localhost" - try: - server = smtplib.SMTP(email_server) - server.sendmail(addr, AUTHOR_ADDR, msg) - server.quit() - QMessageBox.information(None, - self.tr("Bug report sent"), - self.tr("Your bug report has been sent.")) - self.parent.close() - except Exception, e: - QMessageBox.information(None, - self.tr("An exception occurred sending bug report"), - str(e)) - - -class reportBugWindow(QMainWindow): - def __init__(self, kodos_main): - self.kodos_main = kodos_main - QMainWindow.__init__(self, kodos_main)#, Qt.Window | Qt.WA_DeleteOnClose) - - self.setGeometry(100, 50, 800, 600) - self.setWindowTitle(self.tr("Report a Bug")) - self.setWindowIcon(QIcon(QPixmap(":images/kodos_icon.png"))) - - self.bug_report = reportBug(self) - self.setCentralWidget(self.bug_report) - - - self.createMenu() - self.createToolBar() - - self.show() - - - def createMenu(self): - self.menubar = self.menuBar() - self.filemenu = self.menubar.addMenu(self.tr("&File")) - self.filemenu.addAction(self.tr("&Close"), self, SLOT("close()")) - - - def createToolBar(self): - toolbar = QToolBar() - self.addToolBar(toolbar) - self.logolabel = kodos_toolbar_logo(toolbar) - diff --git a/modules/reportBugBA.ui b/modules/reportBugBA.ui deleted file mode 100644 index 74b2eec..0000000 --- a/modules/reportBugBA.ui +++ /dev/null @@ -1,290 +0,0 @@ - - - reportBugBA - - - - 0 - 0 - 750 - 653 - - - - Form1 - - - - 11 - - - 6 - - - - - 6 - - - 0 - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - Submit Bug Report - - - - - - - Cancel - - - - - - - - - Kodos State Information - - - - 11 - - - 6 - - - - - 6 - - - 0 - - - - - Regular Expression: - - - false - - - - - - - Match String: - - - false - - - - - - - - - 6 - - - 0 - - - - - true - - - - - - - true - - - - - - - - - - - - System Information - - - - 11 - - - 6 - - - - - Operating System: - - - false - - - - - - - PyQt Version: - - - false - - - - - - - Python Version: - - - false - - - - - - - - - - - - - - - - - - - Comments - - - - 11 - - - 6 - - - - - 0 - - - 6 - - - - - Comments: - - - false - - - - - - - - - - - 0 - 0 - - - - Email address: - - - false - - - - - - - - - - - - - - - qPixmapFromMimeSource - - OSEdit - pythonVersionEdit - PyQtVersionEdit - emailAddressEdit - submitButton - cancelButton - - - - - submitButton - clicked() - reportBugBA - submit_slot() - - - 20 - 20 - - - 20 - 20 - - - - - cancelButton - clicked() - reportBugBA - cancel_slot() - - - 20 - 20 - - - 20 - 20 - - - - - From 888d127686628989ab7958a3a5f151b8f157488c Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Mon, 13 Aug 2012 12:18:26 +0200 Subject: [PATCH 4/6] Remove the email server config item and the associated code --- modules/prefs.py | 3 --- modules/prefsBA.ui | 26 +++----------------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/modules/prefs.py b/modules/prefs.py index 56ea409..3112d49 100644 --- a/modules/prefs.py +++ b/modules/prefs.py @@ -27,8 +27,6 @@ def load(self): self.parent.setfont(setting.toPyObject()) if preference == 'Match Font': self.parent.setMatchFont(setting.toPyObject()) - if preference == 'Email Server': - self.emailServerEdit.setText(setting.toPyObject()) if preference == 'Recent Files Count': self.recentFilesSpinBox.setValue(int(setting.toPyObject())) except Exception, e: @@ -39,7 +37,6 @@ def load(self): def save(self): self.settings.setValue('Font', self.parent.getfont()) self.settings.setValue('Match Font', self.parent.getMatchFont()) - self.settings.setValue('Email Server', self.emailServerEdit.text()) self.settings.setValue('Recent Files Count', self.recentFilesSpinBox.text()) self.settings.sync() diff --git a/modules/prefsBA.ui b/modules/prefsBA.ui index c5c8586..6b3b40a 100644 --- a/modules/prefsBA.ui +++ b/modules/prefsBA.ui @@ -68,26 +68,7 @@ - - - - - - - - 0 - 0 - - - - Email Server: - - - false - - - - + @@ -103,7 +84,7 @@ - + Qt::Horizontal @@ -119,7 +100,7 @@ - + @@ -228,7 +209,6 @@ fontButton - emailServerEdit recentFilesSpinBox buttonHelp buttonApply From b2fb9528903ca32dcdb85d92e94aa411afe009fe Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Mon, 13 Aug 2012 12:29:48 +0200 Subject: [PATCH 5/6] Fix the layout of the preferences window --- modules/prefsBA.ui | 73 ++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 45 deletions(-) diff --git a/modules/prefsBA.ui b/modules/prefsBA.ui index 6b3b40a..d2f2290 100644 --- a/modules/prefsBA.ui +++ b/modules/prefsBA.ui @@ -7,7 +7,7 @@ 0 0 540 - 268 + 145 @@ -22,7 +22,7 @@ 11 6 519 - 246 + 131 @@ -44,13 +44,6 @@ - - - - - - - @@ -61,14 +54,21 @@ - + - + + + + + + + + @@ -84,23 +84,7 @@ - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 380 - 20 - - - - - + @@ -116,24 +100,24 @@ + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 380 + 20 + + + + - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - @@ -209,7 +193,6 @@ fontButton - recentFilesSpinBox buttonHelp buttonApply buttonOk From 881d9f3d6cbb568373d2e7a0c9eff27b51045f5d Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Mon, 13 Aug 2012 13:36:03 +0200 Subject: [PATCH 6/6] Remove the web browser and mail server paragraphs from the help --- help/prefs.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/help/prefs.html b/help/prefs.html index 06baaf2..793bfc3 100644 --- a/help/prefs.html +++ b/help/prefs.html @@ -77,12 +77,8 @@

Kodos - Help

Preferences

-Set your Web Browser path. You can use the ... button to use a file dialog to help locate your browser. The web browser is necessary to access external links within the Python Regex documentation.

- The Editor Font allows you to select a desirable font for use within the Kodos editor

-The Email Server is required for sending bug reports to the author. You can submit a bug report under the main Help menu

- You can control the number of Recent Files that are displayed at the bottom of the File menu. The default value is 5. To display more or less recent files, set this value accordingly. The recent file list is maintained independtly of this value such that applying a lower value and then a higher value will not purge entries. That is, if you have 10 files and then set this value to 3 and later set this value to 10, the 10 files will be immediately available for selection .