Merge pull request #483 from thotypous/master

Avoid crash on backends which don't define getLinkFromPosition
pull/485/head
Huang Xin 11 years ago
commit 582419d973

@ -177,6 +177,10 @@ function Document:getPageLinks(pageno)
return nil return nil
end end
function Document:getLinkFromPosition(pageno, pos)
return nil
end
function Document:getTextBoxes(pageno) function Document:getTextBoxes(pageno)
return nil return nil
end end

@ -30,7 +30,10 @@ function ReaderTypeset:onReadSettings(config)
-- default to enable floating punctuation -- default to enable floating punctuation
self.floating_punctuation = config:readSetting("floating_punctuation") or 1 self.floating_punctuation = config:readSetting("floating_punctuation") or 1
self.ui.document:setFloatingPunctuation(self.floating_punctuation) self.ui.document:setFloatingPunctuation(self.floating_punctuation)
self:_setPageMargins()
end
function ReaderTypeset:_setPageMargins()
local copt_margins = self.ui.doc_settings:readSetting("copt_page_margins") or DCREREADER_CONFIG_MARGIN_SIZES_MEDIUM local copt_margins = self.ui.doc_settings:readSetting("copt_page_margins") or DCREREADER_CONFIG_MARGIN_SIZES_MEDIUM
self.ui:handleEvent(Event:new("SetPageMargins", copt_margins)) self.ui:handleEvent(Event:new("SetPageMargins", copt_margins))
end end
@ -112,7 +115,10 @@ end
function ReaderTypeset:toggleFloatingPunctuation() function ReaderTypeset:toggleFloatingPunctuation()
self.floating_punctuation = self.floating_punctuation == 0 and 1 or 0 self.floating_punctuation = self.floating_punctuation == 0 and 1 or 0
self.ui.document:setFloatingPunctuation(self.floating_punctuation) self.ui.document:setFloatingPunctuation(self.floating_punctuation)
self.ui:handleEvent(Event:new("UpdatePos")) --self.ui:handleEvent(Event:new("UpdatePos"))
-- workaround: set again things unset by crengine after changing floating punctuation
self.ui.document:setFontFace(self.ui.doc_settings:readSetting("font_face"))
self:_setPageMargins()
end end
function ReaderTypeset:addToMainMenu(tab_item_table) function ReaderTypeset:addToMainMenu(tab_item_table)

@ -1 +1 @@
Subproject commit 9ed7fae5d3bf3b4933852586be0e2fb9d67c3fd2 Subproject commit 04a517ad2734fb7357924f082f479c63ae4c4f49

