Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
766acd38
Commit
766acd38
authored
Apr 05, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - Make Open dialog KDE/GNOME/WIN32 compliant for buttons...
parent
f5a1e36b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
56 deletions
+51
-56
modules/gui/qt4/dialogs/open.cpp
modules/gui/qt4/dialogs/open.cpp
+41
-16
modules/gui/qt4/dialogs/open.hpp
modules/gui/qt4/dialogs/open.hpp
+5
-1
modules/gui/qt4/ui/open.ui
modules/gui/qt4/ui/open.ui
+5
-39
No files found.
modules/gui/qt4/dialogs/open.cpp
View file @
766acd38
...
...
@@ -47,6 +47,7 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal,
setWindowTitle
(
qtr
(
"Open"
)
);
resize
(
500
,
300
);
/* Tab definition and creation */
fileOpenPanel
=
new
FileOpenPanel
(
ui
.
Tab
,
p_intf
);
diskOpenPanel
=
new
DiskOpenPanel
(
ui
.
Tab
,
p_intf
);
netOpenPanel
=
new
NetOpenPanel
(
ui
.
Tab
,
p_intf
);
...
...
@@ -57,8 +58,38 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal,
ui
.
Tab
->
addTab
(
netOpenPanel
,
qtr
(
"&Network"
)
);
ui
.
Tab
->
addTab
(
captureOpenPanel
,
qtr
(
"Capture &Device"
)
);
/* Hide the advancedPanel */
ui
.
advancedFrame
->
hide
();
/* Buttons Creation */
QSizePolicy
buttonSizePolicy
(
static_cast
<
QSizePolicy
::
Policy
>
(
7
),
static_cast
<
QSizePolicy
::
Policy
>
(
1
));
buttonSizePolicy
.
setHorizontalStretch
(
0
);
buttonSizePolicy
.
setVerticalStretch
(
0
);
playButton
=
new
QToolButton
();
playButton
->
setText
(
qtr
(
"&Play"
)
);
playButton
->
setSizePolicy
(
buttonSizePolicy
);
playButton
->
setMinimumSize
(
QSize
(
90
,
0
));
playButton
->
setPopupMode
(
QToolButton
::
MenuButtonPopup
);
playButton
->
setToolButtonStyle
(
Qt
::
ToolButtonTextOnly
);
cancelButton
=
new
QToolButton
();
cancelButton
->
setText
(
qtr
(
"&Cancel"
)
);
cancelButton
->
setSizePolicy
(
buttonSizePolicy
);
QMenu
*
openButtonMenu
=
new
QMenu
(
"Open"
);
openButtonMenu
->
addAction
(
qtr
(
"&Enqueue"
),
this
,
SLOT
(
enqueue
()
),
QKeySequence
(
"Alt+E"
)
);
openButtonMenu
->
addAction
(
qtr
(
"&Play"
),
this
,
SLOT
(
play
()
),
QKeySequence
(
"Alt+P"
)
);
openButtonMenu
->
addAction
(
qtr
(
"&Stream"
),
this
,
SLOT
(
stream
()
)
,
QKeySequence
(
"Alt+S"
)
);
playButton
->
setMenu
(
openButtonMenu
);
ui
.
buttonsBox
->
addButton
(
playButton
,
QDialogButtonBox
::
AcceptRole
);
ui
.
buttonsBox
->
addButton
(
cancelButton
,
QDialogButtonBox
::
RejectRole
);
/* Force MRL update on tab change */
CONNECT
(
ui
.
Tab
,
currentChanged
(
int
),
this
,
signalCurrent
());
...
...
@@ -79,20 +110,12 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal,
CONNECT
(
ui
.
slaveText
,
textChanged
(
QString
),
this
,
updateMRL
());
CONNECT
(
ui
.
cacheSpinBox
,
valueChanged
(
int
),
this
,
updateMRL
());
openButtonMenu
->
addAction
(
qtr
(
"&Enqueue"
),
this
,
SLOT
(
enqueue
()
),
QKeySequence
(
"Alt+E"
)
);
openButtonMenu
->
addAction
(
qtr
(
"&Play"
),
this
,
SLOT
(
play
()
),
QKeySequence
(
"Alt+P"
)
);
openButtonMenu
->
addAction
(
qtr
(
"&Stream"
),
this
,
SLOT
(
stream
()
)
,
QKeySequence
(
"Alt+S"
)
);
ui
.
playButton
->
setMenu
(
openButtonMenu
);
BUTTONACT
(
ui
.
playButton
,
play
());
/* Buttons action */
BUTTONACT
(
playButton
,
play
());
BUTTONACT
(
cancelButton
,
cancel
());
if
(
b_stream_after
)
setAfter
();
BUTTONACT
(
ui
.
cancelButton
,
cancel
());
BUTTONACT
(
ui
.
advancedCheckBox
,
toggleAdvancedPanel
()
);
/* Initialize caching */
...
...
@@ -110,13 +133,13 @@ void OpenDialog::setAfter()
{
if
(
!
b_stream_after
)
{
ui
.
playButton
->
setText
(
qtr
(
"&Play"
)
);
BUTTONACT
(
ui
.
playButton
,
play
()
);
playButton
->
setText
(
qtr
(
"&Play"
)
);
BUTTONACT
(
playButton
,
play
()
);
}
else
{
ui
.
playButton
->
setText
(
qtr
(
"&Stream"
)
);
BUTTONACT
(
ui
.
playButton
,
stream
()
);
playButton
->
setText
(
qtr
(
"&Stream"
)
);
BUTTONACT
(
playButton
,
stream
()
);
}
}
...
...
@@ -132,7 +155,9 @@ void OpenDialog::signalCurrent() {
}
}
/* Actions */
/***********
* Actions *
***********/
/* If Cancel is pressed or escaped */
void
OpenDialog
::
cancel
()
...
...
modules/gui/qt4/dialogs/open.hpp
View file @
766acd38
...
...
@@ -34,6 +34,8 @@
#include <QBoxLayout>
#include <QString>
class
QToolButton
;
class
OpenDialog
:
public
QVLCDialog
{
Q_OBJECT
;
...
...
@@ -78,7 +80,9 @@ private:
int
advHeight
,
mainHeight
;
bool
b_stream_after
;
QStringList
SeparateEntries
(
QString
);
QToolButton
*
cancelButton
;
QToolButton
*
playButton
;
void
playOrEnqueue
(
bool
);
private
slots
:
...
...
modules/gui/qt4/ui/open.ui
View file @
766acd38
...
...
@@ -186,44 +186,12 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="cancelButton" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="playButton" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="text" >
<string>&Play</string>
</property>
<property name="popupMode" >
<enum>QToolButton::MenuButtonPopup</enum>
<widget class="QDialogButtonBox" name="buttonsBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="
toolButtonStyle
" >
<
enum>Qt::ToolButtonTextOnly</enum
>
<property name="
standardButtons
" >
<
set>QDialogButtonBox::NoButton</set
>
</property>
</widget>
</item>
...
...
@@ -235,8 +203,6 @@
<tabstop>cacheSpinBox</tabstop>
<tabstop>advancedLineInput</tabstop>
<tabstop>Tab</tabstop>
<tabstop>playButton</tabstop>
<tabstop>cancelButton</tabstop>
</tabstops>
<resources/>
<connections>
...
...
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