Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
a622a74a
Commit
a622a74a
authored
Mar 15, 2009
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: remove Preferences singleton. Simplify and Close #2552 and #2551
parent
db8fce29
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
63 deletions
+7
-63
modules/gui/qt4/dialogs/preferences.cpp
modules/gui/qt4/dialogs/preferences.cpp
+3
-50
modules/gui/qt4/dialogs/preferences.hpp
modules/gui/qt4/dialogs/preferences.hpp
+2
-12
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.cpp
+2
-1
No files found.
modules/gui/qt4/dialogs/preferences.cpp
View file @
a622a74a
...
@@ -39,8 +39,6 @@
...
@@ -39,8 +39,6 @@
#include <QMessageBox>
#include <QMessageBox>
#include <QDialogButtonBox>
#include <QDialogButtonBox>
PrefsDialog
*
PrefsDialog
::
instance
=
NULL
;
PrefsDialog
::
PrefsDialog
(
QWidget
*
parent
,
intf_thread_t
*
_p_intf
)
PrefsDialog
::
PrefsDialog
(
QWidget
*
parent
,
intf_thread_t
*
_p_intf
)
:
QVLCDialog
(
parent
,
_p_intf
)
:
QVLCDialog
(
parent
,
_p_intf
)
{
{
...
@@ -294,56 +292,13 @@ void PrefsDialog::save()
...
@@ -294,56 +292,13 @@ void PrefsDialog::save()
/* Save to file */
/* Save to file */
config_SaveConfigFile
(
p_intf
,
NULL
);
config_SaveConfigFile
(
p_intf
,
NULL
);
accept
();
destroyPanels
();
hide
();
}
void
PrefsDialog
::
destroyPanels
()
{
msg_Dbg
(
p_intf
,
"Destroying the Panels"
);
/* Delete the other panel in order to force its reload after clicking
on apply. In fact, if we don't do that, the preferences from the other
panels won't be accurate, so we would have to recreate the whole dialog,
and we don't want that.*/
if
(
small
->
isChecked
()
&&
advanced_panel
)
{
/* Deleting only the active panel from the advanced config doesn't work
because the data records of PrefsItemData contains still a
reference to it only cleanAll() is sure to remove all Panels! */
advanced_tree
->
cleanAll
();
advanced_panel
=
NULL
;
}
if
(
all
->
isChecked
()
&&
current_simple_panel
)
{
for
(
int
i
=
0
;
i
<
SPrefsMax
;
i
++
)
{
if
(
simple_panels
[
i
]
)
{
delete
simple_panels
[
i
];
simple_panels
[
i
]
=
NULL
;
}
}
current_simple_panel
=
NULL
;
}
}
}
/* Clean the preferences, dunno if it does something really */
/* Clean the preferences, dunno if it does something really */
void
PrefsDialog
::
cancel
()
void
PrefsDialog
::
cancel
()
{
{
if
(
small
->
isChecked
()
&&
simple_tree
)
reject
();
{
for
(
int
i
=
0
;
i
<
SPrefsMax
;
i
++
)
if
(
simple_panels
[
i
]
)
simple_panels
[
i
]
->
clean
();
}
else
if
(
all
->
isChecked
()
&&
advanced_tree
)
{
advanced_tree
->
cleanAll
();
advanced_panel
=
NULL
;
}
hide
();
}
}
/* Reset all the preferences, when you click the button */
/* Reset all the preferences, when you click the button */
...
@@ -362,8 +317,6 @@ void PrefsDialog::reset()
...
@@ -362,8 +317,6 @@ void PrefsDialog::reset()
config_SaveConfigFile
(
p_intf
,
NULL
);
config_SaveConfigFile
(
p_intf
,
NULL
);
getSettings
()
->
clear
();
getSettings
()
->
clear
();
close
();
accept
();
instance
=
NULL
;
PrefsDialog
::
getInstance
(
p_intf
)
->
show
();
}
}
}
}
modules/gui/qt4/dialogs/preferences.hpp
View file @
a622a74a
...
@@ -45,24 +45,16 @@ class PrefsDialog : public QVLCDialog
...
@@ -45,24 +45,16 @@ class PrefsDialog : public QVLCDialog
{
{
Q_OBJECT
;
Q_OBJECT
;
public:
public:
static
PrefsDialog
*
getInstance
(
intf_thread_t
*
p_intf
)
PrefsDialog
(
QWidget
*
,
intf_thread_t
*
);
{
virtual
~
PrefsDialog
()
{}
if
(
!
instance
)
instance
=
new
PrefsDialog
(
(
QWidget
*
)
p_intf
->
p_sys
->
p_mi
,
p_intf
);
return
instance
;
}
virtual
~
PrefsDialog
()
{
instance
=
NULL
;
}
#if 0
#if 0
/*Called from extended settings, is not used anymore, but could be useful one day*/
/*Called from extended settings, is not used anymore, but could be useful one day*/
void showModulePrefs( char* );
void showModulePrefs( char* );
#endif
#endif
private:
private:
PrefsDialog
(
QWidget
*
,
intf_thread_t
*
);
QGridLayout
*
main_layout
;
QGridLayout
*
main_layout
;
void
destroyPanels
();
QWidget
*
main_panel
;
QWidget
*
main_panel
;
QHBoxLayout
*
main_panel_l
;
QHBoxLayout
*
main_panel_l
;
...
@@ -79,8 +71,6 @@ private:
...
@@ -79,8 +71,6 @@ private:
QGroupBox
*
types
;
QGroupBox
*
types
;
QRadioButton
*
small
,
*
all
;
QRadioButton
*
small
,
*
all
;
static
PrefsDialog
*
instance
;
bool
b_small
;
bool
b_small
;
private
slots
:
private
slots
:
...
...
modules/gui/qt4/dialogs_provider.cpp
View file @
a622a74a
...
@@ -172,7 +172,8 @@ void DialogsProvider::playlistDialog()
...
@@ -172,7 +172,8 @@ void DialogsProvider::playlistDialog()
void
DialogsProvider
::
prefsDialog
()
void
DialogsProvider
::
prefsDialog
()
{
{
PrefsDialog
::
getInstance
(
p_intf
)
->
toggleVisible
();
PrefsDialog
*
p
=
new
PrefsDialog
(
(
QWidget
*
)
p_intf
->
p_sys
->
p_mi
,
p_intf
);
p
->
toggleVisible
();
}
}
void
DialogsProvider
::
extendedDialog
()
void
DialogsProvider
::
extendedDialog
()
...
...
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