Discussion:
[BitPim-devel] alternative filesystem view
Simon C
2005-11-12 09:42:36 UTC
Permalink
I've been playing with the filesystem tab, making it look more like a file
manager you'd find on a PC today.

The attached code allows the user to select the existing filesystem style or
the new style via the view menu.

The new style is a splitter window with a tree view for directories and a
list view for files. You can drag and drop files into the phone's file
system (not the other way yet). The files in the list can be sorted
according to size, alphabetical order by clicking on the column headers.

The code changes are mostly additions rather than changes.

Comments? I'd like to commit this to CVS in a couple of days.



Simon
Roger Binns
2005-11-13 07:06:25 UTC
Permalink
Post by Simon C
The attached code allows the user to select the existing filesystem style or
the new style via the view menu.
I would rather there is only style of view. If your new one is worse than
the existing then don't bother, and if it is better then replace the
existing. There isn't any good user interface reason to have multiple
view styles, and it will just make maintenance more difficult in the
future.

BTW could you post a screenshot?

Roger
Simon C
2005-11-13 15:19:57 UTC
Permalink
Post by Roger Binns
BTW could you post a screenshot?
Attached.

Simon
Stephen Wood
2005-11-13 15:40:50 UTC
Permalink
I like this better. I think it is a little more obvious to click on the +
rather than the triangle to open a directory.

Stephen
Post by Simon C
Post by Roger Binns
BTW could you post a screenshot?
Attached.
Simon
Joe Pham
2005-11-14 02:30:18 UTC
Permalink
Post by Roger Binns
I would rather there is only style of view.
Agreed. The new GUI looks good, and once thoroughly tested should replace the old GUI. I ran into this exception while trying to 'overwrite' a file. I'm planning to have a build Monday or Tuesday night pending Roger's availability to fix a couple of the 9800 problems, so if this could be tested by then, then we'll include it into the new build. Since we have a stable working filesystem, I don't want to rush this new code.

An unexpected exception has occurred.
Please see the help for details on what to do.

Traceback (most recent call last):
File "c:\Documents and Settings\dad\My Documents\cell_apps\bitpim\gui.py", line 1560, in OnCallback
event()
File "c:\Documents and Settings\dad\My Documents\cell_apps\bitpim\gui.py", line 138, in __call__
return apply(self.cb, self.args, self.kwargs)
File "c:\Documents and Settings\dad\My Documents\cell_apps\bitpim\gui.py", line 95, in __call__
apply(self.method, self.args+args, d)
File "c:\Documents and Settings\dad\My Documents\cell_apps\bitpim\gui.py", line 2627, in OnFileOverwriteResults
self.OnDirListing(parentdir)
AttributeError: 'FileSystemFileView' object has no attribute 'OnDirListing'

Variables by last 8 frames, innermost last

Frame ? in ./bp.py at line 79
profile = <function profile at 0x008DE9B0>
__file__ = './bp.py'
__name__ = '__main__'
__doc__ = 'Main entry point to Bitpim\n\nIt invokes BitPim in gui or commandline mode as a

Frame run in c:\Documents and Settings\dad\My Documents\cell_apps\bitpim\gui.py at line 482
args = (['./bp.py'],)
m = <gui.MainApp; proxy of C++ wxPyApp instance at _d01d8b00_p_wxPyApp>

Frame MainLoop in c:\python23\lib\site-packages\wx-2.6-msw-unicode\wx\_core.py at line 7493
self = <gui.MainApp; proxy of C++ wxPyApp instance at _d01d8b00_p_wxPyApp>

Frame MainLoop in c:\python23\lib\site-packages\wx-2.6-msw-unicode\wx\_core.py at line 6926
args = (<gui.MainApp; proxy of C++ wxPyApp instance at _d01d8b00_p_wxPyApp>,)
kwargs = Keys []
{}

Frame OnCallback in c:\Documents and Settings\dad\My Documents\cell_apps\bitpim\gui.py at line 1560
self = <gui.MainWindow; proxy of C++ wxFrame instance at _48569300_p_wxFrame>
event = <gui.HelperReturnEvent; proxy of C++ wxPyEvent instance at _70e69c02_p_wxPyEvent

Frame __call__ in c:\Documents and Settings\dad\My Documents\cell_apps\bitpim\gui.py at line 138
self = <gui.HelperReturnEvent; proxy of C++ wxPyEvent instance at _70e69c02_p_wxPyEvent

