Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Commit

Permalink
added host counter to status bar
Browse files Browse the repository at this point in the history
  • Loading branch information
mpentler committed Jun 26, 2018
1 parent 7183911 commit 10a7af1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Additionally other changes from around GitHub have been merged into this fork:
- Increased precision of time displays
- Code comments are being translated into English to assist in working with the codebase
- Typos and some UI strings corrected
- & other code improvements (addressed some cppcheck and warnings & some build environment stuff)
- & other code improvements (addressed some cppcheck warnings & some build environment stuff)

## Compiling
Dead easy, but you'll need to install a few libraries first. Here's some instructions
Expand Down
4 changes: 4 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
boinctui-extended (v1.0.1)

* added a host counter to the status bar - useful?

boinctui-extended (v1.0.0)

* project renamed (seems to be the polite way)
Expand Down
9 changes: 7 additions & 2 deletions src/mainprog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void MainProg::updatestatuslinecontent()
wstatus->appendstring(attrWG, " |");
wstatus->appendstring(attrYG, " PgUp/PgDn");
wstatus->appendstring(attrWG, " V.Scroll");
wstatus->appendstring(attrWG, " |");
wstatus->appendstring(attrWG, " |");
wstatus->appendstring(attrYG, " Left/Right");
wstatus->appendstring(attrWG, " H.Scroll");
wstatus->appendstring(attrWG, " |");
Expand All @@ -107,7 +107,12 @@ void MainProg::updatestatuslinecontent()
}
if ( (uistate == 0)||(uistate == stUISELECTOR) )
{
wstatus->setstring(attrYG, " PgUp/PgDn");
char nhosts[4];
snprintf(nhosts, 4, "%d", gsrvlist->counthosts());
wstatus->setstring(attrWG, " Hosts: ");
wstatus->appendstring(attrWG, nhosts);
wstatus->appendstring(attrWG, " | ");
wstatus->appendstring(attrYG, "PgUp/PgDn");
wstatus->appendstring(attrWG, " Scroll Msg |");
wstatus->appendstring(attrYG, " +/-");
wstatus->appendstring(attrWG, " Resize Msg |");
Expand Down
7 changes: 6 additions & 1 deletion src/srvdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PtrList::~PtrList()
delete list.front();
list.erase(list.begin());
}
pthread_mutex_destroy(&mutex);
pthread_mutex_destroy(&mutex);
}


Expand Down Expand Up @@ -201,6 +201,11 @@ void SrvList::prevserver()
(*cursrv)->setactive(true);
}

int SrvList::counthosts()
{
return servers.size();
}

//=============================================================================================


Expand Down
1 change: 1 addition & 0 deletions src/srvdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class SrvList //список всех серверов
void clear(); //удалить все соединения
void nextserver(); //переключиться на след сервер в списке
void prevserver();
int counthosts();
protected:
void addserver(Srv* c) { servers.push_back(c); };
std::list<Srv*> servers; //список соединений
Expand Down

0 comments on commit 10a7af1

Please sign in to comment.