@ -4,14 +4,16 @@
# Translators: # Translators:
# Antoine Kamel <antoine12@gmail.com>, 2013 # Antoine Kamel <antoine12@gmail.com>, 2013
# Carcara <tiagoprudente@gmail.com>, 2013 # Carcara <tiagoprudente@gmail.com>, 2013
# thotypous, 2014
# thotypous, 2014
# Carcara <tiagoprudente@gmail.com>, 2013 # Carcara <tiagoprudente@gmail.com>, 2013
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KOReader\n" "Project-Id-Version: KOReader\n"
"Report-Msgid-Bugs-To: https://github.com/koreader/koreader-base/issues\n" "Report-Msgid-Bugs-To: https://github.com/koreader/koreader-base/issues\n"
"POT-Creation-Date: 2014-01-18 17:24+0000\n" "POT-Creation-Date: 2014-01-18 17:24+0000\n"
"PO-Revision-Date: 2014-01-19 08:55+0000\n" "PO-Revision-Date: 2014-01-21 02:21+0000\n"
"Last-Translator: thomass <pblcaccess2me@gmail.com>\n" "Last-Translator: thotypous\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/koreader/language/pt_BR/)\n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/koreader/language/pt_BR/)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@ -21,15 +23,15 @@ msgstr ""
#: reader.lua:107 #: reader.lua:107
msgid "-d start in debug mode" msgid "-d start in debug mode"
msgstr "-d iniciar em modo de depuração" msgstr "-d iniciar em modo de depuração"
#: reader.lua:109 #: reader.lua:109
msgid "-h show this usage help" msgid "-h show this usage help"
msgstr "-h mostrar esse guia de uso" msgstr "-h mostrar esse guia de uso"
#: reader.lua:108 #: reader.lua:108
msgid "-p [rows] enable Lua code profiling" msgid "-p [rows] enable Lua code profiling"
msgstr "-p [rows] habilitar código Lua" msgstr "-p [linhas] gerar perfil de desempenho do código Lua"
#: frontend/ui/data/strings.lua:46 #: frontend/ui/data/strings.lua:46
msgid "0 deg" msgid "0 deg"
@ -122,11 +124,11 @@ msgstr "Contraste"
#: frontend/apps/filemanager/filemanager.lua:133 #: frontend/apps/filemanager/filemanager.lua:133
msgid "Copy" msgid "Copy"
msgstr "" msgstr "Copiar"
#: frontend/apps/filemanager/filemanager.lua:151 #: frontend/apps/filemanager/filemanager.lua:151
msgid "Cut" msgid "Cut"
msgstr "" msgstr "Cortar"
#: frontend/ui/reader/readerfrontlight.lua:44 #: frontend/ui/reader/readerfrontlight.lua:44
msgid "Decrease front light intensity to " msgid "Decrease front light intensity to "
@ -151,7 +153,7 @@ msgstr "Excluir"
#: frontend/ui/input.lua:324 #: frontend/ui/input.lua:324
msgid "Device model=" msgid "Device model="
msgstr "" msgstr "Modelo do dispositivo="
#: frontend/ui/data/strings.lua:16 #: frontend/ui/data/strings.lua:16
msgid "Document Language" msgid "Document Language"
@ -171,7 +173,7 @@ msgstr "Estilo embutido"
#: reader.lua:55 #: reader.lua:55
msgid "File does not exist" msgid "File does not exist"
msgstr "" msgstr "Arquivo inexistente"
#: frontend/apps/filemanager/filemanagermenu.lua:114 #: frontend/apps/filemanager/filemanagermenu.lua:114
msgid "File manager menu" msgid "File manager menu"
@ -187,7 +189,7 @@ msgstr "Ajuste Fino"
#: frontend/ui/input.lua:326 #: frontend/ui/input.lua:326
msgid "Firmware revision" msgid "Firmware revision"
msgstr "" msgstr "Versão do firmware"
#: frontend/ui/data/strings.lua:23 #: frontend/ui/data/strings.lua:23
msgid "Font weight" msgid "Font weight"
@ -262,19 +264,19 @@ msgstr "Indentação"
#: frontend/ui/reader/readerhighlight.lua:145 #: frontend/ui/reader/readerhighlight.lua:145
msgid "Invert" msgid "Invert"
msgstr "" msgstr "Inverter"
#: frontend/ui/data/strings.lua:54 #: frontend/ui/data/strings.lua:54
msgid "LTR" msgid "LTR"
msgstr "" msgstr "ED"
#: frontend/ui/language.lua:31 #: frontend/ui/language.lua:31
msgid "Language" msgid "Language"
msgstr "" msgstr "Língua"
#: frontend/ui/reader/readerhighlight.lua:133 #: frontend/ui/reader/readerhighlight.lua:133
msgid "Lighten" msgid "Lighten"
msgstr "" msgstr "Brilhar"
#: frontend/ui/data/strings.lua:10 #: frontend/ui/data/strings.lua:10
msgid "Line Spacing" msgid "Line Spacing"
@ -319,7 +321,7 @@ msgstr "Margem da Página"
#: frontend/apps/filemanager/filemanager.lua:140 #: frontend/apps/filemanager/filemanager.lua:140
msgid "Paste" msgid "Paste"
msgstr "" msgstr "Colar"
#: frontend/apps/filemanager/filemanagermenu.lua:77 #: frontend/apps/filemanager/filemanagermenu.lua:77
#: frontend/ui/reader/readermenu.lua:75 #: frontend/ui/reader/readermenu.lua:75
@ -330,11 +332,11 @@ msgstr "Reporte falhas em https://github.com/koreader/ koreader/issues. Clique n
#: frontend/ui/language.lua:13 #: frontend/ui/language.lua:13
msgid "Please restart reader for new language setting to take effect." msgid "Please restart reader for new language setting to take effect."
msgstr "" msgstr "Por favor reinicie o leitor para que a tradução tenha efeito."
#: frontend/ui/data/strings.lua:55 #: frontend/ui/data/strings.lua:55
msgid "RTL" msgid "RTL"
msgstr "" msgstr "DE"
#: reader.lua:105 #: reader.lua:105
msgid "Read all the books on your E-Ink reader" msgid "Read all the books on your E-Ink reader"
@ -358,11 +360,11 @@ msgstr "Modo de Tela"
#: frontend/ui/input.lua:328 #: frontend/ui/input.lua:328
msgid "Screen height =" msgid "Screen height ="
msgstr "" msgstr "Altura da tela="
#: frontend/ui/input.lua:330 #: frontend/ui/input.lua:330
msgid "Screen width =" msgid "Screen width ="
msgstr "" msgstr "Largura da tela="
#: frontend/ui/data/strings.lua:8 #: frontend/ui/data/strings.lua:8
msgid "Scroll Mode" msgid "Scroll Mode"
@ -387,7 +389,7 @@ msgstr "Mudar tamanho de fonte para "
#: frontend/ui/reader/readerhighlight.lua:124 #: frontend/ui/reader/readerhighlight.lua:124
msgid "Set highlight drawer " msgid "Set highlight drawer "
msgstr "" msgstr "Escolher estilo de realce "
#: frontend/ui/reader/readertypeset.lua:8 #: frontend/ui/reader/readertypeset.lua:8
msgid "Set render style" msgid "Set render style"
@ -407,11 +409,11 @@ msgstr "Mudar o zoom"
#: frontend/ui/data/strings.lua:57 #: frontend/ui/data/strings.lua:57
msgid "TBLTR" msgid "TBLTR"
msgstr "" msgstr "CBED"
#: frontend/ui/data/strings.lua:56 #: frontend/ui/data/strings.lua:56
msgid "TBRTL" msgid "TBRTL"
msgstr "" msgstr "CBDE"
#: frontend/ui/reader/readertoc.lua:95 #: frontend/ui/reader/readertoc.lua:95
msgid "Table of Contents" msgid "Table of Contents"
@ -451,28 +453,28 @@ msgstr "Traduzir"
#: frontend/ui/reader/readertypeset.lua:127 #: frontend/ui/reader/readertypeset.lua:127
msgid "Turn off floating punctuation" msgid "Turn off floating punctuation"
msgstr "" msgstr "Desabilitar pontuação flutuante"
#: frontend/ui/reader/readerpaging.lua:153 #: frontend/ui/reader/readerpaging.lua:153
msgid "Turn off page overlap" msgid "Turn off page overlap"
msgstr "" msgstr "Não clarear áreas já lidas"
#: frontend/ui/reader/readertypeset.lua:128 #: frontend/ui/reader/readertypeset.lua:128
msgid "Turn on floating punctuation" msgid "Turn on floating punctuation"
msgstr "" msgstr "Habilitar pontuação flutuante"
#: frontend/ui/reader/readerpaging.lua:154 #: frontend/ui/reader/readerpaging.lua:154
msgid "Turn on page overlap" msgid "Turn on page overlap"
msgstr "" msgstr "Clarear áreas já lidas"
#: frontend/ui/reader/readerhighlight.lua:139 #: frontend/ui/reader/readerhighlight.lua:139
msgid "Underscore" msgid "Underscore"
msgstr "" msgstr "Sublinhar"
#: frontend/apps/filemanager/filemanagermenu.lua:82 #: frontend/apps/filemanager/filemanagermenu.lua:82
#: frontend/ui/reader/readermenu.lua:80 #: frontend/ui/reader/readermenu.lua:80
msgid "Version" msgid "Version"
msgstr "" msgstr "Versão"
#: frontend/ui/data/strings.lua:17 #: frontend/ui/data/strings.lua:17
msgid "Vertical Text" msgid "Vertical Text"
@ -488,11 +490,11 @@ msgstr "Vácuo entre palavras"
#: frontend/ui/data/strings.lua:27 #: frontend/ui/data/strings.lua:27
msgid "Writing Direction" msgid "Writing Direction"
msgstr "" msgstr "Direção de escrita"
#: frontend/ui/reader/readerscreenshot.lua:31 #: frontend/ui/reader/readerscreenshot.lua:31
msgid "Writing screen to " msgid "Writing screen to "
msgstr "" msgstr "Gravando a tela em "
#: frontend/ui/reader/readerzooming.lua:311 #: frontend/ui/reader/readerzooming.lua:311
msgid "Zoom to fit content" msgid "Zoom to fit content"
@ -520,7 +522,7 @@ msgstr "Zoom na largura da página"
#: frontend/ui/data/strings.lua:31 #: frontend/ui/data/strings.lua:31
msgid "auto" msgid "auto"
msgstr "automático" msgstr "auto"
#: frontend/ui/widget/confirmbox.lua:37 #: frontend/ui/widget/confirmbox.lua:37
msgid "cancel" msgid "cancel"
@ -731,7 +733,7 @@ msgstr "ligado"
#: reader.lua:60 #: reader.lua:60
msgid "opening file" msgid "opening file"
msgstr "" msgstr "abrindo o arquivo "
#: frontend/ui/data/strings.lua:53 #: frontend/ui/data/strings.lua:53
msgid "page" msgid "page"

Loading…
Cancel
Save