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
94379150
Commit
94379150
authored
Feb 04, 2016
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: implement new dialog callbacks
parent
c50d31d8
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
376 additions
and
173 deletions
+376
-173
modules/gui/qt4/dialogs/external.cpp
modules/gui/qt4/dialogs/external.cpp
+276
-140
modules/gui/qt4/dialogs/external.hpp
modules/gui/qt4/dialogs/external.hpp
+100
-33
No files found.
modules/gui/qt4/dialogs/external.cpp
View file @
94379150
This diff is collapsed.
Click to expand it.
modules/gui/qt4/dialogs/external.hpp
View file @
94379150
...
@@ -26,65 +26,132 @@
...
@@ -26,65 +26,132 @@
#endif
#endif
#include <QObject>
#include <QObject>
#include <QDialog>
#include <QMap>
#include <vlc_common.h>
#include <vlc_common.h>
#include <vlc_dialog.h>
#include "adapters/variables.hpp"
#include "adapters/variables.hpp"
struct
intf_thread_t
;
struct
intf_thread_t
;
class
QProgressDialog
;
class
QProgressDialog
;
class
DialogWrapper
;
class
DialogHandler
:
public
QObject
class
DialogHandler
:
public
QObject
{
{
Q_OBJECT
Q_OBJECT
friend
class
QVLCProgressDialog
;
public:
public:
DialogHandler
(
intf_thread_t
*
,
QObject
*
parent
);
DialogHandler
(
intf_thread_t
*
,
QObject
*
parent
);
virtual
~
DialogHandler
(
void
);
virtual
~
DialogHandler
();
void
removeDialogId
(
vlc_dialog_id
*
p_id
);
private:
intf_thread_t
*
p_intf
;
static
int
error
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
QVLCPointer
critical
;
QVLCPointer
login
;
QVLCPointer
question
;
QVLCPointer
progressBar
;
signals:
signals:
void
error
(
const
QString
&
,
const
QString
&
);
void
errorDisplayed
(
const
QString
&
title
,
const
QString
&
text
);
void
loginDisplayed
(
vlc_dialog_id
*
p_id
,
const
QString
&
title
,
const
QString
&
text
,
const
QString
&
defaultUsername
,
bool
b_ask_store
);
void
questionDisplayed
(
vlc_dialog_id
*
p_id
,
const
QString
&
title
,
const
QString
&
text
,
int
i_type
,
const
QString
&
cancel
,
const
QString
&
action1
,
const
QString
&
action2
);
void
progressDisplayed
(
vlc_dialog_id
*
p_id
,
const
QString
&
title
,
const
QString
&
text
,
bool
b_indeterminate
,
float
f_position
,
const
QString
&
cancel
);
void
cancelled
(
vlc_dialog_id
*
p_id
);
void
progressUpdated
(
vlc_dialog_id
*
p_id
,
float
f_value
,
const
QString
&
text
);
private
slots
:
private
slots
:
void
displayError
(
const
QString
&
,
const
QString
&
);
void
displayError
(
const
QString
&
title
,
const
QString
&
text
);
void
displayCritical
(
void
*
);
void
displayLogin
(
vlc_dialog_id
*
p_id
,
const
QString
&
title
,
void
requestLogin
(
void
*
);
const
QString
&
text
,
const
QString
&
defaultUsername
,
void
requestAnswer
(
void
*
);
bool
b_ask_store
);
void
startProgressBar
(
void
*
);
void
displayQuestion
(
vlc_dialog_id
*
p_id
,
const
QString
&
title
,
void
stopProgressBar
(
QWidget
*
);
const
QString
&
text
,
int
i_type
,
const
QString
&
cancel
,
const
QString
&
action1
,
const
QString
&
action2
);
void
displayProgress
(
vlc_dialog_id
*
p_id
,
const
QString
&
title
,
const
QString
&
text
,
bool
b_indeterminate
,
float
f_position
,
const
QString
&
cancel
);
void
cancel
(
vlc_dialog_id
*
p_id
);
void
updateProgress
(
vlc_dialog_id
*
p_id
,
float
f_value
,
const
QString
&
text
);
private:
intf_thread_t
*
p_intf
;
static
void
displayErrorCb
(
const
char
*
,
const
char
*
,
void
*
);
static
void
displayLoginCb
(
vlc_dialog_id
*
,
const
char
*
,
const
char
*
,
const
char
*
,
bool
,
void
*
);
static
void
displayQuestionCb
(
vlc_dialog_id
*
,
const
char
*
,
const
char
*
,
vlc_dialog_question_type
,
const
char
*
,
const
char
*
,
const
char
*
,
void
*
);
static
void
displayProgressCb
(
vlc_dialog_id
*
,
const
char
*
,
const
char
*
,
bool
,
float
,
const
char
*
,
void
*
);
static
void
cancelCb
(
vlc_dialog_id
*
,
void
*
);
static
void
updateProgressCb
(
vlc_dialog_id
*
,
float
,
const
char
*
,
void
*
);
};
};
/* Put here instead of .cpp because of MOC */
class
DialogWrapper
:
public
QObject
#include <QProgressDialog>
{
Q_OBJECT
friend
class
DialogHandler
;
public:
DialogWrapper
(
DialogHandler
*
p_handler
,
intf_thread_t
*
p_intf
,
vlc_dialog_id
*
p_id
,
QDialog
*
p_dialog
);
virtual
~
DialogWrapper
();
protected
slots
:
virtual
void
finish
(
int
result
=
QDialog
::
Rejected
);
protected:
DialogHandler
*
p_handler
;
intf_thread_t
*
p_intf
;
vlc_dialog_id
*
p_id
;
QDialog
*
p_dialog
;
};
class
QVLCProgressDialog
:
public
QProgressDialog
class
QLineEdit
;
class
QCheckBox
;
class
LoginDialogWrapper
:
public
DialogWrapper
{
{
Q_OBJECT
Q_OBJECT
public:
public:
QVLCProgressDialog
(
DialogHandler
*
parent
,
LoginDialogWrapper
(
DialogHandler
*
p_handler
,
intf_thread_t
*
p_intf
,
struct
dialog_progress_bar_t
*
);
vlc_dialog_id
*
p_id
,
QDialog
*
p_dialog
,
QLineEdit
*
userLine
,
QLineEdit
*
passLine
,
QCheckBox
*
checkbox
);
private
slots
:
virtual
void
accept
();
private:
private:
DialogHandler
*
handler
;
QLineEdit
*
userLine
;
bool
cancelled
;
QLineEdit
*
passLine
;
QCheckBox
*
checkbox
;
};
static
void
update
(
void
*
,
const
char
*
,
float
);
class
QAbstractButton
;
static
bool
check
(
void
*
);
class
QMessageBox
;
static
void
destroy
(
void
*
);
class
QuestionDialogWrapper
:
public
DialogWrapper
{
Q_OBJECT
public:
QuestionDialogWrapper
(
DialogHandler
*
p_handler
,
intf_thread_t
*
p_intf
,
vlc_dialog_id
*
p_id
,
QMessageBox
*
p_box
,
QAbstractButton
*
action1
,
QAbstractButton
*
action2
);
private
slots
:
private
slots
:
void
saveCancel
(
void
);
virtual
void
buttonClicked
(
QAbstractButton
*
);
private:
QAbstractButton
*
action1
;
QAbstractButton
*
action2
;
};
signals:
class
ProgressDialogWrapper
:
public
DialogWrapper
void
progressed
(
int
);
{
void
described
(
const
QString
&
);
Q_OBJECT
void
released
(
void
);
public:
ProgressDialogWrapper
(
DialogHandler
*
p_handler
,
intf_thread_t
*
p_intf
,
vlc_dialog_id
*
p_id
,
QProgressDialog
*
p_progress
,
bool
b_indeterminate
);
void
updateProgress
(
float
f_position
,
const
QString
&
text
);
private:
bool
b_indeterminate
;
};
};
#endif
#endif
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