clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp
changeset 68 a5a1242fd2e8
parent 58 ef813d54df51
child 77 b0711afde476
--- a/clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp	Wed Aug 18 09:47:38 2010 +0300
+++ b/clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp	Thu Sep 02 20:25:23 2010 +0300
@@ -224,6 +224,10 @@
 		   alarmDayIndex -= KDaysInWeek;
 		}
 	}
+	
+	if(mAlarmId) {
+		mAlarmClient.deleteAlarm(mAlarmId);
+	}
 
 	setAlarm(
 			mAlarmTimeItem->contentWidgetData("text").toString(),
@@ -245,6 +249,9 @@
 void ClockAlarmEditor::handleDeleteAction()
 {
 	OstTraceFunctionEntry0( CLOCKALARMEDITOR_HANDLEDELETEACTION_ENTRY );
+	if(mAlarmId) {
+		mAlarmClient.deleteAlarm(mAlarmId);
+	}
 	closeAlarmEditor();
 	OstTraceFunctionExit0( CLOCKALARMEDITOR_HANDLEDELETEACTION_EXIT );
 }
@@ -362,6 +369,9 @@
 		// Check if the Alarm days item is added.
 		// Remove if already added.
 		if (mAlarmDayItemInserted) {
+			mAlarmEditorForm->removeConnection(
+								mAlarmDayItem, SIGNAL(currentIndexChanged(int)),
+								this, SLOT(handleDayChanged(int)));
 			mAlarmEditorModel->removeItem(mAlarmDayItem);
 			mAlarmDayItemInserted = false;
 		}
@@ -524,7 +534,8 @@
 		
 		editor->setSelection(0, 0);
 		if (editor->text().isEmpty()) {
-	        editor->setText(hbTrId("txt_clk_formlabel_val_alarm"));
+	    	mAlarmDescription->setContentWidgetData(
+	    			"text", hbTrId("txt_clk_formlabel_val_alarm"));
         }
 
 	}
@@ -692,7 +703,6 @@
 	// get the alarm details and fill it in mAlarmInfo.
 	if (mAlarmId) {
 		mAlarmClient.getAlarmInfo(mAlarmId, mAlarmInfo);
-		mAlarmClient.deleteAlarm(mAlarmId);
 	}
 	
 	// Set the value for previous alarm time.