Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F628765
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
;
bool
remote
=
false
;
};
DeleteBranchDialog
::
DeleteBranchDialog
(
QWidget
*
parent
,
bool
remote
,
QStringList
const
&
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
->
remote
=
remote
;
if
(
isRemote
())
{
setWindowTitle
(
tr
(
"Delete Remote Branch"
));
ui
->
checkBox_all_branches
->
setVisible
(
false
);
}
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
;
}
bool
DeleteBranchDialog
::
isRemote
()
const
{
return
m
->
remote
;
}
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
))
{
auto
*
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
Sun, Nov 15, 4:58 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
126616
Default Alt Text
DeleteBranchDialog.cpp (1 KB)
Attached To
Mode
R77 Guitar
Attached
Detach File
Event Timeline