DriveSetup: add "open with DiskProbe" menu
Change-Id: I8ea9fe904eea2433e9c70403d554fc6160e0b059 Reviewed-on: https://review.haiku-os.org/c/1398 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
510138aadf
commit
a075ce979e
@@ -65,6 +65,7 @@ enum {
|
|||||||
MSG_INITIALIZE = 'init',
|
MSG_INITIALIZE = 'init',
|
||||||
MSG_DELETE = 'delt',
|
MSG_DELETE = 'delt',
|
||||||
MSG_EJECT = 'ejct',
|
MSG_EJECT = 'ejct',
|
||||||
|
MSG_OPEN_DISKPROBE = 'opdp',
|
||||||
MSG_SURFACE_TEST = 'sfct',
|
MSG_SURFACE_TEST = 'sfct',
|
||||||
MSG_RESCAN = 'rscn',
|
MSG_RESCAN = 'rscn',
|
||||||
|
|
||||||
@@ -217,6 +218,9 @@ MainWindow::MainWindow()
|
|||||||
new BMessage(MSG_FORMAT));
|
new BMessage(MSG_FORMAT));
|
||||||
fEjectMenuItem = new BMenuItem(B_TRANSLATE("Eject"),
|
fEjectMenuItem = new BMenuItem(B_TRANSLATE("Eject"),
|
||||||
new BMessage(MSG_EJECT), 'E');
|
new BMessage(MSG_EJECT), 'E');
|
||||||
|
fOpenDiskProbeMenuItem = new BMenuItem(B_TRANSLATE("Open with DiskProbe"),
|
||||||
|
new BMessage(MSG_OPEN_DISKPROBE));
|
||||||
|
|
||||||
fSurfaceTestMenuItem = new BMenuItem(
|
fSurfaceTestMenuItem = new BMenuItem(
|
||||||
B_TRANSLATE("Surface test (not implemented)"),
|
B_TRANSLATE("Surface test (not implemented)"),
|
||||||
new BMessage(MSG_SURFACE_TEST));
|
new BMessage(MSG_SURFACE_TEST));
|
||||||
@@ -271,6 +275,10 @@ MainWindow::MainWindow()
|
|||||||
fPartitionMenu->AddSeparatorItem();
|
fPartitionMenu->AddSeparatorItem();
|
||||||
|
|
||||||
fPartitionMenu->AddItem(fMountAllMenuItem);
|
fPartitionMenu->AddItem(fMountAllMenuItem);
|
||||||
|
|
||||||
|
fPartitionMenu->AddSeparatorItem();
|
||||||
|
|
||||||
|
fPartitionMenu->AddItem(fOpenDiskProbeMenuItem);
|
||||||
fMenuBar->AddItem(fPartitionMenu);
|
fMenuBar->AddItem(fPartitionMenu);
|
||||||
|
|
||||||
AddChild(fMenuBar);
|
AddChild(fMenuBar);
|
||||||
@@ -288,6 +296,8 @@ MainWindow::MainWindow()
|
|||||||
new BMessage(MSG_MOUNT), 'M');
|
new BMessage(MSG_MOUNT), 'M');
|
||||||
fUnmountContextMenuItem = new BMenuItem(B_TRANSLATE("Unmount"),
|
fUnmountContextMenuItem = new BMenuItem(B_TRANSLATE("Unmount"),
|
||||||
new BMessage(MSG_UNMOUNT), 'U');
|
new BMessage(MSG_UNMOUNT), 'U');
|
||||||
|
fOpenDiskProbeContextMenuItem = new BMenuItem(B_TRANSLATE("Open with DiskProbe"),
|
||||||
|
new BMessage(MSG_OPEN_DISKPROBE));
|
||||||
fFormatContextMenuItem = new BMenu(B_TRANSLATE("Format"));
|
fFormatContextMenuItem = new BMenu(B_TRANSLATE("Format"));
|
||||||
|
|
||||||
fContextMenu->AddItem(fCreateContextMenuItem);
|
fContextMenu->AddItem(fCreateContextMenuItem);
|
||||||
@@ -297,6 +307,8 @@ MainWindow::MainWindow()
|
|||||||
fContextMenu->AddSeparatorItem();
|
fContextMenu->AddSeparatorItem();
|
||||||
fContextMenu->AddItem(fMountContextMenuItem);
|
fContextMenu->AddItem(fMountContextMenuItem);
|
||||||
fContextMenu->AddItem(fUnmountContextMenuItem);
|
fContextMenu->AddItem(fUnmountContextMenuItem);
|
||||||
|
fContextMenu->AddSeparatorItem();
|
||||||
|
fContextMenu->AddItem(fOpenDiskProbeContextMenuItem);
|
||||||
fContextMenu->SetTargetForItems(this);
|
fContextMenu->SetTargetForItems(this);
|
||||||
|
|
||||||
// add DiskView
|
// add DiskView
|
||||||
@@ -389,6 +401,17 @@ MainWindow::MessageReceived(BMessage* message)
|
|||||||
_ScanDrives();
|
_ScanDrives();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case MSG_OPEN_DISKPROBE:
|
||||||
|
{
|
||||||
|
PartitionListRow* row = dynamic_cast<PartitionListRow*>(
|
||||||
|
fListView->CurrentSelection());
|
||||||
|
const char* args[] = { row->DevicePath(), NULL };
|
||||||
|
|
||||||
|
be_roster->Launch("application/x-vnd.Haiku-DiskProbe", 1,
|
||||||
|
(char**)args);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case MSG_SURFACE_TEST:
|
case MSG_SURFACE_TEST:
|
||||||
printf("MSG_SURFACE_TEST\n");
|
printf("MSG_SURFACE_TEST\n");
|
||||||
break;
|
break;
|
||||||
@@ -766,6 +789,9 @@ MainWindow::_UpdateMenus(BDiskDevice* disk,
|
|||||||
fFormatContextMenuItem->SetEnabled(false);
|
fFormatContextMenuItem->SetEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fOpenDiskProbeMenuItem->SetEnabled(true);
|
||||||
|
fOpenDiskProbeContextMenuItem->SetEnabled(true);
|
||||||
|
|
||||||
if (prepared)
|
if (prepared)
|
||||||
disk->CancelModifications();
|
disk->CancelModifications();
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ private:
|
|||||||
BMenuItem* fMountMenuItem;
|
BMenuItem* fMountMenuItem;
|
||||||
BMenuItem* fUnmountMenuItem;
|
BMenuItem* fUnmountMenuItem;
|
||||||
BMenuItem* fMountAllMenuItem;
|
BMenuItem* fMountAllMenuItem;
|
||||||
|
BMenuItem* fOpenDiskProbeMenuItem;
|
||||||
|
|
||||||
BMenu* fFormatContextMenuItem;
|
BMenu* fFormatContextMenuItem;
|
||||||
BMenuItem* fCreateContextMenuItem;
|
BMenuItem* fCreateContextMenuItem;
|
||||||
@@ -118,6 +119,7 @@ private:
|
|||||||
BMenuItem* fDeleteContextMenuItem;
|
BMenuItem* fDeleteContextMenuItem;
|
||||||
BMenuItem* fMountContextMenuItem;
|
BMenuItem* fMountContextMenuItem;
|
||||||
BMenuItem* fUnmountContextMenuItem;
|
BMenuItem* fUnmountContextMenuItem;
|
||||||
|
BMenuItem* fOpenDiskProbeContextMenuItem;
|
||||||
BPopUpMenu* fContextMenu;
|
BPopUpMenu* fContextMenu;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user