@@ -80,42 +80,37 @@ public void Browse()
80
80
}
81
81
}
82
82
83
- public bool ? AddProgramSource ( )
83
+ public ( bool , string ) AddProgramSource ( )
84
84
{
85
85
if ( ! Directory . Exists ( Location ) )
86
86
{
87
- System . Windows . MessageBox . Show ( API . GetTranslation ( "flowlauncher_plugin_program_invalid_path" ) ) ;
88
- return null ;
87
+ return ( false , API . GetTranslation ( "flowlauncher_plugin_program_invalid_path" ) ) ;
89
88
}
90
89
else if ( DuplicateSource ( Location ) )
91
90
{
92
- System . Windows . MessageBox . Show ( API . GetTranslation ( "flowlauncher_plugin_program_duplicate_program_source" ) ) ;
93
- return null ;
91
+ return ( false , API . GetTranslation ( "flowlauncher_plugin_program_duplicate_program_source" ) ) ;
94
92
}
95
93
else
96
94
{
97
95
var source = new ProgramSource ( Location , Enabled ) ;
98
96
Settings . ProgramSources . Insert ( 0 , source ) ;
99
97
ProgramSetting . ProgramSettingDisplayList . Add ( source ) ;
100
- return true ;
98
+ return ( true , null ) ;
101
99
}
102
100
}
103
101
104
- public bool ? UpdateProgramSource ( )
102
+ public ( bool , string ) UpdateProgramSource ( )
105
103
{
106
104
// Separate checks to avoid changing UniqueIdentifier of UWP when changing Enabled
107
105
if ( LocationModified )
108
106
{
109
107
if ( ! Directory . Exists ( Location ) )
110
108
{
111
- System . Windows . MessageBox . Show ( API . GetTranslation ( "flowlauncher_plugin_program_invalid_path" ) ) ;
112
- return null ;
109
+ return ( false , API . GetTranslation ( "flowlauncher_plugin_program_invalid_path" ) ) ;
113
110
}
114
111
else if ( DuplicateSource ( Location ) )
115
112
{
116
- // No need to check win32 or uwp, just override them
117
- System . Windows . MessageBox . Show ( API . GetTranslation ( "flowlauncher_plugin_program_duplicate_program_source" ) ) ;
118
- return null ;
113
+ return ( false , API . GetTranslation ( "flowlauncher_plugin_program_duplicate_program_source" ) ) ;
119
114
}
120
115
else
121
116
{
@@ -126,10 +121,10 @@ public void Browse()
126
121
{
127
122
Source . Enabled = Enabled ;
128
123
}
129
- return StatusModified || LocationModified ;
124
+ return ( StatusModified || LocationModified , null ) ;
130
125
}
131
126
132
- public bool ? AddOrUpdate ( )
127
+ public ( bool , string ) AddOrUpdate ( )
133
128
{
134
129
if ( Source == null )
135
130
{
0 commit comments