Commit 42060ed5 by 陶腾飞

v1.2.0 更新批量打开工具

parent 27a73c30
test/ test/
testmain/
exe/ exe/
*.bat *.bat
*.ps1 *.ps1
......
...@@ -9,7 +9,7 @@ const DaemonListen string = ":" + DaemonPort ...@@ -9,7 +9,7 @@ const DaemonListen string = ":" + DaemonPort
const ADServerDaemon string = Host_adserver + DaemonListen const ADServerDaemon string = Host_adserver + DaemonListen
var LocalDaemon string = User_computername + DaemonListen var LocalDaemon string = User_computername + DaemonListen
const RandMax int = 60 const RandMax int = 60
const Version string = "1.1.2" const Version string = "1.2.0"
// user // // user //
......
...@@ -69,4 +69,4 @@ func NewLoger(s string) * log.Logger{ ...@@ -69,4 +69,4 @@ func NewLoger(s string) * log.Logger{
SendServerErrorf("%s %v-%v",s,Error_Fail_File_Open,err) SendServerErrorf("%s %v-%v",s,Error_Fail_File_Open,err)
} }
return log.New(Log_file_obj,"",log.LstdFlags) return log.New(Log_file_obj,"",log.LstdFlags)
} }
\ No newline at end of file
...@@ -115,6 +115,9 @@ func TrimPrefix(str ,s string)string{ ...@@ -115,6 +115,9 @@ func TrimPrefix(str ,s string)string{
func IndexString(str,sub string)int{ func IndexString(str,sub string)int{
return strings.Index(str,sub) return strings.Index(str,sub)
} }
func Splitln(str string)[]string{
return strings.Split(str,"\n")
}
func Exit(){ func Exit(){
os.Exit(0) os.Exit(0)
} }
...@@ -166,4 +169,4 @@ func GetWeDriveVersion() (int,string,error) { ...@@ -166,4 +169,4 @@ func GetWeDriveVersion() (int,string,error) {
}else { }else {
return 1,"233",Error_Null_Folder_WeDrive return 1,"233",Error_Null_Folder_WeDrive
} }
} }
\ No newline at end of file
...@@ -127,6 +127,7 @@ func Execcmd_nowait_noargs(app string){ ...@@ -127,6 +127,7 @@ func Execcmd_nowait_noargs(app string){
} }
} }
// //
// //
// local // local
......
package main package main
import ( import (
"github.com/lxn/walk" "github.com/lxn/walk"
. "github.com/lxn/walk/declarative"
"fmt"
pub "AD-Control/public" pub "AD-Control/public"
) )
...@@ -262,7 +264,7 @@ func wxdsExplain(){ ...@@ -262,7 +264,7 @@ func wxdsExplain(){
func menuInitTools(ni * walk.NotifyIcon){ func menuInitTools(ni * walk.NotifyIcon){
fa := "工具集合" fa := "工具集合"
sub := [...]string{"Excel关键词分割","备份用户文件","隐藏桌面图标","显示桌面图标","更新手机代理程序","移动硬盘(胡一波)","键盘驱动(徐文强)","测试"} sub := [...]string{"Excel关键词分割","备份用户文件","优雅批量打开网页","隐藏桌面图标","显示桌面图标","更新手机代理程序","移动硬盘(胡一波)","键盘驱动(徐文强)","测试"}
// 建立空菜单 // 建立空菜单
nm,err := walk.NewMenu() nm,err := walk.NewMenu()
if err != nil { if err != nil {
...@@ -295,10 +297,12 @@ func menuInitTools(ni * walk.NotifyIcon){ ...@@ -295,10 +297,12 @@ func menuInitTools(ni * walk.NotifyIcon){
case 1: case 1:
na.Triggered().Attach(tBakcupUser) na.Triggered().Attach(tBakcupUser)
case 2: case 2:
na.Triggered().Attach(tHideIcon) na.Triggered().Attach(tBatchOpenWeb)
case 3: case 3:
na.Triggered().Attach(tShowIcon) na.Triggered().Attach(tHideIcon)
case 4: case 4:
na.Triggered().Attach(tShowIcon)
case 5:
na.Triggered().Attach(tUpdateATool) na.Triggered().Attach(tUpdateATool)
case lastone-2: case lastone-2:
na.Triggered().Attach(t_movedisk_huyibo) na.Triggered().Attach(t_movedisk_huyibo)
...@@ -329,6 +333,45 @@ func menuInitTools(ni * walk.NotifyIcon){ ...@@ -329,6 +333,45 @@ func menuInitTools(ni * walk.NotifyIcon){
func tMultiSplit(){ func tMultiSplit(){
pub.Execcmd_nowait(pub.Cmd_K_Start + pub.App_MultiSplit) 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(){ func tBakcupUser(){
if pub.Msg_YesNo("是否执行一次手动备份用户文件夹。目标文件夹:"+pub.Dir_userprofile)==1{ 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