Skip to content

Commit

Permalink
設定ページと試験機能ページに「すべてデフォルトに戻す」ボタンを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
Robot-Inventor committed Jun 16, 2020
1 parent 0d5e38f commit 9f892ab
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Edition: ORIZIN Agent HTML
- 裸の心
- 香水
- 星影のエール
- 設定ページと試験機能ページに「すべてデフォルトに戻す」ボタンを追加しました。

#### 修正
- リファクタリングを行いました。
Expand Down
19 changes: 19 additions & 0 deletions orizin_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,25 @@ def set_flag(_flag_name, _flag_value):
return


@eel.expose
def reset_setting():
with open("resource/setting/default_setting.otfd", encoding="utf-8_sig") as f:
default_setting = f.read()
with open("resource/setting/setting.otfd", mode="w", encoding="utf-8_sig") as f:
f.write(default_setting)
write_setting("setup_finished", "True")
return


@eel.expose
def reset_flag():
with open("resource/setting/default_flag.otfd", encoding="utf-8_sig") as f:
default_setting = f.read()
with open("resource/setting/flag.otfd", mode="w", encoding="utf-8_sig") as f:
f.write(default_setting)
return


YOUTUBE_MUSIC_VIDEOS = {
"(白|ハク)(日|ジツ)": ["白日", "はくじつ", "King Gnu", "キングヌー", "ony539T074w"],
"マリーゴールド": ["マリーゴールド", "マリーゴールド", "あいみょん", "あいみょん", "0xSiBpUdW4E"],
Expand Down
1 change: 1 addition & 0 deletions resource/html/flag.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h2>試験機能</h2>
設定ページに音声に関する設定を追加し,音声のピッチ・スピード・ボリュームを設定できるようにします。
</p>
</section>
<span style="float: right; cursor: pointer;" onclick="eel.reset_flag(); location.reload();"><i class="material_icon">refresh</i>すべてデフォルトに戻す</span>
</div>
</main>
<style>
Expand Down
1 change: 1 addition & 0 deletions resource/html/setting.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ <h2>設定</h2>
<a href="flag.html">試験機能を設定<i class="material_icon">arrow_forward</i></a>
</details>
</section>
<span style="float: right; cursor: pointer;" onclick="eel.reset_setting(); location.reload();"><i class="material_icon">refresh</i>すべてデフォルトに戻す</span>
</div>
<style>
section {
Expand Down
2 changes: 1 addition & 1 deletion update_message.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
試験機能を追加しました
いくつかの機能を追加しました

0 comments on commit 9f892ab

Please sign in to comment.