From 0eaf2671fd42e2e79cbd089ed0b335e3da468244 Mon Sep 17 00:00:00 2001 From: NuPogodi Date: Wed, 3 Oct 2012 00:45:45 +0200 Subject: [PATCH] New InfoMessage Concept Part I (still no unireader, crereader, filesearcher & fileinfo) Conflicts: commands.lua dialog.lua filechooser.lua filehistory.lua font.lua inputbox.lua reader.lua resources/info-i.png screen.lua selectmenu.lua --- kite/KPDFviewer (last file) | 2 +- kite/KPDFviewer File Manager | 2 +- kpdf.sh | 37 +++++++++++++++++++++++++++++++++++ launchpad/kpdf.ini | 8 ++++---- reader.lua | 20 +++++++++++++++++++ resources/info-aux.png | Bin 0 -> 1109 bytes resources/info-bug.png | Bin 0 -> 1037 bytes resources/info-confirm.png | Bin 0 -> 858 bytes resources/info-error.png | Bin 0 -> 950 bytes resources/info-warn.png | Bin 0 -> 844 bytes 10 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 kpdf.sh create mode 100644 resources/info-aux.png create mode 100644 resources/info-bug.png create mode 100644 resources/info-confirm.png create mode 100644 resources/info-error.png create mode 100644 resources/info-warn.png diff --git a/kite/KPDFviewer (last file) b/kite/KPDFviewer (last file) index 5d9acab14..de0c410d9 100755 --- a/kite/KPDFviewer (last file) +++ b/kite/KPDFviewer (last file) @@ -1,3 +1,3 @@ #!/bin/sh -/mnt/us/launchpad/kpdf.sh +/mnt/us/kindlepdfviewer/kpdf.sh diff --git a/kite/KPDFviewer File Manager b/kite/KPDFviewer File Manager index 3374ef3ae..f5f935234 100755 --- a/kite/KPDFviewer File Manager +++ b/kite/KPDFviewer File Manager @@ -1,3 +1,3 @@ #!/bin/sh -/mnt/us/launchpad/kpdf.sh /mnt/us/documents +/mnt/us/kindlepdfviewer/kpdf.sh /mnt/us/documents diff --git a/kpdf.sh b/kpdf.sh new file mode 100644 index 000000000..c1f81c700 --- /dev/null +++ b/kpdf.sh @@ -0,0 +1,37 @@ +#!/bin/sh +export LC_ALL="en_US.UTF-8" + +echo unlock > /proc/keypad +echo unlock > /proc/fiveway + +# we're always starting from our working directory +cd /mnt/us/kindlepdfviewer/ + +# bind-mount system fonts +if ! grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then + mount -o bind /usr/java/lib/fonts /mnt/us/kindlepdfviewer/fonts/host +fi + +# check if we are supposed to shut down the Amazon framework +if test "$1" == "--framework_stop"; then + shift 1 + /etc/init.d/framework stop +fi + +# stop cvm +killall -stop cvm + +# finally call reader +./reader.lua "$1" 2> /mnt/us/kindlepdfviewer/crash.log || cat /mnt/us/kindlepdfviewer/crash.log + +# unmount system fonts +if grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then + umount /mnt/us/kindlepdfviewer/fonts/host +fi + +# always try to continue cvm +killall -cont cvm || /etc/init.d/framework start + +# cleanup hanging process +killall lipc-wait-event + diff --git a/launchpad/kpdf.ini b/launchpad/kpdf.ini index ab2a1b0d9..53be1fc3f 100755 --- a/launchpad/kpdf.ini +++ b/launchpad/kpdf.ini @@ -1,11 +1,11 @@ [Actions] # start kindlepdfviewer with filebrowser in /mnt/us/documents -P D = !/mnt/us/launchpad/kpdf.sh /mnt/us/documents +P D = !/mnt/us/kindlepdfviewer/kpdf.sh /mnt/us/documents # start kindlepdfviewer with last document -P P = !/mnt/us/launchpad/kpdf.sh +P P = !/mnt/us/kindlepdfviewer/kpdf.sh # start kindlepdfviewer without framework in /mnt/us/documents -P K = !/mnt/us/launchpad/kpdf.sh --framework_stop /mnt/us/documents +P K = !/mnt/us/kindlepdfviewer/kpdf.sh --framework_stop /mnt/us/documents # start kindlepdfviewer without framework on last read document -P L = !/mnt/us/launchpad/kpdf.sh --framework_stop +P L = !/mnt/us/kindlepdfviewer/kpdf.sh --framework_stop # restart amazon framework - when it got irritated P R = !/etc/init.d/framework restart diff --git a/reader.lua b/reader.lua index 8e9e627b2..18f131c13 100755 --- a/reader.lua +++ b/reader.lua @@ -139,6 +139,26 @@ end +-- @TODO dirty workaround, find a way to force native system poll +-- screen orientation and upside down mode 09.03 2012 +Screen:setRotationMode(Screen.native_rotation_mode) + if file then + running = openFile(file) + else + running = false + end + showReader(ARGV[optind], optarg["p"]) + end + UIManager:run() +elseif last_file and lfs.attributes(last_file, "mode") == "file" then + showReader(last_file, optarg["p"]) + UIManager:run() +else + return showusage() +end + + + -- @TODO dirty workaround, find a way to force native system poll -- screen orientation and upside down mode 09.03 2012 Screen:setRotationMode(Screen.native_rotation_mode) diff --git a/resources/info-aux.png b/resources/info-aux.png new file mode 100644 index 0000000000000000000000000000000000000000..afee09ee58ddc37401decbffb73dcd246e9f1623 GIT binary patch literal 1109 zcmV-b1giUqP)%dedCsPG0h089N9(xE=dFdsTMaoE(>L>?>qDX`Vcw5tnjvnVQVDd1glLB__A`xb{q(swwL`hLLPrV{v%5WgZ}^I z;{*FYfqgtd47sI$16OA?!p=y|sCbWpcWFaWsx2L>B=Z>PIrUt|P3F6@j%u$z1a=nX z<`q|N$z7?6(_ef5I)+(sr#RQZ`f`4hAnh&C6VSYh5mJ%}q3TdM;y%}K%j(Vp@MHaGf-s7MQ5QMw4PcYu6eG&3QG8CSlw45dhdd6}8gc1QmoKHqU@dsGZ1HQ zu-6PG^b03I0a0G1!8*Hx{X#JWW=$AGxAI^k6zo`cfb2)#e4X9|K3- z$&!p^xgCQZlv4Ff_A+k8R1O*L((T8*eC+gjMpu@2@apw4*XwF|n>o{^o=Ntp3#R`=*X2N?Gb+jLVX@ z32sffTI~BJO|vX>iWO9a%?H3Pz-6_mSulwa5AUr~{{gtQOj$2Od5WW6YWgu)3#jwi zJh}_5W@-C{;@=i53&Q2nh0wCJlD7@G&&JZz*6}>wwmt9T bzTE!-NI`3pcXg6N00000NkvXXu0mjfMWqY% literal 0 HcmV?d00001 diff --git a/resources/info-bug.png b/resources/info-bug.png new file mode 100644 index 0000000000000000000000000000000000000000..990e0466f67335c2c93d82ee3e3c2399712d8c40 GIT binary patch literal 1037 zcmV+o1oHcdP)hZIjSLz8O<_fXUh zEa*@c8x^xUtZ|#9un4CmRM1OX2N#2(_nbD1%pT@a=%V6OpP_GL*+{9WFQs!xh~AI? zd(RUi60JG^8JMgC)pek=4*a>QN0or5cY%P2e{0{G==U&j&9 zAo#UE65vY-Fk&}eWblpsxmfh+yv2E;vDX;?CQ0yY(s@HHT4p?OLr1-z%+NM=H_I0& zT0e|MkJG8mc~MnLZUVyL$ho?>kR6CFx(tX{MCtQLF>fvGrTvOC7E2-m*0o;K4W^?&DJjN>17)=70 z9e~-;8@)RV@RubHO%9F_)OyXXJ}e$4;3d;EZBZxK0%X&0yH0n!1ax^S;!aHY*l^Rg zDK20UK+bRkxs?6tJx4$ikUzr_*A_0tH2i!6XW;8iDP25yXE?2W4d@})Yz5v4;H$W7 zS(*THtK7T}X1Ay&zB4(T0N}DTx(=ecMlHrH&29nkLSqtL2c26QW9)g(4g&tHY`Fgb zv-;b(AtrFni;dBWSJJsET5Q;SS|~N#6=1fferI6@P|8MX&BUXT4eU}QU00000NkvXX Hu0mjfXJg#k literal 0 HcmV?d00001 diff --git a/resources/info-confirm.png b/resources/info-confirm.png new file mode 100644 index 0000000000000000000000000000000000000000..85a6585ed6090c93505aa6d412dbced7c0dae68b GIT binary patch literal 858 zcmV-g1Eu_lP)+#pbQ-vRjRO1V}c{xqQfcY)@OQqdwF z)&eBpas@D{qDbK)7T^Yo0Y3qlig0=g(GwKFOBG{_NV!f=A*urPRz>uT>o}2vip>&e zgRhFgTn&Nmx`?=mzgGa$k4piq=U$->4$W0OCj<9-f{2Jk+@b*9Cvcj9CoG8Q7ey}J zfnrvyGB60d0_UoOFL3HPsRK(4Jcae*c?6uK5Tt49c{^~(z&V)W=c)T>AxP2Sd0lwO z!1Wna;B9F8X8<=a_nh3xcVPS^1M(D1VO$tiR@PF?k;uESkT3vCsE8CEk0+&md5(g~ zFHitJDxxySl=|f)xRWqIiVmzhOpIQKec-23qA(kdGG1{Nq6!3*WZgj;ljIxvQc+$-}8 z8w@o7INyN{jT1Z zyb>tcwJ9~Zn3n^CU#9sx%jL57Y`SUr|p z91mMjDB0j(?4O86wooGYhXvD+qMHEIKHbPkG1LwLa{rqE)8K>T7~qBu;|styr$qqp zr?(jR@NZ--9n%ak$O`bmkrl09bJXz`#-KM!>s|FjfJ;9Tos9 z@au&D&ON&jSwM z|Kl6yz&&kuBMT;lwfdr8F)-vu!P1tO`3QMbM6`O_odG)`Mtgm{gPW|NV<8?o!@$CP zifBb3ck$CMUQ@>c4CX*#j5k;y*GZKa@+se>cPp~7SD{jXaLpXFjS3qgZf!5L58&~T6#CSySN2T(jDYc@M zW(6uB5tLgpL;|kqEohrFLk~MaTdd8TqQwv{L*JCbrx@D2uM~33LjpCUhHfC*3uuuD&JRh@ ztKCu_w!rg>3=q+^D=MMU0qbLytAKI=JZ+KTbEU}5`3f8fya1ILs08+F3*}n|e5wTk z2+`By>IZjcAFcs_^1S(b(N;q6L{|VC0Ql2XgiULS1(;r>H-~oFOS}olD&7C^)BKwG Y7t(RorN`jwBme*a07*qoM6N<$f+sGkX8-^I literal 0 HcmV?d00001 diff --git a/resources/info-warn.png b/resources/info-warn.png new file mode 100644 index 0000000000000000000000000000000000000000..f653634db11a13f5379d3c7512eba20e8142ff74 GIT binary patch literal 844 zcmV-S1GD^zP)n8YNmh18BHpdzR$Sa}6XF|Gh5 zIF&?+iIdpt3Q&S&N9I zIWR56$tWevUyK0LG<%^4x6~9cm?ntm4tpRC4KgS|teG;L^C(SEh%yk#0FYz@z*fl+ zMd^5{FnP%^27q&FpTVD%GUkPfLF{p^0OWiTIEROg3h))R{Ehl30wH!vz&(Ll{!YFZ zq$mMYSy$i1<4iHr2j)odS^=Fv1W@E@2n{1#1$3VgvE%aw!hOCgKtP~?4n}AjXi^#w zXu-N$1h5JX3KD>t1Fbc?MF0w9?YB%21ma*f1C*kaW)x-3kB&`Wi8shFfzG z=%5Y)7sen^fKq5$ZfFhzI*ersY+(>^H)p;q$UNF}tALA7ll#6uJL}K-NZoPWs-fL# zwa#)nTdS+9L#FVYV%!0s?UXYJxMhP|1yDm(#sORf+LUfi