Commit 42060ed5 by 陶腾飞

v1.2.0 更新批量打开工具

parent 27a73c30
test/
testmain/
exe/
*.bat
*.ps1
......
......@@ -9,7 +9,7 @@ const DaemonListen string = ":" + DaemonPort
const ADServerDaemon string = Host_adserver + DaemonListen
var LocalDaemon string = User_computername + DaemonListen
const RandMax int = 60
const Version string = "1.1.2"
const Version string = "1.2.0"
// user //
......
......@@ -115,6 +115,9 @@ func TrimPrefix(str ,s string)string{
func IndexString(str,sub string)int{
return strings.Index(str,sub)
}
func Splitln(str string)[]string{
return strings.Split(str,"\n")
}
func Exit(){
os.Exit(0)
}
......
......@@ -127,6 +127,7 @@ func Execcmd_nowait_noargs(app string){
}
}
//
//
// local
......
package main
import (
"github.com/lxn/walk"
. "github.com/lxn/walk/declarative"
"fmt"
pub "AD-Control/public"
)
......@@ -262,7 +264,7 @@ func wxdsExplain(){
func menuInitTools(ni * walk.NotifyIcon){
fa := "工具集合"
sub := [...]string{"Excel关键词分割","备份用户文件","隐藏桌面图标","显示桌面图标","更新手机代理程序","移动硬盘(胡一波)","键盘驱动(徐文强)","测试"}
sub := [...]string{"Excel关键词分割","备份用户文件","优雅批量打开网页","隐藏桌面图标","显示桌面图标","更新手机代理程序","移动硬盘(胡一波)","键盘驱动(徐文强)","测试"}
// 建立空菜单
nm,err := walk.NewMenu()
if err != nil {
......@@ -295,10 +297,12 @@ func menuInitTools(ni * walk.NotifyIcon){
case 1:
na.Triggered().Attach(tBakcupUser)
case 2:
na.Triggered().Attach(tHideIcon)
na.Triggered().Attach(tBatchOpenWeb)
case 3:
na.Triggered().Attach(tShowIcon)
na.Triggered().Attach(tHideIcon)
case 4:
na.Triggered().Attach(tShowIcon)
case 5:
na.Triggered().Attach(tUpdateATool)
case lastone-2:
na.Triggered().Attach(t_movedisk_huyibo)
......@@ -329,6 +333,45 @@ func menuInitTools(ni * walk.NotifyIcon){
func tMultiSplit(){
pub.Execcmd_nowait(pub.Cmd_K_Start + pub.App_MultiSplit)
}
// 其他工具 优雅批量打开网页
func tBatchOpenWeb(){
var inTE,outTE *walk.TextEdit
MainWindow{
Title: "优雅批量打开网页",
Size: Size{600, 200},
Layout: VBox{},
Children: []Widget{
HSplitter{
Children: []Widget{
TextEdit{AssignTo: &inTE,VScroll:true},
TextEdit{AssignTo: &outTE,ReadOnly: true,VScroll:true},
},
},
PushButton{
Text: "打开网页",
OnClicked: func() {
for seq,web := range pub.Splitln(inTE.Text()){
if web == ""{
continue
}
pub.Execcmd_nowait(`C:\Progra~2\Google\Chrome\Application\chrome.exe `+web)
pub.Delay(2)
outTE.AppendText(fmt.Sprintf("%d %s\n",seq+1,web))
}
},
},
PushButton{
Text: "清空",
OnClicked: func() {
inTE.SetText("")
outTE.SetText("")
},
},
},
}.Run()
}
// 其他工具 备份用户文件
func tBakcupUser(){
if pub.Msg_YesNo("是否执行一次手动备份用户文件夹。目标文件夹:"+pub.Dir_userprofile)==1{
......
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