-
Notifications
You must be signed in to change notification settings - Fork 0
/
infoWindow.cpp
51 lines (39 loc) · 898 Bytes
/
infoWindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "infoWindow.h"
using namespace TransmissionRC;
using namespace TransmissionRC::Terminal;
void
infoWindow::Draw(rcTorrent torrent){
werase(win);
int ln =0;
mvwprintw(win,ln,0,torrent.Name.c_str());
ln++;
//
std::stringstream ss;
ss.str("");
ss<<"Uploaded:"<<Utility::convertSize(torrent.uploadedEver).get();
mvwprintw(win,ln,0,ss.str().c_str());
ln++;
ss.str("");
ss<<"Available:"<<torrent.desiredAvailable;
mvwprintw(win,ln,0,ss.str().c_str());
ln++;
ln++;
//
//files
mvwprintw(win,ln,0,"Files:");
ln++;
for(int i=0;i<torrent.files.size();i++){
mvwprintw(win,ln,0,(" " + torrent.files[i].name).c_str());
ln++;
}
ln++;
mvwprintw(win,ln,0,("Error: " +torrent.errorString).c_str());
ln++;
//
mvwprintw(win,ln,0,("Comment: " +torrent.comment).c_str());
ln++;
wrefresh(win);
}
void
infoWindow::Draw(std::shared_ptr<std::vector<rcTorrent>>torrents){
}