mirror of
https://github.com/coderkei/akmenu-next.git
synced 2025-06-19 09:25:33 -04:00
Add back support for favorites
This was accidentally removed when file operations were removed; for some reason that was tied to the favorites feature. Add it back in a simpler form.
This commit is contained in:
parent
5adf8515ac
commit
794685e291
@ -183,7 +183,19 @@ void cMainWnd::startMenuItemClicked(s16 i) {
|
|||||||
dbg_printf("start menu item %d\n", i);
|
dbg_printf("start menu item %d\n", i);
|
||||||
// messageBox( this, "Power Off", "Are you sure you want to turn off ds?", MB_YES | MB_NO );
|
// messageBox( this, "Power Off", "Are you sure you want to turn off ds?", MB_YES | MB_NO );
|
||||||
|
|
||||||
if (START_MENU_ITEM_SETTING == i) {
|
if (START_MENU_ITEM_FAVORITES_ADD == i) {
|
||||||
|
bool ret = cFavorites::AddToFavorites(_mainList->getSelectedFullPath());
|
||||||
|
if (ret) // refresh current directory
|
||||||
|
_mainList->enterDir(_mainList->getCurrentDir());
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (START_MENU_ITEM_FAVORITES_DELETE == i) {
|
||||||
|
bool ret = cFavorites::RemoveFromFavorites(_mainList->getSelectedFullPath());
|
||||||
|
if (ret && _mainList->IsFavorites()) // refresh current directory
|
||||||
|
_mainList->enterDir(_mainList->getCurrentDir());
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (START_MENU_ITEM_SETTING == i) {
|
||||||
showSettings();
|
showSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
using namespace akui;
|
using namespace akui;
|
||||||
|
|
||||||
void cStartMenu::init() {
|
void cStartMenu::init() {
|
||||||
|
addItem(START_MENU_ITEM_FAVORITES_ADD, LANG("start menu", "Set favorite"));
|
||||||
|
addItem(START_MENU_ITEM_FAVORITES_DELETE, LANG("start menu", "Unset favorite"));
|
||||||
addItem(START_MENU_ITEM_SETTING, LANG("start menu", "Setting"));
|
addItem(START_MENU_ITEM_SETTING, LANG("start menu", "Setting"));
|
||||||
addItem(START_MENU_ITEM_INFO, LANG("start menu", "Info"));
|
addItem(START_MENU_ITEM_INFO, LANG("start menu", "Info"));
|
||||||
addItem(START_MENU_ITEM_HELP, LANG("start menu", "Help"));
|
addItem(START_MENU_ITEM_HELP, LANG("start menu", "Help"));
|
||||||
|
@ -11,10 +11,12 @@
|
|||||||
|
|
||||||
#include "popmenu.h"
|
#include "popmenu.h"
|
||||||
|
|
||||||
#define START_MENU_ITEM_SETTING 0
|
#define START_MENU_ITEM_FAVORITES_ADD 0
|
||||||
#define START_MENU_ITEM_INFO 1
|
#define START_MENU_ITEM_FAVORITES_DELETE 1
|
||||||
#define START_MENU_ITEM_HELP 2
|
#define START_MENU_ITEM_SETTING 2
|
||||||
#define START_MENU_ITEM_TOOLS 3
|
#define START_MENU_ITEM_INFO 3
|
||||||
|
#define START_MENU_ITEM_HELP 4
|
||||||
|
#define START_MENU_ITEM_TOOLS 5
|
||||||
|
|
||||||
class cStartMenu : public akui::cPopMenu {
|
class cStartMenu : public akui::cPopMenu {
|
||||||
public:
|
public:
|
||||||
|
@ -5,11 +5,9 @@ main = liberation.pcf
|
|||||||
language = 1
|
language = 1
|
||||||
|
|
||||||
[start menu]
|
[start menu]
|
||||||
Copy = Copy
|
|
||||||
Cut = Cut
|
|
||||||
Paste = Paste
|
|
||||||
Delete = Delete
|
|
||||||
Setting = Settings
|
Setting = Settings
|
||||||
|
Set favorite = Set favorite
|
||||||
|
Unset favorite = Unset favorite
|
||||||
Info = File Info
|
Info = File Info
|
||||||
Help = Help
|
Help = Help
|
||||||
Tools = Tools
|
Tools = Tools
|
||||||
|
Loading…
Reference in New Issue
Block a user