Frame __call__ in c:\Documents and Settings\dad\My Documents\cell_apps\bitpim\gui.py at line 95
self = <gui.Callback instance at 0x03030710>
args = (None, None)
d = Keys []
{}
kwargs = Keys []
{}

Frame OnFileOverwriteResults in c:\Documents and Settings\dad\My Documents\cell_apps\bitpim\gui.py at line 2627
mw = <gui.MainWindow; proxy of C++ wxFrame instance at _48569300_p_wxFrame>
parentdir = 'test'
exception = None
_ = None
self = <gui.FileSystemFileView; proxy of C++ wxPyListCtrl instance at _e0adf401_p_wxPyL


-Joe Pham




______________________________________________________________________
Call Anyone, Anytime, Anywhere in the World - FREE!
Free Internet calling from NetZero Voice
Visit http://www.netzerovoice.com today!
Simon C
2005-11-14 06:09:30 UTC
Permalink
Since
Post by Joe Pham
we have a stable working filesystem, I don't want to rush this new code.
Yes, I would feel more comfortable if we could try it out on a few more
phones before a build, I'll commit the changes after the build so we have
time for testing. I'll fix the bug you found.

Simon
Simon C
2005-11-15 09:02:25 UTC
Permalink
I've checked the changes into CVS, it is ready for testing.
I removed the support for the older view.
You can drag multiple files into the phone's filesystem, but dragging out is
not supported yet.
It you have access to non-windows platforms it would be helpful if you could
test to see if it works OK and post your results.

Thanks,

Simon
Joe Pham
2005-11-17 02:13:09 UTC
Permalink
A couple of quick comments on the new filesystem:

1. When I first switched to the filesystem tab, it attempted to read data from the phone and eventually timedout since my phone was not connected. I prefer the old filesystem's behavior.

2. dirs that have no subdirs should not have the + icons, which would disappear once expanded, ie dirs should know whether or not they have any subdir children.

-Joe Pham



______________________________________________________________________
Call Anyone, Anytime, Anywhere in the World - FREE!
Free Internet calling from NetZero Voice
Visit http://www.netzerovoice.com today!
Roger Binns
2005-11-17 07:09:53 UTC
Permalink
Post by Joe Pham
2. dirs that have no subdirs should not have the + icons,
which would disappear once expanded, ie dirs should know
whether or not they have any subdir children.
That can only be done by predicting the future, or by reading
all subdirectories when all the user asked for is the parent
directory.

There are many UIs that take the old approach. It will
also behave correctly if a subdirectory does appear.

Roger
Simon C
2005-11-17 02:39:10 UTC
Permalink
Post by Joe Pham
1. When I first switched to the filesystem tab, it attempted to read data
from the phone and eventually timedout since my phone was not connected.
I prefer the old filesystem's behavior.
I'll fix this, what you are seeing is not what I intended.
Post by Joe Pham
2. dirs that have no subdirs should not have the + icons, which would
disappear once expanded, ie dirs should know whether or not they have any
subdir children.
I stayed with the existing design to read subdirectories on user demand and
remove the + once the directory has been read, this meant that the timing to
be similar to the old view.
Reading the entire filesystem when it was first expanded takes about 20
seconds on my old 4400. Reading 2 dirs deep is similar.
Do you think this delay is acceptable; I can change the code to behave like
this.

Simon
Simon C
2005-11-19 16:13:00 UTC
Permalink
Post by Joe Pham
2. dirs that have no subdirs should not have the + icons, which would
disappear once expanded, ie dirs should know whether or not they have any
subdir children.
I noticed you added this feature. The timing of the file viewer on older
phones has been affected making bitpim slower.
The vx6100 timing on the root expansion has gone from 1200ms to 3100ms.
On the vx4400 it has gone from 800ms to about 1700ms.
Expanding other directories is slower depending on their content. The extra
delay is incurred every time the directory is expanded. There is a more
traffic over the serial port when manipulating the file system.
A once off complete filesystem read would be a more efficient way to achieve
the same result, the initial delay would be higher but subsequent use would
not be slowed down.

When an expanded tree view is collapsed and re-expanded (or refreshed) it
visibly collapses all of it's subdirectories even if they were previously
expanded, the previous behavior of the old filesystem view was to leave
subdirectories in the same state they were previously.

Simon
Joe Pham
2005-11-20 00:19:20 UTC
Permalink
The timing of the file viewer on older phones has been affected
making bitpim slower.
More accurately, the timing of listing dir that contains subdirs increases. I just updated some code that should help a bit, but that's still true. It's a trade-off for a correct dir tree display, which is just a my personal GUI preference. I just want to see if it's can be done and what's the timing impact.
When an expanded tree view is collapsed and re-expanded (or
refreshed) it visibly collapses all of it's subdirectories even if
they were previously expanded
This is exactly what I want, I want to have an accurate representation of the Filesystem (dirs and files) for each and every request.

