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
c5ee72d4
Commit
c5ee72d4
authored
Sep 13, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementation of login, input and progress dialogs in Qt
(untested)
parent
6192caae
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
239 deletions
+54
-239
modules/gui/qt4/Modules.am
modules/gui/qt4/Modules.am
+1
-4
modules/gui/qt4/dialogs/interaction.cpp
modules/gui/qt4/dialogs/interaction.cpp
+46
-20
modules/gui/qt4/dialogs/interaction.hpp
modules/gui/qt4/dialogs/interaction.hpp
+7
-10
modules/gui/qt4/ui/inputdialog.ui
modules/gui/qt4/ui/inputdialog.ui
+0
-74
modules/gui/qt4/ui/logindialog.ui
modules/gui/qt4/ui/logindialog.ui
+0
-54
modules/gui/qt4/ui/progressdialog.ui
modules/gui/qt4/ui/progressdialog.ui
+0
-77
No files found.
modules/gui/qt4/Modules.am
View file @
c5ee72d4
...
...
@@ -12,7 +12,7 @@
AUTOMAKE_OPTIONS
=
subdir-objects
TOUI
=
ui/input_stats ui/main_interface ui/file_open
\
ui/
logindialog ui/inputdialog ui/progressdialog ui/
sprefs_trivial
\
ui/sprefs_trivial
\
ui/sprefs_audio ui/sprefs_playlist ui/sprefs_subtitles
\
ui/sprefs_video ui/sprefs_interface
UIH
=
$(TOUI:%=%.h)
...
...
@@ -137,9 +137,6 @@ EXTRA_DIST += \
ui/input_stats.ui
\
ui/file_open.ui
\
ui/main_interface.ui
\
ui/logindialog.ui
\
ui/inputdialog.ui
\
ui/progressdialog.ui
\
ui/sprefs_trivial.ui
\
ui/sprefs_audio.ui
\
ui/sprefs_video.ui
\
...
...
modules/gui/qt4/dialogs/interaction.cpp
View file @
c5ee72d4
...
...
@@ -20,12 +20,18 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
#include
<QMessageBox>
#include
"qt4.hpp"
#include "dialogs/errors.hpp"
#include "dialogs/interaction.hpp"
#include "util/qvlcframe.hpp"
#include <vlc/intf.h>
#include "qt4.hpp"
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QProgressBar>
#include <QMessageBox>
#include <assert.h>
InteractionDialog
::
InteractionDialog
(
intf_thread_t
*
_p_intf
,
interaction_dialog_t
*
_p_dialog
)
:
QWidget
(
0
),
...
...
@@ -33,9 +39,6 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
{
QVBoxLayout
*
layout
=
new
QVBoxLayout
(
this
);
int
i_ret
=
-
1
;
uiLogin
=
NULL
;
uiProgress
=
NULL
;
uiInput
=
NULL
;
panel
=
NULL
;
if
(
p_dialog
->
i_flags
&
DIALOG_BLOCKING_ERROR
)
...
...
@@ -46,7 +49,7 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_NONBLOCKING_ERROR
)
{
if
(
config_GetInt
(
p_intf
,
"
qt-show-errors
"
)
!=
0
)
if
(
config_GetInt
(
p_intf
,
"
errors-dialog
"
)
!=
0
)
ErrorsDialog
::
getInstance
(
p_intf
)
->
addError
(
qfu
(
p_dialog
->
psz_title
),
qfu
(
p_dialog
->
psz_description
)
);
i_ret
=
0
;
...
...
@@ -54,7 +57,7 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_WARNING
)
{
if
(
config_GetInt
(
p_intf
,
"
qt-show-errors
"
)
!=
0
)
if
(
config_GetInt
(
p_intf
,
"
errors-dialog
"
)
!=
0
)
ErrorsDialog
::
getInstance
(
p_intf
)
->
addWarning
(
qfu
(
p_dialog
->
psz_title
),
qfu
(
p_dialog
->
psz_description
)
);
i_ret
=
0
;
...
...
@@ -74,16 +77,40 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
else
if
(
p_dialog
->
i_flags
&
DIALOG_LOGIN_PW_OK_CANCEL
)
{
panel
=
new
QWidget
(
0
);
uiLogin
=
new
Ui
::
LoginDialog
;
uiLogin
->
setupUi
(
panel
);
uiLogin
->
description
->
setText
(
qfu
(
p_dialog
->
psz_description
)
);
QGridLayout
*
grid
=
new
QGridLayout
;
description
=
new
QLabel
(
qfu
(
p_dialog
->
psz_description
)
);
grid
->
addWidget
(
description
,
0
,
0
,
1
,
2
);
grid
->
addWidget
(
new
QLabel
(
qtr
(
"Login"
)
),
1
,
0
);
loginEdit
=
new
QLineEdit
;
grid
->
addWidget
(
loginEdit
,
1
,
1
);
grid
->
addWidget
(
new
QLabel
(
qtr
(
"Password"
)
),
2
,
0
);
passwordEdit
=
new
QLineEdit
;
grid
->
addWidget
(
passwordEdit
,
2
,
1
);
panel
->
setLayout
(
grid
);
layout
->
addWidget
(
panel
);
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_USER_PROGRESS
)
{
description
=
new
QLabel
(
qfu
(
p_dialog
->
psz_description
)
);
layout
->
addWidget
(
description
);
progressBar
=
new
QProgressBar
;
progressBar
->
setMaximum
(
1000
);
progressBar
->
setTextVisible
(
true
);
progressBar
->
setOrientation
(
Qt
::
Horizontal
);
layout
->
addWidget
(
progressBar
);
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_PSZ_INPUT_OK_CANCEL
)
{
description
=
new
QLabel
(
qfu
(
p_dialog
->
psz_description
)
);
layout
->
addWidget
(
description
);
inputEdit
=
new
QLineEdit
;
layout
->
addWidget
(
inputEdit
);
}
else
msg_Err
(
p_intf
,
"unknown dialog type"
);
...
...
@@ -116,14 +143,16 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
void
InteractionDialog
::
Update
()
{
if
(
p_dialog
->
i_flags
&
DIALOG_USER_PROGRESS
)
{
assert
(
progressBar
);
progressBar
->
setValue
(
(
int
)(
p_dialog
->
val
.
f_float
*
1000
)
);
}
}
InteractionDialog
::~
InteractionDialog
()
{
if
(
panel
)
delete
panel
;
if
(
uiInput
)
delete
uiInput
;
if
(
uiProgress
)
delete
uiProgress
;
if
(
uiLogin
)
delete
uiLogin
;
}
void
InteractionDialog
::
defaultB
()
...
...
@@ -145,15 +174,12 @@ void InteractionDialog::Finish( int i_ret )
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
()
);
p_dialog
->
psz_returned
[
0
]
=
strdup
(
qtu
(
loginEdit
->
text
()
)
);
p_dialog
->
psz_returned
[
1
]
=
strdup
(
qtu
(
passwordEdit
->
text
()
)
);
}
else
if
(
p_dialog
->
i_flags
&
DIALOG_PSZ_INPUT_OK_CANCEL
)
{
p_dialog
->
psz_returned
[
0
]
=
strdup
(
uiInput
->
inputEdit
->
text
().
toUtf8
().
data
()
);
p_dialog
->
psz_returned
[
0
]
=
strdup
(
qtu
(
inputEdit
->
text
()
)
);
}
p_dialog
->
i_status
=
ANSWERED_DIALOG
;
p_dialog
->
i_return
=
i_ret
;
...
...
modules/gui/qt4/dialogs/interaction.hpp
View file @
c5ee72d4
...
...
@@ -25,15 +25,13 @@
#include <vlc/vlc.h>
#include <vlc_interaction.h>
#undef Q_
#include <ui/inputdialog.h>
#undef Q_
#include <ui/logindialog.h>
#undef Q_
#include <ui/progressdialog.h>
#undef Q_
#include <QWidget>
class
QPushButton
;
class
QLabel
;
class
QProgressBar
;
class
QLineEdit
;
class
InteractionDialog
:
public
QWidget
{
Q_OBJECT
...
...
@@ -47,12 +45,11 @@ private:
QWidget
*
panel
;
intf_thread_t
*
p_intf
;
interaction_dialog_t
*
p_dialog
;
Ui
::
LoginDialog
*
uiLogin
;
Ui
::
InputDialog
*
uiInput
;
Ui
::
ProgressDialog
*
uiProgress
;
QPushButton
*
defaultButton
,
*
otherButton
,
*
altButton
;
QLabel
*
description
;
QProgressBar
*
progressBar
;
QLineEdit
*
inputEdit
,
*
loginEdit
,
*
passwordEdit
;
void
Finish
(
int
);
private
slots
:
...
...
modules/gui/qt4/ui/inputdialog.ui
deleted
100644 → 0
View file @
6192caae
<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
deleted
100644 → 0
View file @
6192caae
<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="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>
</widget>
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>
modules/gui/qt4/ui/progressdialog.ui
deleted
100644 → 0
View file @
6192caae
<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>
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