From 3fd6e5f6d7e7b651359f189b731cba3444512013 Mon Sep 17 00:00:00 2001
From: Adrien Destugues
Date: Fri, 2 Jul 2010 13:11:04 +0000
Subject: [PATCH] * Pathc by Jorma Karvonnen updated by me : localize
WebWatch. Thanks !
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37338 a95241bf-73f2-0310-859d-f6bbb57e9c96
---
src/apps/webwatch/Jamfile | 7 +-
src/apps/webwatch/WatchApp.cpp | 8 +-
src/apps/webwatch/WatchView.cpp | 48 ++++++-----
src/apps/webwatch/WatchView.h | 2 +
src/apps/webwatch/readme.html | 139 +++++++++++++++++---------------
5 files changed, 112 insertions(+), 92 deletions(-)
diff --git a/src/apps/webwatch/Jamfile b/src/apps/webwatch/Jamfile
index 6f453e80e7..eb3b8656cb 100644
--- a/src/apps/webwatch/Jamfile
+++ b/src/apps/webwatch/Jamfile
@@ -10,7 +10,12 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
Application WebWatch :
WatchApp.cpp
WatchView.cpp
- : be $(TARGET_LIBSUPC++)
+ : be $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++)
: WebWatch.rdef
;
+DoCatalogs WebWatch :
+ x-vnd.mahlzeit.webwatch
+ :
+ WatchView.cpp
+;
diff --git a/src/apps/webwatch/WatchApp.cpp b/src/apps/webwatch/WatchApp.cpp
index fad4681b3b..30a7027528 100644
--- a/src/apps/webwatch/WatchApp.cpp
+++ b/src/apps/webwatch/WatchApp.cpp
@@ -26,14 +26,14 @@
#include "WatchApp.h"
#include "WatchView.h"
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
BView* instantiate_deskbar_item()
{
return new WatchView;
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
WatchApp::WatchApp() : BApplication(APP_SIGNATURE)
{
@@ -54,7 +54,7 @@ WatchApp::WatchApp() : BApplication(APP_SIGNATURE)
PostMessage(B_QUIT_REQUESTED);
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
int main()
{
@@ -63,4 +63,4 @@ int main()
return 0;
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
diff --git a/src/apps/webwatch/WatchView.cpp b/src/apps/webwatch/WatchView.cpp
index 072aa80ee5..56642d572e 100644
--- a/src/apps/webwatch/WatchView.cpp
+++ b/src/apps/webwatch/WatchView.cpp
@@ -30,17 +30,21 @@
#include "WatchApp.h"
#include "WatchView.h"
+#undef B_TRANSLATE_CONTEXT
+#define B_TRANSLATE_CONTEXT "WatchView"
+
+
const rgb_color COLOR_FOREGROUND = { 0, 0, 0 };
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
WatchView::WatchView()
- : BView(BRect(0, 0, 1, 1), 0, 0, 0)
+ :
+ BView(BRect(0, 0, 1, 1), 0, 0, 0)
{
- // Do nothing.
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
WatchView::WatchView(BMessage* message)
: BView(
@@ -62,7 +66,7 @@ WatchView::WatchView(BMessage* message)
SetViewColor(B_TRANSPARENT_COLOR);
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
__declspec(dllexport) WatchView* WatchView::Instantiate(BMessage* archive)
{
@@ -74,7 +78,7 @@ __declspec(dllexport) WatchView* WatchView::Instantiate(BMessage* archive)
return NULL;
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
status_t WatchView::Archive(BMessage* archive, bool deep) const
{
@@ -86,7 +90,7 @@ status_t WatchView::Archive(BMessage* archive, bool deep) const
return B_OK;
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
void WatchView::Draw(BRect updateRect)
{
@@ -112,17 +116,18 @@ void WatchView::Draw(BRect updateRect)
DrawString(string, BPoint(x, y));
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
void WatchView::MouseDown(BPoint point)
{
- BPopUpMenu* menu = new BPopUpMenu("WatchView", false, false);
+ BPopUpMenu* menu = new BPopUpMenu(B_TRANSLATE("WatchView"), false, false);
menu->AddItem(new BMenuItem(
- "About" B_UTF8_ELLIPSIS, new BMessage(B_ABOUT_REQUESTED)));
+ B_TRANSLATE("About" B_UTF8_ELLIPSIS),
+ new BMessage(B_ABOUT_REQUESTED)));
menu->AddItem(new BMenuItem(
- "Quit", new BMessage(B_QUIT_REQUESTED)));
+ B_TRANSLATE("Quit"), new BMessage(B_QUIT_REQUESTED)));
menu->SetTargetForItems(this);
@@ -132,7 +137,7 @@ void WatchView::MouseDown(BPoint point)
delete menu;
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
void WatchView::MessageReceived(BMessage* msg)
{
@@ -144,21 +149,20 @@ void WatchView::MessageReceived(BMessage* msg)
}
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
void WatchView::OnAboutRequested()
{
- (new BAlert(
- NULL,
- "WebWatch " VERSION
+ BString text = B_TRANSLATE("WebWatch %1"
"\nAn internet time clock for your Deskbar\n\n"
"Created by Matthijs Hollemans\n"
"mahlzeit@users.sourceforge.net\n\n"
- "Thanks to Jason Parks for his help.\n",
- "OK"))->Go(NULL);
+ "Thanks to Jason Parks for his help.\n");
+ text.ReplaceFirst("%1", VERSION);
+ (new BAlert(NULL, text.String(), B_TRANSLATE("OK")))->Go(NULL);
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
void WatchView::OnQuitRequested()
{
@@ -171,7 +175,7 @@ void WatchView::OnQuitRequested()
deskbar.RemoveItem(DESKBAR_ITEM_NAME);
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
void WatchView::Pulse()
{
@@ -183,7 +187,7 @@ void WatchView::Pulse()
}
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
int32 WatchView::GetInternetTime()
{
@@ -196,4 +200,4 @@ int32 WatchView::GetInternetTime()
return (int32) (((real_time_clock() + 3600) % 86400) / 86.4);
}
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
diff --git a/src/apps/webwatch/WatchView.h b/src/apps/webwatch/WatchView.h
index 425b027331..f6d0e88ce5 100644
--- a/src/apps/webwatch/WatchView.h
+++ b/src/apps/webwatch/WatchView.h
@@ -23,6 +23,8 @@
#ifndef WATCHVIEW_H
#define WATCHVIEW_H
+#include
+#include
#include
class WatchView : public BView
diff --git a/src/apps/webwatch/readme.html b/src/apps/webwatch/readme.html
index 4f4f2e91a8..32db17c2a0 100644
--- a/src/apps/webwatch/readme.html
+++ b/src/apps/webwatch/readme.html
@@ -1,117 +1,126 @@
-
+
+
-
-WebWatch
-
+
+WebWatch
+
+
-
+
-WebWatch 1.5
+WebWatch 1.5
-Released on Thursday, 13 February 2003
-Created by Matthijs
-Hollemans
+Released on Thursday, 13 February 2003
+Created by Matthijs
+Hollemans
-What is it
+What is it
-WebWatch is an unofficial port of Swatch's Internet Time utility for BeOS
-R5 or higher that runs inside the Deskbar.
+WebWatch is an unofficial port of Swatch's Internet Time utility for BeOS
+R5 or higher that runs inside the Deskbar.
-Someone at Swatch (you know, the company that makes the watches) came up
+
Someone at Swatch (you know, the company that makes the watches) came up
with an idea for a universal time format that eliminates time zones and
geographical borders. The idea is very simple: time is no longer measured in
hours, minutes, and seconds, but in "beats." A single day consists of 1000
-beats, so each beat corresponds to 1 minute and 26.4 seconds.
+beats, so each beat corresponds to 1 minute and 26.4 seconds.
-This "Internet Time" is the same all over the world, because it is measured
+
This "Internet Time" is the same all over the world, because it is measured
relatively to something called the Biel Mean Time (BMT), a new meridian that
lies in Switzerland. A day in Internet Time begins at midnight BMT, or @000
Swatch Beats, 12 noon is equivalent to @500 beats, and so on. So if it's @812
-at my place, it's also 812 beats at yours and everyone else's.
+at my place, it's also 812 beats at yours and everyone else's.
-Please check out the Swatch website
-for more information.
+Please check out the Swatch website
+for more information.
-How to use it
+How to use it
-Simply double-click the WebWatch icon to install WebWatch into the Deskbar.
-To get rid of it, right-click WebWatch in the Deskbar and select
-the Quit option from the pop-up menu.
+Simply double-click the WebWatch icon to install WebWatch into the Deskbar.
+To get rid of it, right-click WebWatch in the Deskbar and select
+the Quit option from the pop-up menu.
-Legal stuff
+Legal stuff
-This version of WebWatch is open source and may be distributed under the
+
This version of WebWatch is open source and may be distributed under the
terms of the MIT license. Note that the author is in no way affiliated with
-Swatch, and fully respects their copyrights and trademarks.
+Swatch, and fully respects their copyrights and trademarks.
-Copyright (c) 1999-2003 Matthijs Hollemans
+Copyright © 1999-2003 Matthijs Hollemans
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
+
Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
+Software is furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
+DEALINGS IN THE SOFTWARE.
-History
+History
-Version 1.5 (Thursday, 13 February 2003)
+Version 1.5 (Thursday, 13 February 2003)
-
-- Cleaned up the source code.
-- Now uses the plain font, not the bold font.
-
+
+- Cleaned up the source code.
+- Now uses the plain font, not the bold font.
+
-Version 1.4 (Saturday, 9 December 2000)
+Version 1.4 (Saturday, 9 December 2000)
-
-- With certain fonts, WebWatch didn't always fit in the Deskbar.
-
+
+- With certain fonts, WebWatch didn't always fit in the Deskbar.
+
-Version 1.3 (Sunday, 26 November 2000)
+Version 1.3 (Sunday, 26 November 2000)
-
-- The time is now written using a bold font, making it better readable.
-- Thanks to Jason Parks for turning WebWatch into a real Deskbar add-on.
+
+- The time is now written using a bold font, making it better readable.
+- Thanks to Jason Parks for turning WebWatch into a real Deskbar add-on.
Because of this, WebWatch no longer needs to be installed in the
UserBootscript; the Deskbar starts it automatically. This also means that
-WebWatch is now BeOS R5 or higher only.
-
+WebWatch is now BeOS R5 or higher only.
+
-Version 1.2 (Tuesday, 26 September 2000)
+Version 1.2 (Tuesday, 26 September 2000)
-
-- Finally fixed a long-standing bug with WebWatch's background color. Now it
-uses the same color as the Deskbar.
-
+
+- Finally fixed a long-standing bug with WebWatch's background color. Now it
+uses the same color as the Deskbar.
+
-Version 1.1 (Tuesday, 28 March 2000)
+Version 1.1 (Tuesday, 28 March 2000)
-
-- New release for BeOS R5. Older versions of WebWatch came with source
+
+- New release for BeOS R5. Older versions of WebWatch came with source
code only, which was automatically compiled during installation. However,
because of header file changes between R5 and older versions of the BeOS,
and because the free version of BeOS R5 doesn't necessarily include
development tools, WebWatch 1.1 is already compiled. This means that it
-only runs on the Intel platform, since I don't have a PowerPC machine.
-
+only runs on the Intel platform, since I don't have a PowerPC machine.
+
-Version 1.0 (Saturday, 14 August 1999)
+Version 1.0 (Saturday, 14 August 1999)
-
+
-
-
+
+
+
+
+
+