calendarui/views/src/calennativeview.cpp
changeset 77 b0711afde476
parent 58 ef813d54df51
child 80 fa7c359294fa
--- a/calendarui/views/src/calennativeview.cpp	Thu Sep 02 20:25:23 2010 +0300
+++ b/calendarui/views/src/calennativeview.cpp	Fri Sep 17 08:29:05 2010 +0300
@@ -65,6 +65,7 @@
 	notificationArray.Append(ECalenNotifySystemTimeChanged);
 	notificationArray.Append(ECalenNotifySystemLocaleChanged);
 	notificationArray.Append(ECalenNotifyContextChanged);
+	notificationArray.Append(ECalenNotifyCloseDialogs);
 
 	mServices.RegisterForNotificationsL(this, notificationArray);
 
@@ -130,6 +131,7 @@
     
 	// Create a popup with datepicker for the user to select date.
 	HbDialog *popUp = new HbDialog();
+	popUp->setParent(this);
 	popUp->setDismissPolicy(HbDialog::NoDismiss);
 	popUp->setTimeout(HbDialog::NoTimeout);
 	popUp->setAttribute( Qt::WA_DeleteOnClose, true );
@@ -149,6 +151,10 @@
 	popUp->addAction(okAction);
 	connect(okAction, SIGNAL(triggered()), this, SLOT(goToSelectedDate()));
 	popUp->addAction(new HbAction(hbTrId("txt_common_button_cancel"), popUp));
+	
+	// Close the popup once closeDialogs() is received
+	connect(this, SIGNAL(closeDialogs()), popUp, SLOT(close()));
+	
 	popUp->open();
 	
 	OstTraceFunctionExit0( CALENNATIVEVIEW_GOTODATE_EXIT );
@@ -236,6 +242,11 @@
 			onContextChanged();
 		}
 		break;
+		case ECalenNotifyCloseDialogs: {
+			// Emit the signal to close the dialogs which are already opened
+			emit closeDialogs();
+		}
+		break;
 		default:
 			break;
 	}