Permalink
Browse files

Merge remote-tracking branch 'rhodes/3-4-STABLE' into 3-4-STABLE

  • Loading branch information...
2 parents 01c2284 + 16a54ff commit ebd29038f93dbcdd3aa67b90f3714e9556e565da @ziggythehamster committed Dec 10, 2012
View
20 platform/android/build/android.rake
@@ -130,17 +130,25 @@ def add_motosol_sdk(manifest)
end
end
+def set_app_icon_android
+ iconappname = File.join($app_path, "icon", "icon.png")
+
+ ['drawable', 'drawable-hdpi', 'drawable-mdpi', 'drawable-ldpi'].each do |dpi|
+ drawable = File.join($appres, dpi)
+ iconresname = File.join(drawable, "icon.png")
+ rm_f iconresname
+ cp iconappname, iconresname if File.exist? drawable
+ end
+
+end
+
def set_app_name_android(newname)
puts "set_app_name"
$stdout.flush
rm_rf $appres
cp_r $rhores, $appres
- iconappname = File.join($app_path, "icon", "icon.png")
- iconresname = File.join($appres, "drawable", "icon.png")
- rm_f iconresname
- cp iconappname, iconresname
rhostrings = File.join($rhores, "values", "strings.xml")
appstrings = File.join($appres, "values", "strings.xml")
@@ -1368,6 +1376,7 @@ namespace "build" do
task :resources => [:rhobundle, :extensions] do
set_app_name_android($appname)
+ set_app_icon_android
end
#desc "Build Rhodes for android"
@@ -1399,6 +1408,9 @@ namespace "build" do
cp_r res, $tmpdir
end
end
+
+ #copy icon again in case an extension overwrites them (like rhoelementsext...)
+ set_app_icon_android
unless $config_xml.nil?
rawres_path = File.join($tmpdir, 'res', 'raw')
View
4 platform/iphone/Classes/RhoViewController.m
@@ -41,12 +41,12 @@ - (BOOL)shouldAutorotate {
return YES;
}
-
+/*
- (NSUInteger)supportedInterfaceOrientations
{
if ([[Rhodes sharedInstance] isRotationLocked])
return UIInterfaceOrientationMaskPortrait;
return UIInterfaceOrientationMaskAll;
}
-
+*/
@end
View
10 platform/shared/common/RhodesApp.cpp
@@ -1985,7 +1985,15 @@ int rho_rhodesapp_isrubycompiler()
void rho_net_request(const char *url)
{
- getNetRequest().pullData(url, null);
+ String strCallbackUrl = RHODESAPP().canonicalizeRhoUrl(url);
+ RHODESAPP().runCallbackInThread(strCallbackUrl, null);
+}
+
+void rho_net_request_with_data(const char *url, const char *str_body)
+{
+ String strCallbackUrl = RHODESAPP().canonicalizeRhoUrl(url);
+ String strBody = str_body;
+ RHODESAPP().runCallbackInThread(strCallbackUrl, strBody);
}
View
8 platform/shared/common/RhodesAppBase.cpp
@@ -32,13 +32,7 @@
#include "sync/SyncThread.h"
#include "unzip/unzip.h"
-extern "C" {
- void rho_net_request_with_data(const char *url, const char *str_body)
- {
- getNetRequest().pushData(url, str_body, null);
- }
-
-}
+extern "C" void rho_net_request_with_data(const char *url, const char *str_body);
namespace rho {
namespace common{
View
6 platform/shared/net/URI.cpp
@@ -203,12 +203,12 @@ String URI::urlEncode(const String& fullPath)
}
strRes += '%';
- if (c > 15) { // is it a non-control char, ie. >x0F so 2 chars
+ if (((unsigned char)c) > 15) { // is it a non-control char, ie. >x0F so 2 chars
//sb.append(Integer.toHexString((int)c)); // just add % and the string
- toHexString(c, strRes, 16);
+ toHexString((unsigned char)c, strRes, 16);
} else {
strRes += '0';
- toHexString(c, strRes, 16);
+ toHexString((unsigned char)c, strRes, 16);
//sb.append("0" + Integer.toHexString((int)c));
// otherwise need to add a leading 0
}
View
57 platform/wm/rhodes/MainWindow.cpp
@@ -105,6 +105,7 @@ CMainWindow::CMainWindow()
m_menuBarHeight = 0;
m_alertDialog = 0;
+ m_isMinimized = 0;
}
CMainWindow::~CMainWindow()
@@ -579,20 +580,44 @@ LRESULT CMainWindow::OnAuthenticationRequest (UINT /*uMsg*/, WPARAM wParam, LPAR
#endif //APP_BUILD_CAPABILITY_WEBKIT_BROWSER
+LRESULT CMainWindow::OnWindowMinimized (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
+{
+ ProcessActivate( FALSE, MAKEWPARAM(0,1), 0 );
+
+ SetForegroundWindow(m_hWnd);
+
+ ::ShowWindow( m_hWnd, SW_MINIMIZE );
+
+ m_isMinimized = true;
+
+ return 0;
+}
+
LRESULT CMainWindow::OnActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
int fActive = LOWORD(wParam);
- LOG(INFO) + "ACTIVATE: " + fActive;
+
+ if(m_isMinimized)
+ {
+ m_isMinimized = false;
+ SendMessage( m_hWnd, PB_WINDOW_RESTORE, NULL, TRUE);
+ }
if (lParam) //We get activate from some internal window
{
#if defined(_WIN32_WCE)
- if (m_bFullScreen && fActive && (getSIPVisibleTop()<0))
- RhoSetFullScreen(true);
+ if (m_bFullScreen && fActive && (getSIPVisibleTop()<0))
+ RhoSetFullScreen(true);
#endif
return 0;
}
+ ProcessActivate( fActive, wParam, lParam );
+ return 0;
+}
+
+void CMainWindow::ProcessActivate( BOOL fActive, WPARAM wParam, LPARAM lParam )
+{
#if defined(_WIN32_WCE)
if (m_bFullScreen)
RhoSetFullScreen(fActive!=0);
@@ -602,24 +627,10 @@ LRESULT CMainWindow::OnActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOO
#if defined(_WIN32_WCE) && !defined (OS_PLATFORM_MOTCE)
// Notify shell of our WM_ACTIVATE message
SHHandleWMActivate(m_hWnd, wParam, lParam, &m_sai, 0);
-
- //pause_sync(!fActive);
-/* TBD: Commented this out because it was called before http server started
- We need to fix this properly
- if ( fActive )
- CHttpServer::Instance()->ResumeThread();
- else
- CHttpServer::Instance()->FreezeThread();
-*/
- //activate calls after javascript alerts, so we have viciouse cycle if alert is display in home page
- //if ( rho::common::CRhodesApp::getInstance() != null )
- // RHODESAPP().callAppActiveCallback(fActive!=0);
-
#endif
if (!fActive)
rho_geoimpl_turngpsoff();
- return 0;
}
LRESULT CMainWindow::OnSetCookieCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/)
@@ -1124,12 +1135,12 @@ LRESULT CMainWindow::OnAlertShowPopup (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM
m_SyncStatusDlg.setStatusText(convertToStringW(params->m_message).c_str());
m_SyncStatusDlg.setTitle( convertToStringW(params->m_title).c_str() );
if ( !m_SyncStatusDlg.m_hWnd )
- m_SyncStatusDlg.Create(m_hWnd, 0);
- else
- {
- m_SyncStatusDlg.ShowWindow(SW_SHOW);
- m_SyncStatusDlg.BringWindowToTop();
- }
+ m_SyncStatusDlg.Create(m_hWnd, 0);
+ //else
+ //{
+ m_SyncStatusDlg.ShowWindow(SW_SHOW);
+ m_SyncStatusDlg.BringWindowToTop();
+ //}
}else if (params->m_dlgType == CAlertDialog::Params::DLG_DEFAULT) {
MessageBox(convertToStringW(params->m_message).c_str(), strAppName.c_str(), MB_ICONWARNING | MB_OK);
RHODESAPP().callPopupCallback(params->m_callback, "ok", "ok");
View
6 platform/wm/rhodes/MainWindow.h
@@ -103,6 +103,7 @@ static UINT WM_BLUETOOTH_DISCOVERED = ::RegisterWindowMessage(L"RHODES_WM_BLU
static UINT WM_BLUETOOTH_CALLBACK = ::RegisterWindowMessage(L"RHODES_WM_BLUETOOTH_CALLBACK");
static UINT WM_EXECUTE_COMMAND = ::RegisterWindowMessage(L"RHODES_WM_EXECUTE_COMMAND");
static UINT WM_EXECUTE_RUNNABLE = ::RegisterWindowMessage(L"RHODES_WM_EXECUTE_RUNNABLE");
+static UINT WM_WINDOW_MINIMIZE = ::RegisterWindowMessage(L"RHODES_WM_MINIMIZE");
extern UINT WM_LICENSE_SCREEN;
typedef struct _TCookieData {
@@ -210,6 +211,7 @@ class CMainWindow :
MESSAGE_HANDLER(WM_BLUETOOTH_CALLBACK, OnBluetoothCallback);
MESSAGE_HANDLER(WM_EXECUTE_COMMAND, OnExecuteCommand);
MESSAGE_HANDLER(WM_EXECUTE_RUNNABLE, OnExecuteRunnable);
+ MESSAGE_HANDLER(WM_WINDOW_MINIMIZE, OnWindowMinimized);
MESSAGE_HANDLER(WM_LICENSE_SCREEN, OnLicenseScreen);
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus);
MESSAGE_HANDLER(WM_HOTKEY, OnHotKey);
@@ -279,6 +281,7 @@ class CMainWindow :
LRESULT OnBluetoothCallback (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
LRESULT OnExecuteCommand (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
LRESULT OnExecuteRunnable (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
+ LRESULT OnWindowMinimized (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
LRESULT OnLicenseScreen (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
LRESULT OnSetFocus (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
LRESULT OnHotKey (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
@@ -348,6 +351,7 @@ class CMainWindow :
private:
bool mIsBrowserViewHided;
+ bool m_isMinimized;
rho::IBrowserEngine* m_pBrowserEng;
@@ -389,6 +393,8 @@ class CMainWindow :
CAlertDialog *m_alertDialog;
CSyncStatusDlg m_SyncStatusDlg;
+
+ void ProcessActivate( BOOL fActive, WPARAM wParam, LPARAM lParam );
};
#if !defined(_WIN32_WCE) || defined( OS_PLATFORM_MOTCE )
View
3 platform/wm/rhodes/Rhodes.cpp
@@ -405,7 +405,8 @@ HRESULT CRhodesModule::PreMessageLoop(int nShowCmd) throw()
if (hWnd)
{
- SetForegroundWindow( HWND( DWORD(hWnd) | 0x01 ) );
+ SendMessage( hWnd, PB_WINDOW_RESTORE, NULL, TRUE);
+ SetForegroundWindow( hWnd );
return S_FALSE;
}
View
7 platform/wm/rhodes/bluetooth/Bluetooth.cpp
@@ -682,6 +682,13 @@ DWORD WINAPI RhoBluetoothManager::runThreadReadData(LPVOID voidArg) {
return WSAGetLastError();
}
else
+ if (cbBytesRecd == 0) {
+ // connection closed !
+ LOG(INFO) + "RhoBluetoothManager::runThreadReadData() exit with connection closed message";
+ functionInfo->fireSessionCallBack(functionInfo->mConnectedDeviceName, RHO_BT_SESSION_DISCONNECT);
+ return 0;
+ }
+ else
{
// something was received, then copy the contents in szMessage
if(cbBytesRecd>0)
View
3 platform/wm/rhodes/rho/common/ExtManager.cpp
@@ -212,7 +212,8 @@ static void __minimize_restoreApp(int nParam)
void CExtManager::minimizeApp()
{
- rho_callInUIThread(__minimize_restoreApp, SW_MINIMIZE);
+ //rho_callInUIThread(__minimize_restoreApp, SW_MINIMIZE);
+ ::PostMessage( getMainWnd(), WM_WINDOW_MINIMIZE, 0, 0 );
}
void CExtManager::restoreApp()
View
2 version
@@ -1 +1 @@
-3.4.2
+3.4.2.2

0 comments on commit ebd2903

Please sign in to comment.