Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F619545
DeleteBranchDialog.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
DeleteBranchDialog.cpp
View Options
#include
"DeleteBranchDialog.h"
#include
"ui_DeleteBranchDialog.h"
struct
DeleteBranchDialog
::
Private
{
QStringList
all_local_branch_names
;
QStringList
current_local_branch_names
;
};
DeleteBranchDialog
::
DeleteBranchDialog
(
QWidget
*
parent
,
const
QStringList
&
all_local_branch_names
,
QStringList
const
&
current_local_branch_names
)
:
QDialog
(
parent
)
,
ui
(
new
Ui
::
DeleteBranchDialog
)
,
m
(
new
Private
)
{
ui
->
setupUi
(
this
);
Qt
::
WindowFlags
flags
=
windowFlags
();
flags
&=
~
Qt
::
WindowContextHelpButtonHint
;
setWindowFlags
(
flags
);
m
->
all_local_branch_names
=
all_local_branch_names
;
m
->
current_local_branch_names
=
current_local_branch_names
;
updateList
();
}
DeleteBranchDialog
::~
DeleteBranchDialog
()
{
delete
m
;
delete
ui
;
}
void
DeleteBranchDialog
::
updateList
()
{
bool
all
=
ui
->
checkBox_all_branches
->
isChecked
();
ui
->
listWidget
->
clear
();
for
(
QString
const
&
name
:
all
?
m
->
all_local_branch_names
:
m
->
current_local_branch_names
)
{
QListWidgetItem
*
item
=
new
QListWidgetItem
();
item
->
setText
(
name
);
item
->
setCheckState
(
Qt
::
Unchecked
);
ui
->
listWidget
->
addItem
(
item
);
}
}
QStringList
DeleteBranchDialog
::
selectedBranchNames
()
const
{
QStringList
names
;
int
n
=
ui
->
listWidget
->
count
();
for
(
int
row
=
0
;
row
<
n
;
row
++
)
{
QListWidgetItem
*
item
=
ui
->
listWidget
->
item
(
row
);
Q_ASSERT
(
item
);
if
(
item
->
checkState
()
==
Qt
::
Checked
)
{
names
.
push_back
(
item
->
text
());
}
}
return
names
;
}
void
DeleteBranchDialog
::
on_checkBox_all_branches_toggled
(
bool
/*checked*/
)
{
updateList
();
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, Nov 14, 4:53 PM (7 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
136968
Default Alt Text
DeleteBranchDialog.cpp (1 KB)
Attached To
Mode
R77 Guitar
Attached
Detach File
Event Timeline