notes/notesui/notesviews/src/notestodoview.cpp
changeset 50 579cc610882e
parent 26 a949c2543c15
child 58 ef813d54df51
equal deleted inserted replaced
49:5de72ea7a065 50:579cc610882e
   113 	connect(
   113 	connect(
   114 			mListView,
   114 			mListView,
   115 			SIGNAL(longPressed(HbAbstractViewItem *, const QPointF &)),
   115 			SIGNAL(longPressed(HbAbstractViewItem *, const QPointF &)),
   116 			this,
   116 			this,
   117 			SLOT(handleItemLongPressed(HbAbstractViewItem *, const QPointF &)));
   117 			SLOT(handleItemLongPressed(HbAbstractViewItem *, const QPointF &)));
   118 
   118 	
       
   119 	// Get the empty list string.
       
   120 	mEmptyListLabel = static_cast<HbLabel *> (
       
   121 			mDocLoader->findWidget("emptyListLabel"));
       
   122 	
   119 	// Get the toolbar/menu actions.
   123 	// Get the toolbar/menu actions.
   120 	mAddTodoAction = static_cast<HbAction *> (
   124 	mAddTodoAction = static_cast<HbAction *> (
   121 			mDocLoader->findObject("newTodoAction"));
   125 			mDocLoader->findObject("newTodoAction"));
   122 	connect(
   126 	connect(
   123 			mAddTodoAction, SIGNAL(triggered()),
   127 			mAddTodoAction, SIGNAL(triggered()),
   129 			mAllNotesAction, SIGNAL(triggered()),
   133 			mAllNotesAction, SIGNAL(triggered()),
   130 			this, SLOT(displayAllNotesView()));
   134 			this, SLOT(displayAllNotesView()));
   131 
   135 
   132 	mViewCollectionAction = static_cast<HbAction *> (
   136 	mViewCollectionAction = static_cast<HbAction *> (
   133 			mDocLoader->findObject("displayCollectionsAction"));
   137 			mDocLoader->findObject("displayCollectionsAction"));
   134 	mViewCollectionAction->setCheckable(true);
   138 	
   135 	mViewCollectionAction->setChecked(true);
       
   136 	connect(
   139 	connect(
   137 			mViewCollectionAction, SIGNAL(changed()),
   140 			mViewCollectionAction, SIGNAL(changed()),
   138 			this, SLOT(handleActionStateChanged()));
   141 			this, SLOT(handleActionStateChanged()));
   139 	connect(
   142 	connect(
   140 			mViewCollectionAction, SIGNAL(triggered()),
   143 			mViewCollectionAction, SIGNAL(triggered()),
   437 	// Get the number of notes and to-do entries.
   440 	// Get the number of notes and to-do entries.
   438 	QList<ulong> entries = mAgendaUtil->entryIds(
   441 	QList<ulong> entries = mAgendaUtil->entryIds(
   439 		AgendaUtil::IncludeIncompletedTodos);
   442 		AgendaUtil::IncludeIncompletedTodos);
   440 	mSubTitle->setHeading(
   443 	mSubTitle->setHeading(
   441 			hbTrId("txt_notes_subhead_todos_ln_pending",entries.count()));
   444 			hbTrId("txt_notes_subhead_todos_ln_pending",entries.count()));
       
   445 	
       
   446 	if (0 >= entries.count()) {
       
   447 		mEmptyListLabel->show();
       
   448 		mListView->hide();
       
   449 	} else {
       
   450 		mEmptyListLabel->hide();
       
   451 		mListView->show();
       
   452 	}
   442 }
   453 }
   443 
   454 
   444 /*
   455 /*
   445 	Opens the to-do viewer to view the to-do.
   456 	Opens the to-do viewer to view the to-do.
   446  */
   457  */