-Joe Pham



______________________________________________________________________
Call Anyone, Anytime, Anywhere in the World - FREE!
Free Internet calling from NetZero Voice
Visit http://www.netzerovoice.com today!
Roger Binns
2005-11-20 03:16:15 UTC
Permalink
Post by Joe Pham
It's a trade-off for a correct dir tree display, which is
just a my personal GUI preference.
I am with Simon on this one. I don't think there is a benefit
to being hyper accurate. The plus doesn't mean that an item
has subdirectories, just that it could.

I just want to see if it's can be done and what's the timing impact.
Post by Joe Pham
This is exactly what I want, I want to have an accurate
representation of the Filesystem (dirs and files) for each
and every request.
It looks like your new code tries to remember the setting for
each directory. However this is only going to work if nothing
changes the directory such as the user syncing or playing with
the phone directly.

Roger
Simon C
2005-11-20 01:00:29 UTC
Permalink
Post by Joe Pham
More accurately, the timing of listing dir that contains subdirs
increases. I just updated some code that should help a bit, but that's
still true. It's a trade-off for a correct dir tree display, which is
just a my personal GUI preference. I just want to see if it's can be done
and what's the timing impact.
I've been experimenting with this as well to see if there is some sort of
compromise between responsiveness and GUI preferences and accuracy.
I have taken what you did and worked with it to help with the timing.
It reads the entire directory structure once, this causes the initial expand
to take longer (a little less than double) but subsequent directory
expansion takes zero time, showing the contents of a directory is also
faster although this still queries the phone each time to ensure the
Joe Pham
2005-11-20 05:12:09 UTC
Permalink
I don't think there is a benefit to being hyper accurate.
Just a pesonal GUI preference. I'd like to have it if it's not a big deal, and it doesn't seem to be at this point.
However this is only going to work if nothing changes the directory
such as the user syncing or playing with the phone directly.
Exactly why I'd like to query the phone for each and every action: the filesystem view is stateless.

-Joe Pham




______________________________________________________________________
Call Anyone, Anytime, Anywhere in the World - FREE!
Free Internet calling from NetZero Voice
Visit http://www.netzerovoice.com today!
Roger Binns
2005-11-20 06:47:57 UTC
Permalink
Post by Joe Pham
the filesystem view is stateless.
Simon C
2005-11-20 09:32:45 UTC
Permalink
Post by Joe Pham
the filesystem view is stateless.
Joe Pham
2005-11-20 19:11:42 UTC
Permalink
Joe Pham
2005-11-20 19:21:44 UTC
Permalink
I prefer the original way of only updating the parts of the file
system that have been queried from the phone rather than deleting
all and starting again
How do you ensure that the last query was from the same phone, or that the phone's file system has not changed since?
This is way that filesystem viewers work on windows and linux and
would be what users would be expecting.
And they also have mount/dismount for their filesystems.

-Joe Pham




______________________________________________________________________
Call Anyone, Anytime, Anywhere in the World - FREE!
Free Internet calling from NetZero Voice
Visit http://www.netzerovoice.com today!
Roger Binns
2005-11-20 20:13:03 UTC
Permalink
Post by Joe Pham
How do you ensure that the last query was from the same phone,
or that the phone's file system has not changed since?
The way the original code worked was that when you opened a
directory it showed whatever the contents were the last time
it was opened. It then requests the contents (which happen
in the background thread). When those come back the displayed
contents are adjusted to match what just came back. That gives
really good performance and interactivity as well as being
accurate.
Post by Joe Pham
This is way that filesystem viewers work on windows and linux and
would be what users would be expecting.
And they also have mount/dismount for their filesystems.
But we aren't talking about mounting/mounting. We are talking
about displaying hierarchical information.

If you want to be different, then consider this:

http://www.sgi.com/fun/freeware/3d_navigator.html

Roger
Joe Pham
2005-11-20 20:51:33 UTC
Permalink
Post by Roger Binns
The way the original code worked was that when you opened a
directory it showed whatever the contents were the last time it was
opened. It then requests the contents (which happen in the
background thread). When those come back the displayed contents are
adjusted to match what just came back.
That's also how the new code works.
Post by Roger Binns
But we aren't talking about mounting/mounting. We are talking about
displaying hierarchical information.
What I meant by that is the OS keeps track of the state/status of the filesystem, which is different than BitPim's filesystem view.

