Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/readactivity.py
Commit message (Collapse)AuthorAgeFilesLines
* Save the mimetype in the metadata when download a shared fileGonzalo Odiard2014-03-051-0/+9
| | | | | | | | Some mime files, like epub, are not recognized if the extension is not set. We need use the suggested_name extension to save the file, and save the mimetype in the metadata. Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
* Don't set path in the downloaderGonzalo Odiard2014-03-051-11/+3
|
* Copy file in read_file methodGonzalo Odiard2014-03-051-1/+7
| | | | | | | I need copy the file to the instance directory, the path provided by the datastore dissapear later in the life of the activity. Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
* Use Gio to identify the mime type of transfered filesGonzalo Odiard2014-03-041-1/+2
|
* Don't crash if the book have bookmarks saved, but can't open the previewGonzalo Odiard2013-09-051-0/+3
| | | | | | | If the preview can't be opened or created, create a image with a number showing the page number. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Save the mime type in the metadataGonzalo Odiard2013-08-051-1/+6
| | | | | | | This improve startup time when the book is opened by second time, and is needed by the new ObjectChooser filter available on sugar 0.100 Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Improve feedback while receiving a bookGonzalo Odiard2013-08-051-8/+17
| | | | | | | | | A message is displayed when the collaboration is requested, because there are a time until it is establidhed. The progressbar is updated by 10% fractions, and the redraw of the widget is forced. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Pep8 & pyflakes fixesGonzalo Odiard2013-08-051-62/+59
| | | | | | Mostly aligment issues reported by new pep8 version Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Simplify the logic used when download a shared fileGonzalo Odiard2013-08-051-12/+8
| | | | | | Previously, the file was copied two times and that is not needed Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Disable automatic method to read_fileGonzalo Odiard2013-08-051-10/+21
| | | | | | | | | | | | | Activities do read_file when the canvas widget is mapped. This is a problem in Read activity, because we added a emptypanel, and that widget is triggereing the read_file execution. Then, this patch disable the automatic behavior, and call read_file, when is needed: * at start, if is reopening a object in the journal with a book. * after selecting a object with the ObjectChooser. * after receive a book on collaboration. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Show a alert while a file is dischargedGonzalo Odiard2013-08-051-0/+35
| | | | | | This is in the case of receive a book because join a shared session. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Prevent open a file two timesGonzalo Odiard2013-08-051-3/+5
| | | | | | | | | | | | | With latests changes (empty panel addition) the canvas is set more than one time, then the read_file can be triggered more than one time. Check if a file is already openened to not open it two times. This prevent a bug where the book is displayed two times, side by side. This patch also avoid a situation where the book can't be shared because the self._tempfile is not set when the file is opened at start because is reopened the activity from the journal. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Enable collaboration only when a file is loadedGonzalo Odiard2013-08-051-0/+4
| | | | | | | | | | Right now, Read activity can start without a file loaded, showing the empty panel and a button to open the object chooser. If the user try sharing the session before a book is opened, the collaboration is broken, because no file is available to share. This patch disable collaboration until a file is opened. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Make optional the import of filter type constant for compatibilityGonzalo Odiard2013-08-051-1/+4
| | | | | | Is not available on old sugar versions. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Show the empty panel if the activity restart a session without a bookGonzalo Odiard2013-08-051-2/+2
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Use the new filter_type parameter in ObjectChooser if availableGonzalo Odiard2013-08-051-1/+11
| | | | | | | | | This feature is available only in sugar 0.100 and better, if is not available use the old mime.GENERIC_TYPE_TEXT filter. This change is related to AU #2439 & SL #4523 Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Request to the ObjectChooser objects filtered by activtyGonzalo Odiard2013-08-051-1/+1
| | | | | | | | | | | | Previously used the type "Text", but this type include Write files, and Read can't open them [1]. This filter does not work on external devices [2], but a patch for sugar was already provided. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org> [1] https://sugardextrose.org/issues/2439 [2] http://bugs.sugarlabs.org/ticket/4523
* Reorganize toolbar to solve fall out of stop buton when rotated - SL#3832Gonzalo Odiard2013-04-101-13/+5
| | | | | | | The highlight button is moved to the edition subtoolbar, and a invisible separator is replaced by a small margin after the label. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Show 'No book' message when Read starts from scratchManuel Kaufmann2013-04-101-2/+6
| | | | | | | When the user starts a new instance of Read the 'No book' message is shown with a button to 'Choose something to read' that opens the Object Chooser. Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
* Calculate the md5 at write when a file is received - SL #4448Gonzalo Odiard2013-02-281-1/+4
| | | | | | | When a file is received after joining a colaboration session, need be saved in the journal, and we need calculate the md5 hash. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Expand rows on tap/click SL #4197Manuel Kaufmann2013-02-261-0/+14
| | | | | | | | | | This patch changes the normal behaviour of the clicks on rows, so they are expanded just tapping/clicking once on them. This is helpful when the XO is used in eBook mode because the arrows are really small and difficult to tap with the finger. Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Reviewed-by: Manuel QuiƱones <manuq@laptop.org>
* Get the right page number in the bookmarks buttons after restart - SL #4216Gonzalo Odiard2012-11-161-4/+9
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Remove unneded codeGonzalo Odiard2012-10-251-9/+0
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Use sugar-toolkit-gtk3 MenuItemGonzalo Odiard2012-10-091-24/+17
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Save the file hash in the metadata to calculate it only one timeGonzalo Odiard2012-10-091-2/+8
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Remove logGonzalo Odiard2012-10-091-1/+0
|
* Avoid error when closing the activity by toc selection NoneGonzalo Odiard2012-10-091-0/+2
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Show the bookmarks in a tray like in Browse activityGonzalo Odiard2012-10-091-0/+119
| | | | | | The preview is saved in another table in the sqlite db. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Implement display o TOC in pdf filesGonzalo Odiard2012-09-281-2/+5
| | | | | | | | This change needs evince 3.5.92 to work. The code checks evince version, before enable the functionality. This version works with index with one level only. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Remove the topbarGonzalo Odiard2012-09-261-8/+0
| | | | | | | | The topbar was used in full screen mode. Is removed by recomendation of Design Team, to use all the screen with the book view and not be distracted. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Keep the text position in the epub files - SL #3861Gonzalo Odiard2012-09-101-0/+2
| | | | | | When the zoom level change or the index view to is shown / hidden. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Enable the use of arrow keys in the page number entry - SL #3863Gonzalo Odiard2012-09-101-1/+2
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix index management in epub files - SL #3853Gonzalo Odiard2012-09-101-5/+1
| | | | | | | | | | Epub index can point to internal links in the content files. This patch manage this cases. A particular case was found in a file generated in UY (see attachment in the ticket) where the links don't point to the start of a file, but to the end of the previous file. Then, if the index is at the end of a file, we open the next file. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* The BookmarkView should be hidden by defaultGonzalo Odiard2012-09-101-1/+0
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Show the table of contents in a panelGonzalo Odiard2012-09-101-48/+77
| | | | | | | | | | | | The table of contents, actually implemented in epub backend, is displayed in a later panel, instead of in a combo, to do easier the interaction with touch, and provide context. The code is now more general to allow the implementation in the pdf backend too. The button used to display the table of contents, was moved from the main toolbar to the view subtoolbar. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Rename Sidebar to BookmarkViewGonzalo Odiard2012-09-101-14/+15
| | | | | | | | Is not a sidebar anymore, and we will add a sidebar to show the index, the to avoid problems in the future, renamed the object and variables to have more consistent nomenclature. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Changes in the toolbar to show the StopButton with screen vertical (epub)Gonzalo Odiard2012-09-101-10/+6
| | | | | | | | | * Remove style in the number of pages label: is done in the theme now, and the font is smaller. * Set request_size in separators. * remove unneded toolitem around highlight toogle button Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Align the bookmark panel to the scrollbar.Gonzalo Odiard2012-08-161-1/+8
| | | | | | Is using a hack. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* New design to bookmark visualizationGonzalo Odiard2012-08-151-3/+11
| | | | | | | | | | | | | The sidebar where we displayed the bookmark was a thin area at the left of the screen, was not very intuitive, and was dificult to access with a finger. With Gtk3 we can use overlays, then this patch move the sidebar to the top/right of the screen, and display it with a shape similar to other book readers, using the user colors. I have tried to do the botom triangle transparent, but without success, we can try it later. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix Ctrl-c accelerator codeGonzalo Odiard2012-06-061-1/+1
| | | | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org> Signed-off-by: Manuel QuiƱones <manuq@laptop.org> Signed-off-by: Simon Schampijer <erikos@laptop.org>
* Show bookmark in the first page SL #3662Manuel Kaufmann2012-06-011-0/+5
| | | | | | | | | Show the bookmark for the first page (if any) in the sidebar when the file is resumed from the Journal. Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Reviewed-by: Gonzalo Odiard <gonzalo@laptop.org> Tested-by: Simon Schampijer <simon@laptop.org>
* Alert the user when he removes a bookmark SL #1274Manuel Kaufmann2012-06-011-0/+18
| | | | | | | | Alert the user with a Confirmation Alert when he / she removes a bookmark informing that the bookmark information will be lost. Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Reviewed-by: Gonzalo Odiard <gonzalo@laptop.org>
* Initialize current page and number of pages in the toolbar - SL #3434Gonzalo Odiard2012-04-161-1/+1
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix to previous: Enable use of arrow keys in the title entry - SL #3001Gonzalo Odiard2012-04-101-1/+1
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Init page number inputGonzalo Odiard2012-04-101-0/+1
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@latop.org>
* Enable use of arrow keys in the title entry - SL #3001Gonzalo Odiard2012-04-101-3/+5
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Improve bookmarks add/remove - SL #3405Gonzalo Odiard2012-04-101-13/+13
| | | | | | | | | | | | | | | | | The bug have two sources. First, the button used to add/remove the bookmark is a toggle, and the gtk3 theme is not setting the right grey color, then is not obvious to the user if the button is pressed or not. (this problem will be addressed in sugar-artwork) The second problem is, if the user cancel the dialog creating the bookmark, the bookmark is not created but the button continue pressed until the page is changed. This was solved sending a signal to uptade the button state. Two other problems were found and solved: * The page number in the bookmark description was wrong by one. * If the page had more than one bookmark, the clear method only removed the last then the sidebar accumulated bookmark icons. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Save and restore the page with epub files - SL #3413Gonzalo Odiard2012-04-091-7/+4
| | | | | | | | | | | | | | | | | When the user closed and reopened the activity, reading a epub file, the page was lost. The problem had two sources: The invisible webkit widget used to measure the document height, can add a scrollbar (randomly) then the inner width change, the text folw differently and the inner height change. This problem is solved setting document.documentElement.style.overflow = hidden in the widget when is used to measure. The second problem was, after the document was loaded and positioned the epubview tried to change the scroll position again. This patch include a minor change in readactivity.py, only to avoid call many times view.get_current_page. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Separate the speech toolbar in another file to load only if neededGonzalo Odiard2012-03-061-5/+4
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Only init the speech service if the backend support text to speechGonzalo Odiard2012-03-061-4/+5
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>