Commit 0d4485fa authored by Nong Hoang Tu's avatar Nong Hoang Tu
Browse files

Fix missing sudo args and add some more buttons to work

parent c6c85856
......@@ -4,6 +4,7 @@ import cores / [handle_activities, handle_killapps]
import gtk / widgets / [details_widget, main_widget, bottom_widget]
import gtk / anonsurf_icons
import gtk / gui_activities / [details_widget_activities, main_widget_activities, core_activities]
import cores / handle_activities
# type
# RefreshObj = ref object
......@@ -34,6 +35,8 @@ proc createArea(boxMainWindow: Box) =
#[
Create everything for the program
]#
let
cb_send_msg = cli_init_callback_msg(true)
let
btnStart = newButton("Start")
......@@ -46,11 +49,11 @@ proc createArea(boxMainWindow: Box) =
imgStatus = newImageFromPixbuf(surfImages.imgSecMed)
mainWidget = createMainWidget(imgStatus, labelDetails, btnStart, btnShowStatus, btnChangeID, btnCheckIP, btnRestart)
# btnRestart.connect("clicked", ansurf_gtk_do_restart, cb_send_msg)
# btnStatus.connect("clicked", ansurf_gtk_do_status)
btnRestart.connect("clicked", ansurf_gtk_do_restart, cb_send_msg)
# btnStatus.connect("clicked", ansurf_gtk_do_status) # TODO handle do status differently
# btnStart.connect("clicked", ansurf_gtk_do_start_stop, cb_kill_apps, cb_send_msg)
# btnID.connect("clicked", ansurf_gtk_do_changeid, cb_send_msg)
# btnIP.connect("clicked", ansurf_gtk_do_IP, cb_send_msg)
btnChangeID.connect("clicked", ansurf_gtk_do_changeid, cb_send_msg)
btnCheckIP.connect("clicked", ansurf_gtk_do_myip, cb_send_msg)
let
labelDaemons = newLabel("Services: Checking")
......
......@@ -4,13 +4,13 @@ import .. / .. / cores / handle_activities
proc ansurf_gtk_do_start_stop*(b: Button, cb_kill_apps, cb_send_msg: proc) =
if b.label == "Start":
ansurf_acts_handle_start(cb_kill_apps, cb_send_msg)
ansurf_acts_handle_start("gksudo", cb_kill_apps, cb_send_msg)
else:
ansurf_acts_handle_stop(cb_kill_apps, cb_send_msg)
ansurf_acts_handle_stop("gksudo", cb_kill_apps, cb_send_msg)
proc ansurf_gtk_do_restart*(b: Button, cb_kill_apps, cb_send_msg: proc) =
ansurf_acts_handle_restart(cb_kill_apps, cb_send_msg)
proc ansurf_gtk_do_restart*(b: Button, cb_send_msg: proc) =
ansurf_acts_handle_restart("gksudo", cb_send_msg)
proc ansurf_gtk_do_myip*(b: Button, cb_send_msg: proc) =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment