Skip to content

Commit

Permalink
update dirname logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikachu2333 authored Dec 26, 2024
1 parent d619298 commit b9774f9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 1 addition & 3 deletions default.aproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<project ver="10" name="name_exchanger" libEmbed="true" icon="123.ico" ui="win" output="name_exchanger.exe" CompanyName="None" FileDescription="Exchange the name of two files." LegalCopyright="Copyright (C) Mika 2023 MIT License" ProductName="name_exchanger" InternalName="name_exchanger" FileVersion="2.3.0.59" ProductVersion="2.3.0.59" publishDir="/dist/" dstrip="true" local="false" ignored="false">
<project ver="10" name="name_exchanger" libEmbed="true" icon="123.ico" ui="win" output="name_exchanger.exe" CompanyName="None" FileDescription="Exchange the name of two files." LegalCopyright="Copyright (C) Mika 2025 MIT License" ProductName="name_exchanger" InternalName="name_exchanger" FileVersion="2.4.0.3" ProductVersion="2.4.0.3" publishDir="/dist/" dstrip="false" local="false" ignored="false">
<file name="main.aardio" path="main.aardio" comment="main.aardio"/>
<folder name="资源文件" path="res" embed="true" local="false" ignored="false"/>
<folder name="窗体文件" path="dlg" comment="目录" embed="true" local="false" ignored="false"/>
</project>
2 changes: 1 addition & 1 deletion lib/config.aardio
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ config = fsys.config("/config/");
//不需要序列化的配置名字前请添加下划线
namespace config {
__appName = "应用程序名";
__website = "http://www.aardio.com/";
website = "https://github.com/Mikachu2333/name_exchanger";
}

/**intellisense(config)
Expand Down
19 changes: 11 additions & 8 deletions main.aardio
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//RUN\\AS//
import fsys.lnk
import crypt
//import win.messageFilter
import win.ui
import win.ui.tooltip
import win.util.tray
Expand All @@ -20,6 +21,10 @@ static_top={cls="static";text='\u2693';left=4;top=2;right=31;bottom=29;align="ce
)
/*}}*/

//win.messageFilter.change(mainForm.hwnd,1/*_MSGFLT_ADD*/,0x4A/*_WM_COPYDATA*/,0x233/*_WM_DROPFILES*/,0x0049/*_WM_COPYGLOBALDATA*/ )

//io.open()

rename_dll := raw.loadDll($"name_exchanger_rs.dll",,"cdecl")

mainForm.static_tip.oncommand = function(id,event){
Expand Down Expand Up @@ -58,7 +63,6 @@ if(argv_len_judge == 0){
mainForm.close()
}


var tooltipCtrl = win.ui.tooltip(mainForm)
var tip_table = {
"static_tip" = '答疑\n\n關於';
Expand Down Expand Up @@ -89,26 +93,25 @@ mainForm.onDropFiles = function(files){
mainForm.edit_path2.text = files[2]
}
else{
win.msgbox("Error for file error. Please Retry.","Error",,mainForm.hwnd,,500)
win.msgbox("Error for file error. Please Retry.","Error",,mainForm.hwnd,500)
}
}
}

//io.open()
mainForm.button_start.oncommand = function(id,event){
result = rename_dll.exchange(mainForm.edit_path1.text,mainForm.edit_path2.text)
//io.print(result)
if(result == 0){
mainForm.edit_path1.text = ""
mainForm.edit_path2.text = ""
}elseif(result == 1){
win.msgbox("No Exist","Error",,mainForm.hwnd,,2000)
win.msgbox("No Exist","Error",,mainForm.hwnd,2000)
}elseif(result == 2){
win.msgbox("Permission Denied","Error",,mainForm.hwnd,,2000)
win.msgbox("Permission Denied","Error",,mainForm.hwnd,2000)
}elseif(result == 3){
win.msgbox("New File Already Exists","Error",,mainForm.hwnd,,2000)
win.msgbox("New File Already Exists","Error",,mainForm.hwnd,2000)
}else {
win.msgbox("UNKNOWN ERROR","Error",,mainForm.hwnd,,2000)
win.msgbox("UNKNOWN ERROR","Error",,mainForm.hwnd,2000)
}
}

Expand Down
Binary file modified name_exchanger_rs.dll
Binary file not shown.

0 comments on commit b9774f9

Please sign in to comment.