summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2012-12-18 17:20:52 (GMT)
committer jacob1 <jfu614@gmail.com>2012-12-18 17:20:52 (GMT)
commitc06afff0a572c34ea4da8b87670e21c67b9c06b7 (patch)
tree95a251e1c2127a33f528a2194f451bfa5bfd30f1 /src/client
parent672c5ee9135fab6329f789c902f278329869b561 (diff)
downloadpowder-c06afff0a572c34ea4da8b87670e21c67b9c06b7.zip
powder-c06afff0a572c34ea4da8b87670e21c67b9c06b7.tar.gz
selecting a stamp moves it to the front of the list again (unless you hold ctrl)
attempted to do MVC right?
Diffstat (limited to 'src/client')
-rw-r--r--src/client/Client.cpp14
-rw-r--r--src/client/Client.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp
index 0f9de28..4c7ac43 100644
--- a/src/client/Client.cpp
+++ b/src/client/Client.cpp
@@ -909,6 +909,20 @@ RequestStatus Client::UploadSave(SaveInfo & save)
return RequestFailure;
}
+void Client::MoveStampToFront(std::string stampID)
+{
+ for (std::list<std::string>::iterator iterator = stampIDs.begin(), end = stampIDs.end(); iterator != end; ++iterator)
+ {
+ if((*iterator) == stampID)
+ {
+ stampIDs.erase(iterator);
+ break;
+ }
+ }
+ stampIDs.push_front(stampID);
+ updateStamps();
+}
+
SaveFile * Client::GetStamp(std::string stampID)
{
std::string stampFile = std::string(STAMPS_DIR PATH_SEP + stampID + ".stm");
diff --git a/src/client/Client.h b/src/client/Client.h
index bd33273..0b40012 100644
--- a/src/client/Client.h
+++ b/src/client/Client.h
@@ -121,6 +121,7 @@ public:
void RescanStamps();
int GetStampsCount();
SaveFile * GetFirstStamp();
+ void MoveStampToFront(std::string stampID);
RequestStatus AddComment(int saveID, std::string comment);