void KrecipesView::actionRecipe( int recipeID, int action )
{
	//FIXME: Don't use magic numbers, use enums instead
	switch ( action ) {
	case 0:  //Show
		{
			showRecipe( recipeID );
			break;
		}
	case 1:  // Edit
		{
			if ( !inputPanel->everythingSaved() )
			{
				switch ( KMessageBox::questionYesNoCancel( this,
					i18n( "A recipe contains unsaved changes.\n"
					"Do you want to save changes made to this recipe before editing another recipe?" ),
					i18n( "Unsaved changes" ) ) ) {
				case KMessageBox::Yes:
					inputPanel->save();
					break;
				case KMessageBox::No:
					break;
				case KMessageBox::Cancel:
					return ;
				}
			}

			inputPanel->loadRecipe( recipeID );
			slotSetPanel( RecipeEdit );
			break;
		}
	case 2:  //Remove
		{
			switch ( KMessageBox::questionYesNo( this,
				i18n( "Are you sure you want to permanently remove the recipe, %1?"  ,database->recipeTitle(recipeID)),
				i18n( "Confirm remove" ) ) )
			{
			case KMessageBox::Yes:
				database->removeRecipe( recipeID );
				break;
			case KMessageBox::No:
				break;
			}
			QWidget * vis_panel = rightPanel->visiblePanel();
			if ( vis_panel == selectPanel )
				selectPanel->getActionsHandler()->selectionChangedSlot();
			break;
		}
	case 3:  //Add to shopping list
		{
			shoppingListPanel->addRecipeToShoppingList( recipeID );
			break;
		}
	case 4: //Show text in status bar
		{
			Recipe r;
 			database->loadRecipe(&r,RecipeDB::Meta|RecipeDB::Noatime,recipeID );

			KLocale *locale = KGlobal::locale();

			QString statusText = QString("<b>%1</b> %2 <b>%3</b> %4 <b>%5</b> %6")
			.arg(i18nc("Recipe created", "Created:")).arg(locale->formatDateTime(r.ctime))
			.arg(i18nc("Recipe modified", "Modified:")).arg(locale->formatDateTime(r.mtime))
			.arg(i18nc("Recipe last accessed", "Last Accessed:")).arg(locale->formatDateTime(r.atime));

			emit signalChangeStatusbar( statusText );
			break;
		}
	case 5: //Clear text in status bar
		{
			emit signalChangeStatusbar( QString("") );
			break;
		}
	}
}
void KrecipesView::actionRecipe( int recipeID, int action )
{
	 
	switch ( action ) {
	case 0:   
		{
			showRecipe( recipeID );
			break;
		}
	case 1:   
		{
			if ( !inputPanel->everythingSaved() )
			{
				switch ( KMessageBox::questionYesNoCancel( this,
					i18n( "A recipe contains unsaved changes.\n"
					"Do you want to save changes made to this recipe before editing another recipe?" ),
					i18n( "Unsaved changes" ) ) ) {
				case KMessageBox::Yes:
					inputPanel->save();
					break;
				case KMessageBox::No:
					break;
				case KMessageBox::Cancel:
					return ;
				}
			}

			inputPanel->loadRecipe( recipeID );
			slotSetPanel( RecipeEdit );
			break;
		}
	case 2:   
		{
			switch ( KMessageBox::questionYesNo( this,
				i18n( "Are you sure you want to permanently remove the recipe, %1?"  ,database->recipeTitle(recipeID)),
				i18n( "Confirm remove" ) ) )
			{
			case KMessageBox::Yes:
				database->removeRecipe( recipeID );
				break;
			case KMessageBox::No:
				break;
			}
			QWidget * vis_panel = rightPanel->visiblePanel();
			if ( vis_panel == selectPanel )
				selectPanel->getActionsHandler()->selectionChangedSlot();
			break;
		}
	case 3:   
		{
			shoppingListPanel->addRecipeToShoppingList( recipeID );
			break;
		}
	case 4:  
		{
			Recipe r;
 			database->loadRecipe(&r,RecipeDB::Meta|RecipeDB::Noatime,recipeID );

			KLocale *locale = KGlobal::locale();

			QString statusText = QString("<b>%1</b> %2 <b>%3</b> %4 <b>%5</b> %6")
			.arg(i18nc("Recipe created", "Created:")).arg(locale->formatDateTime(r.ctime))
			.arg(i18nc("Recipe modified", "Modified:")).arg(locale->formatDateTime(r.mtime))
			.arg(i18nc("Recipe last accessed", "Last Accessed:")).arg(locale->formatDateTime(r.atime));

			emit signalChangeStatusbar( statusText );
			break;
		}
	case 5:  
		{
			emit signalChangeStatusbar( QString("") );
			break;
		}
	}
}