wip: use new notion of default stuff
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 28 May 2008 07:04:19 +0000 (09:04 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 28 May 2008 07:04:19 +0000 (09:04 +0200)
src/net/pterodactylus/jsite/gui/FileManager.java

index 68dfb2c..e4c8570 100644 (file)
@@ -163,7 +163,7 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr
                                mimeTypeComboBox.setEnabled(useCustomMimeTypeCheckBox.isSelected());
                                if (!useCustomMimeTypeCheckBox.isSelected()) {
                                        for (Entry entry: getSelectedEntries()) {
-                                               entry.setContentType(null);
+                                               entry.restoreDefaultContentType();
                                        }
                                }
                        }
@@ -292,8 +292,8 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr
                                insertAction.setEnabled(true);
                                insertCheckBox.setSelected(fileEntry.isInsert());
                                useCustomMimeTypeAction.setEnabled(fileEntry.isInsert());
-                               useCustomMimeTypeCheckBox.setSelected(contentType != null);
-                               mimeTypeComboBox.setEnabled(contentType != null);
+                               useCustomMimeTypeCheckBox.setSelected(!fileEntry.isDefaultContentType());
+                               mimeTypeComboBox.setEnabled(fileEntry.isDefaultContentType());
                                mimeTypeComboBox.setSelectedItem(contentType);
                        }
                }
@@ -312,7 +312,7 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr
                        for (Entry entry: getSelectedEntries()) {
                                entry.setContentType(contentType);
                        }
-                       useCustomMimeTypeCheckBox.setSelected(contentType != null);
+                       useCustomMimeTypeCheckBox.setSelected(!getSelectedEntries().get(0).isDefaultContentType());
                }
        }