-Joe Pham




______________________________________________________________________
Call Anyone, Anytime, Anywhere in the World - FREE!
Free Internet calling from NetZero Voice
Visit http://www.netzerovoice.com today!
Roger Binns
2005-11-20 21:25:11 UTC
Permalink
Post by Joe Pham
What I meant by that is the OS keeps track of the
state/status of the filesystem, which is different
than BitPim's filesystem view.
That isn't true :-) A program like Explorer effectively
polls the filesystem to maintain what it is showing in
response to user interaction.

It can register a change notification with the kernel.
However that may or may not fire, and when it does
can include details of the changes (eg file foo was
deleted) or no details at all (just that a change has
happened). (And if the directory is on a networked
filesystem then that may or may not even do change
notifications).

The story is the same on Linux. Any program that shows
filesystem information has to be aware that contents
can change underneath them, and operations can take an
unknowable amount of time.

Roger
Simon C
2005-11-20 20:55:03 UTC
Permalink
Post by Joe Pham
I prefer the original way of only updating the parts of the file
system that have been queried from the phone rather than deleting
all and starting again
How do you ensure that the last query was from the same phone, or that the
phone's file system has not changed since?
Without the phone being able to send events every time its filesystem
changes the viewer is always going to be out of date. It can only show
historical data. It is impossible to 100% guarantee that the data is
accurate; I don't think the changes you made make a significant improvement
in accuracy as the directory structure almost never changes.
The original treeview displayed the available data and updated it as new
data came from the phone, I think we should continue with this design; it
has worked OK for users for a few years now. All I intended when changing
the view was to make the GUI function similarly to filesystem viewers on
windows and linux, I reused all the code from the old class with respect to
phone communication, there is more risk that we will break something on an
untested phone if the way we communicate with phone is changed.

For changing phones, we should add a method in the viewer that gets called
when the phone changes, this would delete the tree view contents and return
the viewer to it's initial state.

Simon
Simon C
2005-11-20 20:57:19 UTC
Permalink
Post by Joe Pham
Post by Roger Binns
The way the original code worked was that when you opened a
directory it showed whatever the contents were the last time it was
opened. It then requests the contents (which happen in the
background thread). When those come back the displayed contents are
adjusted to match what just came back.
That's also how the new code works.
Not quite, any information that is not requeried is deleted. For example if
you have the tree view fully expanded and you collapse the root and
re-expand it all the information about sub-directories other than those in
the root is deleted.

Simon
Joe Pham
2005-11-20 21:21:49 UTC
Permalink
We're spending way too much time on this. Simon, since you came up with the new GUI code, I'd leave the implementation to you. The only thing I ask is an accurate display of the filesystem contents following each & every action.

-Joe Pham




______________________________________________________________________
Call Anyone, Anytime, Anywhere in the World - FREE!
Free Internet calling from NetZero Voice
Visit http://www.netzerovoice.com today!
Simon C
2005-11-21 17:17:49 UTC
Permalink
I made some more changes.
The expect behavior is:
Entire directory structure is read when root first expanded (there is a
slight delay here).
Individual directories are refreshed from phone and tree view updated when:
-Directory expanded
-Directory added
-Directory removed
-Different directory selected
-Files restored
If a new directory is discovered it will be fully recursed to get the
directory structure under it (e.g. someone plugging in an SD card after
starting bitpim)
The file view is never cached and always queried from phone when the
directory selection is changed or files are added, deleted or overwritten.

The file viewer subscribes to the phone model changed event and will reset
its contents if it occurs.

Can someone test this on non-windows.

Thanks,

Simon
Stephen Wood
2005-11-22 16:18:42 UTC
Permalink
I tried it on Linux last night. Seems to work fine.

I do get triangles instead of boxes with + or - in them. I didn't yet check
if my wx widgets are up to the save version as currently recommended.

Stephen
Post by Simon C
Can someone test this on non-windows.
Thanks,
Simon
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Simon C
2005-11-22 17:29:43 UTC
Permalink
I think you are seeing the MAC style of twister buttons.

The triangle is an arrow that points right when collapsed and down when
expanded.

I've attached a version of gui.py that attempts to turn this off.



Simon







_____

From: bitpim-devel-***@lists.sourceforge.net
[mailto:bitpim-devel-***@lists.sourceforge.net] On Behalf Of Stephen Wood
Sent: Tuesday, November 22, 2005 8:19 AM
To: bitpim-***@lists.sourceforge.net
Subject: Re: [BitPim-devel] alternative filesystem view



