Tracker: style fixes to MountMenu class
This commit is contained in:
@@ -34,6 +34,9 @@ All rights reserved.
|
|||||||
|
|
||||||
// MountMenu implements a context menu used for mounting/unmounting volumes
|
// MountMenu implements a context menu used for mounting/unmounting volumes
|
||||||
|
|
||||||
|
|
||||||
|
#include "MountMenu.h"
|
||||||
|
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <Locale.h>
|
#include <Locale.h>
|
||||||
@@ -42,10 +45,10 @@ All rights reserved.
|
|||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
#include <VolumeRoster.h>
|
#include <VolumeRoster.h>
|
||||||
#include <Volume.h>
|
#include <Volume.h>
|
||||||
|
|
||||||
#include <fs_info.h>
|
#include <fs_info.h>
|
||||||
|
|
||||||
#include "Commands.h"
|
#include "Commands.h"
|
||||||
#include "MountMenu.h"
|
|
||||||
#include "IconMenuItem.h"
|
#include "IconMenuItem.h"
|
||||||
#include "Tracker.h"
|
#include "Tracker.h"
|
||||||
#include "Bitmaps.h"
|
#include "Bitmaps.h"
|
||||||
@@ -55,20 +58,26 @@ All rights reserved.
|
|||||||
|
|
||||||
#define SHOW_NETWORK_VOLUMES
|
#define SHOW_NETWORK_VOLUMES
|
||||||
|
|
||||||
|
#undef B_TRANSLATION_CONTEXT
|
||||||
|
#define B_TRANSLATION_CONTEXT "MountMenu"
|
||||||
|
|
||||||
|
|
||||||
class AddMenuItemVisitor : public BDiskDeviceVisitor {
|
class AddMenuItemVisitor : public BDiskDeviceVisitor {
|
||||||
public:
|
public:
|
||||||
AddMenuItemVisitor(BMenu* menu);
|
AddMenuItemVisitor(BMenu* menu);
|
||||||
virtual ~AddMenuItemVisitor();
|
virtual ~AddMenuItemVisitor();
|
||||||
|
|
||||||
virtual bool Visit(BDiskDevice* device);
|
virtual bool Visit(BDiskDevice* device);
|
||||||
virtual bool Visit(BPartition* partition, int32 level);
|
virtual bool Visit(BPartition* partition, int32 level);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BMenu* fMenu;
|
BMenu* fMenu;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark - AddMenuItemVisitor
|
||||||
|
|
||||||
|
|
||||||
AddMenuItemVisitor::AddMenuItemVisitor(BMenu* menu)
|
AddMenuItemVisitor::AddMenuItemVisitor(BMenu* menu)
|
||||||
:
|
:
|
||||||
fMenu(menu)
|
fMenu(menu)
|
||||||
@@ -153,12 +162,9 @@ AddMenuItemVisitor::Visit(BPartition* partition, int32 level)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark - MountMenu
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATION_CONTEXT
|
|
||||||
#define B_TRANSLATION_CONTEXT "MountMenu"
|
|
||||||
|
|
||||||
MountMenu::MountMenu(const char* name)
|
MountMenu::MountMenu(const char* name)
|
||||||
: BMenu(name)
|
: BMenu(name)
|
||||||
{
|
{
|
||||||
@@ -200,8 +206,11 @@ MountMenu::AddDynamicItem(add_state)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Use the shared icon instead of the device icon
|
// Use the shared icon instead of the device icon
|
||||||
if (get_device_icon(info.device_name, icon->Bits(), B_MINI_ICON) != B_OK)
|
if (get_device_icon(info.device_name, icon->Bits(), B_MINI_ICON)
|
||||||
GetTrackerResources()->GetIconResource(R_ShareIcon, B_MINI_ICON, icon);
|
!= B_OK) {
|
||||||
|
GetTrackerResources()->GetIconResource(R_ShareIcon,
|
||||||
|
B_MINI_ICON, icon);
|
||||||
|
}
|
||||||
|
|
||||||
BMessage* message = new BMessage(kUnmountVolume);
|
BMessage* message = new BMessage(kUnmountVolume);
|
||||||
message->AddInt32("device_id", volume.Device());
|
message->AddInt32("device_id", volume.Device());
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ of Be Incorporated in the United States and other countries. Other brand product
|
|||||||
names are registered trademarks or trademarks of their respective holders.
|
names are registered trademarks or trademarks of their respective holders.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
*/
|
*/
|
||||||
#ifndef MOUNTMENU_H
|
#ifndef _MOUNT_MENU_H
|
||||||
#define MOUNTMENU_H
|
#define _MOUNT_MENU_H
|
||||||
|
|
||||||
|
|
||||||
#include <Menu.h>
|
#include <Menu.h>
|
||||||
@@ -42,11 +42,9 @@ namespace BPrivate {
|
|||||||
|
|
||||||
class MountMenu : public BMenu {
|
class MountMenu : public BMenu {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
MountMenu(const char*);
|
MountMenu(const char*);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual bool AddDynamicItem(add_state state);
|
virtual bool AddDynamicItem(add_state state);
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -55,4 +53,5 @@ protected:
|
|||||||
|
|
||||||
using namespace BPrivate;
|
using namespace BPrivate;
|
||||||
|
|
||||||
#endif // MOUNTMENU_H
|
|
||||||
|
#endif // _MOUNT_MENU_H
|
||||||
|
|||||||
Reference in New Issue
Block a user