equal
deleted
inserted
replaced
23 #include "fmlogger.h" |
23 #include "fmlogger.h" |
24 #include "fmutils.h" |
24 #include "fmutils.h" |
25 #include "fmdrivemodel.h" |
25 #include "fmdrivemodel.h" |
26 #include "fmcommon.h" |
26 #include "fmcommon.h" |
27 |
27 |
28 #include "hbwidget.h" |
28 #include <hbwidget.h> |
29 #include "hblabel.h" |
29 #include <hblabel.h> |
30 #include "hbaction.h" |
30 #include <hbaction.h> |
31 #include "hbpushbutton.h" |
31 #include <hbpushbutton.h> |
32 #include "hblineedit.h" |
32 #include <hblineedit.h> |
33 |
33 #include <hbtranslator.h> |
|
34 |
34 #include <QGraphicsLinearLayout> |
35 #include <QGraphicsLinearLayout> |
35 #include <QEventLoop> |
36 #include <QEventLoop> |
36 |
37 |
37 FmFileDialog::FmFileDialog( QGraphicsItem *parent ) : |
38 FmFileDialog::FmFileDialog( QGraphicsItem *parent ) : |
38 HbDialog( parent ), d_ptr( new FmFileDialogPrivate( this ) ) |
39 HbDialog( parent ), d_ptr( new FmFileDialogPrivate( this ) ) |
48 const QString &title, |
49 const QString &title, |
49 const QString &dir, |
50 const QString &dir, |
50 const QStringList &nameFilters, |
51 const QStringList &nameFilters, |
51 Options options ) |
52 Options options ) |
52 { |
53 { |
53 |
54 HbTranslator translator("filemanager"); |
|
55 translator.loadCommon(); |
|
56 |
54 QString ret; |
57 QString ret; |
55 |
58 |
56 FmFileDialogPrivate::FmFileDialogArgs args; |
59 FmFileDialogPrivate::FmFileDialogArgs args; |
57 args.mDialogMode = FmFileDialogPrivate::GetDirMode; |
60 args.mDialogMode = FmFileDialogPrivate::GetDirMode; |
58 args.mTitle = title; |
61 args.mTitle = title; |
66 args.mOptions = options; |
69 args.mOptions = options; |
67 |
70 |
68 FmFileDialog dialog( parent ); |
71 FmFileDialog dialog( parent ); |
69 dialog.d_ptr->init( args ); |
72 dialog.d_ptr->init( args ); |
70 if( dialog.exec() ) { |
73 if( dialog.exec() ) { |
71 ret = FmUtils::formatPath( dialog.d_ptr->currentPath() ); |
74 ret = FmUtils::fillPathWithSplash( dialog.d_ptr->currentPath() ); |
72 } |
75 } |
73 return ret; |
76 return ret; |
74 } |
77 } |
75 |
78 |
76 QString FmFileDialog::getOpenFileName( HbWidget *parent, |
79 QString FmFileDialog::getOpenFileName( HbWidget *parent, |
77 const QString &title, |
80 const QString &title, |
78 const QString &dir, |
81 const QString &dir, |
79 const QStringList &nameFilters, |
82 const QStringList &nameFilters, |
80 Options options ) |
83 Options options ) |
81 { |
84 { |
82 |
85 HbTranslator translator("filemanager"); |
|
86 translator.loadCommon(); |
|
87 |
83 QString ret; |
88 QString ret; |
84 |
89 |
85 FmFileDialogPrivate::FmFileDialogArgs args; |
90 FmFileDialogPrivate::FmFileDialogArgs args; |
86 args.mDialogMode = FmFileDialogPrivate::GetFileMode; |
91 args.mDialogMode = FmFileDialogPrivate::GetFileMode; |
87 args.mTitle = title; |
92 args.mTitle = title; |
95 args.mOptions = options; |
100 args.mOptions = options; |
96 |
101 |
97 FmFileDialog dialog( parent ); |
102 FmFileDialog dialog( parent ); |
98 dialog.d_ptr->init( args ); |
103 dialog.d_ptr->init( args ); |
99 if( dialog.exec() ) { |
104 if( dialog.exec() ) { |
100 ret = FmUtils::formatPath( dialog.d_ptr->currentPath() ) |
105 ret = FmUtils::fillPathWithSplash( dialog.d_ptr->currentPath() ) |
101 + dialog.d_ptr->selectedFile(); |
106 + dialog.d_ptr->selectedFile(); |
102 } |
107 } |
103 return ret; |
108 return ret; |
104 } |
109 } |
105 |
110 |
108 const QString &title, |
113 const QString &title, |
109 const QString &dir, |
114 const QString &dir, |
110 const QStringList &nameFilters, |
115 const QStringList &nameFilters, |
111 Options options ) |
116 Options options ) |
112 { |
117 { |
|
118 HbTranslator translator("filemanager"); |
|
119 translator.loadCommon(); |
|
120 |
113 QString ret; |
121 QString ret; |
114 |
122 |
115 FmFileDialogPrivate::FmFileDialogArgs args; |
123 FmFileDialogPrivate::FmFileDialogArgs args; |
116 args.mDialogMode = FmFileDialogPrivate::SaveFileMode; |
124 args.mDialogMode = FmFileDialogPrivate::SaveFileMode; |
117 args.mTitle = title; |
125 args.mTitle = title; |
125 args.mOptions = options; |
133 args.mOptions = options; |
126 |
134 |
127 FmFileDialog dialog( parent ); |
135 FmFileDialog dialog( parent ); |
128 dialog.d_ptr->init( args ); |
136 dialog.d_ptr->init( args ); |
129 if( dialog.exec() ) { |
137 if( dialog.exec() ) { |
130 ret = FmUtils::formatPath( dialog.d_ptr->currentPath() ) |
138 ret = FmUtils::fillPathWithSplash( dialog.d_ptr->currentPath() ) |
131 + dialog.d_ptr->selectedFile(); |
139 + dialog.d_ptr->selectedFile(); |
132 } |
140 } |
133 return ret; |
141 return ret; |
134 } |
142 } |
135 |
143 |