diff -r 491b3ed49290 -r 65326cf895ed filemanager/src/filemanager/src/components/fmdialog.cpp --- a/filemanager/src/filemanager/src/components/fmdialog.cpp Tue Aug 31 15:06:05 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * - * Description: - * The source file of filemanager base dialog class - */ - -#include "fmdialog.h" -#include - -FmDialog::FmDialog( QGraphicsItem *parent) : HbDialog( parent ), mRetAction( 0 ) -{ - -} - -HbAction *FmDialog::exec() -{ - HbDialog::open( this, SLOT(dialogClosed(HbAction*)) ); - mEventLoop.exec(); - return mRetAction; -} - -void FmDialog::dialogClosed(HbAction *action) -{ - mRetAction = action; - mEventLoop.exit(); -} - -HbAction *FmDialog::primaryAction() const -{ - QList actionList = QGraphicsWidget::actions(); - if (actionList.size() > 0) { - return (HbAction *)(actionList.at(0)); - } else { - return 0; - } - -} - -void FmDialog::setPrimaryAction( HbAction *action ) -{ - action->setObjectName( "primaryAction" ); - QList actionList = QGraphicsWidget::actions(); - if (actionList.size() == 0) { - QGraphicsWidget::addAction(action); - } else if (actionList.size() == 1) { - actionList.clear(); - QGraphicsWidget::addAction(action); - } else if (actionList.size() == 2) { - actionList.removeAt(0); - actionList.insert(0, action); - } -} - -HbAction *FmDialog::secondaryAction() const -{ - QList actionList = QGraphicsWidget::actions(); - if (actionList.size() > 1) { - return (HbAction *)(actionList.at(1)); - } else { - return 0; - } -} - -void FmDialog::setSecondaryAction( HbAction *action ) -{ - action->setObjectName( "secondaryAction" ); - QList actionList = QGraphicsWidget::actions(); - if (actionList.size() == 0) { - HbAction *primaryAction = new HbAction(hbTrId("txt_common_button_ok")); - primaryAction->setObjectName( "primaryAction" ); - QGraphicsWidget::addAction(primaryAction); - QGraphicsWidget::addAction(action); - } else if (actionList.size() == 1) { - QGraphicsWidget::addAction(action); - } else if (actionList.size() == 2) { - actionList.removeAt(1); - actionList.insert(1, action); - } -}