comparison widgets/InteractiveFileFinder.cpp @ 842:8432d2551fb2 tonioni

Update subrepos and merge from default branch
author Chris Cannam
date Tue, 02 Sep 2014 16:23:48 +0100
parents 831188672987
children c02c51ae5238 a429b2acb45d
comparison
equal deleted inserted replaced
826:43256b925e15 842:8432d2551fb2
32 InteractiveFileFinder 32 InteractiveFileFinder
33 InteractiveFileFinder::m_instance; 33 InteractiveFileFinder::m_instance;
34 34
35 InteractiveFileFinder::InteractiveFileFinder() : 35 InteractiveFileFinder::InteractiveFileFinder() :
36 m_sessionExtension("sv"), 36 m_sessionExtension("sv"),
37 m_lastLocatedLocation("") 37 m_lastLocatedLocation(""),
38 m_parent(0)
38 { 39 {
39 SVDEBUG << "Registering interactive file finder" << endl; 40 SVDEBUG << "Registering interactive file finder" << endl;
40 FileFinder::registerFileFinder(this); 41 FileFinder::registerFileFinder(this);
41 } 42 }
42 43
43 InteractiveFileFinder::~InteractiveFileFinder() 44 InteractiveFileFinder::~InteractiveFileFinder()
44 { 45 {
46 }
47
48 void
49 InteractiveFileFinder::setParentWidget(QWidget *parent)
50 {
51 getInstance()->m_parent = parent;
45 } 52 }
46 53
47 void 54 void
48 InteractiveFileFinder::setApplicationSessionExtension(QString extension) 55 InteractiveFileFinder::setApplicationSessionExtension(QString extension)
49 { 56 {
160 167
161 QString path = ""; 168 QString path = "";
162 169
163 // Use our own QFileDialog just for symmetry with getSaveFileName below 170 // Use our own QFileDialog just for symmetry with getSaveFileName below
164 171
165 QFileDialog dialog; 172 QFileDialog dialog(m_parent);
166 dialog.setNameFilters(filter.split('\n')); 173 dialog.setNameFilters(filter.split('\n'));
167 dialog.setWindowTitle(title); 174 dialog.setWindowTitle(title);
168 dialog.setDirectory(lastPath); 175 dialog.setDirectory(lastPath);
169 176
170 dialog.setAcceptMode(QFileDialog::AcceptOpen); 177 dialog.setAcceptMode(QFileDialog::AcceptOpen);
304 QString path = ""; 311 QString path = "";
305 312
306 // Use our own QFileDialog instead of static functions, as we may 313 // Use our own QFileDialog instead of static functions, as we may
307 // need to adjust the file extension based on the selected filter 314 // need to adjust the file extension based on the selected filter
308 315
309 QFileDialog dialog; 316 QFileDialog dialog(m_parent);
310 317
311 QStringList filters = filter.split('\n'); 318 QStringList filters = filter.split('\n');
312 319
313 dialog.setNameFilters(filters); 320 dialog.setNameFilters(filters);
314 dialog.setWindowTitle(title); 321 dialog.setWindowTitle(title);