Skip to content

Commit

Permalink
Add path selection dialog for settings saveto lib path only on local …
Browse files Browse the repository at this point in the history
…mode
  • Loading branch information
ThePromidius committed Mar 2, 2024
1 parent 74a1ab2 commit 702ec74
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
14 changes: 13 additions & 1 deletion src/FMD3_Tkinter/FMD3.ui
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
</layout>
<child>
<object class="customtkinter.CTkLabel" id="ctklabel1">
<property name="text" translatable="yes">Downloaded manga will save to:</property>
<property name="text" translatable="yes">Downloaded manga will save to: (Absolute path)</property>
<layout manager="pack">
<property name="side">top</property>
</layout>
Expand Down Expand Up @@ -456,6 +456,18 @@
</layout>
</object>
</child>
<child>
<object class="customtkinter.CTkButton" id="widget_settings_saveto_librarypath_dialog_button" named="True">
<property name="command" type="command" cbtype="simple">on_settings_saveto_library_path_dialog</property>
<property name="fg_color">dark grey</property>
<property name="hover_color">grey</property>
<property name="text" translatable="yes">...</property>
<property name="width">20</property>
<layout manager="pack">
<property name="side">top</property>
</layout>
</object>
</child>
</object>
</child>
<child>
Expand Down
10 changes: 5 additions & 5 deletions src/FMD3_Tkinter/app/baseui.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

PROJECT_PATH = pathlib.Path(__file__).parent.parent
PROJECT_UI = PROJECT_PATH / "FMD3.ui"

from tkinter.filedialog import askdirectory


class BaseUI:
Expand All @@ -48,7 +48,7 @@ def __init__(self, master=None, translator=None):
self.widget_settings_saveto_libraries_treeview = self.builder.get_object("widget_settings_saveto_libraries_treeview")

self.widget_settings_saveto_libraries_default_optionmenu = self.builder.get_object("widget_settings_saveto_libraries_default_optionmenu")

self.widget_settings_saveto_librarypath_dialog_button = self.builder.get_object("widget_settings_saveto_librarypath_dialog_button")
# Tasks
self.widget_tasks_treeview:Treeview = self.builder.get_object("widget_tasks_treeview")

Expand Down Expand Up @@ -159,9 +159,9 @@ def on_series_chapters_actionmenu_select(self, value):
if value == "All":
tree.check_all()




def on_settings_saveto_library_path_dialog(self,*_):
asl_path = askdirectory(parent=self.mainwindow,title="Select dowload folder to save as library")
self.var_settings_saveto_lib_path.set(asl_path)


# if value == "All":
Expand Down
6 changes: 5 additions & 1 deletion src/FMD3_Tkinter/run_web_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ def run_web():

from FMD3_Tkinter.app.main import App
start_scheduler_loop()
App().run()
app = App()
# disable button as this is not useable in the api mode
app.widget_settings_saveto_librarypath_dialog_button.pack_forget()
app.run()

if __name__ == '__main__':
run_web()

0 comments on commit 702ec74

Please sign in to comment.