From: David ‘Bombe’ Roden Date: Wed, 28 May 2008 07:04:19 +0000 (+0200) Subject: wip: use new notion of default stuff X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=086aff15fcd35b2dfed9d64b24e5b7dacd8fb684;p=jSite2.git wip: use new notion of default stuff --- diff --git a/src/net/pterodactylus/jsite/gui/FileManager.java b/src/net/pterodactylus/jsite/gui/FileManager.java index 68dfb2c..e4c8570 100644 --- a/src/net/pterodactylus/jsite/gui/FileManager.java +++ b/src/net/pterodactylus/jsite/gui/FileManager.java @@ -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()); } }