← Back to team overview

torios-dev team mailing list archive

Re: Silliness of Syntax

 

On 01/25/2015 08:02 AM, Nio Wiklund wrote:
> Den 2015-01-25 14:52, Israel skrev:
>> On 01/25/2015 12:10 AM, Nio Wiklund wrote:
>>> Den 2015-01-25 04:26, Israel skrev:
>>>> ..
>>> Hi Israel,
>>>
>>> I'm glad you found it. I did not see it.
>>>
>>> But still, you'd better check that the menu is working properly, for
>>> example it is not good if the last line is hidden (unless the user
>>> scrolls). Then it is better to remove one of the options or move a group
>>> of options to a submenu.
>> Hi,
>> Poweroff is hidden, but I think this is not a problem, as there is a way
>> to shutdown easily.
>> But it might be good to move some of the items into a sub-menu anyhow,
>> to present the user with only a few choices.
>>
>> this version of OBI basically scans the disk to look in the tarballs
>> folders to select a tarball if selected contains something that doesn't
>> exist.
>> So I could move all the tarball things
>> Download
>> Make
>> Select
>> into a separate dialog
>> This would keep things that are "more advanced" from looking confusing
>> to a casual user and be very organized
>> Call the menu Custom Tarball Options  or something...
>>> Best regards
>>> Nio
>>>
> Hi Israel,
>
> That is a good idea (with a tarball submenu).
>
> In a desktop environment it may not be a problem, but if the menu is
> used in text mode, it is more awkward to poweroff.
>
> Just one question: What if there is no tarball? In such cases, it would
> be good to have a tarball option activated, maybe to select the tarball
> menu automatically, or at least select the entry for it in the main menu.
>
> Best regards
> Nio
Hi Nio,
This is a good idea. 
This is what code gets executed right before the menutitle gets set:

## Test to see if the tarball in 'selected' exists first
selectedtest=$(cat "${selected}")
if [ ! -f "${selectedtest}" ]
then
## if it doesn't pick the last one listed so there is some reasonable
choice available
  for i in "${tarpath}"/*.tar.[gx]z
  do
   target="$i"
  done
  echoout "Had to find a tarball.. OBI found $target"
# write tarball name
  echo "$target" > "$selected"
fi

I guess I could do something to check target or selected
if [ -z "$target" ]
then
defitem=t
#autoselect Tarball Menu
fi



I also decided to change the $menutitle a bit.

  thisOS=$(basename "${tarball/.tar*/}")
   if [ "$thisOS" == "ball" ]
   then
     echoout "Unlabeled OS to install: $thisOS"
     menutitle="Unlabeled OS to install: $thisOS"
   else
     echoout "OS to install: $thisOS"
     menutitle="OS to install: $thisOS"
   fi

I figure this will be more coherent in most cases... as long as it isn't
the generic tarball
something will show up and will make sense to the person who saved the
tarball

What do you think of this?

-- 
Regards

-Israel
ToriOS Team



Follow ups

References