@@ -68,6 +68,7 @@ public class DialogItem {
68
68
69
69
// Edit
70
70
private final List <BaseEditUiModule > editModules = new ArrayList <>();
71
+ private String path ;
71
72
72
73
public DialogItem (Activity activity , ItemManager itemManager ) {
73
74
this .activity = activity ;
@@ -76,16 +77,17 @@ public DialogItem(Activity activity, ItemManager itemManager) {
76
77
77
78
public void create (Class <? extends Item > type , OnEditDone onEditDone ) {
78
79
Item item = ItemsRegistry .REGISTRY .getItemInfoByClass (type ).create ();
79
- show (item , true , onEditDone );
80
+ show (item , "unsupported" , true , onEditDone );
80
81
}
81
82
82
- public void edit (Item item ) {
83
- show (item , false , null );
83
+ public void edit (Item item , String path ) {
84
+ show (item , path , false , null );
84
85
}
85
86
86
- private void show (Item item , boolean create , OnEditDone onEditDone ) {
87
+ private void show (Item item , String path , boolean create , OnEditDone onEditDone ) {
87
88
cancel ();
88
89
this .item = item ;
90
+ this .path = path ;
89
91
this .create = create ;
90
92
this .onEditDone = onEditDone ;
91
93
this .canceled = false ;
@@ -100,6 +102,7 @@ private void show(Item item, boolean create, OnEditDone onEditDone) {
100
102
private View generateView () {
101
103
DialogItemFrameBinding binding = DialogItemFrameBinding .inflate (this .activity .getLayoutInflater ());
102
104
105
+ binding .path .setText (path != null ? path : "unsupported" );
103
106
if (item instanceof Item ) {
104
107
binding .canvas .addView (addEditModule (new ItemEditModule ()));
105
108
}
@@ -237,7 +240,7 @@ public abstract static class BaseEditUiModule {
237
240
public void notifyCreateMode () {}
238
241
}
239
242
240
- public static class ItemEditModule extends BaseEditUiModule {
243
+ public class ItemEditModule extends BaseEditUiModule {
241
244
private DialogItemModuleItemBinding binding ;
242
245
private Runnable onEditStart ;
243
246
@@ -292,6 +295,7 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {
292
295
binding .minimize .setOnClickListener (v -> onEditStart .run ());
293
296
//
294
297
298
+ binding .editNotifications .setEnabled (!DialogItem .this .create );
295
299
binding .editNotifications .setOnClickListener (v -> new DialogItemNotificationsEditor (activity , item , () -> updateNotificationPreview (item , activity )).show ());
296
300
updateNotificationPreview (item , activity );
297
301
}
@@ -489,7 +493,7 @@ public void notifyCreateMode() {
489
493
}
490
494
}
491
495
492
- public static class CycleListItemEditModule extends BaseEditUiModule {
496
+ public class CycleListItemEditModule extends BaseEditUiModule {
493
497
private DialogItemModuleCyclelistBinding binding ;
494
498
private SimpleSpinnerAdapter <CycleListItem .TickBehavior > simpleSpinnerAdapter ;
495
499
private Runnable onEditStart ;
@@ -505,10 +509,8 @@ public void setup(Item item, Activity activity, View view) {
505
509
CycleListItem cycleListItem = (CycleListItem ) item ;
506
510
507
511
binding = DialogItemModuleCyclelistBinding .inflate (activity .getLayoutInflater (), (ViewGroup ) view , false );
508
- fcu_viewOnClick (binding .externalEditor , () -> {
509
- // TODO: 29.08.2022 path unsupported fix
510
- new DialogItemStorageEditor (activity , App .get (activity ).getItemManager (), cycleListItem .getItemsCycleStorage (), null , "unsupported" ).show ();
511
- });
512
+ binding .externalEditor .setEnabled (!DialogItem .this .create );
513
+ fcu_viewOnClick (binding .externalEditor , () -> new DialogItemStorageEditor (activity , App .get (activity ).getItemManager (), cycleListItem .getItemsCycleStorage (), null , DialogItem .this .path ).show ());
512
514
simpleSpinnerAdapter = new SimpleSpinnerAdapter <CycleListItem .TickBehavior >(activity )
513
515
.add (activity .getString (R .string .cycleListItem_tick_all ), CycleListItem .TickBehavior .ALL )
514
516
.add (activity .getString (R .string .cycleListItem_tick_current ), CycleListItem .TickBehavior .CURRENT );
@@ -585,7 +587,7 @@ public void setOnStartEditListener(Runnable o) {
585
587
}
586
588
}
587
589
588
- private static class GroupItemEditModule extends BaseEditUiModule {
590
+ private class GroupItemEditModule extends BaseEditUiModule {
589
591
private DialogItemModuleGroupBinding binding ;
590
592
591
593
@ Override
@@ -597,10 +599,8 @@ public View getView() {
597
599
public void setup (Item item , Activity activity , View view ) {
598
600
GroupItem groupItem = (GroupItem ) item ;
599
601
binding = DialogItemModuleGroupBinding .inflate (activity .getLayoutInflater (), (ViewGroup ) view , false );
600
- fcu_viewOnClick (binding .externalEditor , () -> {
601
- // TODO: 29.08.2022 path unsupported fix
602
- new DialogItemStorageEditor (activity , App .get (activity ).getItemManager (), groupItem .getItemStorage (), null , "unsupported" ).show ();
603
- });
602
+ binding .externalEditor .setEnabled (!DialogItem .this .create );
603
+ fcu_viewOnClick (binding .externalEditor , () -> new DialogItemStorageEditor (activity , App .get (activity ).getItemManager (), groupItem .getItemStorage (), null , DialogItem .this .path ).show ());
604
604
}
605
605
606
606
@ Override
@@ -610,7 +610,7 @@ public void commit(Item item) {}
610
610
public void setOnStartEditListener (Runnable o ) { }
611
611
}
612
612
613
- private static class FilterGroupItemEditModule extends BaseEditUiModule {
613
+ private class FilterGroupItemEditModule extends BaseEditUiModule {
614
614
private DialogItemModuleFiltergroupBinding binding ;
615
615
616
616
@ Override
@@ -622,10 +622,8 @@ public View getView() {
622
622
public void setup (Item item , Activity activity , View view ) {
623
623
FilterGroupItem fGroupItem = (FilterGroupItem ) item ;
624
624
binding = DialogItemModuleFiltergroupBinding .inflate (activity .getLayoutInflater (), (ViewGroup ) view , false );
625
- fcu_viewOnClick (binding .externalEditor , () -> {
626
- // TODO: 29.08.2022 path unsupported fix
627
- new DialogFilterGroupEdit (activity , fGroupItem , "unsupported" ).show ();
628
- });
625
+ binding .externalEditor .setEnabled (!DialogItem .this .create );
626
+ fcu_viewOnClick (binding .externalEditor , () -> new DialogFilterGroupEdit (activity , fGroupItem , DialogItem .this .path ).show ());
629
627
}
630
628
631
629
@ Override
0 commit comments