Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ build:
make -C vmware_fs
make -C vmware_mouse
make -C vmware_tray
make -C vmware_tray bindcatalogs
make -C vmware_video/accelerant
make -C vmware_video/kernel

release:
make RELEASE=1 -C vmware_fs
make RELEASE=1 -C vmware_mouse
make RELEASE=1 -C vmware_tray
make RELEASE=1 -C vmware_tray bindcatalogs
make RELEASE=1 -C vmware_video/accelerant
make RELEASE=1 -C vmware_video/kernel

Expand Down
14 changes: 12 additions & 2 deletions vmware_tray/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ NAME= vmware_tray
# DRIVER: Kernel Driver
TYPE= APP

APP_MIME_SIG = application/x-vnd.VinDuv.VMwareAddOns

# add support for new Pe and Eddie features
# to fill in generic makefile

Expand Down Expand Up @@ -58,7 +60,7 @@ RSRCS=
# naming scheme you need to specify the path to the library
# and it's name
# library: my_lib.a entry: my_lib.a or path/my_lib.a
LIBS= be $(STDCPPLIBS)
LIBS= be localestub $(STDCPPLIBS)

# specify additional paths to directories following the standard
# libXXX.so or libXXX.a naming scheme. You can specify full paths
Expand All @@ -71,7 +73,8 @@ LIBPATHS=
# additional paths to look for system headers
# thes use the form: #include <header>
# source file directories are NOT auto-included here
SYSTEM_INCLUDE_PATHS =
SYSTEM_INCLUDE_PATHS = \
$(shell findpaths -e B_FIND_PATH_HEADERS_DIRECTORY private/interface)

# additional paths to look for local headers
# thes use the form: #include "header"
Expand All @@ -82,6 +85,13 @@ LOCAL_INCLUDE_PATHS = ../shared_sources/
# NONE, SOME, FULL
OPTIMIZE= SOME

# Specify the codes for languages you are going to support in this
# application. The default "en" one must be provided too. "make catkeys"
# will recreate only the "locales/en.catkeys" file. Use it as a template
# for creating catkeys for other languages. All localization files must be
# placed in the "locales" subdirectory.
LOCALES = en es_419 es

# specify any preprocessor symbols to be defined. The symbols will not
# have their values set automatically; you must supply the value (if any)
# to use. For example, setting DEFINES to "DEBUG=1" will cause the
Expand Down
2 changes: 1 addition & 1 deletion vmware_tray/VMWAddOns.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// Application constants
#define APP_SIG "application/x-vnd.VinDuv.VMwareAddOns"
#define APP_NAME "VMWare Add-ons"
#define APP_NAME "VMware Add-ons"
#define APP_VERSION "1.2.2"
#define TRAY_NAME "vmware add-ons"

Expand Down
38 changes: 23 additions & 15 deletions vmware_tray/VMWAddOnsCleanup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
#include "VMWAddOnsCleanup.h"

#include <Alert.h>
#include <Catalog.h>

#include "VMWAddOnsSelectWindow.h"
#include "VMWAddOnsStatusWindow.h"
#include "VMWAddOnsTray.h"


#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "Virtual Disk Shrinking"

#define MB (1024 * 1024)
#define BUF_SIZE (MB / 2)
#define MAX_FILES 200
Expand Down Expand Up @@ -58,11 +62,13 @@ VMWAddOnsCleanup::ThreadLoop()
break;

