← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2463: Move file list status bar buttons to the toolbar

 

------------------------------------------------------------
revno: 2463
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2011-03-18 22:48:06 +0100
message:
  Move file list status bar buttons to the toolbar
modified:
  changelog.txt
  dwt/include/dwt/widgets/ToolBar.h
  dwt/src/widgets/ToolBar.cpp
  help/window_file_list.html
  win32/DirectoryListingFrame.cpp
  win32/DirectoryListingFrame.h
  win32/MainWindow.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'changelog.txt'
--- changelog.txt	2011-03-16 18:23:54 +0000
+++ changelog.txt	2011-03-18 21:48:06 +0000
@@ -10,6 +10,7 @@
 * [L#730828] Prevent a stack overflow when searching within too big file lists (poy)
 * [L#710359] Add finished downloads log (emtee)
 * Save and restore the current directory of file lists (poy)
+* Move file list status bar buttons to the toolbar (poy)
 
 -- 0.782 2011-03-05 --
 * Prevent a remote crash triggered via malformed user commands (poy)

=== modified file 'dwt/include/dwt/widgets/ToolBar.h'
--- dwt/include/dwt/widgets/ToolBar.h	2011-01-02 17:12:02 +0000
+++ dwt/include/dwt/widgets/ToolBar.h	2011-03-18 21:48:06 +0000
@@ -95,11 +95,12 @@
 	/**
 	* add a button to the toolbar. this will only create the internal structures for holding the
 	* button; call setLayout when all buttons have been created to actually add them to the bar.
+	* @param showText show text on the button itself (otherwise, it will only be used for tooltips).
 	*/
-	void addButton(const std::string& id, const IconPtr& icon, const IconPtr& hotIcon, const tstring& text, unsigned helpId = 0,
-		const Dispatcher::F& f = 0, const DropDownFunction& dropDownF = 0);
-	void addButton(const std::string& id, int image, const tstring& text, unsigned helpId = 0,
-		const Dispatcher::F& f = 0, const DropDownFunction& dropDownF = 0);
+	void addButton(const std::string& id, const IconPtr& icon, const IconPtr& hotIcon, const tstring& text, bool showText = false,
+		unsigned helpId = 0, const Dispatcher::F& f = 0, const DropDownFunction& dropDownF = 0);
+	void addButton(const std::string& id, int image, const tstring& text, bool showText = false,
+		unsigned helpId = 0, const Dispatcher::F& f = 0, const DropDownFunction& dropDownF = 0);
 
 	/**
 	* fills a vector with ids of the current buttons, to represent the current state of the

=== modified file 'dwt/src/widgets/ToolBar.cpp'
--- dwt/src/widgets/ToolBar.cpp	2011-03-02 21:33:22 +0000
+++ dwt/src/widgets/ToolBar.cpp	2011-03-18 21:48:06 +0000
@@ -83,8 +83,8 @@
 	return Point(rect.right, rect.bottom - rect.top);
 }
 
-void ToolBar::addButton(const std::string& id, const IconPtr& icon, const IconPtr& hotIcon, const tstring& text, unsigned helpId,
-						const Dispatcher::F& f, const DropDownFunction& dropDownF)
+void ToolBar::addButton(const std::string& id, const IconPtr& icon, const IconPtr& hotIcon, const tstring& text, bool showText,
+	unsigned helpId, const Dispatcher::F& f, const DropDownFunction& dropDownF)
 {
 	if(icon) {
 		if(!itsNormalImageList)
@@ -97,11 +97,11 @@
 		itsHotImageList->add(*hotIcon);
 	}
 
-	addButton(id, icon ? itsNormalImageList->size() - 1 : I_IMAGENONE, text, helpId, f, dropDownF);
+	addButton(id, icon ? itsNormalImageList->size() - 1 : I_IMAGENONE, text, showText, helpId, f, dropDownF);
 }
 
-void ToolBar::addButton(const std::string& id, int image, const tstring& text, unsigned helpId,
-						const Dispatcher::F& f, const DropDownFunction& dropDownF)
+void ToolBar::addButton(const std::string& id, int image, const tstring& text, bool showText,
+	unsigned helpId, const Dispatcher::F& f, const DropDownFunction& dropDownF)
 {
 	TBBUTTON tb = { 0 };
 	tb.iBitmap = image;
@@ -110,13 +110,21 @@
 	tb.fsStyle = BTNS_AUTOSIZE;
 	if(dropDownF)
 		tb.fsStyle |= f ? BTNS_DROPDOWN : BTNS_WHOLEDROPDOWN;
-	/* we could pass the string to the toolbar and let it handle tooltips by itself; unfortunately
-	* it messes toolbar customization with shift + drag. so resort to handling TBN_GETINFOTIP... */
-	static tstring emptyString;
-	tb.iString = reinterpret_cast<INT_PTR>(emptyString.c_str());
+	if(showText)
+		tb.fsStyle |= BTNS_SHOWTEXT;
 
 	Button button = { tb, id, text, helpId, f, dropDownF };
 	buttons.push_back(button);
+
+	Button& b = buttons.back();
+	if(hasStyle(CCS_ADJUSTABLE)) {
+		/* in a customizable toolbar, shift + drag gets messed up when we add text here; so resort
+		to an empty string. not a problem for tooltips since we manually handle TBN_GETINFOTIP. */
+		static tstring emptyString;
+		b.button.iString = reinterpret_cast<INT_PTR>(emptyString.c_str());
+	} else {
+		b.button.iString = sendMessage(TB_ADDSTRING, 0, reinterpret_cast<LPARAM>(b.text.c_str()));
+	}
 }
 
 std::vector<std::string> ToolBar::getLayout() const {

=== modified file 'help/window_file_list.html'
--- help/window_file_list.html	2011-02-21 19:48:45 +0000
+++ help/window_file_list.html	2011-03-18 21:48:06 +0000
@@ -10,6 +10,7 @@
 		<img src="Directory.ico" width="16" height="16" alt="File List"/>
 		File List
 	</h1>
+
 <h2>Toolbar</h2>
 <dl style="margin-left: 40px;">
 	<dt><img src="Left.ico" width="16" height="16" alt="Back"/> Back</dt>
@@ -18,11 +19,35 @@
 	<dd cshelp="IDH_FILE_LIST_FORWARD">Switch to the next visited directory. This command can also be accessed via the Ctrl+Right keyboard shortcut.</dd>
 	<dt><img src="Up.ico" width="16" height="16" alt="Up one level"/> Up one level</dt>
 	<dd cshelp="IDH_FILE_LIST_UP">Switch to the parent directory. This command can also be accessed via the Ctrl+Up keyboard shortcut.</dd>
-</dl>
+  <dt>Subtract list</dt>
+  <dd cshelp="IDH_FILE_LIST_SUBSTRACT">Compare this list to another list, and only show the differences between each. Useful to see new items added by an user to his file list.</dd>
+  <dt>Match queue</dt>
+  <dd cshelp="IDH_FILE_LIST_MATCH_QUEUE">Search the list for items you are currently downloading; found items will be automatically added as sources for your current downloads.</dd>
+  <dt><img src="Search.ico" width="16" height="16" alt="Find"/> Find</dt>
+  <dd cshelp="IDH_FILE_LIST_FIND">Toggle the visibility of the search box, which allows searching
+  within the file list.</dd>
+</dl>
+
+<h2>Search row (optional - below the toolbar)</h2>
+A search row may be shown right below the toolbar to allow looking for files in the current file
+list. Its visibility is controlled by the "Find &#8711;" button.
+<dl style="margin-left: 40px;">
+  <dt>Text-box (left)</dt>
+  <dd cshelp="IDH_FILE_LIST_SEARCH_BOX">Enter your search terms here. The most recent searches can
+  be accessed by unfolding the list contained within this box.</dd>
+  <dt><img src="Left.ico" width="16" height="16" alt="Previous"/> Previous</dt>
+  <dd cshelp="IDH_FILE_LIST_FIND_PREV">Find items that match the search strings specified in the
+  text-box. The search starts from the current selection and goes backwards.</dd>
+  <dt><img src="Right.ico" width="16" height="16" alt="Next"/> Next</dt>
+  <dd cshelp="IDH_FILE_LIST_FIND_NEXT">Find items that match the search strings specified in the
+  text-box. The search starts from the current selection and goes forward.</dd>
+</dl>
+
 <h2>Folder list (left)</h2>
 <p cshelp="IDH_FILE_LIST_DIRS">
 Folders available in the current file list. Left-click on a folder to show the contents of that folder in the window on the right; right-click to open a menu that allows you to download the whole folder.
 </p>
+
 <h2>Contents (right)</h2>
 <p cshelp="IDH_FILE_LIST_FILES">
 Shows the contents of the folder selected in the folder list (window on the left). Right-click to get menu options.
@@ -52,23 +77,7 @@
   </dd>
 </dl>
 
-<h2>Search row (bottom)</h2>
-A search row may be shown right above the status bar to allow looking for files in the current file
-list. Its visibility is controlled by the "Find &#8710;" button.
-<dl style="margin-left: 40px;">
-  <dt>Text-box (left)</dt>
-  <dd cshelp="IDH_FILE_LIST_SEARCH_BOX">Enter your search terms here. The most recent searches can
-  be accessed by unfolding the list contained within this box.</dd>
-  <dt>Previous</dt>
-  <dd cshelp="IDH_FILE_LIST_FIND_PREV">Find items that match the search strings specified in the
-  text-box. The search starts from the current selection and goes backwards.</dd>
-  <dt>Next</dt>
-  <dd cshelp="IDH_FILE_LIST_FIND_NEXT">Find items that match the search strings specified in the
-  text-box. The search starts from the current selection and goes forward.</dd>
-</dl>
-
 <h2>Status bar (bottom)</h2>
-<h3>Indicators:</h3>
 <dl style="margin-left: 40px;">
   <dt>Speed</dt>
   <dd>The speed the current file list was downloaded.</dd>
@@ -81,15 +90,5 @@
   <dt>Size (right)</dt>
   <dd>Total amount of bytes represented by the currently selected items; or by all items in the current directory if there is no item selected.</dd>
 </dl>
-<h3>Buttons:</h3>
-<dl style="margin-left: 40px;">
-  <dt>Subtract list</dt>
-  <dd cshelp="IDH_FILE_LIST_SUBSTRACT">Compare this list to another list, and only show the differences between each. Useful to see new items added by an user to his file list.</dd>
-  <dt>Match queue</dt>
-  <dd cshelp="IDH_FILE_LIST_MATCH_QUEUE">Search the list for items you are currently downloading; found items will be automatically added as sources for your current downloads.</dd>
-  <dt>Find</dt>
-  <dd cshelp="IDH_FILE_LIST_FIND">Toggle the visibility of the search box, which allows searching
-  within the file list.</dd>
-</dl>
 </body>
 </html>

=== modified file 'win32/DirectoryListingFrame.cpp'
--- win32/DirectoryListingFrame.cpp	2011-03-18 20:38:32 +0000
+++ win32/DirectoryListingFrame.cpp	2011-03-18 21:48:06 +0000
@@ -194,13 +194,10 @@
 	rebar(0),
 	pathBox(0),
 	grid(0),
+	searchGrid(0),
+	searchBox(0),
 	dirs(0),
 	files(0),
-	searchGrid(0),
-	searchBox(0),
-	listDiff(0),
-	matchQueue(0),
-	find(0),
 	speed(aSpeed),
 	dl(new DirectoryListing(aUser)),
 	user(aUser),
@@ -213,43 +210,13 @@
 {
 	grid = addChild(Grid::Seed(2, 1));
 	grid->column(0).mode = GridInfo::FILL;
-	grid->row(0).mode = GridInfo::FILL;
-	grid->row(0).align = GridInfo::STRETCH;
-	grid->row(1).size = 0;
-	grid->row(1).mode = GridInfo::STATIC;
+	grid->row(0).size = 0;
+	grid->row(0).mode = GridInfo::STATIC;
+	grid->row(1).mode = GridInfo::FILL;
+	grid->row(1).align = GridInfo::STRETCH;
 	grid->setSpacing(0);
 
 	{
-		auto paned = grid->addChild(SplitterContainer::Seed(0.3));
-
-		dirs = paned->addChild(WidgetDirs::Seed());
-		dirs->setHelpId(IDH_FILE_LIST_DIRS);
-		addWidget(dirs);
-
-		dirs->setNormalImageList(WinUtil::fileImages);
-		dirs->onSelectionChanged(std::bind(&DirectoryListingFrame::handleSelectionChanged, this));
-		dirs->onKeyDown(std::bind(&DirectoryListingFrame::handleKeyDownDirs, this, _1));
-		dirs->onSysKeyDown(std::bind(&DirectoryListingFrame::handleKeyDownDirs, this, _1));
-		dirs->onContextMenu(std::bind(&DirectoryListingFrame::handleDirsContextMenu, this, _1));
-		dirs->onXMouseUp(std::bind(&DirectoryListingFrame::handleXMouseUp, this, _1));
-
-		files = paned->addChild(WidgetFiles::Seed());
-		files->setHelpId(IDH_FILE_LIST_FILES);
-		addWidget(files);
-
-		files->setSmallImageList(WinUtil::fileImages);
-		WinUtil::makeColumns(files, filesColumns, COLUMN_LAST, SETTING(DIRECTORYLISTINGFRAME_ORDER), SETTING(DIRECTORYLISTINGFRAME_WIDTHS));
-		files->setSort(COLUMN_FILENAME);
-
-		files->onSelectionChanged([this] { GCC_WTF->callAsync([&] { updateStatus(); }); });
-		files->onDblClicked(std::bind(&DirectoryListingFrame::handleDoubleClickFiles, this));
-		files->onKeyDown(std::bind(&DirectoryListingFrame::handleKeyDownFiles, this, _1));
-		files->onSysKeyDown(std::bind(&DirectoryListingFrame::handleKeyDownFiles, this, _1));
-		files->onContextMenu(std::bind(&DirectoryListingFrame::handleFilesContextMenu, this, _1));
-		files->onXMouseUp(std::bind(&DirectoryListingFrame::handleXMouseUp, this, _1));
-	}
-
-	{
 		Button::Seed cs = WinUtil::Seeds::button;
 
 		searchGrid = grid->addChild(Grid::Seed(1, 3));
@@ -277,28 +244,42 @@
 		button->setImage(WinUtil::buttonIcon(IDI_RIGHT));
 		button->onClicked(std::bind(&DirectoryListingFrame::handleFind, this, false));
 		addWidget(button);
-
-		cs.caption = T_("Subtract list");
-		listDiff = addChild(cs);
-		listDiff->setHelpId(IDH_FILE_LIST_SUBSTRACT);
-		listDiff->onClicked(std::bind(&DirectoryListingFrame::handleListDiff, this));
-
-		cs.caption = T_("Match queue");
-		matchQueue = addChild(cs);
-		matchQueue->setHelpId(IDH_FILE_LIST_MATCH_QUEUE);
-		matchQueue->onClicked(std::bind(&DirectoryListingFrame::handleMatchQueue, this));
-
-		cs.caption = T_("Find") + _T(" \u2206") /* up arrow */;
-		find = addChild(cs);
-		find->setHelpId(IDH_FILE_LIST_FIND);
-		find->setImage(WinUtil::buttonIcon(IDI_SEARCH));
-		find->onClicked(std::bind(&DirectoryListingFrame::handleFindToggle, this));
 	}
 
 	searchGrid->setEnabled(false);
 	searchGrid->setVisible(false);
 
 	{
+		auto paned = grid->addChild(SplitterContainer::Seed(0.3));
+
+		dirs = paned->addChild(WidgetDirs::Seed());
+		dirs->setHelpId(IDH_FILE_LIST_DIRS);
+		addWidget(dirs);
+
+		dirs->setNormalImageList(WinUtil::fileImages);
+		dirs->onSelectionChanged(std::bind(&DirectoryListingFrame::handleSelectionChanged, this));
+		dirs->onKeyDown(std::bind(&DirectoryListingFrame::handleKeyDownDirs, this, _1));
+		dirs->onSysKeyDown(std::bind(&DirectoryListingFrame::handleKeyDownDirs, this, _1));
+		dirs->onContextMenu(std::bind(&DirectoryListingFrame::handleDirsContextMenu, this, _1));
+		dirs->onXMouseUp(std::bind(&DirectoryListingFrame::handleXMouseUp, this, _1));
+
+		files = paned->addChild(WidgetFiles::Seed());
+		files->setHelpId(IDH_FILE_LIST_FILES);
+		addWidget(files);
+
+		files->setSmallImageList(WinUtil::fileImages);
+		WinUtil::makeColumns(files, filesColumns, COLUMN_LAST, SETTING(DIRECTORYLISTINGFRAME_ORDER), SETTING(DIRECTORYLISTINGFRAME_WIDTHS));
+		files->setSort(COLUMN_FILENAME);
+
+		files->onSelectionChanged([this] { GCC_WTF->callAsync([&] { updateStatus(); }); });
+		files->onDblClicked(std::bind(&DirectoryListingFrame::handleDoubleClickFiles, this));
+		files->onKeyDown(std::bind(&DirectoryListingFrame::handleKeyDownFiles, this, _1));
+		files->onSysKeyDown(std::bind(&DirectoryListingFrame::handleKeyDownFiles, this, _1));
+		files->onContextMenu(std::bind(&DirectoryListingFrame::handleFilesContextMenu, this, _1));
+		files->onXMouseUp(std::bind(&DirectoryListingFrame::handleXMouseUp, this, _1));
+	}
+
+	{
 		// create the rebar after the rest to make sure it doesn't grab the default focus.
 		rebar = addChild(Rebar::Seed());
 
@@ -308,14 +289,14 @@
 		ToolBarPtr toolbar = addChild(seed);
 
 		StringList ids;
-		auto addButton = [&toolbar, &ids](unsigned icon, const tstring& text, unsigned helpId, const dwt::Dispatchers::VoidVoid<>::F& f) {
+		auto addButton = [&toolbar, &ids](unsigned icon, const tstring& text, bool showText, unsigned helpId, const dwt::Dispatchers::VoidVoid<>::F& f) {
 			ids.push_back(std::string(1, '0' + ids.size()));
-			toolbar->addButton(ids.back(), WinUtil::toolbarIcon(icon), 0, text, helpId, f);
+			toolbar->addButton(ids.back(), icon ? WinUtil::toolbarIcon(icon) : 0, 0, text, showText, helpId, f);
 		};
-		addButton(IDI_LEFT, T_("Back"), IDH_FILE_LIST_BACK, [this] { back(); });
-		addButton(IDI_RIGHT, T_("Forward"), IDH_FILE_LIST_FORWARD, [this] { this->forward(); }); // explicit ns (vs std::forward)
+		addButton(IDI_LEFT, T_("Back"), false, IDH_FILE_LIST_BACK, [this] { back(); });
+		addButton(IDI_RIGHT, T_("Forward"), false, IDH_FILE_LIST_FORWARD, [this] { this->forward(); }); // explicit ns (vs std::forward)
 		ids.push_back(string());
-		addButton(IDI_UP, T_("Up one level"), IDH_FILE_LIST_UP, [this] { up(); });
+		addButton(IDI_UP, T_("Up one level"), false, IDH_FILE_LIST_UP, [this] { up(); });
 		toolbar->setLayout(ids);
 
 		rebar->add(toolbar, RBBS_NOGRIPPER);
@@ -328,14 +309,21 @@
 
 		rebar->add(pathBox, RBBS_NOGRIPPER);
 		rebar->sendMessage(RB_MAXIMIZEBAND, 1); // the address bar will occupy all the space it can.
+
+		// create the second toolbar (on the right of the address bar).
+		toolbar = addChild(seed);
+
+		ids.clear();
+		addButton(0, T_("Subtract list"), true, IDH_FILE_LIST_SUBSTRACT, [this] { handleListDiff(); });
+		addButton(0, T_("Match queue"), true, IDH_FILE_LIST_MATCH_QUEUE, [this] { handleMatchQueue(); });
+		addButton(IDI_SEARCH, T_("Find") + _T(" \u2207") /* down arrow */, true, IDH_FILE_LIST_FIND, [this] { handleFindToggle(); });
+		toolbar->setLayout(ids);
+
+		rebar->add(toolbar, RBBS_NOGRIPPER);
 	}
 
 	initStatus();
 
-	status->setSize(STATUS_FILE_LIST_DIFF, listDiff->getPreferredSize().x);
-	status->setSize(STATUS_MATCH_QUEUE, matchQueue->getPreferredSize().x);
-	status->setSize(STATUS_FIND, find->getPreferredSize().x);
-
 	treeRoot = dirs->insert(NULL, new ItemInfo(true, dl->getRoot()));
 
 	ClientManager::getInstance()->addListener(this);
@@ -392,10 +380,6 @@
 
 	r.size.y -= status->refresh();
 
-	status->mapWidget(STATUS_FILE_LIST_DIFF, listDiff);
-	status->mapWidget(STATUS_MATCH_QUEUE, matchQueue);
-	status->mapWidget(STATUS_FIND, find);
-
 	grid->resize(r);
 }
 
@@ -448,13 +432,13 @@
 		searchBox->clear();
 		searchGrid->setEnabled(false);
 		searchGrid->setVisible(false);
-		grid->row(1).mode = GridInfo::STATIC;
+		grid->row(0).mode = GridInfo::STATIC;
 	} else {
 		for(auto i = lastSearches.crbegin(), iend = lastSearches.crend(); i != iend; ++i)
 			searchBox->addValue(*i);
 		searchGrid->setEnabled(true);
 		searchGrid->setVisible(true);
-		grid->row(1).mode = GridInfo::AUTO;
+		grid->row(0).mode = GridInfo::AUTO;
 		searchBox->setFocus();
 	}
 	layout();

=== modified file 'win32/DirectoryListingFrame.h'
--- win32/DirectoryListingFrame.h	2011-03-18 20:38:32 +0000
+++ win32/DirectoryListingFrame.h	2011-03-18 21:48:06 +0000
@@ -55,9 +55,6 @@
 		STATUS_TOTAL_SIZE,
 		STATUS_SELECTED_FILES,
 		STATUS_SELECTED_SIZE,
-		STATUS_FILE_LIST_DIFF,
-		STATUS_MATCH_QUEUE,
-		STATUS_FIND,
 		STATUS_LAST
 	};
 
@@ -156,6 +153,9 @@
 
 	GridPtr grid;
 
+	GridPtr searchGrid;
+	ComboBoxPtr searchBox;
+
 	typedef TypedTree<ItemInfo> WidgetDirs;
 	typedef WidgetDirs* WidgetDirsPtr;
 	WidgetDirsPtr dirs;
@@ -164,13 +164,6 @@
 	typedef WidgetFiles* WidgetFilesPtr;
 	WidgetFilesPtr files;
 
-	GridPtr searchGrid;
-	ComboBoxPtr searchBox;
-
-	ButtonPtr listDiff;
-	ButtonPtr matchQueue;
-	ButtonPtr find;
-
 	int64_t speed;		/**< Speed at which this file list was downloaded */
 
 	std::unique_ptr<DirectoryListing> dl;

=== modified file 'win32/MainWindow.cpp'
--- win32/MainWindow.cpp	2011-03-18 15:40:31 +0000
+++ win32/MainWindow.cpp	2011-03-18 21:48:06 +0000
@@ -352,44 +352,45 @@
 	dcdebug("initToolbar\n");
 	toolbar = addChild(ToolBar::Seed());
 
-	toolbar->addButton(PublicHubsFrame::id, WinUtil::toolbarIcon(IDI_PUBLICHUBS), 0, T_("Public Hubs"), IDH_TOOLBAR_PUBLIC_HUBS,
-		[this] { PublicHubsFrame::openWindow(getTabView()); });
-	toolbar->addButton("Reconnect", WinUtil::toolbarIcon(IDI_RECONNECT), 0, T_("Reconnect"), IDH_TOOLBAR_RECONNECT,
-		std::bind(&MainWindow::handleReconnect, this));
-	toolbar->addButton("Redirect", WinUtil::toolbarIcon(IDI_FOLLOW), 0, T_("Follow last redirect"), IDH_TOOLBAR_FOLLOW,
-		std::bind(&MainWindow::handleRedirect, this));
-	toolbar->addButton(FavHubsFrame::id, WinUtil::toolbarIcon(IDI_FAVORITE_HUBS), 0, T_("Favorite Hubs"), IDH_TOOLBAR_FAVORITE_HUBS,
-		[this] { FavHubsFrame::openWindow(getTabView()); }, std::bind(&MainWindow::handleFavHubsDropDown, this, _1));
-	toolbar->addButton(UsersFrame::id, WinUtil::toolbarIcon(IDI_FAVORITE_USERS), 0, T_("Users"), IDH_TOOLBAR_FAVORITE_USERS,
-		[this] { UsersFrame::openWindow(getTabView()); });
-	toolbar->addButton(QueueFrame::id, WinUtil::toolbarIcon(IDI_QUEUE), 0, T_("Download Queue"), IDH_TOOLBAR_QUEUE,
-		[this] { QueueFrame::openWindow(getTabView()); });
-	toolbar->addButton(FinishedDLFrame::id, WinUtil::toolbarIcon(IDI_FINISHED_DL), 0, T_("Finished Downloads"), IDH_TOOLBAR_FINISHED_DL,
-		[this] { FinishedDLFrame::openWindow(getTabView()); });
-	toolbar->addButton(WaitingUsersFrame::id, WinUtil::toolbarIcon(IDI_WAITING_USERS), 0, T_("Waiting Users"), IDH_TOOLBAR_WAITING_USERS,
-		[this] { WaitingUsersFrame::openWindow(getTabView()); });
-	toolbar->addButton(FinishedULFrame::id, WinUtil::toolbarIcon(IDI_FINISHED_UL), 0, T_("Finished Uploads"), IDH_TOOLBAR_FINISHED_UL,
-		[this] { FinishedULFrame::openWindow(getTabView()); });
-	toolbar->addButton(SearchFrame::id, WinUtil::toolbarIcon(IDI_SEARCH), 0, T_("Search"), IDH_TOOLBAR_SEARCH,
-		[this] { SearchFrame::openWindow(getTabView()); });
-	toolbar->addButton(ADLSearchFrame::id, WinUtil::toolbarIcon(IDI_ADLSEARCH), 0, T_("ADL Search"), IDH_TOOLBAR_ADL_SEARCH,
-		[this] { ADLSearchFrame::openWindow(getTabView()); });
-	toolbar->addButton(SpyFrame::id, WinUtil::toolbarIcon(IDI_SPY), 0, T_("Search Spy"), IDH_TOOLBAR_SEARCH_SPY,
-		[this] { SpyFrame::openWindow(getTabView()); });
-	toolbar->addButton(StatsFrame::id, WinUtil::toolbarIcon(IDI_NET_STATS), 0, T_("Network Statistics"), IDH_TOOLBAR_NET_STATS,
-		[this] { StatsFrame::openWindow(getTabView()); });
-	toolbar->addButton("OpenFL", WinUtil::toolbarIcon(IDI_OPEN_FILE_LIST), 0, T_("Open file list..."), IDH_TOOLBAR_FILE_LIST,
-		std::bind(&MainWindow::handleOpenFileList, this));
-	toolbar->addButton("Recents", WinUtil::toolbarIcon(IDI_RECENTS), 0, T_("Recent windows"), IDH_TOOLBAR_RECENT,
-		0, std::bind(&MainWindow::handleRecent, this, _1));
-	toolbar->addButton("Settings", WinUtil::toolbarIcon(IDI_SETTINGS), 0, T_("Settings"), IDH_TOOLBAR_SETTINGS,
-		std::bind(&MainWindow::handleSettings, this));
-	toolbar->addButton(NotepadFrame::id, WinUtil::toolbarIcon(IDI_NOTEPAD), 0, T_("Notepad"), IDH_TOOLBAR_NOTEPAD,
-		[this] { NotepadFrame::openWindow(getTabView()); });
-	toolbar->addButton("Refresh", WinUtil::toolbarIcon(IDI_REFRESH), 0, T_("Refresh file list"), IDH_TOOLBAR_REFRESH,
-		std::bind(&MainWindow::handleRefreshFileList, this));
-	toolbar->addButton("CSHelp", WinUtil::toolbarIcon(IDI_WHATS_THIS), 0, T_("What's This?"), IDH_TOOLBAR_WHATS_THIS,
-		std::bind(&MainWindow::handleWhatsThis, this));
+	toolbar->addButton(PublicHubsFrame::id, WinUtil::toolbarIcon(IDI_PUBLICHUBS), 0, T_("Public Hubs"), false,
+		IDH_TOOLBAR_PUBLIC_HUBS, [this] { PublicHubsFrame::openWindow(getTabView()); });
+	toolbar->addButton("Reconnect", WinUtil::toolbarIcon(IDI_RECONNECT), 0, T_("Reconnect"), false,
+		IDH_TOOLBAR_RECONNECT, [this] { handleReconnect(); });
+	toolbar->addButton("Redirect", WinUtil::toolbarIcon(IDI_FOLLOW), 0, T_("Follow last redirect"), false,
+		IDH_TOOLBAR_FOLLOW, [this] { handleRedirect(); });
+	toolbar->addButton(FavHubsFrame::id, WinUtil::toolbarIcon(IDI_FAVORITE_HUBS), 0, T_("Favorite Hubs"), false,
+		IDH_TOOLBAR_FAVORITE_HUBS, [this] { FavHubsFrame::openWindow(getTabView()); },
+		[this](const dwt::ScreenCoordinate& pt) { handleFavHubsDropDown(pt); });
+	toolbar->addButton(UsersFrame::id, WinUtil::toolbarIcon(IDI_FAVORITE_USERS), 0, T_("Users"), false,
+		IDH_TOOLBAR_FAVORITE_USERS, [this] { UsersFrame::openWindow(getTabView()); });
+	toolbar->addButton(QueueFrame::id, WinUtil::toolbarIcon(IDI_QUEUE), 0, T_("Download Queue"), false,
+		IDH_TOOLBAR_QUEUE, [this] { QueueFrame::openWindow(getTabView()); });
+	toolbar->addButton(FinishedDLFrame::id, WinUtil::toolbarIcon(IDI_FINISHED_DL), 0, T_("Finished Downloads"), false,
+		IDH_TOOLBAR_FINISHED_DL, [this] { FinishedDLFrame::openWindow(getTabView()); });
+	toolbar->addButton(WaitingUsersFrame::id, WinUtil::toolbarIcon(IDI_WAITING_USERS), 0, T_("Waiting Users"), false,
+		IDH_TOOLBAR_WAITING_USERS, [this] { WaitingUsersFrame::openWindow(getTabView()); });
+	toolbar->addButton(FinishedULFrame::id, WinUtil::toolbarIcon(IDI_FINISHED_UL), 0, T_("Finished Uploads"), false,
+		IDH_TOOLBAR_FINISHED_UL, [this] { FinishedULFrame::openWindow(getTabView()); });
+	toolbar->addButton(SearchFrame::id, WinUtil::toolbarIcon(IDI_SEARCH), 0, T_("Search"), false,
+		IDH_TOOLBAR_SEARCH, [this] { SearchFrame::openWindow(getTabView()); });
+	toolbar->addButton(ADLSearchFrame::id, WinUtil::toolbarIcon(IDI_ADLSEARCH), 0, T_("ADL Search"), false,
+		IDH_TOOLBAR_ADL_SEARCH, [this] { ADLSearchFrame::openWindow(getTabView()); });
+	toolbar->addButton(SpyFrame::id, WinUtil::toolbarIcon(IDI_SPY), 0, T_("Search Spy"), false,
+		IDH_TOOLBAR_SEARCH_SPY, [this] { SpyFrame::openWindow(getTabView()); });
+	toolbar->addButton(StatsFrame::id, WinUtil::toolbarIcon(IDI_NET_STATS), 0, T_("Network Statistics"), false,
+		IDH_TOOLBAR_NET_STATS, [this] { StatsFrame::openWindow(getTabView()); });
+	toolbar->addButton("OpenFL", WinUtil::toolbarIcon(IDI_OPEN_FILE_LIST), 0, T_("Open file list..."), false,
+		IDH_TOOLBAR_FILE_LIST, [this] { handleOpenFileList(); });
+	toolbar->addButton("Recents", WinUtil::toolbarIcon(IDI_RECENTS), 0, T_("Recent windows"), false,
+		IDH_TOOLBAR_RECENT, 0, [this](const dwt::ScreenCoordinate& pt) { handleRecent(pt); });
+	toolbar->addButton("Settings", WinUtil::toolbarIcon(IDI_SETTINGS), 0, T_("Settings"), false,
+		IDH_TOOLBAR_SETTINGS, [this] { handleSettings(); });
+	toolbar->addButton(NotepadFrame::id, WinUtil::toolbarIcon(IDI_NOTEPAD), 0, T_("Notepad"), false,
+		IDH_TOOLBAR_NOTEPAD, [this] { NotepadFrame::openWindow(getTabView()); });
+	toolbar->addButton("Refresh", WinUtil::toolbarIcon(IDI_REFRESH), 0, T_("Refresh file list"), false,
+		IDH_TOOLBAR_REFRESH, [this] { handleRefreshFileList(); });
+	toolbar->addButton("CSHelp", WinUtil::toolbarIcon(IDI_WHATS_THIS), 0, T_("What's This?"), false,
+		IDH_TOOLBAR_WHATS_THIS, [this] { handleWhatsThis(); });
 
 	if(SettingsManager::getInstance()->isDefault(SettingsManager::TOOLBAR)) {
 		// gotta create a default layout for the toolbar