← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2386: Prevent multiple password dialogs and give them the hub title

 

------------------------------------------------------------
revno: 2386
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sun 2011-01-09 23:09:24 +0100
message:
  Prevent multiple password dialogs and give them the hub title
modified:
  changelog.txt
  win32/AspectChat.h
  win32/HubFrame.cpp
  win32/MainWindow.cpp
  win32/NetworkPage.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-01-09 15:38:35 +0000
+++ changelog.txt	2011-01-09 22:09:24 +0000
@@ -67,6 +67,7 @@
 * Rework file and folder icons, add one for incomplete dirs (poy)
 * Save and restore the selected tab when re-opening (poy)
 * Process file lists only when they first come into view (poy)
+* [L#700594] Prevent multiple password dialogs and give them the hub title (poy)
 
 -- 0.770 2010-07-05 --
 * [L#550300] Catch more potential file corruptions (thanks bigmuscle)

=== modified file 'win32/AspectChat.h'
--- win32/AspectChat.h	2011-01-02 17:12:02 +0000
+++ win32/AspectChat.h	2011-01-09 22:09:24 +0000
@@ -64,6 +64,8 @@
 	virtual ~AspectChat() { }
 
 	tstring formatChatMessage(Client* aClient, const tstring& aLine) {
+		/// @todo factor out to dwt
+		/// @todo Text::toT works but _T doesn't, verify this.
 		return Text::toT("{\\urtf1\n") + chat->rtfEscape(aLine) + Text::toT("}\n");
 	}
 

=== modified file 'win32/HubFrame.cpp'
--- win32/HubFrame.cpp	2011-01-09 14:54:10 +0000
+++ win32/HubFrame.cpp	2011-01-09 22:09:24 +0000
@@ -538,21 +538,22 @@
 	if(client->getPassword().size() > 0) {
 		client->password(client->getPassword());
 		addStatus(T_("Stored password sent..."));
-	} else {
-		if(!BOOLSETTING(PROMPT_PASSWORD)) {
+	} else if(!waitingForPW) {
+		waitingForPW = true;
+		if(BOOLSETTING(PROMPT_PASSWORD)) {
+			ParamDlg linePwd(this, getText(), T_("Please enter a password"), Util::emptyStringT, true);
+			auto res = linePwd.run();
+			waitingForPW = false;
+			if(res == IDOK) {
+				client->setPassword(Text::fromT(linePwd.getValue()));
+				client->password(Text::fromT(linePwd.getValue()));
+			} else {
+				client->disconnect(true);
+			}
+		} else {
 			message->setText(_T("/password "));
 			message->setFocus();
 			message->setSelection(10, 10);
-			waitingForPW = true;
-		} else {
-			ParamDlg linePwd(this, T_("Please enter a password"), T_("Please enter a password"), Util::emptyStringT, true);
-			if(linePwd.run() == IDOK) {
-				client->setPassword(Text::fromT(linePwd.getValue()));
-				client->password(Text::fromT(linePwd.getValue()));
-				waitingForPW = false;
-			} else {
-				client->disconnect(true);
-			}
 		}
 	}
 }

=== modified file 'win32/MainWindow.cpp'
--- win32/MainWindow.cpp	2011-01-09 14:54:10 +0000
+++ win32/MainWindow.cpp	2011-01-09 22:09:24 +0000
@@ -250,7 +250,7 @@
 
 		file->appendItem(T_("Settings\tCtrl+F3"), [this] { handleSettings(); }, WinUtil::menuIcon(IDI_SETTINGS));
 		file->appendSeparator();
-		file->appendItem(T_("E&xit\tAlt+F4"), [this] { close(true); }, WinUtil::menuIcon(IDI_EXIT));
+		file->appendItem(T_("E&xit\tAlt+F4"), [this] { GCC_WTF->close(true); }, WinUtil::menuIcon(IDI_EXIT));
 	}
 
 	{

=== modified file 'win32/NetworkPage.cpp'
--- win32/NetworkPage.cpp	2011-01-03 18:48:46 +0000
+++ win32/NetworkPage.cpp	2011-01-09 22:09:24 +0000
@@ -204,7 +204,8 @@
 }
 
 void NetworkPage::addLogLine(const tstring& msg) {
-	const tstring message = msg + Text::toT("\r\n");
+	/// @todo factor out to dwt
+	const tstring message = Text::toT("{\\urtf1\n") + log->rtfEscape(msg + Text::toT("\r\n")) + Text::toT("}\n");
 	log->addTextSteady(message, message.size());
 }