You can now remove MIME types.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16387 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-02-14 00:45:34 +00:00
parent a11f16fd7e
commit 79dd9fd23e
2 changed files with 37 additions and 1 deletions

View File

@ -8,6 +8,7 @@
#include "FileTypesWindow.h"
#include "MimeTypeListView.h"
#include <Alert.h>
#include <Application.h>
#include <Bitmap.h>
#include <Box.h>
@ -22,6 +23,7 @@
#include <ScrollView.h>
#include <TextControl.h>
#include <OverrideAlert.h>
#include <be_apps/Tracker/RecentItems.h>
#include <stdio.h>
@ -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:

View File

@ -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