diff --git a/src/preferences/filetypes/FileTypesWindow.cpp b/src/preferences/filetypes/FileTypesWindow.cpp index 971701273e..b14d2327ad 100644 --- a/src/preferences/filetypes/FileTypesWindow.cpp +++ b/src/preferences/filetypes/FileTypesWindow.cpp @@ -8,6 +8,7 @@ #include "FileTypesWindow.h" #include "MimeTypeListView.h" +#include #include #include #include @@ -22,6 +23,7 @@ #include #include +#include #include #include @@ -991,6 +993,40 @@ FileTypesWindow::MessageReceived(BMessage* message) break; } + case kMsgAddType: + puts("add type"); + break; + + case kMsgRemoveType: + { + if (fCurrentType.Type() == NULL) + break; + + BAlert* alert; + if (fCurrentType.IsSupertypeOnly()) { + alert = new BPrivate::OverrideAlert("FileTypes Request", + "Removing a super type cannot be reverted.\n" + "All file types that belong to this super type " + "will be lost!\n\n" + "Are you sure you want to do this? To remove the whole " + "group, hold down the Shift key and press \"Remove\".", + "Remove", B_SHIFT_KEY, "Cancel", 0, NULL, 0, + B_WIDTH_AS_USUAL, B_STOP_ALERT); + } else { + alert = new BAlert("FileTypes Request", + "Removing a file type cannot be reverted.\n" + "Are you sure you want to remove it?", + "Remove", "Cancel", NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); + } + if (alert->Go()) + break; + + status_t status = fCurrentType.Delete(); + if (status != B_OK) + fprintf(stderr, "Could not remove file type: %s\n", strerror(status)); + break; + } + // File Extensions group case kMsgExtensionSelected: diff --git a/src/preferences/filetypes/Jamfile b/src/preferences/filetypes/Jamfile index 1d7dac400e..0e38c67714 100644 --- a/src/preferences/filetypes/Jamfile +++ b/src/preferences/filetypes/Jamfile @@ -3,7 +3,7 @@ SubDir HAIKU_TOP src preferences filetypes ; SetSubDirSupportedPlatformsBeOSCompatible ; AddSubDirSupportedPlatforms libbe_test ; -SubDirSysHdrs $(SUBDIR) ; +SubDirSysHdrs $(HAIKU_TOP) src kits tracker ; Preference FileTypes : FileTypes.cpp