Skip to content

Commit

Permalink
ContainersFragment: Add function to reconfigure container on next sta…
Browse files Browse the repository at this point in the history
…rtup.
  • Loading branch information
longjunyu2 committed Aug 27, 2024
1 parent df52ad3 commit 4118b8a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/src/main/java/com/winlator/ContainersFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.winlator.core.PreloaderDialog;
import com.winlator.xenvironment.ImageFs;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -185,6 +186,11 @@ private void showListItemMenu(View anchorView, Container container) {
case R.id.container_info:
(new StorageInfoDialog(getActivity(), container)).show();
break;
case R.id.container_reconfigure:
ContentDialog.confirm(getContext(), R.string.do_you_want_to_reconfigure_wine, () -> {
new File(container.getRootDir(), ".wine/.update-timestamp").delete();
});
break;
}
return true;
});
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/menu/container_popup_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<item android:id="@+id/container_duplicate" android:title="@string/duplicate" android:icon="@drawable/icon_popup_menu_duplicate" android:iconTint="@color/colorAccent" />
<item android:id="@+id/container_remove" android:title="@string/remove" android:icon="@drawable/icon_popup_menu_remove" android:iconTint="@color/colorAccent" />
<item android:id="@+id/container_info" android:title="@string/storage_info" android:icon="@drawable/icon_popup_menu_info" android:iconTint="@color/colorAccent" />
<item android:id="@+id/container_reconfigure" android:title="@string/reconfigure" android:icon="@drawable/icon_popup_menu_settings" android:iconTint="@color/colorAccent" />
</menu>
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@
<string name="help_file_provider"><![CDATA[
<i><b>文件提供器</b></i>允许通过安卓文件管理器访问Winlator的内部数据。<br/><br/>
]]></string>
<string name="reconfigure">重新配置</string>
<string name="do_you_want_to_reconfigure_wine">您想要在下一次启动时重新配置容器吗? 这将删除时间戳以触发Wine配置。</string>

<!-- OpenXR specific text -->
<string name="toggle_orientation">切换方向</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@
<string name="help_file_provider"><![CDATA[
<i><b>File Provider</b></i> allows access to Winlator\'s internal data through android file manager.<br/><br/>
]]></string>
<string name="reconfigure">Reconfigure</string>
<string name="do_you_want_to_reconfigure_wine">Do you want to reconfigure this container on the next startup? This will remove the timestamp to trigger Wine Configuration.</string>

<!-- OpenXR specific text -->
<string name="xr" translatable="false">XR</string>
Expand Down

0 comments on commit 4118b8a

Please sign in to comment.