← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2588: fix gcc build & tabbing in file list

 

------------------------------------------------------------
revno: 2588
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Tue 2011-08-09 12:34:44 +0200
message:
  fix gcc build & tabbing in file list
modified:
  win32/DirectoryListingFrame.cpp
  win32/DirectoryListingFrame.h


--
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 'win32/DirectoryListingFrame.cpp'
--- win32/DirectoryListingFrame.cpp	2011-08-06 07:00:02 +0000
+++ win32/DirectoryListingFrame.cpp	2011-08-09 10:34:44 +0000
@@ -217,6 +217,7 @@
 	searchBox(0),
 	dirs(0),
 	files(0),
+	showTree(0),
 	speed(aSpeed),
 	dl(new DirectoryListing(aUser)),
 	user(aUser),
@@ -225,8 +226,7 @@
 	treeRoot(NULL),
 	loaded(false),
 	updating(false),
-	searching(false),
-	showTree(0)
+	searching(false)
 {
 	grid = addChild(Grid::Seed(2, 1));
 	grid->column(0).mode = GridInfo::FILL;
@@ -268,9 +268,9 @@
 	searchGrid->setEnabled(false);
 	searchGrid->setVisible(false);
 
+	auto paned = grid->addChild(SplitterContainer::Seed(0.3));
+
 	{
-		paned = grid->addChild(SplitterContainer::Seed(0.3));
-
 		dirs = paned->addChild(WidgetDirs::Seed());
 		dirs->setHelpId(IDH_FILE_LIST_DIRS);
 		addWidget(dirs);
@@ -350,10 +350,14 @@
 	}
 
 	initStatus();
-	
+
 	showTree = addChild(WinUtil::Seeds::splitCheckBox);
 	showTree->setChecked(true);
-	showTree->onClicked([this] { handleShowTreeClicked(); });
+	showTree->onClicked([this, paned] {
+		auto checked = showTree->getChecked();
+		dirs->setEnabled(checked);
+		paned->maximize(checked ? nullptr : files);
+	});
 	status->setWidget(STATUS_SHOW_TREE, showTree);
 
 	treeRoot = dirs->insert(NULL, new ItemInfo(true, dl->getRoot()));
@@ -561,10 +565,6 @@
 	return menu;
 }
 
-void DirectoryListingFrame::handleShowTreeClicked() {
-	paned->maximize(showTree->getChecked() ? NULL : files);
-}
-
 void DirectoryListingFrame::addUserCommands(const MenuPtr& parent) {
 	prepareMenu(parent, UserCommand::CONTEXT_FILELIST, ClientManager::getInstance()->getHubs(dl->getUser().user->getCID(), dl->getUser().hint));
 }

=== modified file 'win32/DirectoryListingFrame.h'
--- win32/DirectoryListingFrame.h	2011-08-06 07:00:02 +0000
+++ win32/DirectoryListingFrame.h	2011-08-09 10:34:44 +0000
@@ -148,9 +148,6 @@
 		tstring columns[COLUMN_LAST];
 	};
 	
-	SplitterContainerPtr paned;
-	CheckBoxPtr showTree;
-
 	RebarPtr rebar;
 	ComboBoxPtr pathBox;
 
@@ -167,6 +164,8 @@
 	typedef WidgetFiles* WidgetFilesPtr;
 	WidgetFilesPtr files;
 
+	CheckBoxPtr showTree;
+
 	int64_t speed;		/**< Speed at which this file list was downloaded */
 
 	std::unique_ptr<DirectoryListing> dl;