Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
boinc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
boinc
Commits
2d193f91
Commit
2d193f91
authored
17 years ago
by
Charlie Fenton
Browse files
Options
Downloads
Patches
Plain Diff
MGR: Add "Show only this project" button to messages tab
svn path=/trunk/boinc/; revision=15559
parent
60069493
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
checkin_notes
+8
-0
8 additions, 0 deletions
checkin_notes
clientgui/Events.h
+1
-0
1 addition, 0 deletions
clientgui/Events.h
clientgui/ViewMessages.cpp
+144
-28
144 additions, 28 deletions
clientgui/ViewMessages.cpp
clientgui/ViewMessages.h
+9
-1
9 additions, 1 deletion
clientgui/ViewMessages.h
with
162 additions
and
29 deletions
checkin_notes
+
8
−
0
View file @
2d193f91
...
...
@@ -5498,3 +5498,11 @@ David 6 July 2008
user/
forum_moderate_thread.php
forum_modearte_thread_action.php
Charlie 8 July 2008
- MGR: Add "Show only this project" button to messages tab; filters
message display to show only messages for the selected project.
clientgui/
Events.h
ViewMessages.cpp,.h
This diff is collapsed.
Click to expand it.
clientgui/Events.h
+
1
−
0
View file @
2d193f91
...
...
@@ -114,6 +114,7 @@
#define ID_TASK_TRANSFERS_ABORT 9301
#define ID_TASK_MESSAGES_COPYALL 9400
#define ID_TASK_MESSAGES_COPYSELECTED 9401
#define ID_TASK_MESSAGES_FILTERBYPROJECT 9402
#define ID_TASK_STATISTICS_USERTOTAL 9500
#define ID_TASK_STATISTICS_USERAVERAGE 9501
#define ID_TASK_STATISTICS_HOSTTOTAL 9502
...
...
This diff is collapsed.
Click to expand it.
clientgui/ViewMessages.cpp
+
144
−
28
View file @
2d193f91
...
...
@@ -42,6 +42,7 @@
// buttons in the "tasks" area
#define BTN_COPYALL 0
#define BTN_COPYSELECTED 1
#define BTN_FILTERMSGS 2
IMPLEMENT_DYNAMIC_CLASS
(
CViewMessages
,
CBOINCBaseView
)
...
...
@@ -49,6 +50,7 @@ IMPLEMENT_DYNAMIC_CLASS(CViewMessages, CBOINCBaseView)
BEGIN_EVENT_TABLE
(
CViewMessages
,
CBOINCBaseView
)
EVT_BUTTON
(
ID_TASK_MESSAGES_COPYALL
,
CViewMessages
::
OnMessagesCopyAll
)
EVT_BUTTON
(
ID_TASK_MESSAGES_COPYSELECTED
,
CViewMessages
::
OnMessagesCopySelected
)
EVT_BUTTON
(
ID_TASK_MESSAGES_FILTERBYPROJECT
,
CViewMessages
::
OnMessagesFilter
)
EVT_LIST_ITEM_SELECTED
(
ID_LIST_MESSAGESVIEW
,
CViewMessages
::
OnListSelected
)
EVT_LIST_ITEM_DESELECTED
(
ID_LIST_MESSAGESVIEW
,
CViewMessages
::
OnListDeselected
)
END_EVENT_TABLE
()
...
...
@@ -71,9 +73,12 @@ CViewMessages::CViewMessages(wxNotebook* pNotebook) :
//
// Initialize variables used in later parts of the class
//
m_iPreviousDocCount
=
0
;
m_iPreviousRowCount
=
0
;
m_iTotalDocCount
=
0
;
m_iPreviousTotalDocCount
=
0
;
m_bIsFiltered
=
false
;
m_strFilteredProjectName
.
clear
();
m_iFilteredIndexes
.
Clear
();
//
// Setup View
//
...
...
@@ -102,6 +107,13 @@ CViewMessages::CViewMessages(wxNotebook* pNotebook) :
);
pGroup
->
m_Tasks
.
push_back
(
pItem
);
pItem
=
new
CTaskItem
(
_
(
"Show only this project"
),
_
(
"Show only the messages for the selected project."
),
ID_TASK_MESSAGES_FILTERBYPROJECT
);
pGroup
->
m_Tasks
.
push_back
(
pItem
);
// Create Task Pane Items
m_pTaskPane
->
UpdateControls
();
...
...
@@ -129,6 +141,8 @@ CViewMessages::~CViewMessages() {
m_pMessageErrorAttr
=
NULL
;
}
EmptyTasks
();
m_strFilteredProjectName
.
clear
();
m_iFilteredIndexes
.
Clear
();
}
...
...
@@ -217,8 +231,80 @@ void CViewMessages::OnMessagesCopySelected( wxCommandEvent& WXUNUSED(event) ) {
}
void
CViewMessages
::
OnMessagesFilter
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
{
wxLogTrace
(
wxT
(
"Function Start/End"
),
wxT
(
"CViewMessages::OnMessagesFilter - Function Begin"
));
wxInt32
iIndex
=
-
1
;
CAdvancedFrame
*
pFrame
=
wxDynamicCast
(
GetParent
()
->
GetParent
()
->
GetParent
(),
CAdvancedFrame
);
MESSAGE
*
message
;
wxASSERT
(
pFrame
);
wxASSERT
(
wxDynamicCast
(
pFrame
,
CAdvancedFrame
));
m_iFilteredIndexes
.
Clear
();
m_strFilteredProjectName
.
clear
();
if
(
m_bIsFiltered
)
{
m_bIsFiltered
=
false
;
m_iFilteredDocCount
=
m_iTotalDocCount
;
}
else
{
iIndex
=
m_pListPane
->
GetNextItem
(
-
1
,
wxLIST_NEXT_ALL
,
wxLIST_STATE_SELECTED
);
if
(
iIndex
>=
0
)
{
message
=
wxGetApp
().
GetDocument
()
->
message
(
iIndex
);
if
((
message
->
project
).
size
()
>
0
)
{
pFrame
->
UpdateStatusText
(
_
(
"Filtering messages..."
));
m_strFilteredProjectName
=
message
->
project
;
m_bIsFiltered
=
true
;
for
(
iIndex
=
0
;
iIndex
<
m_iTotalDocCount
;
iIndex
++
)
{
message
=
wxGetApp
().
GetDocument
()
->
message
(
iIndex
);
if
(
message
->
project
==
m_strFilteredProjectName
)
{
m_iFilteredIndexes
.
Add
(
iIndex
);
}
}
m_iFilteredDocCount
=
(
int
)(
m_iFilteredIndexes
.
GetCount
());
}
}
}
// Force a complete update
m_iPreviousRowCount
=
0
;
m_pListPane
->
DeleteAllItems
();
m_pListPane
->
SetItemCount
(
m_iFilteredDocCount
);
UpdateSelection
();
pFrame
->
FireRefreshView
();
pFrame
->
UpdateStatusText
(
wxT
(
""
));
wxLogTrace
(
wxT
(
"Function Start/End"
),
wxT
(
"CViewMessages::OnMessagesFilter - Function End"
));
}
wxInt32
CViewMessages
::
GetFilteredMessageIndex
(
wxInt32
iRow
)
const
{
if
(
m_bIsFiltered
)
return
m_iFilteredIndexes
[
iRow
];
return
iRow
;
}
// Get the (possibly filtered) item count (i.e., the Row count)
wxInt32
CViewMessages
::
GetDocCount
()
{
return
wxGetApp
().
GetDocument
()
->
GetMessageCount
();
int
i
;
m_iTotalDocCount
=
wxGetApp
().
GetDocument
()
->
GetMessageCount
();
if
(
m_bIsFiltered
)
{
for
(
i
=
m_iPreviousTotalDocCount
;
i
<
m_iTotalDocCount
;
i
++
)
{
MESSAGE
*
message
=
wxGetApp
().
GetDocument
()
->
message
(
i
);
if
(
message
->
project
==
m_strFilteredProjectName
)
{
m_iFilteredIndexes
.
Add
(
i
);
}
}
m_iPreviousTotalDocCount
=
m_iTotalDocCount
;
m_iFilteredDocCount
=
(
int
)(
m_iFilteredIndexes
.
GetCount
());
return
m_iFilteredDocCount
;
}
m_iPreviousTotalDocCount
=
m_iTotalDocCount
;
m_iFilteredDocCount
=
m_iTotalDocCount
;
return
m_iTotalDocCount
;
}
...
...
@@ -237,8 +323,8 @@ void CViewMessages::OnListRender (wxTimerEvent& event) {
wxASSERT
(
m_pListPane
);
isConnected
=
pDoc
->
IsConnected
();
wxInt32
i
Doc
Count
=
GetDocCount
();
if
(
0
>=
i
Doc
Count
)
{
wxInt32
i
Row
Count
=
GetDocCount
();
if
(
0
>=
i
Row
Count
)
{
m_pListPane
->
DeleteAllItems
();
}
else
{
// If connection status changed, adjust color of messages display
...
...
@@ -254,29 +340,29 @@ void CViewMessages::OnListRender (wxTimerEvent& event) {
}
// Force a complete update
m_pListPane
->
DeleteAllItems
();
m_pListPane
->
SetItemCount
(
i
Doc
Count
);
m_pListPane
->
SetItemCount
(
i
Row
Count
);
}
if
(
m_iPrevious
Doc
Count
!=
i
Doc
Count
)
m_pListPane
->
SetItemCount
(
i
Doc
Count
);
if
(
m_iPrevious
Row
Count
!=
i
Row
Count
)
m_pListPane
->
SetItemCount
(
i
Row
Count
);
}
if
((
i
Doc
Count
)
&&
(
_EnsureLastItemVisible
())
&&
(
m_iPrevious
Doc
Count
!=
i
Doc
Count
))
{
m_pListPane
->
EnsureVisible
(
i
Doc
Count
-
1
);
if
((
i
Row
Count
)
&&
(
_EnsureLastItemVisible
())
&&
(
m_iPrevious
Row
Count
!=
i
Row
Count
))
{
m_pListPane
->
EnsureVisible
(
i
Row
Count
-
1
);
}
if
(
isConnected
)
{
pDoc
->
GetConnectedComputerName
(
strNewMachineName
);
if
(
strLastMachineName
!=
strNewMachineName
)
{
strLastMachineName
=
strNewMachineName
;
if
(
i
Doc
Count
)
{
m_pListPane
->
EnsureVisible
(
i
Doc
Count
-
1
);
if
(
i
Row
Count
)
{
m_pListPane
->
EnsureVisible
(
i
Row
Count
-
1
);
}
}
}
if
(
m_iPrevious
Doc
Count
!=
i
Doc
Count
)
{
m_iPrevious
Doc
Count
=
i
Doc
Count
;
if
(
m_iPrevious
Row
Count
!=
i
Row
Count
)
{
m_iPrevious
Row
Count
=
i
Row
Count
;
}
m_bProcessingListRenderEvent
=
false
;
...
...
@@ -288,16 +374,17 @@ void CViewMessages::OnListRender (wxTimerEvent& event) {
wxString
CViewMessages
::
OnListGetItemText
(
long
item
,
long
column
)
const
{
wxString
strBuffer
=
wxEmptyString
;
wxInt32
index
=
GetFilteredMessageIndex
(
item
);
switch
(
column
)
{
case
COLUMN_PROJECT
:
FormatProjectName
(
i
tem
,
strBuffer
);
FormatProjectName
(
i
ndex
,
strBuffer
);
break
;
case
COLUMN_TIME
:
FormatTime
(
i
tem
,
strBuffer
);
FormatTime
(
i
ndex
,
strBuffer
);
break
;
case
COLUMN_MESSAGE
:
FormatMessage
(
i
tem
,
strBuffer
);
FormatMessage
(
i
ndex
,
strBuffer
);
break
;
}
...
...
@@ -307,7 +394,8 @@ wxString CViewMessages::OnListGetItemText(long item, long column) const {
wxListItemAttr
*
CViewMessages
::
OnListGetItemAttr
(
long
item
)
const
{
wxListItemAttr
*
pAttribute
=
NULL
;
MESSAGE
*
message
=
wxGetApp
().
GetDocument
()
->
message
(
item
);
wxInt32
index
=
GetFilteredMessageIndex
(
item
);
MESSAGE
*
message
=
wxGetApp
().
GetDocument
()
->
message
(
index
);
if
(
message
)
{
switch
(
message
->
priority
)
{
...
...
@@ -328,8 +416,8 @@ bool CViewMessages::EnsureLastItemVisible() {
int
numVisible
=
m_pListPane
->
GetCountPerPage
();
// Auto-scroll only if already at bottom of list
if
((
m_iPrevious
Doc
Count
>
numVisible
)
&&
((
m_pListPane
->
GetTopItem
()
+
numVisible
)
<
(
m_iPrevious
Doc
Count
-
1
))
if
((
m_iPrevious
Row
Count
>
numVisible
)
&&
((
m_pListPane
->
GetTopItem
()
+
numVisible
)
<
(
m_iPrevious
Row
Count
-
1
))
)
{
return
false
;
}
...
...
@@ -340,16 +428,43 @@ bool CViewMessages::EnsureLastItemVisible() {
void
CViewMessages
::
UpdateSelection
()
{
CTaskItemGroup
*
pGroup
=
NULL
;
MESSAGE
*
message
;
CBOINCBaseView
::
PreUpdateSelection
();
pGroup
=
m_TaskGroups
[
0
];
if
(
m_pListPane
->
GetSelectedItemCount
())
{
int
n
=
m_pListPane
->
GetSelectedItemCount
();
if
(
n
>
0
)
{
m_pTaskPane
->
EnableTask
(
pGroup
->
m_Tasks
[
BTN_COPYSELECTED
]);
}
else
{
m_pTaskPane
->
DisableTask
(
pGroup
->
m_Tasks
[
BTN_COPYSELECTED
]);
}
if
(
m_bIsFiltered
)
{
m_pTaskPane
->
UpdateTask
(
pGroup
->
m_Tasks
[
BTN_FILTERMSGS
],
_
(
"Show all messages"
),
_
(
"Resume tasks for this project."
)
);
m_pTaskPane
->
EnableTask
(
pGroup
->
m_Tasks
[
BTN_FILTERMSGS
]);
}
else
{
m_pTaskPane
->
UpdateTask
(
pGroup
->
m_Tasks
[
BTN_FILTERMSGS
],
_
(
"Show only this project"
),
_
(
"Show only the messages for the selected project."
)
);
m_pTaskPane
->
DisableTask
(
pGroup
->
m_Tasks
[
BTN_FILTERMSGS
]);
if
(
n
==
1
)
{
n
=
m_pListPane
->
GetNextItem
(
-
1
,
wxLIST_NEXT_ALL
,
wxLIST_STATE_SELECTED
);
message
=
wxGetApp
().
GetDocument
()
->
message
(
n
);
if
((
message
->
project
).
size
()
>
0
)
{
m_pTaskPane
->
EnableTask
(
pGroup
->
m_Tasks
[
BTN_FILTERMSGS
]);
}
}
}
CBOINCBaseView
::
PostUpdateSelection
();
}
...
...
@@ -408,6 +523,7 @@ bool CViewMessages::OpenClipboard() {
wxInt32
CViewMessages
::
CopyToClipboard
(
wxInt32
item
)
{
wxInt32
iRetVal
=
-
1
;
wxInt32
index
=
GetFilteredMessageIndex
(
item
);
if
(
m_bClipboardOpen
)
{
wxString
strBuffer
=
wxEmptyString
;
...
...
@@ -415,9 +531,9 @@ wxInt32 CViewMessages::CopyToClipboard(wxInt32 item) {
wxString
strProject
=
wxEmptyString
;
wxString
strMessage
=
wxEmptyString
;
FormatTime
(
i
tem
,
strTimeStamp
);
FormatProjectName
(
i
tem
,
strProject
);
FormatMessage
(
i
tem
,
strMessage
);
FormatTime
(
i
ndex
,
strTimeStamp
);
FormatProjectName
(
i
ndex
,
strProject
);
FormatMessage
(
i
ndex
,
strMessage
);
#ifdef __WXMSW__
strBuffer
.
Printf
(
wxT
(
"%s|%s|%s
\r\n
"
),
strTimeStamp
.
c_str
(),
strProject
.
c_str
(),
strMessage
.
c_str
());
...
...
This diff is collapsed.
Click to expand it.
clientgui/ViewMessages.h
+
9
−
1
View file @
2d193f91
...
...
@@ -46,16 +46,24 @@ public:
void
OnMessagesCopyAll
(
wxCommandEvent
&
event
);
void
OnMessagesCopySelected
(
wxCommandEvent
&
event
);
void
OnMessagesFilter
(
wxCommandEvent
&
event
);
protected:
wxInt32
m_iPreviousDocCount
;
wxArrayInt
m_iFilteredIndexes
;
wxInt32
m_iTotalDocCount
;
wxInt32
m_iFilteredDocCount
;
wxInt32
m_iPreviousTotalDocCount
;
wxInt32
m_iPreviousRowCount
;
bool
m_bIsFiltered
;
std
::
string
m_strFilteredProjectName
;
wxListItemAttr
*
m_pMessageInfoAttr
;
wxListItemAttr
*
m_pMessageErrorAttr
;
virtual
void
OnListRender
(
wxTimerEvent
&
event
);
virtual
wxInt32
GetFilteredMessageIndex
(
wxInt32
iRow
)
const
;
virtual
wxInt32
GetDocCount
();
virtual
wxString
OnListGetItemText
(
long
item
,
long
column
)
const
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment