Commit 8d7f7b47 authored by Nong Hoang Tu's avatar Nong Hoang Tu
Browse files

Fix kill app issue when select don't kill

parent 3e3119b6
Pipeline #3768 canceled with stages
......@@ -9,5 +9,7 @@ proc init_cli_askkill*(is_desktop: bool): callback_kill_apps =
return cli_kill_apps
proc init_gtk_askkill*(): proc =
return dialog_kill_app
proc init_gtk_askkill*(): callback_kill_apps =
# return dialog_kill_app
# return window_kill_app
return window_kill_apps_gtk
......@@ -3,7 +3,7 @@ import .. / ansurf_types
import kill_apps_activities
proc onExit(w: Window) =
proc onClickExit(w: Window) =
mainQuit()
......@@ -57,17 +57,23 @@ proc window_kill_app*(callback_send_msg: callback_send_messenger) =
mainBoard.setBorderWidth(3)
mainBoard.showAll()
mainBoard.connect("destroy", onExit)
mainBoard.connect("destroy", onClickExit)
gtk.main()
proc dialog_kill_app*(callback_send_msg: callback_send_messenger) =
proc window_kill_apps_gtk*(callback_send_msg: callback_send_messenger) =
gtk.init()
let
retDialog = newDialog()
dialogArea = retDialog.getContentArea()
boxDialog = box_kill_app(callback_send_msg)
retDialog.setTitle("Kill dangerous application")
dialogArea.add(boxDialog)
retDialog.showAll()
discard retDialog.run()
retDialog.destroy()
mainBoard = newWindow()
boxMainWindow = box_kill_app(callback_send_msg)
mainBoard.setResizable(false)
mainBoard.title = "Kill dangerous application"
mainBoard.setPosition(WindowPosition.center)
mainBoard.add(boxMainWindow)
mainBoard.setBorderWidth(3)
mainBoard.showAll()
mainBoard.connect("destroy", onClickExit)
gtk.main()
mainQuit()
......@@ -10,17 +10,15 @@ proc ansurf_gtk_do_show_details*(b: Button, s: Stack) =
b.label = "Details"
proc ansurf_gtk_do_exit*(b: Button) =
#[
Close program by click on exit button
]#
# channel.close()
mainQuit()
# proc ansurf_gtk_do_exit*(b: Button) =
# #[
# Close program by click on exit button
# ]#
# mainQuit()
proc ansurf_gtk_do_stop*(w: Window) =
#[
Close program by click on title bar
]#
# channel.close()
mainQuit()
......@@ -18,5 +18,3 @@ proc ansurf_gtk_do_enable_disable_boot*(b: Button, cb_send_msg: proc) =
else:
# ansurf_acts_handle_boot_disable("gksudo", cb_send_msg)
createThread(ansurf_workers_common, do_anonsurf_disable_boot, cb_send_msg)
ansurf_workers_common.joinThread()
......@@ -3,7 +3,7 @@ import .. / .. / cores / handle_activities
import .. / .. / cores / handle_killapps
import .. / ansurf_objects
let cb_kill_apps = init_gtk_askkill()
let cb_kill_apps = init_gtk_askkill()
proc do_anonsurf_start(cb_send_msg: proc) {.gcsafe.} =
......@@ -28,20 +28,19 @@ proc do_anonsurf_checkip(cb_send_msg: proc) {.gcsafe.} =
proc ansurf_gtk_do_start_stop*(b: Button, cb_send_msg: proc) =
if b.label == "Start":
createThread(ansurf_workers_common, do_anonsurf_start, cb_send_msg)
# createThread(ansurf_workers_common, do_anonsurf_start, cb_send_msg)
# createThread(ansurf_start_stop_workers, ansurf_acts_handle_start, ("gksudo", cb_kill_apps, cb_send_msg))
# ansurf_acts_handle_start("gksudo", cb_kill_apps, cb_send_msg)
ansurf_acts_handle_start("gksudo", cb_kill_apps, cb_send_msg)
else:
createThread(ansurf_workers_common, do_anonsurf_stop, cb_send_msg)
# ansurf_acts_handle_stop("gksudo", cb_kill_apps, cb_send_msg)
# createThread(ansurf_workers_common, do_anonsurf_stop, cb_send_msg)
ansurf_acts_handle_stop("gksudo", cb_kill_apps, cb_send_msg)
# createThread(ansurf_start_stop_workers, ansurf_acts_handle_stop, "gksudo", cb_kill_apps, cb_send_msg)
ansurf_workers_common.joinThread()
# joinThread(ansurf_workers_common)
proc ansurf_gtk_do_restart*(b: Button, cb_send_msg: proc) =
createThread(ansurf_workers_common, do_anonsurf_restart, cb_send_msg)
ansurf_workers_common.joinThread()
# ansurf_workers_common.joinThread()
# createThread(ansurf_workers_common_sudo, ansurf_acts_handle_restart, ("gksudo", cb_send_msg))
# ansurf_acts_handle_restart("gksudo", cb_send_msg)
......
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