55See the file 'LICENSE' for copying permission
66"""
77
8+ import webbrowser
9+
10+ from lib .core .settings import DEV_EMAIL_ADDRESS
11+ from lib .core .settings import ISSUES_PAGE
12+ from lib .core .settings import GIT_PAGE
13+ from lib .core .settings import SITE
14+ from lib .core .settings import VERSION_STRING
15+ from lib .core .settings import WIKI_PAGE
16+ from thirdparty .six .moves import tkinter_messagebox as _tkinter_messagebox
17+
818def runGui (parser ):
919 import re
1020 import tkinter as tk
@@ -42,7 +52,7 @@ def _on_tab_changed(self,event):
4252 event .widget .configure (height = tab .winfo_reqheight ())
4353
4454 window = tk .Tk ()
45- window .title ("sqlmap" )
55+ window .title (VERSION_STRING )
4656
4757 # Reference: https://www.holadevs.com/pregunta/64750/change-selected-tab-color-in-ttknotebook
4858 style = ttk .Style ()
@@ -56,28 +66,28 @@ def dummy():
5666 menubar = tk .Menu (window )
5767
5868 filemenu = tk .Menu (menubar , tearoff = 0 )
59- filemenu .add_command (label = "Open" , command = dummy )
60- filemenu .add_command (label = "Save" , command = dummy )
69+ filemenu .add_command (label = "Open" , command = dummy , state = tk . DISABLED )
70+ filemenu .add_command (label = "Save" , command = dummy , state = tk . DISABLED )
6171 filemenu .add_separator ()
6272 filemenu .add_command (label = "Exit" , command = window .quit )
6373 menubar .add_cascade (label = "File" , menu = filemenu )
6474
65- runmenu = tk .Menu (menubar , tearoff = 0 )
66- runmenu .add_command (label = "Start" , command = dummy )
67- runmenu .add_command (label = "Stop" , command = dummy )
68- menubar .add_cascade (label = "Run" , menu = runmenu )
75+ menubar .add_command (label = "Run" , command = window .quit )
6976
7077 helpmenu = tk .Menu (menubar , tearoff = 0 )
71- helpmenu .add_command (label = "Wiki pages" , command = dummy )
72- helpmenu .add_command (label = "Official site" , command = dummy )
78+ helpmenu .add_command (label = "Official site" , command = lambda : webbrowser .open (SITE ))
79+ helpmenu .add_command (label = "Github pages" , command = lambda : webbrowser .open (GIT_PAGE ))
80+ helpmenu .add_command (label = "Wiki pages" , command = lambda : webbrowser .open (WIKI_PAGE ))
81+ helpmenu .add_command (label = "Report issue" , command = lambda : webbrowser .open (ISSUES_PAGE ))
7382 helpmenu .add_separator ()
74- helpmenu .add_command (label = "About" , command = dummy )
83+ helpmenu .add_command (label = "About" , command = lambda : _tkinter_messagebox . showinfo ( "About" , "Copyright (c) 2006-2019 \n \n (%s)" % DEV_EMAIL_ADDRESS ) )
7584 menubar .add_cascade (label = "Help" , menu = helpmenu )
7685
7786 window .config (menu = menubar )
7887
7988 notebook = AutoresizableNotebook (window )
8089
90+ first = None
8191 frames = {}
8292 for group in parser .option_groups :
8393 frame = frames [group .title ] = tk .Frame (notebook , width = 200 , height = 200 )
@@ -105,6 +115,7 @@ def dummy():
105115 widget = tk .Checkbutton (frame , variable = var )
106116 widget .var = var
107117
118+ first = first or widget
108119 widget .grid (column = 1 , row = row , sticky = tk .W )
109120
110121 default = defaults .get (option .dest )
@@ -119,7 +130,8 @@ def dummy():
119130 tk .Label (frame ).grid (column = 0 , row = row , sticky = tk .W )
120131
121132 notebook .pack (expand = 1 , fill = "both" )
122-
123133 notebook .enable_traversal ()
124134
135+ first .focus ()
136+
125137 window .mainloop ()
0 commit comments