2012-05-01 15:06:38 +02:00
|
|
|
BugReport = {}
|
|
|
|
|
|
|
|
local bugReportWindow
|
|
|
|
local bugTextEdit
|
|
|
|
local HOTKEY = 'Ctrl+Z'
|
|
|
|
|
|
|
|
function BugReport.init()
|
2012-06-26 00:13:30 +02:00
|
|
|
g_ui.importStyle('bugreport.otui')
|
2012-05-01 15:06:38 +02:00
|
|
|
|
2012-06-26 00:13:30 +02:00
|
|
|
bugReportWindow = g_ui.createWidget('BugReportWindow', rootWidget)
|
2012-05-01 15:06:38 +02:00
|
|
|
bugReportWindow:hide()
|
|
|
|
|
|
|
|
bugTextEdit = bugReportWindow:getChildById('bugTextEdit')
|
|
|
|
|
2012-06-26 00:13:30 +02:00
|
|
|
g_keyboard.bindKeyDown(HOTKEY, BugReport.show)
|
2012-05-01 15:06:38 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function BugReport.terminate()
|
2012-06-26 00:13:30 +02:00
|
|
|
g_keyboard.unbindKeyDown(HOTKEY)
|
2012-05-01 15:06:38 +02:00
|
|
|
bugReportWindow:destroy()
|
|
|
|
bugReportWindow = nil
|
|
|
|
bugTextEdit = nil
|
|
|
|
end
|
|
|
|
|
|
|
|
function BugReport.doReport()
|
|
|
|
g_game.reportBug(bugTextEdit:getText())
|
|
|
|
bugReportWindow:hide()
|
|
|
|
TextMessage.displayEventAdvance(tr('Bug report sent.'))
|
|
|
|
end
|
|
|
|
|
|
|
|
function BugReport.show()
|
|
|
|
bugTextEdit:setText('')
|
|
|
|
bugReportWindow:show()
|
|
|
|
bugReportWindow:raise()
|
|
|
|
bugReportWindow:focus()
|
|
|
|
end
|