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
97ce64ff
Commit
97ce64ff
authored
Mar 08, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: back-end for dialog_Question
parent
3c62d02f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
modules/gui/qt4/dialogs/external.cpp
modules/gui/qt4/dialogs/external.cpp
+44
-0
modules/gui/qt4/dialogs/external.hpp
modules/gui/qt4/dialogs/external.hpp
+6
-2
No files found.
modules/gui/qt4/dialogs/external.cpp
View file @
97ce64ff
...
@@ -50,12 +50,19 @@ DialogHandler::DialogHandler (intf_thread_t *intf)
...
@@ -50,12 +50,19 @@ DialogHandler::DialogHandler (intf_thread_t *intf)
var_Create
(
intf
,
"dialog-login"
,
VLC_VAR_ADDRESS
);
var_Create
(
intf
,
"dialog-login"
,
VLC_VAR_ADDRESS
);
var_AddCallback
(
intf
,
"dialog-login"
,
LoginCallback
,
this
);
var_AddCallback
(
intf
,
"dialog-login"
,
LoginCallback
,
this
);
connect
(
this
,
SIGNAL
(
question
(
struct
dialog_question_t
*
)),
this
,
SLOT
(
requestAnswer
(
struct
dialog_question_t
*
)),
Qt
::
BlockingQueuedConnection
);
var_Create
(
intf
,
"dialog-question"
,
VLC_VAR_ADDRESS
);
var_AddCallback
(
intf
,
"dialog-question"
,
QuestionCallback
,
this
);
dialog_Register
(
intf
);
dialog_Register
(
intf
);
}
}
DialogHandler
::~
DialogHandler
(
void
)
DialogHandler
::~
DialogHandler
(
void
)
{
{
dialog_Unregister
(
intf
);
dialog_Unregister
(
intf
);
var_DelCallback
(
intf
,
"dialog-question"
,
QuestionCallback
,
this
);
var_DelCallback
(
intf
,
"dialog-login"
,
LoginCallback
,
this
);
var_DelCallback
(
intf
,
"dialog-login"
,
LoginCallback
,
this
);
var_DelCallback
(
intf
,
"dialog-fatal"
,
MessageCallback
,
this
);
var_DelCallback
(
intf
,
"dialog-fatal"
,
MessageCallback
,
this
);
}
}
...
@@ -138,3 +145,40 @@ void DialogHandler::requestLogin (struct dialog_login_t *data)
...
@@ -138,3 +145,40 @@ void DialogHandler::requestLogin (struct dialog_login_t *data)
delete
dialog
;
delete
dialog
;
}
}
int
DialogHandler
::
QuestionCallback
(
vlc_object_t
*
obj
,
const
char
*
var
,
vlc_value_t
,
vlc_value_t
value
,
void
*
data
)
{
DialogHandler
*
self
=
(
DialogHandler
*
)
data
;
dialog_question_t
*
dialog
=
(
dialog_question_t
*
)
value
.
p_address
;
emit
self
->
question
(
dialog
);
return
VLC_SUCCESS
;
}
void
DialogHandler
::
requestAnswer
(
struct
dialog_question_t
*
data
)
{
QMessageBox
*
box
=
new
QMessageBox
(
QMessageBox
::
Question
,
qfu
(
data
->
title
),
qfu
(
data
->
message
));
QAbstractButton
*
yes
=
(
data
->
yes
!=
NULL
)
?
box
->
addButton
(
"&"
+
qfu
(
data
->
yes
),
QMessageBox
::
YesRole
)
:
NULL
;
QAbstractButton
*
no
=
(
data
->
no
!=
NULL
)
?
box
->
addButton
(
"&"
+
qfu
(
data
->
no
),
QMessageBox
::
NoRole
)
:
NULL
;
QAbstractButton
*
cancel
=
(
data
->
cancel
!=
NULL
)
?
box
->
addButton
(
"&"
+
qfu
(
data
->
cancel
),
QMessageBox
::
RejectRole
)
:
NULL
;
box
->
exec
();
int
answer
;
if
(
box
->
clickedButton
()
==
yes
)
answer
=
1
;
else
if
(
box
->
clickedButton
()
==
no
)
answer
=
2
;
else
answer
=
3
;
delete
box
;
data
->
answer
=
answer
;
}
modules/gui/qt4/dialogs/external.hpp
View file @
97ce64ff
...
@@ -38,15 +38,19 @@ private:
...
@@ -38,15 +38,19 @@ private:
static
int
MessageCallback
(
vlc_object_t
*
,
const
char
*
,
static
int
MessageCallback
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
LoginCallback
(
vlc_object_t
*
obj
,
const
char
*
,
static
int
LoginCallback
(
vlc_object_t
*
obj
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
data
);
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
QuestionCallback
(
vlc_object_t
*
obj
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
private
slots
:
private
slots
:
void
displayMessage
(
const
struct
dialog_fatal_t
*
);
void
displayMessage
(
const
struct
dialog_fatal_t
*
);
void
requestLogin
(
struct
dialog_login_t
*
data
);
void
requestLogin
(
struct
dialog_login_t
*
);
void
requestAnswer
(
struct
dialog_question_t
*
);
signals:
signals:
void
message
(
const
struct
dialog_fatal_t
*
);
void
message
(
const
struct
dialog_fatal_t
*
);
void
authentication
(
struct
dialog_login_t
*
);
void
authentication
(
struct
dialog_login_t
*
);
void
question
(
struct
dialog_question_t
*
);
};
};
#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