neutrino nfs: increased menu width (user request) and using member addIntroItems() to add back buttons

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@978 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
thilo
2010-12-30 21:19:30 +00:00
parent 70bff6a681
commit 67a4c1a9a5
2 changed files with 20 additions and 23 deletions

View File

@@ -41,6 +41,7 @@
#include <gui/widget/hintbox.h> #include <gui/widget/hintbox.h>
#include <gui/widget/stringinput.h> #include <gui/widget/stringinput.h>
#include <gui/widget/stringinput_ext.h> #include <gui/widget/stringinput_ext.h>
#include <driver/screen_max.h>
#include <fstream> #include <fstream>
@@ -87,7 +88,8 @@ CNFSMountGui::CNFSMountGui()
m_nfs_sup = CFSMounter::FS_UNPROBED; m_nfs_sup = CFSMounter::FS_UNPROBED;
m_cifs_sup = CFSMounter::FS_UNPROBED; m_cifs_sup = CFSMounter::FS_UNPROBED;
m_lufs_sup = CFSMounter::FS_UNPROBED; m_lufs_sup = CFSMounter::FS_UNPROBED;
width = w_max (50, 10); //%
} }
@@ -171,10 +173,8 @@ int CNFSMountGui::exec( CMenuTarget* parent, const std::string & actionKey )
int CNFSMountGui::menu() int CNFSMountGui::menu()
{ {
CMenuWidget mountMenuW(LOCALE_NFS_MOUNT, NEUTRINO_ICON_NETWORK); CMenuWidget mountMenuW(LOCALE_NFS_MOUNT, NEUTRINO_ICON_NETWORK, width);
mountMenuW.addItem(GenericMenuSeparator); mountMenuW.addIntroItems();
mountMenuW.addItem(GenericMenuBack);
mountMenuW.addItem(GenericMenuSeparatorLine);
char s2[12]; char s2[12];
for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++)
@@ -246,10 +246,8 @@ int CNFSMountGui::menuEntry(int nr)
(m_nfs_sup != CFSMounter::FS_UNSUPPORTED && *type != (int)CFSMounter::NFS) || (m_nfs_sup != CFSMounter::FS_UNSUPPORTED && *type != (int)CFSMounter::NFS) ||
(m_lufs_sup != CFSMounter::FS_UNSUPPORTED && *type != (int)CFSMounter::LUFS); (m_lufs_sup != CFSMounter::FS_UNSUPPORTED && *type != (int)CFSMounter::LUFS);
CMenuWidget mountMenuEntryW(LOCALE_NFS_MOUNT, NEUTRINO_ICON_NETWORK); CMenuWidget mountMenuEntryW(LOCALE_NFS_MOUNT, NEUTRINO_ICON_NETWORK, width);
mountMenuEntryW.addItem(GenericMenuSeparator); mountMenuEntryW.addIntroItems();
mountMenuEntryW.addItem(GenericMenuBack);
mountMenuEntryW.addItem(GenericMenuSeparatorLine);
CIPInput ipInput(LOCALE_NFS_IP, g_settings.network_nfs_ip[nr], LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2); CIPInput ipInput(LOCALE_NFS_IP, g_settings.network_nfs_ip[nr], LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2);
CStringInputSMS dirInput(LOCALE_NFS_DIR, dir, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE,"abcdefghijklmnopqrstuvwxyz0123456789-_.,:|!?/ "); CStringInputSMS dirInput(LOCALE_NFS_DIR, dir, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE,"abcdefghijklmnopqrstuvwxyz0123456789-_.,:|!?/ ");
CMenuOptionChooser *automountInput= new CMenuOptionChooser(LOCALE_NFS_AUTOMOUNT, automount, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true); CMenuOptionChooser *automountInput= new CMenuOptionChooser(LOCALE_NFS_AUTOMOUNT, automount, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true);
@@ -306,10 +304,8 @@ int CNFSUmountGui::menu()
{ {
int count = 0; int count = 0;
CFSMounter::MountInfos infos; CFSMounter::MountInfos infos;
CMenuWidget umountMenu(LOCALE_NFS_UMOUNT, NEUTRINO_ICON_NETWORK); CMenuWidget umountMenu(LOCALE_NFS_UMOUNT, NEUTRINO_ICON_NETWORK, width);
umountMenu.addItem(GenericMenuSeparator); umountMenu.addIntroItems();
umountMenu.addItem(GenericMenuBack);
umountMenu.addItem(GenericMenuSeparatorLine);
CFSMounter::getMountedFS(infos); CFSMounter::getMountedFS(infos);
for (CFSMounter::MountInfos::const_iterator it = infos.begin(); for (CFSMounter::MountInfos::const_iterator it = infos.begin();
it != infos.end();it++) it != infos.end();it++)
@@ -339,16 +335,14 @@ int CNFSSmallMenu::exec( CMenuTarget* parent, const std::string & actionKey )
{ {
if (actionKey.empty()) if (actionKey.empty())
{ {
CMenuWidget menu(LOCALE_NFSMENU_HEAD, NEUTRINO_ICON_NETWORK); CMenuWidget sm_menu(LOCALE_NFSMENU_HEAD, NEUTRINO_ICON_NETWORK, width);
CNFSMountGui mountGui; CNFSMountGui mountGui;
CNFSUmountGui umountGui; CNFSUmountGui umountGui;
menu.addItem(GenericMenuSeparator); sm_menu.addIntroItems();
menu.addItem(GenericMenuBack); sm_menu.addItem(new CMenuForwarder(LOCALE_NFS_REMOUNT, true, NULL, this, "remount"));
menu.addItem(GenericMenuSeparatorLine); sm_menu.addItem(new CMenuForwarder(LOCALE_NFS_MOUNT , true, NULL, & mountGui));
menu.addItem(new CMenuForwarder(LOCALE_NFS_REMOUNT, true, NULL, this, "remount")); sm_menu.addItem(new CMenuForwarder(LOCALE_NFS_UMOUNT, true, NULL, &umountGui));
menu.addItem(new CMenuForwarder(LOCALE_NFS_MOUNT , true, NULL, & mountGui)); return sm_menu.exec(parent, actionKey);
menu.addItem(new CMenuForwarder(LOCALE_NFS_UMOUNT, true, NULL, &umountGui));
return menu.exec(parent, actionKey);
} }
else if(actionKey.substr(0,7) == "remount") else if(actionKey.substr(0,7) == "remount")
{ {

View File

@@ -51,13 +51,16 @@ class CNFSMountGui : public CMenuTarget
CFSMounter::FS_Support m_nfs_sup; CFSMounter::FS_Support m_nfs_sup;
CFSMounter::FS_Support m_cifs_sup; CFSMounter::FS_Support m_cifs_sup;
CFSMounter::FS_Support m_lufs_sup; CFSMounter::FS_Support m_lufs_sup;
protected:
int width;
public: public:
CNFSMountGui(); CNFSMountGui();
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget* parent, const std::string & actionKey);
}; };
class CNFSUmountGui : public CMenuTarget class CNFSUmountGui : public CNFSMountGui
{ {
private: private:
@@ -69,7 +72,7 @@ class CNFSUmountGui : public CMenuTarget
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget* parent, const std::string & actionKey);
}; };
class CNFSSmallMenu : public CMenuTarget class CNFSSmallMenu : public CNFSMountGui
{ {
private: private: