Blob Blame History Raw
Based on 2006-03-02 22:47 centericq-quitask.patch from centericq package

diff -Nurp centerim-4.22.1.orig/src/icqconf.cc centerim-4.22.1/src/icqconf.cc
--- centerim-4.22.1.orig/src/icqconf.cc	2007-10-02 17:24:40.000000000 +0200
+++ centerim-4.22.1/src/icqconf.cc	2007-10-02 18:03:05.000000000 +0200
@@ -495,6 +495,7 @@ void icqconf::loadmainconfig() {
 	    if(param == "russian" || param == "convert") initmultiproto(cpconvert, buf, false); else
 	    if(param == "nobidi") setbidi(false); else
 	    if(param == "askaway") askaway = true; else
+	    if(param == "askquit") askquit = true; else
 	    if(param == "logtimestamps") logtimestamps = true; else
 	    if(param == "logonline") logonline = true; else
 	    if(param == "fromcharset") fromcharset = buf; else
@@ -593,6 +594,7 @@ void icqconf::save() {
 	    f << "tocharset\t" << tocharset << endl;
 
 	    if(!getbidi()) f << "nobidi" << endl;
+	    if(getaskquit()) f << "askquit" << endl;
 	    if(logtimestamps) f << "logtimestamps" << endl;
 	    if(timestampstothesecond) f << "timestampstothesecond" << endl;
 	    if(logonline) f << "logonline" << endl;
@@ -1015,6 +1017,9 @@ void icqconf::setscreensocketpath(string
 void icqconf::setquote(bool use) {
     quote = use;
 }
+void icqconf::setaskquit(bool faskquit) { 
+    askquit = faskquit; 
+} 
 
 void icqconf::setsockshost(const string &nsockshost) {
     int pos;
diff -Nurp centerim-4.22.1.orig/src/icqconf.h centerim-4.22.1/src/icqconf.h
--- centerim-4.22.1.orig/src/icqconf.h	2007-10-02 17:24:40.000000000 +0200
+++ centerim-4.22.1/src/icqconf.h	2007-10-02 18:03:05.000000000 +0200
@@ -146,7 +146,7 @@ class icqconf {
 	bool hideoffline, quote, savepwd, antispam, screenna, mailcheck,
 	    makelog, fenoughdiskspace, askaway, bidi, logtimestamps,
 	    logonline, emacs, proxyconnect, proxyssl, notitles, debug,
-	    timestampstothesecond, dropauthreq, usingcaptcha;
+	    timestampstothesecond, dropauthreq, usingcaptcha, askquit;
 
 	unsigned int captchatimeout;
 
@@ -275,6 +275,9 @@ class icqconf {
 
 	bool getchatmode(protocolname pname);
 	void setchatmode(protocolname pname, bool fchatmode);
+	
+        bool getaskquit() const { return askquit; } 
+        void setaskquit(bool faskquit); 
 
 	bool getentersends(protocolname pname);
 	void setentersends(protocolname pname, bool fentersends);
diff -Nurp centerim-4.22.1.orig/src/icqdialogs.cc centerim-4.22.1/src/icqdialogs.cc
--- centerim-4.22.1.orig/src/icqdialogs.cc	2007-10-02 17:24:40.000000000 +0200
+++ centerim-4.22.1/src/icqdialogs.cc	2007-10-02 18:03:05.000000000 +0200
@@ -1108,6 +1108,7 @@ bool icqface::updateconf(icqconf::regsou
     bool makelog = conf.getmakelog();
     bool askaway = conf.getaskaway();
     bool bidi = conf.getbidi();
+    bool askquit = conf.getaskquit();
     bool emacs = conf.getemacs();
     bool proxyconnect = conf.getproxyconnect();
     bool timestampstothesecond = conf.gettimestampstothesecond();
@@ -1194,6 +1195,7 @@ bool icqface::updateconf(icqconf::regsou
 	t.addleaff(i, 0, 20, _( " Enable bidirectional languages support : %s "), stryesno(bidi));
     #endif
 	t.addleaff(i, 0, 23, _(" Enable emacs bindings in text editor : %s "), stryesno(emacs));
+	t.addleaff(i, 0, 52, _(" Ask before quit : %s "), stryesno(askquit));
 
 	i = t.addnode(_(" Codepages conversion "));
 
@@ -1439,6 +1441,9 @@ bool icqface::updateconf(icqconf::regsou
 			if (dropauthreq && usingcaptcha)
 				dropauthreq = false;
 			break;
+		    case 53:
+		    	askquit = !askquit;
+			break;
   		}
   		break;
 	    case 1:
@@ -1470,6 +1475,7 @@ bool icqface::updateconf(icqconf::regsou
 		}
 
 		conf.setbidi(bidi);
+		conf.setaskquit(askquit);
 		conf.setlogoptions(logtimestamps, logonline);
 
 		if(ptp) conf.setpeertopeer(ptpmin, ptpmax);
diff -Nurp centerim-4.22.1.orig/src/icqface.cc centerim-4.22.1/src/icqface.cc
--- centerim-4.22.1.orig/src/icqface.cc	2007-10-02 17:24:40.000000000 +0200
+++ centerim-4.22.1/src/icqface.cc	2007-10-02 18:03:05.000000000 +0200
@@ -3282,6 +3282,9 @@ int icqface::contactskeys(verticalmenu &
 	    break;
 
 	case key_quit:
+	    if (conf.getaskquit())
+		if(face.ask("Really Quit?", ASK_YES | ASK_NO, ASK_NO) == ASK_NO)
+		    break;
 	    face.extk = ACT_QUIT;
 	    break;