if (ret != B_DEVICE_FULL && ret != B_OK) {
(new BAlert("Error",
(BString("An error occurred while cleaning ”")
<< name << "” (" << strerror(ret) << "). This volume may be damaged.")
.String(),
"Cancel", NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT))
BString alertText;
alertText.SetToFormat(B_TRANSLATE_COMMENT("An error occurred while cleaning %s (%s). "
"This volume may be damaged.",
"First %s is the name of the volume being cleaned. Second %s is the error message."),
name, strerror(ret));
(new BAlert(B_TRANSLATE("Error"), alertText.String(),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT))
->Go();
}
}
Expand All @@ -80,12 +86,14 @@ VMWAddOnsCleanup::Start(void* data)
{
VMWAddOnsTray* parentTray = (VMWAddOnsTray*)data;

int32 result = (new BAlert("Shrink disks",
"Disk shrinking will operate on all auto-expanding disks "
int32 result = (new BAlert(B_TRANSLATE("Shrink disks"),
B_TRANSLATE("Disk shrinking will operate on all auto-expanding disks "
"attached to this virtual machine.\nFor best results it is "
"recommanded to clean up free space on these disks before starting "
"the process.\n",
"Cancel", "Shrink now" B_UTF8_ELLIPSIS, "Clean up disks" B_UTF8_ELLIPSIS,
"recommended to clean up free space on these disks before starting "
"the process.\n"),
B_TRANSLATE("Cancel"),
B_TRANSLATE("Shrink now" B_UTF8_ELLIPSIS),
B_TRANSLATE("Clean up disks" B_UTF8_ELLIPSIS),
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT))
->Go();

Expand All @@ -104,11 +112,11 @@ VMWAddOnsCleanup::Start(void* data)
}
}

result = (new BAlert("Shrink disks",
"The shrink operation will now be launched in VMWare."
"This may take a long time ; the virtual machine will be "
"suspended during the process.",
"Cancel", "OK"))
result = (new BAlert(B_TRANSLATE("Shrink disks"),
B_TRANSLATE("The shrink operation will now be launched in VMware. "
"This may take a long time; the virtual machine will be "
"suspended during the process."),
B_TRANSLATE("Cancel"), B_TRANSLATE("OK")))
->Go();

// OK...
Expand Down
15 changes: 10 additions & 5 deletions vmware_tray/VMWAddOnsSelectWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@

#include <stdlib.h>

#include <Catalog.h>
#include <NodeMonitor.h>
#include <Screen.h>
#include <ScrollView.h>

#include "VMWAddOnsCleanup.h"


#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "Virtual Disk Shrinking"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define B_TRANSLATION_CONTEXT "Virtual Disk Shrinking"
#define B_TRANSLATION_CONTEXT "Volume Cleanup"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will leave this as-is (unless further clarifications convince me otherwise). My reasoning being:

Disk(s) shrinking is the over-arching context, as the disk(s) clean up operation cannot be performed separately; it is just an optional step before the shrinking.


#define _H(x) static_cast<int>((x)->Frame().Height())
#define _W(x) static_cast<int>((x)->Frame().Width())

Expand All @@ -25,7 +30,7 @@

VMWAddOnsSelectWindow::VMWAddOnsSelectWindow()
:
BWindow(BRect(0, 0, 300, 1), "Clean up free space", B_TITLED_WINDOW,
BWindow(BRect(0, 0, 300, 1), B_TRANSLATE("Clean up free space"), B_TITLED_WINDOW,
B_NOT_CLOSABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
{
fVolumeRoster = new BVolumeRoster();
Expand All @@ -35,7 +40,7 @@ VMWAddOnsSelectWindow::VMWAddOnsSelectWindow()
fDisksView = new BView(Bounds(), "disks view", B_FOLLOW_ALL, B_WILL_DRAW);
fDisksView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));

fInfoText = new BStringView(BRect(SPACING, y, 1, 1), NULL, "Volumes to cleanup :");
fInfoText = new BStringView(BRect(SPACING, y, 1, 1), NULL, B_TRANSLATE("Volumes to clean up:"));
fInfoText->ResizeToPreferred();
y += _H(fInfoText) + SPACING;
if (w < _W(fInfoText))
Expand Down Expand Up @@ -66,7 +71,7 @@ VMWAddOnsSelectWindow::VMWAddOnsSelectWindow()

fDisksView->AddChild(new BScrollView(NULL, fVolumesList, B_FOLLOW_ALL_SIDES, 0, false, true));

fCleanupButton = new BButton(BRect(0, 0, 0, 0), NULL, "Cleanup selection",
fCleanupButton = new BButton(BRect(0, 0, 0, 0), NULL, B_TRANSLATE("Clean up selection"),
new BMessage(CLEANUP_SELECTION), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
fCleanupButton->MakeDefault(true);
fCleanupButton->SetEnabled(fVolumesList->CurrentSelection() >= 0);
Expand All @@ -77,8 +82,8 @@ VMWAddOnsSelectWindow::VMWAddOnsSelectWindow()

fCleanupButton->SetEnabled(fVolumesList->CurrentSelection() >= 0);

fCancelButton = new BButton(BRect(0, 0, 0, 0), NULL, "Cancel", new BMessage(CANCEL_OPERATION),
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
fCancelButton = new BButton(BRect(0, 0, 0, 0), NULL, B_TRANSLATE("Cancel"),
new BMessage(CANCEL_OPERATION), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
fCancelButton->ResizeToPreferred();
fCancelButton->MoveTo(w - _W(fCleanupButton) - _W(fCancelButton), y + 3);

Expand Down
16 changes: 12 additions & 4 deletions vmware_tray/VMWAddOnsStatusWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@

#include "VMWAddOnsStatusWindow.h"

#include <Catalog.h>
#include <Screen.h>
#include <String.h>


#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "Virtual Disk Shrinking"

#define _H(x) static_cast<int>((x)->Frame().Height())
#define _W(x) static_cast<int>((x)->Frame().Width())

Expand All @@ -19,19 +23,20 @@

VMWAddOnsStatusWindow::VMWAddOnsStatusWindow()
:
BWindow(BRect(0, 0, 300, 400), "Progress", B_TITLED_WINDOW,
BWindow(BRect(0, 0, 300, 400), B_TRANSLATE("Progress"), B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
{
fStatusView = new BView(Bounds(), "cleanup view", B_FOLLOW_ALL_SIDES, B_WILL_DRAW);
fStatusView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));

fProgressBar = new BStatusBar(BRect(SPACING, SPACING, 200, 45), NULL,
"Starting cleanup process, please wait...");
B_TRANSLATE("Starting cleanup process, please wait" B_UTF8_ELLIPSIS));
fProgressBar->ResizeToPreferred();

fStatusView->AddChild(fProgressBar);

fStopButton = new BButton(BRect(0, 0, 0, 0), NULL, "Stop", new BMessage(STOP_OPERATION));
fStopButton = new BButton(BRect(0, 0, 0, 0), NULL, B_TRANSLATE("Stop"),
new BMessage(STOP_OPERATION));
fStopButton->ResizeToPreferred();

fStopButton->MoveTo(2 * SPACING + _W(fProgressBar),
Expand Down Expand Up @@ -73,7 +78,10 @@ VMWAddOnsStatusWindow::MessageReceived(BMessage* message)

off_t size = sizeRead;

fProgressBar->Reset((BString("Cleaning up “") << name << "”" B_UTF8_ELLIPSIS).String());
BString text;
text.SetToFormat(B_TRANSLATE_COMMENT("Cleaning up %s" B_UTF8_ELLIPSIS,
"%s is the name of the volume being cleaned."), name);
fProgressBar->Reset(text.String());
fProgressBar->SetMaxValue(size);
}

Expand Down
52 changes: 32 additions & 20 deletions vmware_tray/VMWAddOnsTray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

#include "VMWAddOnsTray.h"

#include <AboutWindow.h>
#include <Alert.h>
#include <Catalog.h>
#include <Deskbar.h>
#include <MenuItem.h>
#include <Mime.h>
Expand All @@ -17,6 +19,9 @@
#include "icons.h"


#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "Deskbar tray icon"

#define CLIP_POLL_DELAY 1000000
#define CLOCK_POLL_DELAY 60000000

Expand Down Expand Up @@ -193,13 +198,10 @@ VMWAddOnsTray::MessageReceived(BMessage* message)

case B_ABOUT_REQUESTED:
{
BAlert* alert = new BAlert("about",
APP_NAME ", version " APP_VERSION "\n"
"© 2009, Vincent Duvert\n"
"Distributed under the terms of the MIT License.",
"OK", NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT);
alert->SetShortcut(0, B_ENTER);
alert->Go(NULL);
BAboutWindow* window = new BAboutWindow("VMware Add-ons",
"application/x-vnd.VinDuv.VMwareAddOns");
window->AddCopyright(2009, "Vincent Duvert");
window->Show();
} break;

case B_CLIPBOARD_CHANGED:
Expand Down Expand Up @@ -338,9 +340,9 @@ VMWAddOnsTray::StartShrink()
fBackdoor.CloseRPCChannel();
} else {
(new BAlert(TRAY_NAME,
"Unable to communicate with VMWare. Your VMWare version may be too old. Please start "
"the process manually if your VMware version allows it.",
"Cancel", NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT))
B_TRANSLATE("Unable to communicate with VMware. Your VMware version may be too old. "
"Please start the process manually if your VMware version allows it."),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT))
->Go();
}
}
Expand All @@ -355,9 +357,12 @@ VMWAddOnsTray::RemoveMyself(bool askUser)
int32 result = 1;
if (askUser) {
result = (new BAlert(TRAY_NAME,
"Are you sure you want to quit?\n"
"This will stop clipboard sharing (but not mouse sharing if it is running).",
"Cancel", "Quit", NULL, B_WIDTH_AS_USUAL, B_INFO_ALERT))
B_TRANSLATE("Are you sure you want to quit?\n"
"This will stop clipboard sharing, and time synchronization "
"(but not the mouse sharing, if it is currently enabled)."),
B_TRANSLATE("Cancel"),
B_TRANSLATE("Quit"),
NULL, B_WIDTH_AS_USUAL, B_INFO_ALERT))
->Go();
}

