Compare commits
2 Commits
61b139fcb9
...
00c764605b
| Author | SHA1 | Date | |
|---|---|---|---|
| 00c764605b | |||
| a2a33c2a69 |
@ -17,24 +17,6 @@ from main import (
|
|||||||
setup_logging
|
setup_logging
|
||||||
)
|
)
|
||||||
|
|
||||||
def select_directory_with_dialog(title="Select Directory"):
|
|
||||||
"""Use dialog command to select directory in terminal environment"""
|
|
||||||
try:
|
|
||||||
result = subprocess.run(
|
|
||||||
['dialog', '--title', title, '--dselect', str(os.getcwd()), '20', '50'],
|
|
||||||
env={'DIALOGRC': '/etc/dialogrc'},
|
|
||||||
capture_output=True,
|
|
||||||
text=True
|
|
||||||
)
|
|
||||||
if result.returncode == 0:
|
|
||||||
return result.stderr.strip() # dialog outputs to stderr
|
|
||||||
return None
|
|
||||||
except FileNotFoundError:
|
|
||||||
st.error("Please install 'dialog' package: sudo apt-get install dialog")
|
|
||||||
return None
|
|
||||||
except Exception as e:
|
|
||||||
st.error(f"Error using dialog: {str(e)}")
|
|
||||||
return None
|
|
||||||
|
|
||||||
def is_running_locally():
|
def is_running_locally():
|
||||||
"""Check if the app is running locally or in cloud environment"""
|
"""Check if the app is running locally or in cloud environment"""
|
||||||
@ -189,14 +171,18 @@ with col1:
|
|||||||
|
|
||||||
col_src1, col_src2 = st.columns([1, 4])
|
col_src1, col_src2 = st.columns([1, 4])
|
||||||
with col_src1:
|
with col_src1:
|
||||||
if st.button("Browse", key='source_browse'):
|
if st.button("How to Browse", key='source_browse'):
|
||||||
st.info("""
|
st.info("""
|
||||||
To browse for a directory:
|
To find your folder path in Windows:
|
||||||
1. Open Windows File Explorer
|
1. Open File Explorer
|
||||||
2. Navigate to your desired folder
|
2. Navigate to your desired folder
|
||||||
3. Click in the address bar (or press Alt+D)
|
3. Click in the address bar (or press Alt+D)
|
||||||
4. Copy the full path (Ctrl+C)
|
4. Copy the full path (Ctrl+C)
|
||||||
5. Paste it here (Ctrl+V)
|
5. Paste it here (Ctrl+V)
|
||||||
|
|
||||||
|
Example paths:
|
||||||
|
C:\\Users\\YourName\\Documents
|
||||||
|
D:\\Work\\Files
|
||||||
""")
|
""")
|
||||||
|
|
||||||
# Add a check and display for source directory status
|
# Add a check and display for source directory status
|
||||||
@ -217,14 +203,18 @@ with col1:
|
|||||||
|
|
||||||
col_dest1, col_dest2 = st.columns([1, 4])
|
col_dest1, col_dest2 = st.columns([1, 4])
|
||||||
with col_dest1:
|
with col_dest1:
|
||||||
if st.button("Browse", key='dest_browse'):
|
if st.button("How to Browse", key='dest_browse'):
|
||||||
st.info("""
|
st.info("""
|
||||||
To browse for a directory:
|
To find your folder path in Windows:
|
||||||
1. Open Windows File Explorer
|
1. Open File Explorer
|
||||||
2. Navigate to your desired folder
|
2. Navigate to your desired folder
|
||||||
3. Click in the address bar (or press Alt+D)
|
3. Click in the address bar (or press Alt+D)
|
||||||
4. Copy the full path (Ctrl+C)
|
4. Copy the full path (Ctrl+C)
|
||||||
5. Paste it here (Ctrl+V)
|
5. Paste it here (Ctrl+V)
|
||||||
|
|
||||||
|
Example paths:
|
||||||
|
C:\\Users\\YourName\\Documents
|
||||||
|
D:\\Work\\Files
|
||||||
""")
|
""")
|
||||||
|
|
||||||
# Add a check and display for destination directory status
|
# Add a check and display for destination directory status
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user