@@ -77,6 +77,11 @@ public MainForm(string openPath, bool darkMode)
7777 InitLanguage ( ) ;
7878
7979 closeFile ( ) ;
80+
81+ if ( Properties . Settings . Default . StartupMaximize )
82+ {
83+ this . WindowState = FormWindowState . Maximized ;
84+ }
8085 }
8186
8287 protected override void WndProc ( ref Message m )
@@ -195,11 +200,11 @@ private void slideshowTimer_Event(Object source, ElapsedEventArgs e)
195200 {
196201 if ( ( Properties . Settings . Default . SlideshowTime - slideshowCounter ) <= 1 )
197202 {
198- showSuggestion ( resMan . GetString ( "next-image-in-1-second" ) ) ;
203+ showSuggestion ( resMan . GetString ( "next-image-in-1-second" ) , SuggestionIcon . Info ) ;
199204 }
200205 else
201206 {
202- showSuggestion ( string . Format ( resMan . GetString ( "next-image-in-x-seconds" ) , ( Properties . Settings . Default . SlideshowTime - slideshowCounter ) ) ) ;
207+ showSuggestion ( string . Format ( resMan . GetString ( "next-image-in-x-seconds" ) , Properties . Settings . Default . SlideshowTime - slideshowCounter ) , SuggestionIcon . Info ) ;
203208 }
204209 }
205210 }
@@ -223,10 +228,10 @@ private void MainForm_Load(object sender, EventArgs e)
223228 {
224229 if ( string . IsNullOrEmpty ( openPath ) )
225230 {
226- if ( Properties . Settings . Default . StartupAction == 1 && Clipboard . ContainsImage ( ) )
231+ if ( Properties . Settings . Default . StartupPaste && Clipboard . ContainsImage ( ) )
227232 {
228233 pasteButton . PerformClick ( ) ;
229- showSuggestion ( resMan . GetString ( "image-pasted-from-clipboard" ) ) ;
234+ showSuggestion ( resMan . GetString ( "image-pasted-from-clipboard" ) , SuggestionIcon . Info ) ;
230235 }
231236 }
232237 else
@@ -244,7 +249,7 @@ private void MainForm_Load(object sender, EventArgs e)
244249 }
245250 catch
246251 {
247- MessageBox . Show ( resMan . GetString ( "unable-to-open-file" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
252+ showSuggestion ( resMan . GetString ( "unable-to-open-file" ) , SuggestionIcon . Warning ) ;
248253 }
249254
250255 if ( Properties . Settings . Default . CheckForUpdates )
@@ -273,7 +278,7 @@ public async void checkForUpdates(bool showUpToDateDialog)
273278 {
274279 if ( showUpToDateDialog )
275280 {
276- MessageBox . Show ( resMan . GetString ( "app-is-up-to-date" ) , resMan . GetString ( "updator" ) , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
281+ showSuggestion ( resMan . GetString ( "app-is-up-to-date" ) , SuggestionIcon . Check ) ;
277282 }
278283 }
279284 else
@@ -300,7 +305,7 @@ public async void checkForUpdates(bool showUpToDateDialog)
300305 {
301306 if ( showUpToDateDialog )
302307 {
303- MessageBox . Show ( resMan . GetString ( "update-failed" ) , resMan . GetString ( "updator" ) , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
308+ showSuggestion ( resMan . GetString ( "update-failed" ) , SuggestionIcon . Warning ) ;
304309 Console . WriteLine ( ex ) ;
305310 }
306311 }
@@ -382,7 +387,7 @@ private void openFile(string path)
382387 }
383388 catch ( Exception ex )
384389 {
385- MessageBox . Show ( resMan . GetString ( "unable-to-open-file" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
390+ showSuggestion ( resMan . GetString ( "unable-to-open-file" ) , SuggestionIcon . Warning ) ;
386391 Console . WriteLine ( ex ) ;
387392 }
388393 }
@@ -427,14 +432,14 @@ public void openDdsOrTga(string path)
427432 }
428433 catch ( Exception ex )
429434 {
430- MessageBox . Show ( resMan . GetString ( "dds-memory-error" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
435+ showSuggestion ( resMan . GetString ( "dds-memory-error" ) , SuggestionIcon . Warning ) ;
431436 Console . WriteLine ( ex ) ;
432437 }
433438 }
434439 }
435440 catch ( Exception ex )
436441 {
437- MessageBox . Show ( resMan . GetString ( "unable-open-dds" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
442+ showSuggestion ( resMan . GetString ( "unable-open-dds" ) , SuggestionIcon . Warning ) ;
438443 Console . WriteLine ( ex ) ;
439444 }
440445 }
@@ -462,7 +467,7 @@ public void openSvg(string path, int width, int height)
462467 }
463468 catch ( Exception ex )
464469 {
465- MessageBox . Show ( resMan . GetString ( "unable-open-svg" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
470+ showSuggestion ( resMan . GetString ( "unable-open-svg" ) , SuggestionIcon . Warning ) ;
466471 Console . WriteLine ( ex ) ;
467472 }
468473 }
@@ -933,7 +938,7 @@ private void saveAsButton_Click(object sender, EventArgs e)
933938 private void copyButton_Click ( object sender , EventArgs e )
934939 {
935940 Clipboard . SetImage ( originalImage ) ;
936- showSuggestion ( resMan . GetString ( "image-copied-to-clipboard" ) ) ;
941+ showSuggestion ( resMan . GetString ( "image-copied-to-clipboard" ) , SuggestionIcon . Check ) ;
937942 }
938943
939944 private void pasteButton_Click ( object sender , EventArgs e )
@@ -1119,7 +1124,7 @@ private void setFullscreen(bool b)
11191124
11201125 setAlwaysOnTop ( false , true ) ;
11211126
1122- showSuggestion ( string . Format ( resMan . GetString ( "press-to-exit-fullscreen" ) , "Esc" ) ) ;
1127+ showSuggestion ( string . Format ( resMan . GetString ( "press-to-exit-fullscreen" ) , "Esc" ) , SuggestionIcon . Info ) ;
11231128 }
11241129 else
11251130 {
@@ -1423,7 +1428,7 @@ private int nextFile()
14231428 if ( currentIndex == - 1 )
14241429 {
14251430 setSlideshow ( false ) ;
1426- MessageBox . Show ( resMan . GetString ( "cur-file-not-found" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
1431+ showSuggestion ( resMan . GetString ( "cur-file-not-found" ) , SuggestionIcon . Warning ) ;
14271432 return 0 ;
14281433 }
14291434 else
@@ -1462,7 +1467,7 @@ private void prevFile()
14621467
14631468 if ( currentIndex == - 1 )
14641469 {
1465- MessageBox . Show ( resMan . GetString ( "cur-file-not-found" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
1470+ showSuggestion ( resMan . GetString ( "cur-file-not-found" ) , SuggestionIcon . Warning ) ;
14661471 }
14671472 else
14681473 {
@@ -1510,7 +1515,7 @@ private void openFirstFileInFolder()
15101515 }
15111516 else
15121517 {
1513- MessageBox . Show ( resMan . GetString ( "no-files-to-open" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
1518+ showSuggestion ( resMan . GetString ( "no-files-to-open" ) , SuggestionIcon . Warning ) ;
15141519 }
15151520 }
15161521
@@ -1549,7 +1554,7 @@ private void deleteButton_Click(object sender, EventArgs e)
15491554 }
15501555 else
15511556 {
1552- MessageBox . Show ( resMan . GetString ( "cur-file-not-found" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
1557+ showSuggestion ( resMan . GetString ( "cur-file-not-found" ) , SuggestionIcon . Warning ) ;
15531558 }
15541559 }
15551560 }
@@ -1826,7 +1831,7 @@ private void showFileButton_Click(object sender, EventArgs e)
18261831 }
18271832 else
18281833 {
1829- MessageBox . Show ( resMan . GetString ( "cur-file-not-found" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
1834+ showSuggestion ( resMan . GetString ( "cur-file-not-found" ) , SuggestionIcon . Warning ) ;
18301835 }
18311836 }
18321837
@@ -1845,11 +1850,31 @@ private void zoomOutButton_MouseDown(object sender, MouseEventArgs e)
18451850 zoomOutTimer . Start ( ) ;
18461851 }
18471852
1848- private void showSuggestion ( string text )
1853+ private enum SuggestionIcon
1854+ {
1855+ Info = 0 ,
1856+ Check = 1 ,
1857+ Warning = 2
1858+ }
1859+
1860+ private void showSuggestion ( string text , SuggestionIcon icon )
18491861 {
18501862 suggestionLabel . Invoke ( ( MethodInvoker ) ( ( ) => {
18511863 suggestionLabel . Text = text ;
18521864 suggestionLabel . Visible = true ;
1865+ if ( icon == SuggestionIcon . Info )
1866+ {
1867+ suggestionIcon . Image = Properties . Resources . white_info ;
1868+ }
1869+ else if ( icon == SuggestionIcon . Check )
1870+ {
1871+ suggestionIcon . Image = Properties . Resources . white_check ;
1872+ }
1873+ else
1874+ {
1875+ suggestionIcon . Image = Properties . Resources . white_warning ;
1876+ }
1877+ suggestionIcon . Visible = true ;
18531878 } ) ) ;
18541879
18551880 if ( suggestionTimer != null )
@@ -1869,6 +1894,8 @@ private void hideSuggestion()
18691894 suggestionLabel . Invoke ( ( MethodInvoker ) ( ( ) => {
18701895 suggestionLabel . Text = string . Empty ;
18711896 suggestionLabel . Visible = false ;
1897+ suggestionIcon . Image . Dispose ( ) ;
1898+ suggestionIcon . Visible = false ;
18721899 } ) ) ;
18731900 }
18741901
@@ -1899,7 +1926,7 @@ private void typeOpsButton_Click(object sender, EventArgs e)
18991926 private void reloadButton_Click ( object sender , EventArgs e )
19001927 {
19011928 openFile ( Path . Combine ( currentFolder , currentFile ) ) ;
1902- showSuggestion ( resMan . GetString ( "file-reloaded" ) ) ;
1929+ showSuggestion ( resMan . GetString ( "file-reloaded" ) , SuggestionIcon . Check ) ;
19031930 }
19041931
19051932 private void newWindowButton_Click ( object sender , EventArgs e )
@@ -2013,11 +2040,11 @@ private void copyFileBtn_Click(object sender, EventArgs e)
20132040 string [ ] filesToCopy = { Path . Combine ( currentFolder , currentFile ) } ;
20142041 Clipboard . Clear ( ) ;
20152042 Clipboard . SetData ( DataFormats . FileDrop , filesToCopy ) ;
2016- showSuggestion ( resMan . GetString ( "file-copied-to-clipboard" ) ) ;
2043+ showSuggestion ( resMan . GetString ( "file-copied-to-clipboard" ) , SuggestionIcon . Check ) ;
20172044 }
20182045 catch
20192046 {
2020- MessageBox . Show ( resMan . GetString ( "cur-file-not-found" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
2047+ showSuggestion ( resMan . GetString ( "cur-file-not-found" ) , SuggestionIcon . Warning ) ;
20212048 }
20222049 }
20232050
@@ -2057,7 +2084,7 @@ private void externalRunBtn_Click(object sender, EventArgs e)
20572084 }
20582085 catch
20592086 {
2060- MessageBox . Show ( resMan . GetString ( "unable-to-run-external-app" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
2087+ showSuggestion ( resMan . GetString ( "unable-to-run-external-app" ) , SuggestionIcon . Warning ) ;
20612088 }
20622089 }
20632090
@@ -2069,7 +2096,7 @@ private void externalFavoriteBtn_Click(object sender, EventArgs e)
20692096 }
20702097 catch
20712098 {
2072- MessageBox . Show ( resMan . GetString ( "unable-to-run-external-app" ) , resMan . GetString ( "error" ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
2099+ showSuggestion ( resMan . GetString ( "unable-to-run-external-app" ) , SuggestionIcon . Warning ) ;
20732100 }
20742101 }
20752102
0 commit comments