Browse Source

Bugfix: Draw statuswin in line order to ensure overflow is cutoff properly

Conflicts:
	miner.c
Luke Dashjr 12 years ago
parent
commit
9ffde5235b
1 changed files with 21 additions and 20 deletions
  1. 21 20
      miner.c

+ 21 - 20
miner.c

@@ -3096,12 +3096,26 @@ static void curses_print_status(const int ts)
 		);
 		);
 	}
 	}
 	wattroff(statuswin, A_BOLD);
 	wattroff(statuswin, A_BOLD);
-	wmove(statuswin, 5, 1);
-	bfg_waddstr(statuswin, statusline);
-	wclrtoeol(statuswin);
+	
+	wattron(statuswin, menu_attr);
+	cg_mvwprintw(statuswin, 1, 0, " [M]anage devices [P]ool management [S]ettings [D]isplay options  [H]elp [Q]uit ");
+	wattroff(statuswin, menu_attr);
 
 
+	if ((pool_strategy == POOL_LOADBALANCE  || pool_strategy == POOL_BALANCE) && total_pools > 1) {
+		cg_mvwprintw(statuswin, 2, 0, " Connected to multiple pools with%s LP",
+			have_longpoll ? "": "out");
+	} else if (pool->has_stratum) {
+		cg_mvwprintw(statuswin, 2, 0, " Connected to %s diff %s with stratum as user %s",
+			pool->sockaddr_url, pool->diff, pool->rpc_user);
+	} else {
+		cg_mvwprintw(statuswin, 2, 0, " Connected to %s diff %s with%s LP as user %s",
+			pool->sockaddr_url, pool->diff, have_longpoll ? "": "out", pool->rpc_user);
+	}
+	wclrtoeol(statuswin);
+	cg_mvwprintw(statuswin, 3, 0, " Block: %s  Diff:%s (%s)  Started: %s",
+		  current_hash, block_diff, net_hashrate, blocktime);
+	
 	utility = total_accepted / total_secs * 60;
 	utility = total_accepted / total_secs * 60;
-
 	char bwstr[12];
 	char bwstr[12];
 	cg_mvwprintw(statuswin, 4, 0, " ST:%d  F:%d  NB:%d  AS:%d  BW:[%s]  E:%.2f  U:%.1f/m  BS:%s",
 	cg_mvwprintw(statuswin, 4, 0, " ST:%d  F:%d  NB:%d  AS:%d  BW:[%s]  E:%.2f  U:%.1f/m  BS:%s",
 		ts,
 		ts,
@@ -3116,19 +3130,10 @@ static void curses_print_status(const int ts)
 		utility,
 		utility,
 		best_share);
 		best_share);
 	wclrtoeol(statuswin);
 	wclrtoeol(statuswin);
-	if ((pool_strategy == POOL_LOADBALANCE  || pool_strategy == POOL_BALANCE) && total_pools > 1) {
-		cg_mvwprintw(statuswin, 2, 0, " Connected to multiple pools with%s LP",
-			have_longpoll ? "": "out");
-	} else if (pool->has_stratum) {
-		cg_mvwprintw(statuswin, 2, 0, " Connected to %s diff %s with stratum as user %s",
-			pool->sockaddr_url, pool->diff, pool->rpc_user);
-	} else {
-		cg_mvwprintw(statuswin, 2, 0, " Connected to %s diff %s with%s LP as user %s",
-			pool->sockaddr_url, pool->diff, have_longpoll ? "": "out", pool->rpc_user);
-	}
+	
+	mvwaddstr(statuswin, 5, 0, " ");
+	bfg_waddstr(statuswin, statusline);
 	wclrtoeol(statuswin);
 	wclrtoeol(statuswin);
-	cg_mvwprintw(statuswin, 3, 0, " Block: %s  Diff:%s (%s)  Started: %s",
-		  current_hash, block_diff, net_hashrate, blocktime);
 	
 	
 	logdiv = statusy - 1;
 	logdiv = statusy - 1;
 	bfg_hline(statuswin, 6);
 	bfg_hline(statuswin, 6);
@@ -3148,10 +3153,6 @@ static void curses_print_status(const int ts)
 		mvwadd_wch(statuswin, logdiv, offset, WACS_BTEE);
 		mvwadd_wch(statuswin, logdiv, offset, WACS_BTEE);
 	}
 	}
 #endif
 #endif
-	
-	wattron(statuswin, menu_attr);
-	cg_mvwprintw(statuswin, 1, 0, " [M]anage devices [P]ool management [S]ettings [D]isplay options  [H]elp [Q]uit ");
-	wattroff(statuswin, menu_attr);
 }
 }
 
 
 static void adj_width(int var, int *length)
 static void adj_width(int var, int *length)