Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
a7838c2b
Commit
a7838c2b
authored
Jan 21, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - unification of the common used path for QFileDialogs...
parent
d64f6aac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
19 deletions
+16
-19
modules/gui/qt4/components/open_panels.cpp
modules/gui/qt4/components/open_panels.cpp
+5
-16
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.cpp
+2
-2
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+8
-0
modules/gui/qt4/qt4.hpp
modules/gui/qt4/qt4.hpp
+1
-1
No files found.
modules/gui/qt4/components/open_panels.cpp
View file @
a7838c2b
...
...
@@ -65,14 +65,9 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
ADD_FILTER_ALL
(
fileTypes
);
fileTypes
.
replace
(
QString
(
";*"
),
QString
(
" *"
));
/* retrieve last known path used in file browsing */
char
*
psz_filepath
=
config_GetPsz
(
p_intf
,
"qt-filedialog-path"
);
// Make this QFileDialog a child of tempWidget from the ui.
dialogBox
=
new
FileOpenBox
(
ui
.
tempWidget
,
NULL
,
qfu
(
EMPTY_STR
(
psz_filepath
)
?
psz_filepath
:
p_intf
->
p_libvlc
->
psz_homedir
),
fileTypes
);
delete
psz_filepath
;
qfu
(
p_intf
->
p_sys
->
psz_filepath
),
fileTypes
);
dialogBox
->
setFileMode
(
QFileDialog
::
ExistingFiles
);
dialogBox
->
setAcceptMode
(
QFileDialog
::
AcceptOpen
);
...
...
@@ -138,7 +133,9 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
CONNECT
(
ui
.
sizeSubComboBox
,
currentIndexChanged
(
int
),
this
,
updateMRL
()
);
}
FileOpenPanel
::~
FileOpenPanel
(){}
FileOpenPanel
::~
FileOpenPanel
()
{
}
/* Show a fileBrowser to select a subtitle */
void
FileOpenPanel
::
browseFileSub
()
...
...
@@ -178,15 +175,7 @@ void FileOpenPanel::updateMRL()
void
FileOpenPanel
::
accept
()
{
//TODO set the completer
const
char
*
psz_filepath
=
config_GetPsz
(
p_intf
,
"qt-filedialog-path"
);
if
(
(
NULL
==
psz_filepath
)
||
strcmp
(
psz_filepath
,
qtu
(
dialogBox
->
directory
().
absolutePath
()
))
)
{
/* set dialog box current directory as last known path */
config_PutPsz
(
p_intf
,
"qt-filedialog-path"
,
qtu
(
dialogBox
->
directory
().
absolutePath
()
)
);
}
delete
psz_filepath
;
p_intf
->
p_sys
->
psz_filepath
=
qtu
(
dialogBox
->
directory
().
absolutePath
()
);
}
void
FileOpenBox
::
accept
()
...
...
modules/gui/qt4/dialogs_provider.cpp
View file @
a7838c2b
...
...
@@ -284,7 +284,7 @@ QStringList DialogsProvider::showSimpleOpen( QString help,
fileTypes
.
replace
(
QString
(
";*"
),
QString
(
" *"
));
return
QFileDialog
::
getOpenFileNames
(
NULL
,
help
.
isNull
()
?
qfu
(
I_OP_SEL_FILES
)
:
help
,
path
.
isNull
()
?
qfu
(
p_intf
->
p_
libvlc
->
psz_homedir
)
:
path
,
path
.
isNull
()
?
qfu
(
p_intf
->
p_
sys
->
psz_filepath
)
:
path
,
fileTypes
);
}
...
...
@@ -373,7 +373,7 @@ void DialogsProvider::saveAPlaylist()
{
QFileDialog
*
qfd
=
new
QFileDialog
(
NULL
,
qtr
(
"Choose a filename to save playlist"
),
qfu
(
p_intf
->
p_
libvlc
->
psz_homedir
),
qfu
(
p_intf
->
p_
sys
->
psz_filepath
),
qtr
(
"XSPF playlist (*.xspf);; "
)
+
qtr
(
"M3U playlist (*.m3u);; Any (*.*) "
)
);
qfd
->
setFileMode
(
QFileDialog
::
AnyFile
);
...
...
modules/gui/qt4/qt4.cpp
View file @
a7838c2b
...
...
@@ -331,6 +331,12 @@ static void Init( intf_thread_t *p_intf )
/* Last settings */
app
->
setQuitOnLastWindowClosed
(
false
);
/* retrieve last known path used in file browsing */
char
*
psz_path
=
config_GetPsz
(
p_intf
,
"qt-filedialog-path"
);
p_intf
->
p_sys
->
psz_filepath
=
EMPTY_STR
(
psz_path
)
?
psz_path
:
p_intf
->
p_libvlc
->
psz_homedir
;
delete
psz_path
;
/* Launch */
app
->
exec
();
...
...
@@ -347,6 +353,8 @@ static void Init( intf_thread_t *p_intf )
/* Destroy the MainInputManager */
MainInputManager
::
killInstance
();
delete
p_intf
->
p_sys
->
psz_filepath
;
delete
app
;
}
...
...
modules/gui/qt4/qt4.hpp
View file @
a7838c2b
...
...
@@ -51,8 +51,8 @@ struct intf_sys_t
msg_subscription_t
*
p_sub
;
///< Subscription to the message bank
VideoWidget
*
p_video
;
int
i_saved_height
,
i_saved_width
;
char
*
psz_filepath
;
QMenu
*
p_popup_menu
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment