| 118 | #endif |
| 119 | |
| 120 | CRRecentBooksMenu::CRRecentBooksMenu(CRGUIWindowManager * wm, LVDocView * docview, int numItems, lvRect & rc) |
| 121 | : CRFullScreenMenu( wm, MCMD_BOOKMARK_LIST, lString16(_("Open recent book")), numItems, rc ) |
| 122 | { |
| 123 | docview->savePosition(); // to move current file to top |
| 124 | LVPtrVector<CRFileHistRecord> & files = docview->getHistory()->getRecords(); |
| 125 | _files = &files; |
| 126 | // skip Null |
| 127 | for ( int i=1; i<files.length(); i++ ) { |
| 128 | CRFileHistRecord * file = files.get( i ); |
| 129 | CRRecentBookMenuItem * item = new CRRecentBookMenuItem( this, i, file ); |
| 130 | addItem( item ); |
| 131 | } |
| 132 | //_helpText = L"Long press 1..8 = set, short press = go to"; |
| 133 | //_helpHeight = 36; |
| 134 | CRGUIAcceleratorTableRef acc = _wm->getAccTables().get("bookmarks"); |
| 135 | if ( acc.isNull() ) |
| 136 | acc = _wm->getAccTables().get("menu"); |
| 137 | setAccelerators( acc ); |
| 138 | setSkinName(lString16(L"#bookmarks")); |
| 139 | lString16 pattern(_("$1 - open book\n$2, $3 - close")); |
| 140 | #ifdef CR_POCKETBOOK |
| 141 | pattern.replaceParam(1, getCommandKeyName( MCMD_SELECT )); |
| 142 | #else |
| 143 | pattern.replaceParam(1, getItemNumberKeysName()); |
| 144 | #endif |
| 145 | pattern.replaceParam(2, getCommandKeyName(MCMD_OK) ); |
| 146 | pattern.replaceParam(3, getCommandKeyName(MCMD_CANCEL) ); |
| 147 | _statusText = pattern; |
| 148 | #ifdef CR_POCKETBOOK |
| 149 | bmkDialog = this; |
| 150 | #endif |
| 151 | } |
| 152 | |
| 153 | /// returns true if command is processed |
| 154 | bool CRRecentBooksMenu::onCommand( int command, int params ) |
nothing calls this directly
no test coverage detected