I tried it on Linux last night. Seems to work fine.

I do get triangles instead of boxes with + or - in them. I didn't yet check
if my wx widgets are up to the save version as currently recommended.

Stephen



On 11/21/05, Simon C <***@sbcglobal.net> wrote:


Can someone test this on non-windows.

Thanks,

Simon




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628
<http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click>
&alloc_id=16845&op=click
Stephen Wood
2005-11-23 04:52:29 UTC
Permalink
I still get the triangles with this version.

Stephen
Post by Simon C
I think you are seeing the MAC style of twister buttons.
The triangle is an arrow that points right when collapsed and down when
expanded.
I've attached a version of gui.py that attempts to turn this off.
Simon
Roger Binns
2005-11-28 04:07:28 UTC
Permalink
Post by Simon C
The triangle is an arrow that points right when collapsed and down when
expanded.
I just tried the code out on the Mac. That is how things look. One
suggestion I have is that when a directory is empty there should be
some indication of that fact on the right. Otherwise it looks like
the program is hung or busy as you wait for the directory to fill in
(that never does).

Roger
Simon C
2005-11-23 05:15:39 UTC
Permalink
My guess is that wxPython does not support the + style of tree view on that
version of Linux (which one is it ?) which UI are you using (kde, gnome
etc.) I'll do some googling.

Which version of wxPython/widgets do you have?

I noticed on windows that I cannot make the triangles appear even when I
choose that style.

Do the column sorters work in the file view? (Click the column titles)



Simon



_____

From: bitpim-devel-***@lists.sourceforge.net
[mailto:bitpim-devel-***@lists.sourceforge.net] On Behalf Of Stephen Wood
Sent: Tuesday, November 22, 2005 8:52 PM
To: bitpim-***@lists.sourceforge.net
Subject: Re: [BitPim-devel] alternative filesystem view



I still get the triangles with this version.

Stephen

On 11/22/05, Simon C <***@sbcglobal.net> wrote:

I think you are seeing the MAC style of twister buttons.

The triangle is an arrow that points right when collapsed and down when
expanded.

I've attached a version of gui.py that attempts to turn this off.



Simon
Stephen Wood
2005-11-23 05:30:07 UTC
Permalink
I am using Fedora Core with Gnome. I am running BitPim using python2.3 and
wxPython2.6-gtk2-unicode-2.6.1.0-1.

The column sorters seem to work fine.

Stephen
Post by Simon C
My guess is that wxPython does not support the + style of tree view on
that version of Linux (which one is it ?) which UI are you using (kde, gnome
etc.) I'll do some googling.
Which version of wxPython/widgets do you have?
I noticed on windows that I cannot make the triangles appear even when I
choose that style.
Do the column sorters work in the file view? (Click the column titles)
Simon
------------------------------
*Sent:* Tuesday, November 22, 2005 8:52 PM
*Subject:* Re: [BitPim-devel] alternative filesystem view
I still get the triangles with this version.
Stephen
I think you are seeing the MAC style of twister buttons.
The triangle is an arrow that points right when collapsed and down when
expanded.
I've attached a version of gui.py that attempts to turn this off.
Simon
Simon C
2005-11-28 04:15:02 UTC
Permalink
Post by Roger Binns
Post by Simon C
The triangle is an arrow that points right when collapsed and down when
expanded.
I just tried the code out on the Mac. That is how things look. One
suggestion I have is that when a directory is empty there should be
some indication of that fact on the right. Otherwise it looks like
the program is hung or busy as you wait for the directory to fill in
(that never does).
The arrows show for empty directories?
Maybe a special entry in the file view called "empty directory" or "This
directory is empty"?

Simon
Roger Binns
2005-11-28 04:16:18 UTC
Permalink
Post by Simon C
The arrows show for empty directories?
No.
Post by Simon C
Maybe a special entry in the file view called "empty directory" or "This
directory is empty"?
Yes, that is what I was thinking of as I was looking at 3/4 of my
screen being empty white space and wondering why BitPim hadn't put
anything there :-)

Roger
Simon C
2005-11-30 02:02:10 UTC
Permalink
Post by Roger Binns
Post by Simon C
Maybe a special entry in the file view called "empty directory" or
"This
directory is empty"?
Yes, that is what I was thinking of as I was looking at 3/4 of my
screen being empty white space and wondering why BitPim hadn't put
anything there :-)
I've checked in a change to show a message if there are no files in the
directory.
I'm open to suggestions as to the exact words to use :)

Simon

Loading...