filemanager/src/fmfiledialog/src/fmfiledialog_p.cpp
changeset 37 15bc28c9dd51
parent 16 ada7962b4308
child 46 d58987eac7e8
--- a/filemanager/src/fmfiledialog/src/fmfiledialog_p.cpp	Mon May 03 12:24:39 2010 +0300
+++ b/filemanager/src/fmfiledialog/src/fmfiledialog_p.cpp	Tue Aug 24 10:24:14 2010 +0800
@@ -90,11 +90,13 @@
 {
     // Create action for ok button and assign it to the primary action of popup
     mOkAction = new HbAction( primaryActionText, mFileDialog );
+    mOkAction->setObjectName( "okAction" );
     Q_ASSERT( mOkAction );
     mFileDialog->setPrimaryAction( mOkAction );
 
     // Create action for cancel button and assign it to the secondary action of popup
     mCancelAction = new HbAction( secondaryActionText, mFileDialog );
+    mCancelAction->setObjectName( "cancelAction" );
     Q_ASSERT( mCancelAction );
     mFileDialog->setSecondaryAction( mCancelAction );
 }
@@ -144,6 +146,7 @@
 void FmFileDialogPrivate::createHeadingWidget()
 {
     mHeadingWidget = new HbWidget( mFileDialog );
+    mHeadingWidget->setObjectName( "headingWidget" ); 
 
     QGraphicsLinearLayout *headingLayout = new QGraphicsLinearLayout;
     headingLayout->setOrientation(Qt::Horizontal);
@@ -154,6 +157,7 @@
     titleLayout->setOrientation(Qt::Vertical);    
 
     mTitleLabel = new HbLabel();
+    mTitleLabel->setObjectName( "titleLabel" );
     if( mArgs.mTitle.isEmpty() ){
         mTitleLabel->setPlainText( QString( FmPlaceholderString ) );
     } else {
@@ -161,9 +165,11 @@
     }
 
     mCurrentPathLabel = new HbLabel( QString( FmPlaceholderString ) );
+    mCurrentPathLabel->setObjectName( "currentPathLabel" );
     mCurrentPathLabel->setElideMode(Qt::ElideRight);
 
     mUpButton  = new HbPushButton;
+    mUpButton->setObjectName( "upButton" );
     mUpButton->setIcon(HbIcon(backButtonIcon));
 
     titleLayout->addItem( mTitleLabel );
@@ -187,6 +193,7 @@
 void FmFileDialogPrivate::createContentWidget()
 {
     mContentWidget = new HbWidget( mFileDialog );
+    mContentWidget->setObjectName( "contentWidget" );
 
     mContentLayout = new QGraphicsLinearLayout;
     mContentLayout->setOrientation(Qt::Vertical);
@@ -194,6 +201,7 @@
     mContentWidget->setLayout( mContentLayout );
 
     mFileWidget = new FmFileWidget( mContentWidget );
+    mFileWidget->setObjectName( "fileWidget" );
     mContentLayout->addItem( mFileWidget );
 
     mFileDialog->setContentWidget( mContentWidget );
@@ -210,15 +218,18 @@
         return;
     }
     HbWidget *bottomWidget = new HbWidget( mContentWidget );
+    bottomWidget->setObjectName( "bottomWidget" );
     mContentLayout->addItem( bottomWidget );
 
     QGraphicsLinearLayout *bottomLayout = new QGraphicsLinearLayout;
     bottomLayout->setOrientation( Qt::Horizontal );
 
     mFileNameTitleLabel = new HbLabel( mFileDialog->tr( "file name:" ), bottomWidget );
+    mFileNameTitleLabel->setObjectName( "fileNameTitleLabel" );
     bottomLayout->addItem( mFileNameTitleLabel );
 
     mFileNameLineEdit = new HbLineEdit( bottomWidget );
+    mFileNameLineEdit->setObjectName( "fileNameLineEdit" );
     bottomLayout->addItem( mFileNameLineEdit );    
 
     bottomWidget->setLayout( bottomLayout );
@@ -256,10 +267,12 @@
         }
         break;
     case SaveFileMode:
-        if( mFileWidget->currentPath().absoluteFilePath().isEmpty() ) {
-            mFileNameLineEdit->setReadOnly( true );
-        } else {
-            mFileNameLineEdit->setReadOnly( false );
+        if( mFileNameLineEdit ){
+            if( mFileWidget->currentPath().absoluteFilePath().isEmpty() ) {
+                mFileNameLineEdit->setReadOnly( true );
+            } else {
+                mFileNameLineEdit->setReadOnly( false );
+            }
         }
         break;
     }
@@ -357,4 +370,19 @@
     return false;
 }
 
+void FmFileDialogPrivate::setRetAction( HbAction *action )
+{
+    mRetAction = action;
+}
+
+HbAction *FmFileDialogPrivate::retAction()
+{
+    return mRetAction;
+}
+
+QEventLoop &FmFileDialogPrivate::eventLoop()
+{
+    return mEventLoop;
+}
+    
 #include "moc_fmfiledialog.cpp"