Example #1
0
		/// <summary>
		/// Save file contacts on file.
		/// </summary>
		private void SaveContactsFile()
		{
			QMessageBox mdlg = null;
			
			if (GlobalObjUI.ContactsFilePath != "")
			{
				mdlg = new QMessageBox(QMessageBox.Icon.Question, 
					MainClass.AppNameVer + " - " + GlobalObjUI.LMan.GetString("savefileact"),
					GlobalObjUI.LMan.GetString("override") + "\r\n" + 
					Path.GetFileNameWithoutExtension(GlobalObjUI.ContactsFilePath),
					0x00400400 , this);
				
				int respType = mdlg.Exec();

				if (respType == 0x00000400)
				{
					// override (Ok)
					mdlg.Close();
					mdlg.Dispose();
					mdlg = null;
					
					WriteContactsOnFile(GlobalObjUI.ContactsFilePath, GlobalObjUI.FileContacts.SimContacts);
					return;
				}

				mdlg.Close();
				mdlg.Dispose();
				mdlg = null;

			}
			
			// select new file to save
			string fileToSave = ChooseFileToSave(GlobalObjUI.LMan.GetString("savefileact"));
			if (fileToSave == "")
			{
				// no file selected
				return;
			}
			
			WriteContactsOnFile(fileToSave, GlobalObjUI.FileContacts.SimContacts);
			GlobalObjUI.ContactsFilePath = fileToSave;
			
		}
Example #2
0
		private void DeleteContactsSim()
		{
			QMessageBox dmsg = new QMessageBox(QMessageBox.Icon.Question,
				MainClass.AppNameVer + " - " + GlobalObjUI.LMan.GetString("deletesimact"),
				GlobalObjUI.LMan.GetString("suredeletesim"),
				(uint)QMessageBox.StandardButton.Yes | (uint)QMessageBox.StandardButton.No);
			
			int respType = dmsg.Exec();
			
			dmsg.Close();
			dmsg.Dispose();
			
			
			if (respType != (uint)QMessageBox.StandardButton.Yes)
			{
				return;
			}


			// Delete sim
			ScanSimBefore();
			
			// Reset status values
			GlobalObjUI.SimADNStatus = 1;
			GlobalObjUI.SimADNPosition = 0;
			GlobalObjUI.SimADNError = "";
			
            // Start thread for reading process
            isReading = false;
			isEnd = false;
            simThread = new System.Threading.Thread(new System.Threading.ThreadStart(GlobalObjUI.DeleteAllSimContactsList));
            simThread.Start();

			return;
			

		}
		/// <summary>
		/// Are you sure dialog
		/// </summary>
		private bool DeleteContactQuestion()
		{
			QMessageBox mdlg = new QMessageBox(QMessageBox.Icon.Question, 
				MainClass.AppNameVer + " - " + GlobalObjUI.LMan.GetString("delcontacts"),
				GlobalObjUI.LMan.GetString("suredelcontact"), 
				(uint)QMessageBox.StandardButton.Yes | 
				(uint)QMessageBox.StandardButton.No);
			
			int respType = mdlg.Exec();
			mdlg.Close();
			mdlg.Dispose();
			mdlg = null;
			
			if (respType == (uint)QMessageBox.StandardButton.Yes)
			{
				return true;
			}
			return false;			
		}