Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
packages
tools
anonsurf
Commits
a7fed97d
Commit
a7fed97d
authored
Jan 13, 2021
by
Nong Hoang Tu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New layout for AnonSurf
parent
bcf66465
Pipeline
#1756
canceled with stages
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
55 deletions
+39
-55
nimsrc/anonsurf/AnonSurfGTK.nim
nimsrc/anonsurf/AnonSurfGTK.nim
+8
-6
nimsrc/anonsurf/actions/gtkClick.nim
nimsrc/anonsurf/actions/gtkClick.nim
+7
-9
nimsrc/anonsurf/cores/images.nim
nimsrc/anonsurf/cores/images.nim
+1
-10
nimsrc/anonsurf/displays/bottombar.nim
nimsrc/anonsurf/displays/bottombar.nim
+18
-0
nimsrc/anonsurf/displays/mainPage.nim
nimsrc/anonsurf/displays/mainPage.nim
+5
-30
No files found.
nimsrc/anonsurf/AnonSurfGTK.nim
View file @
a7fed97d
import
gintro
/
[
gtk
,
glib
,
gobject
]
import
displays
/
[
detailPage
,
mainPage
]
import
displays
/
[
detailPage
,
mainPage
,
bottombar
]
import
cores
/
[
status
,
refresher
,
images
]
import
actions
/
[
actDetailPage
,
actMainPage
,
gtkClick
]
...
...
@@ -40,9 +40,9 @@ proc createArea(boxMainWindow: Box) =
btnShowStatus
=
newButton
(
"Tor Stats"
)
btnChangeID
=
newButton
(
"Change
\n
Identity"
)
btnCheckIP
=
newButton
(
"My IP"
)
btnRestart
=
newButton
(
""
)
btnRestart
=
newButton
(
"
Restart
"
)
imgStatus
=
newImageFromPixbuf
(
surfImages
.
imgSecMed
)
mainWidget
=
createMainWidget
(
imgStatus
,
labelDetails
,
btnStart
,
btnShowDetails
,
btnShowStatus
,
btnChangeID
,
btnCheckIP
,
btnRestart
)
mainWidget
=
createMainWidget
(
imgStatus
,
labelDetails
,
btnStart
,
btnShowStatus
,
btnChangeID
,
btnCheckIP
,
btnRestart
)
btnRestart
.
connect
(
"clicked"
,
onClickRestart
)
btnStart
.
connect
(
"clicked"
,
onClickRun
)
...
...
@@ -57,10 +57,9 @@ proc createArea(boxMainWindow: Box) =
imgStatusBoot
=
newImageFromPixbuf
(
surfImages
.
imgBootOff
)
labelStatusBoot
=
newLabel
(
"Not enabled at boot"
)
btnBoot
=
newButton
(
"Enable"
)
btnBack
=
newButton
(
"Back"
)
detailWidget
=
createDetailWidget
(
labelDaemons
,
labelPorts
,
labelDNS
,
labelStatusBoot
,
btnBoot
,
btnBack
,
imgStatusBoot
btnBoot
,
imgStatusBoot
)
btnBoot
.
connect
(
"clicked"
,
onClickBoot
)
...
...
@@ -69,11 +68,14 @@ proc createArea(boxMainWindow: Box) =
mainStack
=
newStack
()
btnShowDetails
.
connect
(
"clicked"
,
onClickDetail
,
mainStack
)
btnBack
.
connect
(
"clicked"
,
onClickBack
,
mainStack
)
mainStack
.
addNamed
(
mainWidget
,
"main"
)
mainStack
.
addNamed
(
detailWidget
,
"detail"
)
boxMainWindow
.
add
(
mainStack
)
let
boxBottom
=
makeBottomBar
(
btnShowDetails
)
boxMainWindow
.
add
(
boxBottom
)
boxMainWindow
.
showAll
()
var
...
...
nimsrc/anonsurf/actions/gtkClick.nim
View file @
a7fed97d
...
...
@@ -2,18 +2,16 @@ import gintro / gtk
import
actMainPage
proc
onClickBack
*
(
b
:
Button
,
s
:
Stack
)
=
#[
Return
main
widget
from
current
page
]
#
s
.
setVisibleChildName
(
"main"
)
proc
onClickDetail
*
(
b
:
Button
,
s
:
Stack
)
=
#[
Display
status
pa
ge
Display
details
widget
or
main
wid
ge
t
]
#
s
.
setVisibleChildName
(
"detail"
)
if
b
.
label
==
"Details"
:
s
.
setVisibleChildName
(
"detail"
)
b
.
label
=
"Back"
else
:
s
.
setVisibleChildName
(
"main"
)
b
.
label
=
"Details"
proc
onClickExit
*
(
b
:
Button
)
=
...
...
nimsrc/anonsurf/cores/images.nim
View file @
a7fed97d
...
...
@@ -56,15 +56,6 @@ proc surfIconPixbuf(): Pixbuf =
result
=
loadData
.
getPixbuf
()
proc
reloadIconPixbuf
():
Pixbuf
=
const
imgData
=
staticRead
(
"../../../icons/reload.png"
)
let
loadData
=
newPixbufLoader
()
discard
loadData
.
write
(
imgData
)
discard
loadData
.
close
()
result
=
loadData
.
getPixbuf
()
proc
exitIconPixbuf
():
Pixbuf
=
const
imgData
=
staticRead
(
"../../../icons/exit.png"
)
...
...
@@ -86,6 +77,6 @@ proc aboutIconPixbuf(): Pixbuf =
let
surfImages
*
=
initImgs
()
surfIcon
*
=
surfIconPixbuf
()
reloadIcon
*
=
reloadIconPixbuf
()
#
reloadIcon* = reloadIconPixbuf()
exitIcon
*
=
exitIconPixbuf
()
aboutIcon
*
=
aboutIconPixbuf
()
nimsrc/anonsurf/displays/bottombar.nim
0 → 100644
View file @
a7fed97d
import
gintro
/
[
gtk
,
gobject
]
import
..
/
cores
/
images
import
about
proc
makeBottomBar
*
(
bSwitchWidget
:
Button
):
Box
=
let
btnAbout
=
newButton
(
""
)
imgAbout
=
newImageFromPixbuf
(
aboutIcon
)
bxBottomBar
=
newBox
(
Orientation
.
horizontal
,
3
)
btnAbout
.
setImage
(
imgAbout
)
btnAbout
.
connect
(
"clicked"
,
onClickAbout
)
bxBottomBar
.
packStart
(
bSwitchWidget
,
false
,
true
,
3
)
bxBottomBar
.
packEnd
(
btnAbout
,
false
,
true
,
3
)
return
bxBottomBar
nimsrc/anonsurf/displays/mainPage.nim
View file @
a7fed97d
import
gintro
/
[
gtk
,
gobject
]
import
..
/
cores
/
images
import
about
import
gintro
/
gtk
proc
makeDetailPanel
(
imgStatus
:
Image
,
labDetails
:
Label
,
btn
Detail
,
btnStatus
:
Button
):
Frame
=
proc
makeDetailPanel
(
imgStatus
:
Image
,
labDetails
:
Label
,
btn
Status
,
btnRestart
:
Button
):
Frame
=
#[
Create
the
area
Detail
in
main
page
it
has
image
of
current
AnonSurf
...
...
@@ -17,7 +15,7 @@ proc makeDetailPanel(imgStatus: Image, labDetails: Label, btnDetail, btnStatus:
bxDetailPanel
=
newBox
(
Orientation
.
horizontal
,
6
)
bxDetailPanel
.
add
(
imgStatus
)
bxButtons
.
packStart
(
btn
Detail
,
false
,
true
,
4
)
bxButtons
.
packStart
(
btn
Restart
,
false
,
true
,
4
)
bxButtons
.
packStart
(
btnStatus
,
false
,
true
,
2
)
areaInfo
.
packStart
(
labDetails
,
false
,
true
,
3
)
...
...
@@ -49,38 +47,15 @@ proc makeToolBar(btnStart, btnID, btnIP: Button): Frame =
return
fmTool
proc
makeBottomBarForMain
(
btnRestart
:
Button
):
Box
=
#[
Create
bottom
bar
It
has
About
and
Exit
button
]
#
let
boxBottomBar
=
newBox
(
Orientation
.
horizontal
,
3
)
imgRestart
=
newImageFromPixbuf
(
reloadIcon
)
btnAbout
=
newButton
(
""
)
imgAbout
=
newImageFromPixbuf
(
aboutIcon
)
btnRestart
.
setImage
(
imgRestart
)
btnAbout
.
setImage
(
imgAbout
)
btnAbout
.
connect
(
"clicked"
,
onClickAbout
)
boxBottomBar
.
packStart
(
btnRestart
,
false
,
true
,
3
)
boxBottomBar
.
packEnd
(
btnAbout
,
false
,
true
,
3
)
return
boxBottomBar
proc
createMainWidget
*
(
imgStatus
:
Image
,
lDetails
:
Label
,
bStart
,
bDetail
,
bStatus
,
bID
,
bIP
,
bRestart
:
Button
):
Box
=
proc
createMainWidget
*
(
imgStatus
:
Image
,
lDetails
:
Label
,
bStart
,
bStatus
,
bID
,
bIP
,
bRestart
:
Button
):
Box
=
#[
Create
the
page
for
main
widget
]
#
let
boxPanel
=
makeDetailPanel
(
imgStatus
,
lDetails
,
b
Detail
,
bStatus
)
boxPanel
=
makeDetailPanel
(
imgStatus
,
lDetails
,
b
Status
,
bRestart
)
boxToolBar
=
makeToolBar
(
bStart
,
bID
,
bIP
)
bottomBar
=
makeBottomBarForMain
(
bRestart
)
mainWidget
=
newBox
(
Orientation
.
vertical
,
3
)
mainWidget
.
packStart
(
boxPanel
,
false
,
true
,
2
)
mainWidget
.
packStart
(
boxToolBar
,
false
,
true
,
1
)
mainWidget
.
packEnd
(
bottomBar
,
false
,
true
,
2
)
return
mainWidget
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment