From e528df3eb1ee48c55535fc09e7d016a83b38b02e Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 10 Mar 2016 18:35:21 +0900 Subject: Kate session panel: added move up/down and rename functionality. Signed-off-by: Michele Calgaro --- kate/app/katesession.h | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'kate/app/katesession.h') diff --git a/kate/app/katesession.h b/kate/app/katesession.h index 28cabea75..077ad1fda 100644 --- a/kate/app/katesession.h +++ b/kate/app/katesession.h @@ -194,6 +194,7 @@ class KateSessionManager : public TQObject * @param sessionId the id of the session to activate * @param saveCurr if true, save the current session before activating the new one * @return whether the session was activated or not + * @emit sessionActivated */ bool activateSession(int sessionId, bool saveCurr = true); @@ -202,6 +203,7 @@ class KateSessionManager : public TQObject * @param sessionName new session name * @param activate if true, activate the new session after creation * @return the id of the newly created session + * @emit sessionCreated */ int newSession(const TQString &sessionName = TQString::null, bool activate = true); @@ -221,9 +223,29 @@ class KateSessionManager : public TQObject * Delete the specified session * @param sessionId the id of the session to delete * @return whether the session has been deleted or not + * @emit sessionDeleted */ bool deleteSession(int sessionId); + /** + * Move the specified session forward in the session list (by one position) + * @param sessionId the id of the session to move + */ + void moveSessionForward(int sessionId); + + /** + * Move the specified session backward in the session list (by one position) + * @param sessionId the id of the session to move + */ + void moveSessionBackward(int sessionId); + + /** + * Rename the specified session + * @param sessionId the id of the session to rename + * @param newSessionName the new session name + */ + void renameSession(int sessionId, const TQString &newSessionName); + signals: /** @@ -245,10 +267,26 @@ class KateSessionManager : public TQObject */ void sessionDeleted(int sessionId); + /** + * Emitted once the position of the two sessions have been swapped + * @param sessionIdMin the smallest id of the session couple + * @param sessionIdMax the biggest id of the session couple + */ + void sessionsSwapped(int sessionIdMin, int sessionIdMax); - private: + + protected: KateSessionManager(); + /** + * Swap the position of the two specified sessions in the session list + * @param sessionId1 the id of the first session + * @param sessionId2 the id of the second session + * @emit sessionsSwapped + */ + void swapSessionsPosition(int sessionId1, int sessionId2); + + TQString m_baseDir; // folder where session files are stored TQString m_configFile; // file where the session list config is stored int m_activeSessionId; // index of the active session -- cgit v1.2.1