← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3087: allow showing of timestamps of when client went into away mode in reply PM

 

------------------------------------------------------------
revno: 3087
committer: cologic <ne5@xxxxxxxxxxx>
branch nick: dcplusplus
timestamp: Mon 2012-10-22 07:38:19 -0400
message:
  allow showing of timestamps of when client went into away mode in reply PM
modified:
  dcpp/SettingsManager.cpp
  dcpp/SettingsManager.h
  dcpp/Util.cpp
  win32/GeneralPage.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 'dcpp/SettingsManager.cpp'
--- dcpp/SettingsManager.cpp	2012-09-10 22:14:27 +0000
+++ dcpp/SettingsManager.cpp	2012-10-22 11:38:19 +0000
@@ -100,6 +100,7 @@
 	"StatusInChat", "TimeDependentThrottle", "TimeStamps",
 	"ToggleActiveTab", "UrlHandler", "UseCTRLForLineHistory", "UseSystemIcons",
 	"UsersFilterFavorite", "UsersFilterOnline", "UsersFilterQueue", "UsersFilterWaiting",
+	"AwayTimeStamp",
 	"SENTRY",
 	// Int64
 	"TotalUpload", "TotalDownload",
@@ -218,6 +219,7 @@
 	setDefault(AUTO_AWAY, false);
 	setDefault(AWAY_COMP_LOCK, true);
 	setDefault(AWAY_IDLE, 10);
+	setDefault(AWAY_TIMESTAMP, false);
 	setDefault(TIME_STAMPS_FORMAT, "%H:%M");
 	setDefault(COUNTRY_FORMAT, "%[2code] - %[name]");
 	setDefault(MAX_COMPRESSION, 6);

=== modified file 'dcpp/SettingsManager.h'
--- dcpp/SettingsManager.h	2012-09-10 22:14:27 +0000
+++ dcpp/SettingsManager.h	2012-10-22 11:38:19 +0000
@@ -137,6 +137,7 @@
 		STATUS_IN_CHAT, TIME_DEPENDENT_THROTTLE, TIME_STAMPS,
 		TOGGLE_ACTIVE_WINDOW, URL_HANDLER, USE_CTRL_FOR_LINE_HISTORY, USE_SYSTEM_ICONS,
 		USERS_FILTER_FAVORITE, USERS_FILTER_ONLINE, USERS_FILTER_QUEUE, USERS_FILTER_WAITING,
+		AWAY_TIMESTAMP,
 		BOOL_LAST };
 
 	enum Int64Setting { INT64_FIRST = BOOL_LAST + 1,

=== modified file 'dcpp/Util.cpp'
--- dcpp/Util.cpp	2012-09-09 14:05:30 +0000
+++ dcpp/Util.cpp	2012-10-22 11:38:19 +0000
@@ -504,7 +504,11 @@
 
 string Util::getAwayMessage() {
 	const auto& msg = awayMsg.empty() ? SETTING(DEFAULT_AWAY_MESSAGE) : awayMsg;
-	return msg.empty() ? msg : formatTime(msg, awayTime) + " <" APPNAME " v" VERSIONSTRING ">";
+	if (SETTING(AWAY_TIMESTAMP)) {
+		return msg.empty() ? msg : formatTime(msg + "[%x %X]", awayTime) + " <DC++ v" VERSIONSTRING ">";
+	} else {
+		return msg.empty() ? msg : formatTime(msg, awayTime) + " <DC++ v" VERSIONSTRING ">";
+	}
 }
 
 string Util::formatBytes(int64_t aBytes) {

=== modified file 'win32/GeneralPage.cpp'
--- win32/GeneralPage.cpp	2012-05-16 11:34:47 +0000
+++ win32/GeneralPage.cpp	2012-10-22 11:38:19 +0000
@@ -105,6 +105,10 @@
 		box->setHelpId(IDH_SETTINGS_GENERAL_AWAY_COMP_LOCK);
 		items.emplace_back(box, SettingsManager::AWAY_COMP_LOCK, PropPage::T_BOOL);
 
+		box = cur->addChild(Grid::Seed(1, 1))->addChild(CheckBox::Seed(T_("Add timestamp to the end of away messages automatically")));
+		box->setHelpId(IDH_SETTINGS_GENERAL_AWAY_TIMESTAMP);
+		items.emplace_back(box, SettingsManager::AWAY_TIMESTAMP, PropPage::T_BOOL);
+
 		{
 			auto idle = cur->addChild(Grid::Seed(1, 3));
 			idle->setHelpId(IDH_SETTINGS_GENERAL_AWAY_IDLE);