Ejemplo n.º 1
0
        public void startApp()
        {
            LOG.INFO("startApp");

            CRhoResourceMap.deployContent();
            RhoRuby.Init(m_webBrowser);

            DBAdapter.initAttrManager();

            LOG.INFO("Starting sync engine...");
            SyncThread sync = null;

            try{
                sync = SyncThread.Create();
            }catch (Exception exc) {
                LOG.ERROR("Create sync failed.", exc);
            }
            if (sync != null)
            {
                //sync.setStatusListener(this);
            }

            RhoRuby.InitApp();
            RhoRuby.call_config_conflicts();
            RHOCONF().conflictsResolved();
        }
Ejemplo n.º 2
0
        public void stopApp()
        {
            //string[] ar1 = CRhoFile.enumDirectory("db");

            RhoRuby.callUIDestroyed();

            SyncThread.getInstance().Destroy();
            CAsyncHttp.Destroy();

            RhoRuby.Stop();

            //string[] ar2 = CRhoFile.enumDirectory("db");
            //int i = 0;
            //net::CAsyncHttp::Destroy();
        }
Ejemplo n.º 3
0
        private void processToolBarCommand(object sender, EventArgs e, String strAction)
        {
            boolean callback = false;

            if (strAction == "back")
            {
                if (m_strAppBackUrl.length() > 0)
                {
                    processToolBarCommand(this, e, m_strAppBackUrl);
                }
                else if (m_backHistory.Count > 0)
                {
                    Uri destination = m_backHistory.Peek();
                    m_webBrowser.Navigate(destination);
                }
                return;
            }

            if (strAction.startsWith("callback:"))
            {
                strAction = strAction.substring(9);
                callback  = true;
            }

            if (strAction == "forward" && m_forwardHistory.Count > 0)
            {
                Uri destination = m_forwardHistory.Peek();
                m_webBrowser.Navigate(destination);
                return;
            }

            if (strAction == "home")
            {
                String strHomePage = RhoRuby.getStartPage();
                strHomePage = canonicalizeRhoUrl(strHomePage);
                m_webBrowser.Navigate(new Uri(strHomePage));
                return;
            }

            if (strAction == "log")
            {
                showLogScreen();
                return;
            }

            if (strAction == "options")
            {
                String curUrl = RhoRuby.getOptionsPage();
                curUrl = canonicalizeRhoUrl(curUrl);
                m_webBrowser.Navigate(new Uri(curUrl));
                return;
            }

            if (strAction == "refresh" && m_currentUri != null)
            {
                m_webBrowser.Navigate(m_currentUri);
                return;
            }

            if (strAction == "sync")
            {
                SyncThread.doSyncAllSources(true);
                return;
            }

            strAction = canonicalizeRhoUrl(strAction);
            if (callback)
            {
                RhoClassFactory.createNetRequest().pushData(strAction, "rho_callback=1", null);
            }
            else
            {
                m_webBrowser.Navigate(new Uri(strAction));
            }
        }