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
1debd199
Commit
1debd199
authored
Aug 18, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: Bookmarks: correctly apply buttons states
parent
4bea14e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
modules/gui/qt4/dialogs/bookmarks.cpp
modules/gui/qt4/dialogs/bookmarks.cpp
+16
-3
modules/gui/qt4/dialogs/bookmarks.hpp
modules/gui/qt4/dialogs/bookmarks.hpp
+4
-0
No files found.
modules/gui/qt4/dialogs/bookmarks.cpp
View file @
1debd199
...
...
@@ -45,10 +45,10 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
QPushButton
*
addButton
=
new
QPushButton
(
qtr
(
"Create"
)
);
addButton
->
setToolTip
(
qtr
(
"Create a new bookmark"
)
);
buttonsBox
->
addButton
(
addButton
,
QDialogButtonBox
::
ActionRole
);
QPushButton
*
delButton
=
new
QPushButton
(
qtr
(
"Delete"
)
);
delButton
=
new
QPushButton
(
qtr
(
"Delete"
)
);
delButton
->
setToolTip
(
qtr
(
"Delete the selected item"
)
);
buttonsBox
->
addButton
(
delButton
,
QDialogButtonBox
::
ActionRole
);
QPushButton
*
clearButton
=
new
QPushButton
(
qtr
(
"Clear"
)
);
clearButton
=
new
QPushButton
(
qtr
(
"Clear"
)
);
clearButton
->
setToolTip
(
qtr
(
"Delete all the bookmarks"
)
);
buttonsBox
->
addButton
(
clearButton
,
QDialogButtonBox
::
ResetRole
);
#if 0
...
...
@@ -85,14 +85,21 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
activateItem
(
QModelIndex
)
);
CONNECT
(
bookmarksList
,
itemChanged
(
QTreeWidgetItem
*
,
int
),
this
,
edit
(
QTreeWidgetItem
*
,
int
)
);
CONNECT
(
bookmarksList
->
model
(),
rowsInserted
(
const
QModelIndex
&
,
int
,
int
),
this
,
updateButtons
()
);
CONNECT
(
bookmarksList
->
model
(),
rowsRemoved
(
const
QModelIndex
&
,
int
,
int
),
this
,
updateButtons
()
);
CONNECT
(
bookmarksList
->
selectionModel
(),
selectionChanged
(
const
QItemSelection
&
,
const
QItemSelection
&
),
this
,
updateButtons
()
);
BUTTONACT
(
addButton
,
add
()
);
BUTTONACT
(
delButton
,
del
()
);
BUTTONACT
(
clearButton
,
clear
()
);
#if 0
BUTTONACT( extractButton, extract() );
#endif
CONNECT
(
buttonsBox
,
rejected
(),
this
,
close
()
);
updateButtons
();
restoreWidgetPosition
(
"Bookmarks"
,
QSize
(
435
,
280
)
);
updateGeometry
();
...
...
@@ -103,6 +110,12 @@ BookmarksDialog::~BookmarksDialog()
saveWidgetPosition
(
"Bookmarks"
);
}
void
BookmarksDialog
::
updateButtons
()
{
clearButton
->
setEnabled
(
bookmarksList
->
model
()
->
rowCount
()
>
0
);
delButton
->
setEnabled
(
bookmarksList
->
selectionModel
()
->
hasSelection
()
);
}
void
BookmarksDialog
::
update
()
{
input_thread_t
*
p_input
=
THEMIM
->
getInput
();
...
...
modules/gui/qt4/dialogs/bookmarks.hpp
View file @
1debd199
...
...
@@ -30,6 +30,7 @@
#include <QTreeView>
#include <QTreeWidget>
#include "util/singleton.hpp"
class
QPushButton
;
class
BookmarksDialog
:
public
QVLCFrame
,
public
Singleton
<
BookmarksDialog
>
{
...
...
@@ -39,6 +40,8 @@ private:
virtual
~
BookmarksDialog
();
QTreeWidget
*
bookmarksList
;
QPushButton
*
clearButton
;
QPushButton
*
delButton
;
private
slots
:
void
update
();
...
...
@@ -48,6 +51,7 @@ private slots:
void
edit
(
QTreeWidgetItem
*
item
,
int
column
);
void
extract
();
void
activateItem
(
QModelIndex
index
);
void
updateButtons
();
friend
class
Singleton
<
BookmarksDialog
>
;
};
...
...
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