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
62f327db
Commit
62f327db
authored
Apr 27, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt, help/update: code simplification
parent
25bf26b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
38 deletions
+11
-38
modules/gui/qt4/dialogs/help.cpp
modules/gui/qt4/dialogs/help.cpp
+5
-23
modules/gui/qt4/dialogs/help.hpp
modules/gui/qt4/dialogs/help.hpp
+5
-12
modules/gui/qt4/util/qvlcframe.hpp
modules/gui/qt4/util/qvlcframe.hpp
+1
-3
No files found.
modules/gui/qt4/dialogs/help.cpp
View file @
62f327db
...
@@ -57,12 +57,14 @@ HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
...
@@ -57,12 +57,14 @@ HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
setMinimumSize
(
350
,
300
);
setMinimumSize
(
350
,
300
);
QVBoxLayout
*
layout
=
new
QVBoxLayout
(
this
);
QVBoxLayout
*
layout
=
new
QVBoxLayout
(
this
);
QTextBrowser
*
helpBrowser
=
new
QTextBrowser
(
this
);
QTextBrowser
*
helpBrowser
=
new
QTextBrowser
(
this
);
helpBrowser
->
setOpenExternalLinks
(
true
);
helpBrowser
->
setOpenExternalLinks
(
true
);
helpBrowser
->
setHtml
(
qtr
(
I_LONGHELP
)
);
helpBrowser
->
setHtml
(
qtr
(
I_LONGHELP
)
);
QDialogButtonBox
*
closeButtonBox
=
new
QDialogButtonBox
(
Qt
::
Horizontal
,
this
);
QDialogButtonBox
*
closeButtonBox
=
new
QDialogButtonBox
(
this
);
closeButtonBox
->
addButton
(
closeButtonBox
->
addButton
(
new
QPushButton
(
qtr
(
"&Close"
)
,
this
),
QDialogButtonBox
::
RejectRole
);
new
QPushButton
(
qtr
(
"&Close"
)
),
QDialogButtonBox
::
RejectRole
);
closeButtonBox
->
setFocus
();
closeButtonBox
->
setFocus
();
layout
->
addWidget
(
helpBrowser
);
layout
->
addWidget
(
helpBrowser
);
...
@@ -77,11 +79,6 @@ HelpDialog::~HelpDialog()
...
@@ -77,11 +79,6 @@ HelpDialog::~HelpDialog()
writeSettings
(
"Help"
);
writeSettings
(
"Help"
);
}
}
void
HelpDialog
::
close
()
{
toggleVisible
();
}
AboutDialog
::
AboutDialog
(
intf_thread_t
*
_p_intf
)
AboutDialog
::
AboutDialog
(
intf_thread_t
*
_p_intf
)
:
QVLCDialog
(
(
QWidget
*
)
_p_intf
->
p_sys
->
p_mi
,
_p_intf
)
:
QVLCDialog
(
(
QWidget
*
)
_p_intf
->
p_sys
->
p_mi
,
_p_intf
)
{
{
...
@@ -92,8 +89,8 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
...
@@ -92,8 +89,8 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
setWindowTitle
(
qtr
(
"About"
)
);
setWindowTitle
(
qtr
(
"About"
)
);
setWindowRole
(
"vlc-about"
);
setWindowRole
(
"vlc-about"
);
resize
(
600
,
500
);
setMinimumSize
(
600
,
500
);
setMinimumSize
(
600
,
500
);
resize
(
600
,
500
);
setWindowModality
(
Qt
::
WindowModal
);
setWindowModality
(
Qt
::
WindowModal
);
CONNECT
(
ui
.
closeButtonBox
,
rejected
(),
this
,
close
()
);
CONNECT
(
ui
.
closeButtonBox
,
rejected
(),
this
,
close
()
);
...
@@ -133,15 +130,6 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
...
@@ -133,15 +130,6 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
ui
.
authorsEdit
->
setText
(
qfu
(
psz_authors
)
);
ui
.
authorsEdit
->
setText
(
qfu
(
psz_authors
)
);
}
}
AboutDialog
::~
AboutDialog
()
{
}
void
AboutDialog
::
close
()
{
toggleVisible
();
}
#ifdef UPDATE_CHECK
#ifdef UPDATE_CHECK
/*****************************************************************************
/*****************************************************************************
...
@@ -203,11 +191,6 @@ UpdateDialog::~UpdateDialog()
...
@@ -203,11 +191,6 @@ UpdateDialog::~UpdateDialog()
writeSettings
(
"Update"
);
writeSettings
(
"Update"
);
}
}
void
UpdateDialog
::
close
()
{
toggleVisible
();
}
/* Check for updates */
/* Check for updates */
void
UpdateDialog
::
UpdateOrDownload
()
void
UpdateDialog
::
UpdateOrDownload
()
{
{
...
@@ -283,4 +266,3 @@ void UpdateDialog::updateNotify( bool b_result )
...
@@ -283,4 +266,3 @@ void UpdateDialog::updateNotify( bool b_result )
}
}
#endif
#endif
modules/gui/qt4/dialogs/help.hpp
View file @
62f327db
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#define QVLC_HELP_DIALOG_H_ 1
#define QVLC_HELP_DIALOG_H_ 1
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#
include "config.h"
#endif
#endif
#include "qt4.hpp"
#include "qt4.hpp"
...
@@ -35,12 +35,7 @@
...
@@ -35,12 +35,7 @@
#include "ui/about.h"
#include "ui/about.h"
#include "ui/update.h"
#include "ui/update.h"
class
QPushButton
;
class
QTextBrowser
;
class
QLabel
;
class
QEvent
;
class
QEvent
;
class
QPushButton
;
class
QTextEdit
;
class
HelpDialog
:
public
QVLCFrame
,
public
Singleton
<
HelpDialog
>
class
HelpDialog
:
public
QVLCFrame
,
public
Singleton
<
HelpDialog
>
{
{
...
@@ -50,23 +45,20 @@ private:
...
@@ -50,23 +45,20 @@ private:
virtual
~
HelpDialog
();
virtual
~
HelpDialog
();
public
slots
:
public
slots
:
v
oid
close
();
v
irtual
void
close
()
{
toggleVisible
();
}
friend
class
Singleton
<
HelpDialog
>
;
friend
class
Singleton
<
HelpDialog
>
;
};
};
class
AboutDialog
:
public
QVLCDialog
,
public
Singleton
<
AboutDialog
>
class
AboutDialog
:
public
QVLCDialog
,
public
Singleton
<
AboutDialog
>
{
{
Q_OBJECT
Q_OBJECT
private:
private:
AboutDialog
(
intf_thread_t
*
);
AboutDialog
(
intf_thread_t
*
);
virtual
~
AboutDialog
();
Ui
::
aboutWidget
ui
;
Ui
::
aboutWidget
ui
;
public
slots
:
public
slots
:
v
oid
close
();
v
irtual
void
close
()
{
toggleVisible
();
}
friend
class
Singleton
<
AboutDialog
>
;
friend
class
Singleton
<
AboutDialog
>
;
};
};
...
@@ -92,7 +84,8 @@ private:
...
@@ -92,7 +84,8 @@ private:
bool
b_checked
;
bool
b_checked
;
private
slots
:
private
slots
:
void
close
();
virtual
void
close
()
{
toggleVisible
();
}
void
UpdateOrDownload
();
void
UpdateOrDownload
();
friend
class
Singleton
<
UpdateDialog
>
;
friend
class
Singleton
<
UpdateDialog
>
;
...
...
modules/gui/qt4/util/qvlcframe.hpp
View file @
62f327db
...
@@ -188,9 +188,7 @@ protected:
...
@@ -188,9 +188,7 @@ protected:
class
QVLCMW
:
public
QMainWindow
class
QVLCMW
:
public
QMainWindow
{
{
public:
public:
QVLCMW
(
intf_thread_t
*
_p_intf
)
:
QMainWindow
(
NULL
),
p_intf
(
_p_intf
)
QVLCMW
(
intf_thread_t
*
_p_intf
)
:
QMainWindow
(
NULL
),
p_intf
(
_p_intf
){}
{
}
virtual
~
QVLCMW
()
{};
void
toggleVisible
()
void
toggleVisible
()
{
{
if
(
isVisible
()
)
hide
();
if
(
isVisible
()
)
hide
();
...
...
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