Expand All @@ -382,21 +387,24 @@ VMWAddOnsMenu::VMWAddOnsMenu(VMWAddOnsTray* tray, VMWBackdoor& fBackdoor)
SetFont(be_plain_font);

if (fBackdoor.InVMware()) {
menuItem = new BMenuItem("Enable mouse sharing", new BMessage(MOUSE_SHARING));
menuItem = new BMenuItem(B_TRANSLATE("Enable mouse sharing"), new BMessage(MOUSE_SHARING));
if (fBackdoor.GetGUISetting(VMWBackdoor::POINTER_GRAB_UNGRAB))
menuItem->SetMarked(gSettings.GetBool("mouse_enabled", true));
else
menuItem->SetMarked(false);
AddItem(menuItem);

menuItem = new BMenuItem("Enable clipboard sharing", new BMessage(CLIPBOARD_SHARING));
menuItem = new BMenuItem(B_TRANSLATE("Enable clipboard sharing"),
new BMessage(CLIPBOARD_SHARING));
if (fBackdoor.GetGUISetting(VMWBackdoor::CLIP_BOARD_SHARING))
menuItem->SetMarked(gSettings.GetBool("clip_enabled", true));
else
menuItem->SetMarked(false);
AddItem(menuItem);

menuItem = new BMenuItem("Enable time synchronization", new BMessage(TIMESYNC_HOST));
menuItem = new BMenuItem(B_TRANSLATE_COMMENT("Enable time synchronization",
"Alternatively: \"Synchronize clock\"."),
new BMessage(TIMESYNC_HOST));
if (fBackdoor.GetGUISetting(VMWBackdoor::TIME_SYNC))
menuItem->SetMarked(gSettings.GetBool("timesync_enabled", true));
else
Expand All @@ -405,18 +413,22 @@ VMWAddOnsMenu::VMWAddOnsMenu(VMWAddOnsTray* tray, VMWBackdoor& fBackdoor)

if (!tray->fCleanupInProgress) {
AddItem(
new BMenuItem("Shrink virtual disks " B_UTF8_ELLIPSIS, new BMessage(SHRINK_DISKS)));
new BMenuItem(B_TRANSLATE("Shrink virtual disks" B_UTF8_ELLIPSIS),
new BMessage(SHRINK_DISKS))
);
}
} else {
menuItem = new BMenuItem("Not running in VMware", NULL);
menuItem = new BMenuItem(B_TRANSLATE_COMMENT("Not running in VMware",
"Alternatively: \"VMware not detected\"."), NULL);
menuItem->SetEnabled(false);
AddItem(menuItem);
}

