← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2596: hash dialog fixes

 

------------------------------------------------------------
revno: 2596
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sat 2011-08-20 17:26:22 +0200
message:
  hash dialog fixes
modified:
  win32/HashProgressDlg.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 'win32/HashProgressDlg.cpp'
--- win32/HashProgressDlg.cpp	2011-05-04 19:32:00 +0000
+++ win32/HashProgressDlg.cpp	2011-08-20 15:26:22 +0000
@@ -80,9 +80,9 @@
 	progress->setRange(0, 10000);
 
 	{
-		GridPtr cur = grid->addChild(Grid::Seed(1, 3));
-		cur->column(2).mode = GridInfo::FILL;
-		cur->column(2).align = GridInfo::BOTTOM_RIGHT;
+		GridPtr cur = grid->addChild(Grid::Seed(1, 2));
+		cur->column(1).mode = GridInfo::FILL;
+		cur->column(1).align = GridInfo::BOTTOM_RIGHT;
 
 		pair<ButtonPtr, ButtonPtr> buttons = WinUtil::addDlgButtons(cur,
 			[this] { GCC_WTF->endDialog(IDOK); },
@@ -91,7 +91,8 @@
 		buttons.second->setVisible(false);
 
 		pauseResume = cur->addChild(Button::Seed());
-		pauseResume->onClicked([this] { handlePauseResume(); });
+		cur->setWidget(pauseResume, 0, 1);
+		pauseResume->onClicked([this, cur] { handlePauseResume(); cur->layout(); pauseResume->redraw(); });
 		setButtonState();
 	}
 
@@ -128,6 +129,7 @@
 		close(true);
 		return true;
 	}
+
 	double diff = tick - startTime;
 	bool paused = HashManager::getInstance()->isHashingPaused();
 	if(diff < 1000 || files == 0 || bytes == 0 || paused) {
@@ -137,7 +139,6 @@
 			left->setText(T_("Paused"));
 		} else {
 			left->setText(T_("-:--:-- left"));
-			progress->setPosition(0);
 		}
 	} else {
 		double filestat = (((double)(startFiles - files)) * 60 * 60 * 1000) / diff;
@@ -178,7 +179,6 @@
 	}
 
 	setButtonState();
-	layout();
 }
 
 void HashProgressDlg::setButtonState() {