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
2aa9dde7
Commit
2aa9dde7
authored
May 07, 2003
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modules/gui/beos/PreferencesWindow.cpp:
Misc enhancements
parent
41409dfc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
19 deletions
+58
-19
modules/gui/beos/PreferencesWindow.cpp
modules/gui/beos/PreferencesWindow.cpp
+58
-19
No files found.
modules/gui/beos/PreferencesWindow.cpp
View file @
2aa9dde7
...
...
@@ -2,7 +2,7 @@
* PreferencesWindow.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: PreferencesWindow.cpp,v 1.1
6 2003/05/05 13:06:02
titer Exp $
* $Id: PreferencesWindow.cpp,v 1.1
7 2003/05/07 16:47:10
titer Exp $
*
* Authors: Eric Petit <titer@videolan.org>
*
...
...
@@ -31,6 +31,28 @@
#include "PreferencesWindow.h"
/* We use this function to order the items of the BOutlineView */
int
compare_func
(
const
BListItem
*
_first
,
const
BListItem
*
_second
)
{
StringItemWithView
*
first
=
(
StringItemWithView
*
)
_first
;
StringItemWithView
*
second
=
(
StringItemWithView
*
)
_second
;
/* the beos module first */
if
(
!
strcmp
(
first
->
Text
(),
"beos"
)
)
return
-
1
;
if
(
!
strcmp
(
second
->
Text
(),
"beos"
)
)
return
1
;
/* the main module in second */
if
(
!
strcmp
(
first
->
Text
(),
"main"
)
)
return
-
1
;
if
(
!
strcmp
(
second
->
Text
(),
"main"
)
)
return
1
;
/* alphabetic order */
return
(
strcmp
(
first
->
Text
(),
second
->
Text
()
)
);
}
/*****************************************************************************
* StringItemWithView::StringItemWithView
*****************************************************************************/
...
...
@@ -90,14 +112,19 @@ PreferencesWindow::PreferencesWindow( intf_thread_t * p_interface,
fDummyView
=
new
BView
(
rect
,
""
,
B_FOLLOW_ALL_SIDES
,
B_WILL_DRAW
);
fPrefsView
->
AddChild
(
fDummyView
);
/* Add a category for modules configuration */
StringItemWithView
*
modulesItem
;
modulesItem
=
new
StringItemWithView
(
_
(
"Modules"
)
);
modulesItem
->
fConfigView
=
NULL
;
fOutline
->
AddItem
(
modulesItem
);
/* Fill the tree */
/* TODO:
- manage CONFIG_HINT_SUBCATEGORY
- use a pop-up for CONFIG_HINT_MODULE
- use BSliders for integer_with_range and float_with_range
- add a tab for BeOS specific configution (screenshot path, etc)
- add the needed LockLooper()s
- fix window resizing
- fix
horizontal
window resizing
- make this intuitive ! */
vlc_list_t
*
p_list
;
p_list
=
vlc_list_find
(
p_intf
,
VLC_OBJECT_MODULE
,
FIND_ANYWHERE
);
...
...
@@ -220,7 +247,11 @@ PreferencesWindow::PreferencesWindow( intf_thread_t * p_interface,
StringItemWithView
*
stringItem
;
stringItem
=
new
StringItemWithView
(
p_module
->
psz_object_name
);
stringItem
->
fConfigView
=
configView
;
if
(
!
strcmp
(
p_module
->
psz_object_name
,
"beos"
)
||
!
strcmp
(
p_module
->
psz_object_name
,
"main"
)
)
fOutline
->
AddItem
(
stringItem
);
else
fOutline
->
AddUnder
(
stringItem
,
modulesItem
);
}
vlc_list_release
(
p_list
);
...
...
@@ -228,6 +259,10 @@ PreferencesWindow::PreferencesWindow( intf_thread_t * p_interface,
/* Set the correct values */
ApplyChanges
(
false
);
/* Sort items, collapse the Modules one */
fOutline
->
FullListSortItems
(
compare_func
);
fOutline
->
Collapse
(
modulesItem
);
/* Select the first item */
fOutline
->
Select
(
0
);
...
...
@@ -306,16 +341,12 @@ void PreferencesWindow::FrameResized( float width, float height )
{
BWindow
::
FrameResized
(
width
,
height
);
StringItemWithView
*
item
;
/* Get the current ConfigView */
ConfigView
*
view
;
for
(
int
i
=
0
;
i
<
fOutline
->
CountItems
();
i
++
)
{
/* Fix ConfigView sizes */
item
=
(
StringItemWithView
*
)
fOutline
->
ItemAt
(
i
);
view
=
item
->
fConfigView
;
view
=
(
ConfigView
*
)
fConfigScroll
->
ChildAt
(
0
);
view
->
ResizeTo
(
fDummyView
->
Bounds
().
Width
()
-
B_V_SCROLL_BAR_WIDTH
,
fDummyView
->
Bounds
().
Height
()
);
}
UpdateScrollBar
();
}
...
...
@@ -325,12 +356,16 @@ void PreferencesWindow::FrameResized( float width, float height )
*****************************************************************************/
void
PreferencesWindow
::
Update
()
{
/* Get the selected item */
/* Get the selected item
, if any
*/
if
(
fOutline
->
CurrentSelection
()
<
0
)
return
;
StringItemWithView
*
selectedItem
=
(
StringItemWithView
*
)
fOutline
->
ItemAt
(
fOutline
->
CurrentSelection
()
);
if
(
!
selectedItem
->
fConfigView
)
/* This must be the "Modules" item */
return
;
if
(
fConfigScroll
)
{
/* If we don't do this, the ConfigView will remember a wrong position */
...
...
@@ -345,6 +380,10 @@ void PreferencesWindow::Update()
delete
fConfigScroll
;
}
selectedItem
->
fConfigView
->
ResizeTo
(
fDummyView
->
Bounds
().
Width
()
-
B_V_SCROLL_BAR_WIDTH
,
fDummyView
->
Bounds
().
Height
()
);
/* Create a BScrollView with the new ConfigView in it */
fConfigScroll
=
new
BScrollView
(
""
,
selectedItem
->
fConfigView
,
B_FOLLOW_ALL_SIDES
,
0
,
false
,
true
,
B_NO_BORDER
);
...
...
@@ -363,11 +402,7 @@ void PreferencesWindow::UpdateScrollBar()
/* Get the current config view */
ConfigView
*
view
;
if
(
fOutline
->
CurrentSelection
()
<
0
)
return
;
StringItemWithView
*
selectedItem
=
(
StringItemWithView
*
)
fOutline
->
ItemAt
(
fOutline
->
CurrentSelection
()
);
view
=
selectedItem
->
fConfigView
;
view
=
(
ConfigView
*
)
fConfigScroll
->
ChildAt
(
0
);
/* Get the available BRect for display */
BRect
display
=
fConfigScroll
->
Bounds
();
...
...
@@ -401,6 +436,10 @@ void PreferencesWindow::ApplyChanges( bool doIt )
item
=
(
StringItemWithView
*
)
fOutline
->
ItemAt
(
i
);
view
=
item
->
fConfigView
;
if
(
!
view
)
/* This must be the "Modules" item */
continue
;
for
(
int
j
=
0
;
j
<
view
->
CountChildren
();
j
++
)
{
child
=
view
->
ChildAt
(
j
);
...
...
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