AddSeparatorItem();

AddItem(new BMenuItem("About " APP_NAME B_UTF8_ELLIPSIS, new BMessage(B_ABOUT_REQUESTED)));
AddItem(new BMenuItem("Quit" B_UTF8_ELLIPSIS, new BMessage(REMOVE_FROM_DESKBAR)));
AddItem(new BMenuItem(B_TRANSLATE("About " APP_NAME B_UTF8_ELLIPSIS),
new BMessage(B_ABOUT_REQUESTED)));
AddItem(new BMenuItem(B_TRANSLATE("Quit" B_UTF8_ELLIPSIS), new BMessage(REMOVE_FROM_DESKBAR)));

SetTargetForItems(tray);
SetAsyncAutoDestruct(true);
Expand Down
29 changes: 29 additions & 0 deletions vmware_tray/locales/en.catkeys
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
1 English application/x-vnd.VinDuv.VMwareAddOns 3446789908
Enable time synchronization Deskbar tray icon Alternatively: \"Synchronize clock\". Enable time synchronization
Shrink now… Virtual Disk Shrinking Shrink now…
Clean up selection Virtual Disk Shrinking Clean up selection
OK Virtual Disk Shrinking OK
Cancel Deskbar tray icon Cancel
Disk shrinking will operate on all auto-expanding disks attached to this virtual machine.\nFor best results it is recommended to clean up free space on these disks before starting the process.\n Virtual Disk Shrinking Disk shrinking will operate on all auto-expanding disks attached to this virtual machine.\nFor best results it is recommended to clean up free space on these disks before starting the process.\n
Quit… Deskbar tray icon Quit…
Starting cleanup process, please wait… Virtual Disk Shrinking Starting cleanup process, please wait…
Are you sure you want to quit?\nThis will stop clipboard sharing, and time synchronization (but not the mouse sharing, if it is currently enabled). Deskbar tray icon Are you sure you want to quit?\nThis will stop clipboard sharing, and time synchronization (but not the mouse sharing, if it is currently enabled).
Shrink virtual disks… Deskbar tray icon Shrink virtual disks…
Volumes to clean up: Virtual Disk Shrinking Volumes to clean up:
Shrink disks Virtual Disk Shrinking Shrink disks
An error occurred while cleaning %s (%s). This volume may be damaged. Virtual Disk Shrinking First %s is the name of the volume being cleaned. Second %s is the error message. An error occurred while cleaning %s (%s). This volume may be damaged.
Clean up disks… Virtual Disk Shrinking Clean up disks…
Stop Virtual Disk Shrinking Stop
Cancel Virtual Disk Shrinking Cancel
OK Deskbar tray icon OK
About VMware Add-ons… Deskbar tray icon About VMware Add-ons…
Progress Virtual Disk Shrinking Progress
Clean up free space Virtual Disk Shrinking Clean up free space
Cleaning up %s… Virtual Disk Shrinking %s is the name of the volume being cleaned. Cleaning up %s…
Enable mouse sharing Deskbar tray icon Enable mouse sharing
Error Virtual Disk Shrinking Error
Not running in VMware Deskbar tray icon Alternatively: \"VMware not detected\". Not running in VMware
Unable to communicate with VMware. Your VMware version may be too old. Please start the process manually if your VMware version allows it. Deskbar tray icon Unable to communicate with VMware. Your VMware version may be too old. Please start the process manually if your VMware version allows it.
The shrink operation will now be launched in VMware. This may take a long time; the virtual machine will be suspended during the process. Virtual Disk Shrinking The shrink operation will now be launched in VMware. This may take a long time; the virtual machine will be suspended during the process.
Enable clipboard sharing Deskbar tray icon Enable clipboard sharing
Quit Deskbar tray icon Quit
Loading