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
5fcb0513
Commit
5fcb0513
authored
Jul 19, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some more Qt interaction support
parent
debc0363
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
427 additions
and
16 deletions
+427
-16
modules/gui/qt4/Modules.am
modules/gui/qt4/Modules.am
+6
-1
modules/gui/qt4/components/preferences.cpp
modules/gui/qt4/components/preferences.cpp
+1
-1
modules/gui/qt4/dialogs/interaction.cpp
modules/gui/qt4/dialogs/interaction.cpp
+60
-13
modules/gui/qt4/dialogs/interaction.hpp
modules/gui/qt4/dialogs/interaction.hpp
+17
-1
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+13
-0
modules/gui/qt4/ui/inputdialog.ui
modules/gui/qt4/ui/inputdialog.ui
+74
-0
modules/gui/qt4/ui/logindialog.ui
modules/gui/qt4/ui/logindialog.ui
+101
-0
modules/gui/qt4/ui/progressdialog.ui
modules/gui/qt4/ui/progressdialog.ui
+77
-0
modules/gui/qt4/ui/yesnocanceldialog.ui
modules/gui/qt4/ui/yesnocanceldialog.ui
+78
-0
No files found.
modules/gui/qt4/Modules.am
View file @
5fcb0513
...
...
@@ -12,7 +12,8 @@
AUTOMAKE_OPTIONS
=
subdir-objects
TOUI
=
ui/input_stats ui/main_interface ui/file_open
\
ui/okcanceldialog
ui/okcanceldialog ui/yesnocanceldialog ui/logindialog ui/inputdialog
\
ui/progressdialog
UIH
=
$(TOUI:%=%.h)
TOMOC
=
main_interface
\
...
...
@@ -119,6 +120,10 @@ EXTRA_DIST += \
ui/file_open.ui
\
ui/main_interface.ui
\
ui/okcanceldialog.ui
\
ui/yesnocanceldialog.ui
\
ui/logindialog.ui
\
ui/inputdialog.ui
\
ui/progressdialog.ui
\
pixmaps/advanced.xpm
\
pixmaps/audio.xpm
\
pixmaps/codec.xpm
\
...
...
modules/gui/qt4/components/preferences.cpp
View file @
5fcb0513
...
...
@@ -317,7 +317,7 @@ PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
QWidget
(
_parent
),
p_intf
(
_p_intf
)
{
module_config_t
*
p_item
;
module_t
*
p_module
;
module_t
*
p_module
=
NULL
;
vlc_list_t
*
p_list
=
NULL
;
global_layout
=
new
QVBoxLayout
();
...
...
modules/gui/qt4/dialogs/interaction.cpp
View file @
5fcb0513
...
...
@@ -22,16 +22,23 @@
#include "dialogs/interaction.hpp"
#include <vlc/intf.h>
#include "qt4.hpp"
InteractionDialog
::
InteractionDialog
(
intf_thread_t
*
_p_intf
,
interaction_dialog_t
*
_p_dialog
)
:
p_intf
(
_p_intf
),
p_dialog
(
_p_dialog
)
interaction_dialog_t
*
_p_dialog
)
:
QWidget
(
0
),
p_intf
(
_p_intf
),
p_dialog
(
_p_dialog
)
{
uiOkCancel
=
NULL
;
uiYesNoCancel
=
NULL
;
uiLogin
=
NULL
;
uiProgress
=
NULL
;
uiInput
=
NULL
;
if
(
p_dialog
->
i_flags
&
DIALOG_YES_NO_CANCEL
)
{
uiOkCancel
=
new
Ui
::
OKCancelDialog
;
uiOkCancel
->
setupUi
(
this
);
uiOkCancel
->
description
->
setText
(
p_dialog
->
psz_description
);
uiOkCancel
->
description
->
setText
(
qfu
(
p_dialog
->
psz_description
)
);
connect
(
uiOkCancel
->
okButton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
OK
()
)
);
connect
(
uiOkCancel
->
cancelButton
,
SIGNAL
(
clicked
()
),
...
...
@@ -39,11 +46,25 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_YES_NO_CANCEL
)
{
uiYesNoCancel
=
new
Ui
::
YesNoCancelDialog
;
uiYesNoCancel
->
setupUi
(
this
);
uiYesNoCancel
->
description
->
setText
(
qfu
(
p_dialog
->
psz_description
)
);
connect
(
uiYesNoCancel
->
yesButton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
yes
()
)
);
connect
(
uiYesNoCancel
->
noButton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
no
()
)
);
connect
(
uiYesNoCancel
->
cancelButton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
cancel
()
)
);
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_LOGIN_PW_OK_CANCEL
)
{
uiLogin
=
new
Ui
::
LoginDialog
;
uiLogin
->
setupUi
(
this
);
uiLogin
->
description
->
setText
(
qfu
(
p_dialog
->
psz_description
)
);
connect
(
uiLogin
->
okButton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
OK
()
)
);
connect
(
uiLogin
->
cancelButton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
cancel
()
)
);
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_USER_PROGRESS
)
{
...
...
@@ -54,6 +75,7 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
}
else
msg_Err
(
p_intf
,
"unknown dialog type"
);
setWindowTitle
(
qfu
(
p_dialog
->
psz_title
)
);
}
void
InteractionDialog
::
Update
()
...
...
@@ -62,24 +84,49 @@ void InteractionDialog::Update()
InteractionDialog
::~
InteractionDialog
()
{
if
(
uiYesNoCancel
)
delete
uiYesNoCancel
;
if
(
uiOkCancel
)
delete
uiOkCancel
;
if
(
uiInput
)
delete
uiInput
;
if
(
uiProgress
)
delete
uiProgress
;
if
(
uiLogin
)
delete
uiLogin
;
}
void
InteractionDialog
::
yes
()
{
Finish
(
DIALOG_OK_YES
);
}
void
InteractionDialog
::
no
()
{
Finish
(
DIALOG_NO
);
}
void
InteractionDialog
::
OK
()
{
Finish
(
DIALOG_OK_YES
,
NULL
,
NULL
);
Finish
(
DIALOG_OK_YES
);
}
void
InteractionDialog
::
cancel
()
{
Finish
(
DIALOG_CANCELLED
,
NULL
,
NULL
);
Finish
(
DIALOG_CANCELLED
);
}
void
InteractionDialog
::
Finish
(
int
i_ret
,
QString
*
r1
,
QString
*
r2
)
void
InteractionDialog
::
Finish
(
int
i_ret
)
{
vlc_mutex_lock
(
&
p_dialog
->
p_interaction
->
object_lock
);
vlc_mutex_lock
(
&
p_dialog
->
p_interaction
->
object_lock
);
p_dialog
->
i_status
=
ANSWERED_DIALOG
;
p_dialog
->
i_return
=
i_ret
;
hide
();
vlc_mutex_unlock
(
&
p_dialog
->
p_interaction
->
object_lock
);
if
(
p_dialog
->
i_flags
&
DIALOG_LOGIN_PW_OK_CANCEL
)
{
p_dialog
->
psz_returned
[
0
]
=
strdup
(
uiLogin
->
loginEdit
->
text
().
toUtf8
().
data
()
);
p_dialog
->
psz_returned
[
1
]
=
strdup
(
uiLogin
->
passwordEdit
->
text
().
toUtf8
().
data
()
);
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_PSZ_INPUT_OK_CANCEL
)
{
p_dialog
->
psz_returned
[
0
]
=
strdup
(
uiInput
->
inputEdit
->
text
().
toUtf8
().
data
()
);
}
p_dialog
->
i_status
=
ANSWERED_DIALOG
;
p_dialog
->
i_return
=
i_ret
;
hide
();
vlc_mutex_unlock
(
&
p_dialog
->
p_interaction
->
object_lock
);
}
modules/gui/qt4/dialogs/interaction.hpp
View file @
5fcb0513
...
...
@@ -25,7 +25,17 @@
#include <vlc/vlc.h>
#include <vlc_interaction.h>
#undef Q_
#include <ui/okcanceldialog.h>
#undef Q_
#include <ui/yesnocanceldialog.h>
#undef Q_
#include <ui/inputdialog.h>
#undef Q_
#include <ui/logindialog.h>
#undef Q_
#include <ui/progressdialog.h>
#undef Q_
class
InteractionDialog
:
public
QWidget
{
...
...
@@ -40,10 +50,16 @@ private:
intf_thread_t
*
p_intf
;
interaction_dialog_t
*
p_dialog
;
Ui
::
OKCancelDialog
*
uiOkCancel
;
Ui
::
YesNoCancelDialog
*
uiYesNoCancel
;
Ui
::
LoginDialog
*
uiLogin
;
Ui
::
InputDialog
*
uiInput
;
Ui
::
ProgressDialog
*
uiProgress
;
void
Finish
(
int
,
QString
*
,
QString
*
);
void
Finish
(
int
);
private
slots
:
void
OK
();
void
yes
();
void
no
();
void
cancel
();
};
...
...
modules/gui/qt4/qt4.cpp
View file @
5fcb0513
...
...
@@ -154,3 +154,16 @@ static void ShowDialog( intf_thread_t *p_intf, int i_dialog_event, int i_arg,
QApplication
::
postEvent
(
DialogsProvider
::
getInstance
(
p_intf
),
static_cast
<
QEvent
*>
(
event
)
);
}
/*****************************************************************************
* PopupMenuCB: callback to show the popupmenu.
* We don't show the menu directly here because we don't want the
* caller to block for a too long time.
*****************************************************************************/
static
int
PopupMenuCB
(
vlc_object_t
*
p_this
,
const
char
*
psz_variable
,
vlc_value_t
old_val
,
vlc_value_t
new_val
,
void
*
param
)
{
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
param
;
ShowDialog
(
p_intf
,
INTF_DIALOG_POPUPMENU
,
new_val
.
b_bool
,
0
);
return
VLC_SUCCESS
;
}
modules/gui/qt4/ui/inputdialog.ui
0 → 100644
View file @
5fcb0513
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>InputDialog</class>
<widget class="QWidget" name="InputDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>409</width>
<height>89</height>
</rect>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="description" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="inputEdit" />
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="okButton" >
<property name="text" >
<string>OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>
modules/gui/qt4/ui/logindialog.ui
0 → 100644
View file @
5fcb0513
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>LoginDialog</class>
<widget class="QWidget" name="LoginDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>409</width>
<height>129</height>
</rect>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Login</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="loginEdit" />
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Password</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLineEdit" name="passwordEdit" />
</item>
<item row="0" column="0" colspan="2" >
<widget class="QLabel" name="description" >
<property name="text" >
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="okButton" >
<property name="text" >
<string>OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>
modules/gui/qt4/ui/progressdialog.ui
0 → 100644
View file @
5fcb0513
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>ProgressDialog</class>
<widget class="QWidget" name="ProgressDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>407</width>
<height>91</height>
</rect>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="description" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar" >
<property name="value" >
<number>24</number>
</property>
<property name="textVisible" >
<bool>true</bool>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>
modules/gui/qt4/ui/yesnocanceldialog.ui
0 → 100644
View file @
5fcb0513
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>YesNoCancelDialog</class>
<widget class="QWidget" name="YesNoCancelDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>122</height>
</rect>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="description" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="yesButton" >
<property name="text" >
<string>Yes</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="noButton" >
<property name="text" >
<string>No</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>
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