Page 1 of 2

Bookmark All Tabs

Posted: Fri Dec 31, 2010 6:16 pm
by twinsen
The bookmark feature is good, however I'd like to bookmark all the tabs.
This incorporates those changes. It only saves the tabs for the current window, so its still not as advanced as browser session managers which can do multiple windows. But you can just create a new bookmark for each window.

* Exe: Explorer++_bookmark_all_tabs.7z http://members.iinet.net.au/~bertdb/rya ... ll_tabs.7z
* Src: Explorer++_bookmark_all_tabs_src.7z http://members.iinet.net.au/~bertdb/rya ... abs_src.7z

I haven't created a patch yet, but you can diff the files with 1.2 to see the changes.

Re: Bookmark All Tabs

Posted: Fri Dec 31, 2010 10:02 pm
by ajs
Hi twinsen,
very good job for all 4 fixes and also the address bar filter functionality.
Tomorrow I will merge all your changes with mines and create a "global patch" against commit 156. That should make life easier to David to merge everything in, since now there are about 10 pending changes which needs commit.
By the way, happy new year ;)

Re: Bookmark All Tabs

Posted: Sat Jan 01, 2011 8:03 pm
by ajs
Hi twinsen,
i looked at the code for this change, and it seemed quite complex for what it should do. So before merging, I decided to try the executable you linked and it didn't work on my computer: when you click on "bookmark all tabs" it just bookmarks the current one.
So I decided to rewrite the code myself. A simple "for" loop through all the tabs does the job nicely.
I have attached a new patch against commit 156

Re: Bookmark All Tabs

Posted: Sun Jan 02, 2011 5:53 pm
by twinsen
I'm surprised it didn't work. I've used it on multiple computers fine.
It was a simple for loop:

Code: Select all

				int NumTabs = TabCtrl_GetItemCount(m_hTabCtrl);
				for (int i = 0;i < NumTabs;i++)
				{
					TCITEM tcItem;
					tcItem.mask = TCIF_PARAM;
					TabCtrl_GetItem(m_hTabCtrl,i,&tcItem);
					int iIndex = (int)tcItem.lParam;

					LPITEMIDLIST dir = m_pShellBrowser[iIndex]->QueryCurrentDirectoryIdl();
					abi.pidlDirectories.push_back(dir);
				}
Its the same as the existing bookmark code. Only difference is a for loop and storing directories in a vector.

Not sure how that could fail.
Perhaps you had the exact same folders open already, so when you opened the bookmark it appeared to do nothing when in fact it closed all the existing tabs and re-opened the exact same ones. Its best to make sure you have different folders open so you can see how the feature works.

I haven't tested what your patch's behaviour is yet, but it appears to not work as intented. I'll show you what the expected behavior is with some pics (I was planning to document the new features sometime anyway).

Open one Explorer++ instance and open multiple folders.
Image
Now bookmark all the tabs (under a single bookmark).
Image
Give it a name.
Image
Note that the location contains all the tab directories.
Image
Click OK.
Close Explorer++, so it saves information to the registry or xml file.
Start Explorer++. Open a whole bunch of completely different folders.
For this example, we closed all the folders and opened "My Computer".
Image
Now open the single bookmark.
Image
Now your session is restored, and you don't need to reopen all those directories manually or by clicking multiple bookmarks.
Image
Note: When restoring a session, existing tabs are removed.
Note: As with all Explorer++ settings, be careful when you use multiple instances, since only settings from the last one you close gets saved! It would be good if there was a way to share persistent settings changes between all instances, so you don't lose data reguardless of the order you close them.

Re: Bookmark All Tabs

Posted: Sun Jan 02, 2011 9:43 pm
by ajs
twinsen wrote:I'm surprised it didn't work. I've used it on multiple computers fine.
It was a simple for loop:
Hi twinsen,
ok, I think we misunderstood each other. After your explanation, I tried again your executable and it indeed works as you explained.
The reason for misunderstanding is the name you gave to the feature.
For "bookmark all tabs" I understood that the command would bookmark all the existing tabs, creating an entry in the bookmark table for each single tab. The change I wrote does that (so if you have for example three tabs open, it will book all of them and create 3 entries in the bookmark table). I think many people would have the same understanding.
The change you made is definitely very good (after you explained the intended use ;) ) but I think it should be named differently, for example "save existing session" or something similar. I think this is a thing we should develop further: creating a "session" menu in the main menu and provide the same functions available for the bookmarks (so create, rename, delete and so on).
Let's get David opinion as well, but I am already in favor of your idea.

Re: Bookmark All Tabs

Posted: Mon Jan 03, 2011 7:16 pm
by twinsen
Yeah I think a separate session manager would be better than overloading bookmarks.
Having a bunch of directories with | between them seems simple enough, but now I'm getting used to using renamed tabs, and thats one more bit of data that I want to save.

It should just use the existing xml/registry format for saving tab state. That way even column sizes would be saved.

Code: Select all

<Tabs>
		<Tab name="0" Directory="dir" ApplyFilter="no" AutoArrange="yes" Filter="" ShowGridlines="yes" ShowHidden="yes" ShowInGroups="no" SortAscending="yes" SortMode="1" ViewMode="4" Locked="no" AddressLocked="no" UseCustomName="no" CustomName="">
			<Columns>
				<Column name="Generic" .../>
...
			</Columns>
		</Tab>
...
Here is an exe that supports saving sessions with renamed tabs:
http://members.iinet.net.au/~bertdb/rya ... sen_1.4.7z
It also supports duplicating and moving renamed tabs.

I might work on fixing the data loss problem before changing saving sessions. Its very annoying when you lose a session you purposely saved. Hopefully it would then be easier to save all windows state too.
http://www.explorerplusplus.com/phpBB3/ ... ?f=5&t=623

Re: Bookmark All Tabs

Posted: Mon Jan 03, 2011 9:38 pm
by ajs
ok, good news!
I think you can just look at the way bookmarks are managed (menu and dialog box) and replicate that for sessions (menu "sessions" and "organize sessions" dialog.
Also saving tab state would definitely be good!

Re: Bookmark All Tabs

Posted: Tue Jan 04, 2011 3:28 pm
by ajs
Updated patch against commit 161.
This patch includes only the changes for this function, without any another change made.

Re: Bookmark All Tabs

Posted: Fri Jan 07, 2011 12:06 pm
by twinsen
Found a bug when saving a large session with 12 tabs (but it was expected). My session was so large that it exceeded MAX_PATH. So at the moment you can only save the number of tabs until their paths concatenated together sum to MAX_PATH (with | inbetween each).
To fix this we need to switch to the other structure (ie one that supports MAX_PATH per path) and I'd prefer it to be part of the separate session manager.
The saving tab state on exit does not have this limitation (another reason why we should use the same saving/loading code as it).

Re: Bookmark All Tabs

Posted: Sat Jan 15, 2011 9:46 pm
by twinsen
I fixed the MAX_PATH limitation. I just switched it to a wstring (still haven't switched the structure over).
Demo Exe: http://members.iinet.net.au/~bertdb/rya ... sen_1.8.7z