class higdialog class and add report this bug in exception dialog and add some fixes for adding icons to buttons
This commit is contained in:
parent
aa7ab32aa5
commit
fcc4a6a0ce
|
@ -37,6 +37,8 @@ def init():
|
||||||
except IOError:
|
except IOError:
|
||||||
_translation = gettext.NullTranslations()
|
_translation = gettext.NullTranslations()
|
||||||
|
|
||||||
|
init()
|
||||||
|
|
||||||
def _(s):
|
def _(s):
|
||||||
if s == '':
|
if s == '':
|
||||||
return s
|
return s
|
||||||
|
|
|
@ -25,7 +25,7 @@ import stat
|
||||||
import common.gajim
|
import common.gajim
|
||||||
from common import i18n
|
from common import i18n
|
||||||
_ = i18n._
|
_ = i18n._
|
||||||
from common import helpers
|
import helpers
|
||||||
|
|
||||||
LOGPATH = os.path.expanduser('~/.gajim/logs')
|
LOGPATH = os.path.expanduser('~/.gajim/logs')
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
|
|
|
@ -194,6 +194,7 @@ class FileTransfersWindow:
|
||||||
gtkgui_helpers.escape_for_pango_markup(file_path)
|
gtkgui_helpers.escape_for_pango_markup(file_path)
|
||||||
dialog = dialogs.HigDialog(None, gtk.MESSAGE_INFO, gtk.BUTTONS_NONE,
|
dialog = dialogs.HigDialog(None, gtk.MESSAGE_INFO, gtk.BUTTONS_NONE,
|
||||||
_('File transfer completed'), sectext)
|
_('File transfer completed'), sectext)
|
||||||
|
#FIXME: add folder icon to Open Containgin Folder button
|
||||||
dialog.add_buttons(_('_Open Containing Folder'), gtk.RESPONSE_ACCEPT,
|
dialog.add_buttons(_('_Open Containing Folder'), gtk.RESPONSE_ACCEPT,
|
||||||
gtk.STOCK_OK, gtk.RESPONSE_OK )
|
gtk.STOCK_OK, gtk.RESPONSE_OK )
|
||||||
dialog.show_all()
|
dialog.show_all()
|
||||||
|
|
|
@ -26,13 +26,11 @@ import traceback
|
||||||
import gtk
|
import gtk
|
||||||
import pango
|
import pango
|
||||||
|
|
||||||
from common import i18n
|
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
|
from common import helpers
|
||||||
|
from common import i18n
|
||||||
|
|
||||||
|
|
||||||
i18n.init()
|
|
||||||
_ = i18n._
|
_ = i18n._
|
||||||
APP = i18n.APP
|
|
||||||
_exception_in_progress = False
|
_exception_in_progress = False
|
||||||
|
|
||||||
def _info(type, value, tb):
|
def _info(type, value, tb):
|
||||||
|
@ -45,16 +43,17 @@ def _info(type, value, tb):
|
||||||
|
|
||||||
_exception_in_progress = True
|
_exception_in_progress = True
|
||||||
|
|
||||||
dialog = gtk.MessageDialog(parent = None,
|
dialog = dialogs.HigDialog(None, gtk.MESSAGE_WARNING, gtk.BUTTONS_NONE,
|
||||||
flags = 0,
|
_('A programming error has been detected'),
|
||||||
type = gtk.MESSAGE_WARNING,
|
|
||||||
buttons = gtk.BUTTONS_CLOSE,
|
|
||||||
message_format = _('A programming error has been detected'))
|
|
||||||
|
|
||||||
dialog.format_secondary_text(
|
|
||||||
_('It probably is not fatal, but should be reported '
|
_('It probably is not fatal, but should be reported '
|
||||||
'to the developers nonetheless.'))
|
'to the developers nonetheless.'))
|
||||||
dialog.set_default_response(gtk.RESPONSE_CLOSE)
|
|
||||||
|
#FIXME: add icon to this button
|
||||||
|
RESPONSE_REPORT_BUG = 42
|
||||||
|
dialog.add_button(_('_Report Bug'), RESPONSE_REPORT_BUG)
|
||||||
|
btn = dialog.add_button(gtk.STOCK_CLOSE, gtk.BUTTONS_CLOSE)
|
||||||
|
|
||||||
|
btn.grab_focus()
|
||||||
|
|
||||||
# Details
|
# Details
|
||||||
textview = gtk.TextView()
|
textview = gtk.TextView()
|
||||||
|
@ -81,8 +80,13 @@ def _info(type, value, tb):
|
||||||
dialog.set_position(gtk.WIN_POS_CENTER)
|
dialog.set_position(gtk.WIN_POS_CENTER)
|
||||||
|
|
||||||
dialog.show_all()
|
dialog.show_all()
|
||||||
dialog.run()
|
resp = dialog.run()
|
||||||
dialog.destroy()
|
dialog.destroy()
|
||||||
|
|
||||||
|
if resp == RESPONSE_REPORT_BUG:
|
||||||
|
url = 'http://trac.gajim.org/wiki/WikiStart#howto_report_ticket'
|
||||||
|
helpers.launch_browser_mailer('url', url)
|
||||||
|
|
||||||
_exception_in_progress = False
|
_exception_in_progress = False
|
||||||
|
|
||||||
if not sys.stderr.isatty(): # gdb/kdm etc if we use startx this is not True
|
if not sys.stderr.isatty(): # gdb/kdm etc if we use startx this is not True
|
||||||
|
|
Loading…
Reference in New Issue