void KrecipesView::slotSetPanel( KrePanel p, bool highlightLeftButton )
{
	if (p != -1) {
		if ( (m_activePanel != RecipeEdit) && (m_activePanel != RecipeView) )
			m_previousActivePanel = m_activePanel;
		m_activePanel = p;
	}
	kDebug() << "current:" << m_activePanel << "previous" << m_previousActivePanel;

	switch ( p ) {
	case SelectP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button0 );
		rightPanel->setHeader( i18n( "Find/Edit Recipes" ), "system-search" );
		rightPanel->raise( selectPanel );
		break;
	case ShoppingP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button1 );
		rightPanel->setHeader( i18n( "Shopping List" ), "view-pim-tasks" );
		rightPanel->raise( shoppingListPanel );
		shoppingListPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case DietP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button7 );
		rightPanel->setHeader( i18n( "Diet Helper" ), "diet" );
		rightPanel->raise( dietPanel );
		dietPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case MatcherP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button8 );
		rightPanel->setHeader( i18n( "Ingredient Matcher" ), "view-filter" );
		rightPanel->raise( ingredientMatcherPanel );
		ingredientMatcherPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;

	case IngredientsP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button2 );
		rightPanel->setHeader( i18n( "Ingredients" ), "ingredients" );
		rightPanel->raise( ingredientsPanel );
		ingredientsPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case PropertiesP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button3 );
		rightPanel->setHeader( i18n( "Properties" ), "properties" );
		rightPanel->raise( propertiesPanel );
		//propertiesPanel->reload();
		emit signalChangeStatusbar( QString("") );
		break;
	case UnitsP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button4 );
		rightPanel->setHeader( i18n( "Units" ), "units" );
		rightPanel->raise( unitsPanel );
		unitsPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case PrepMethodsP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button9 );
		rightPanel->setHeader( i18n( "Preparation Methods" ), "methods" );
		rightPanel->raise( prepMethodsPanel );
		prepMethodsPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case CategoriesP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button5 );
		rightPanel->setHeader( i18n( "Categories" ), "folder-yellow" );
		rightPanel->raise( categoriesPanel );
		categoriesPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case AuthorsP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button6 );
		rightPanel->setHeader( i18n( "Authors" ), "authors" );
		rightPanel->raise( authorsPanel );
		authorsPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case RecipeEdit:
		rightPanel->setHeader( i18n( "Edit Recipe" ), "document-edit" );
		rightPanel->raise( inputPanel );
		emit signalChangeStatusbar( QString("") );
		break;
	case RecipeView:
		rightPanel->setHeader( i18n( "View Recipe" ), "system-search" );
		rightPanel->raise( viewPanel );
		emit signalChangeStatusbar( QString("") );
		break;
	}
}
void KrecipesView::slotSetPanel( KrePanel p, bool highlightLeftButton )
{
	if (p != -1) {
		if ( (m_activePanel != RecipeEdit) && (m_activePanel != RecipeView) )
			m_previousActivePanel = m_activePanel;
		m_activePanel = p;
	}
	kDebug() << "current:" << m_activePanel << "previous" << m_previousActivePanel;

	switch ( p ) {
	case SelectP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button0 );
		rightPanel->setHeader( i18n( "Find/Edit Recipes" ), "system-search" );
		rightPanel->raise( selectPanel );
		break;
	case ShoppingP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button1 );
		rightPanel->setHeader( i18n( "Shopping List" ), "view-pim-tasks" );
		rightPanel->raise( shoppingListPanel );
		shoppingListPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case DietP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button7 );
		rightPanel->setHeader( i18n( "Diet Helper" ), "diet" );
		rightPanel->raise( dietPanel );
		dietPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case MatcherP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button8 );
		rightPanel->setHeader( i18n( "Ingredient Matcher" ), "view-filter" );
		rightPanel->raise( ingredientMatcherPanel );
		ingredientMatcherPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;

	case IngredientsP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button2 );
		rightPanel->setHeader( i18n( "Ingredients" ), "ingredients" );
		rightPanel->raise( ingredientsPanel );
		ingredientsPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case PropertiesP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button3 );
		rightPanel->setHeader( i18n( "Properties" ), "properties" );
		rightPanel->raise( propertiesPanel );
		 
		emit signalChangeStatusbar( QString("") );
		break;
	case UnitsP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button4 );
		rightPanel->setHeader( i18n( "Units" ), "units" );
		rightPanel->raise( unitsPanel );
		unitsPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case PrepMethodsP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button9 );
		rightPanel->setHeader( i18n( "Preparation Methods" ), "methods" );
		rightPanel->raise( prepMethodsPanel );
		prepMethodsPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case CategoriesP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button5 );
		rightPanel->setHeader( i18n( "Categories" ), "folder-yellow" );
		rightPanel->raise( categoriesPanel );
		categoriesPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case AuthorsP:
		if ( highlightLeftButton )
			leftPanel->highlightButton( button6 );
		rightPanel->setHeader( i18n( "Authors" ), "authors" );
		rightPanel->raise( authorsPanel );
		authorsPanel->reload( Load );
		emit signalChangeStatusbar( QString("") );
		break;
	case RecipeEdit:
		rightPanel->setHeader( i18n( "Edit Recipe" ), "document-edit" );
		rightPanel->raise( inputPanel );
		emit signalChangeStatusbar( QString("") );
		break;
	case RecipeView:
		rightPanel->setHeader( i18n( "View Recipe" ), "system-search" );
		rightPanel->raise( viewPanel );
		emit signalChangeStatusbar( QString("") );
		break;
	}
}