Пример #1
0
class Browser(QObject):
    def __init__(self, callback):
        QObject.__init__(self, app)
        self.callback = callback
        self.view = QWebView()
        self.page = self.view.page()
        self.page.mainFrame().loadFinished.connect(self.cb)

    def load(self, url):
        self.page.mainFrame().setUrl(QUrl(url))
        self.current_url = url

    def back(self):
        self.view.back()

    def cb(self):
        usleep(INITIAL_SLEEP)
        document = self.page.mainFrame().documentElement()
        self.callback(self, self.current_url, document)
Пример #2
0
class Browser(QObject):
    def __init__(self, callback):
        QObject.__init__(self, app)
        self.callback = callback
        self.view = QWebView()
        self.page = self.view.page()
        self.page.mainFrame().loadFinished.connect(self.cb)

    def load(self, url):
        self.page.mainFrame().setUrl(QUrl(url))
        self.current_url = url

    def back(self):
        self.view.back()

    def cb(self):
        usleep(INITIAL_SLEEP)
        document = self.page.mainFrame().documentElement()
        self.callback(self, self.current_url, document)
Пример #3
0
class WebViewWidget(QtGui.QWidget):
    """
    Descript. :
    """

    def __init__(self, parent):
        """
        Descript. :
        """
        QtGui.QWidget.__init__(self, parent)

        self.home_url = None

        self.navigation_bar = QtGui.QWidget(self)
        self.url_ledit = QtGui.QLineEdit(self.navigation_bar)
        self.url_ledit.setReadOnly(True)
        self.home_button = QtGui.QPushButton(self.navigation_bar)
        self.back_button = QtGui.QPushButton(self.navigation_bar)
        self.forward_button = QtGui.QPushButton(self.navigation_bar)

        self.home_button.setIcon(Qt4_Icons.load_icon("Home2"))
        self.back_button.setIcon(Qt4_Icons.load_icon("Left2"))
        self.forward_button.setIcon(Qt4_Icons.load_icon("Right2"))
         
        if QWEBVIEW_AVAILABLE:
            self.web_page_viewer = QWebView(self)
            self.web_page_viewer.settings().setObjectCacheCapacities(0,0,0)

        _navigation_bar_hlayout = QtGui.QHBoxLayout(self.navigation_bar)
        _navigation_bar_hlayout.addWidget(self.home_button)
        _navigation_bar_hlayout.addWidget(self.back_button) 
        _navigation_bar_hlayout.addWidget(self.forward_button)
        _navigation_bar_hlayout.addWidget(self.url_ledit)  
        _navigation_bar_hlayout.setSpacing(2)
        _navigation_bar_hlayout.setContentsMargins(2, 2, 2, 2)

        _main_vlayout = QtGui.QVBoxLayout(self)
        _main_vlayout.addWidget(self.navigation_bar) 
        _main_vlayout.addWidget(self.web_page_viewer)  
        _main_vlayout.setSpacing(2)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)
        
        self.web_page_viewer.setSizePolicy(QtGui.QSizePolicy.Expanding,
                                           QtGui.QSizePolicy.Expanding)

        self.home_button.clicked.connect(self.go_to_home_page)
        self.back_button.clicked.connect(self.go_back)
        self.forward_button.clicked.connect(self.go_forward)

    def set_url(self, url):
        """
        """
        if QWEBVIEW_AVAILABLE:
            self.home_url = url
            self.navigation_bar.setEnabled(True)
            self.go_to_home_page()
              
    def set_static_page(self, html_text):
        """
        """
        if QWEBVIEW_AVAILABLE:
            self.web_page_viewer.setHtml(html_text)
            self.navigation_bar.setEnabled(False)

    def go_to_home_page(self):
        """
        """
        print "go_to_home_page: ", self.home_url
        self.url_ledit.setText(self.home_url)
        self.web_page_viewer.load(QtCore.QUrl(self.home_url))
        self.web_page_viewer.show()

    def go_back(self):
        """
        """
        if QWEBVIEW_AVAILABLE:
            self.web_page_viewer.back()

    def go_forward(self):
        """
        """
        if QWEBVIEW_AVAILABLE:
            self.web_page_viewer.forward()  
Пример #4
0
class Browser(QFrame):

    # =======================================================================
    def __init__(self, parent=None, _PARENT=None):

        # -------------------------------------------------------------------
        QFrame.__init__(self, parent)

        _SIZE = [3, 5, 975, 585]

        self.setGeometry(_SIZE[0], _SIZE[1], _SIZE[2], _SIZE[3])
        self.PARENT = _PARENT
        self.CONF = _PARENT.CONF

        self.setStyleSheet(
            "QFrame{ font: 12px 'monospace'; color: #000; background-color: transparent; background-image: url('./data/imgs/TAB_Browser.png'); }"
        )

        # -------------------------------------------------------------------
        self.BROWSER = QWebView(self)
        self.BROWSER.setGeometry(6, 83, 963, 500)
        self.BROWSER.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
        #self.BROWSER.loadFinished.connect( self.on_loadFinished );

        self.connect(self.BROWSER.page(), SIGNAL('linkClicked (QUrl)'),
                     self.LINK_CLICKED)
        self.connect(self.BROWSER.page(), SIGNAL('loadProgress (int)'),
                     self.PAGE_LOADPROGRESS)
        # void linkHovered (const QString&,const QString&,const QString&)
        self.connect(self.BROWSER.page(),
                     SIGNAL('linkHovered (QString, QString, QString)'),
                     self.LINK_HOVERED)

        #self.BROWSER.load(QUrl.fromUserInput(sys.argv[1]))

        # -------------------------------------------------------------------
        self.HISTORY = []
        # -------------------------------------------------------------------
        # CONTROLS

        # BACK
        self.CONTROL_BACK_BTN = QPushButton("", self)
        self.CONTROL_BACK_BTN.setGeometry(11, 15, 43, 34)
        self.CONTROL_BACK_BTN.setStyleSheet(
            "QPushButton{ background-color: transparent; border-style: none; }"
        )
        self.connect(self.CONTROL_BACK_BTN, SIGNAL('clicked()'),
                     self.BROWSER.back)

        # STOP
        self.CONTROL_STOP_BTN = QPushButton("", self)
        self.CONTROL_STOP_BTN.setGeometry(55, 15, 49, 34)
        self.CONTROL_STOP_BTN.setStyleSheet(
            "QPushButton{ background-color: transparent; border-style: none; }"
        )
        self.connect(self.CONTROL_STOP_BTN, SIGNAL('clicked()'),
                     self.BROWSER.stop)

        # RELOAD
        self.CONTROL_RELOAD_BTN = QPushButton("", self)
        self.CONTROL_RELOAD_BTN.setGeometry(105, 15, 52, 34)
        self.CONTROL_RELOAD_BTN.setStyleSheet(
            "QPushButton{ background-color: transparent; border-style: none; }"
        )
        self.connect(self.CONTROL_RELOAD_BTN, SIGNAL('clicked()'),
                     self.BROWSER.reload)

        # FOREWARDE
        self.CONTROL_FOREWARDE_BTN = QPushButton("", self)
        self.CONTROL_FOREWARDE_BTN.setGeometry(158, 15, 43, 34)
        self.CONTROL_FOREWARDE_BTN.setStyleSheet(
            "QPushButton{ background-color: transparent; border-style: none; }"
        )
        self.connect(self.CONTROL_FOREWARDE_BTN, SIGNAL('clicked()'),
                     self.BROWSER.forward)

        # URL-BAR
        self.URL_BAR = QLineEdit(
            "tradingview.com/chart/BNC1/BLX/YFDnalUh-The-Road-to-Obsolescence-A-Seven-Year-Cycle-in-Bitcoin/, https://www.bitstamp.net/, https://blockchain.info/charts/market-cap/",
            self)
        self.URL_BAR.setGeometry(6, 55, 950, 27)
        self.URL_BAR.setPlaceholderText(
            "bitstamp.net, blockchain.info/charts/market-cap/")
        self.URL_BAR.setStyleSheet(
            "QLineEdit{ background-color: #222; color: #fff; padding-left: 10px; border-style: none; }"
        )
        self.connect(self.URL_BAR, SIGNAL('returnPressed ()'), self.GO_TO)

        # CALENDER
        self.CONTROL_CALENDER_BTN = QPushButton("", self)
        self.CONTROL_CALENDER_BTN.setGeometry(769, 15, 43, 34)
        self.CONTROL_CALENDER_BTN.setStyleSheet(
            "QPushButton{ background-color: transparent; border-style: none; }"
        )
        self.connect(self.CONTROL_CALENDER_BTN, SIGNAL('clicked()'),
                     self.GET_CALENDER)

        # BC-E HOME
        self.BTCE_HOME_LNK = "https://btc-e.com/exchange/ltc_usd"
        self.CONTROL_BTCE_HOME_BTN = QPushButton("", self)
        self.CONTROL_BTCE_HOME_BTN.setGeometry(812, 15, 49, 34)
        self.CONTROL_BTCE_HOME_BTN.setStyleSheet(
            "QPushButton{ background-color: transparent; border-style: none; }"
        )
        self.connect(self.CONTROL_BTCE_HOME_BTN, SIGNAL('clicked()'),
                     lambda: self.BROWSER.load(QUrl(self.BTCE_HOME_LNK)))

        # BLOCKCHAIN
        self.BLOCKCHAIN_LNK = "https://blockchain.info/charts/market-cap/?showDataPoints=true&timespan=30days&show_header=false&daysAverageString=7&scale=1&address="
        self.CONTROL_BLOCKCHAIN_BTN = QPushButton("", self)
        self.CONTROL_BLOCKCHAIN_BTN.setGeometry(862, 15, 53, 34)
        self.CONTROL_BLOCKCHAIN_BTN.setStyleSheet(
            "QPushButton{ background-color: transparent; border-style: none; }"
        )
        self.connect(self.CONTROL_BLOCKCHAIN_BTN, SIGNAL('clicked()'),
                     lambda: self.BROWSER.load(QUrl(self.BLOCKCHAIN_LNK)))

        # GOOGLE
        self.GOOGLE_LNK = "https://google.com/"
        self.CONTROL_GOOGLE_BTN = QPushButton("", self)
        self.CONTROL_GOOGLE_BTN.setGeometry(913, 15, 43, 34)
        self.CONTROL_GOOGLE_BTN.setStyleSheet(
            "QPushButton{ background-color: transparent; border-style: none; }"
        )
        self.connect(self.CONTROL_GOOGLE_BTN, SIGNAL('clicked()'),
                     lambda: self.BROWSER.load(QUrl(self.GOOGLE_LNK)))

        # STATUS-BAR
        self.STATUS_BAR = QLineEdit("status-bar", self)
        self.STATUS_BAR.setGeometry(6, 585 - 27, 950, 27)
        self.STATUS_BAR.setStyleSheet(
            "QLineEdit{ background-color: #333; color: #fff; padding-left: 10px; border-style: none; }"
        )

        # -------------------------------------------------------------------
        self.setMouseTracking(True)

        self.MOUSE_X = 0
        self.MOUSE_Y = 0

        #self.load(QUrl('https://www.bitstamp.net/market/tradeview/'))
        #self.load(QUrl('https://www.bitstamp.net/'))
        #self.load(QUrl('https://btc-e.com/'))
        #self.BROWSER.load(QUrl('https://google.com/'))

        # -------------------------------------------------------------------
        self.INTI()
        # -------------------------------------------------------------------

    # =======================================================================
    def INTI(self):

        # -------------------------------------------------------------------
        #self.GET_CALENDER();
        pass
        # -------------------------------------------------------------------

    # =======================================================================
    def PAGE_LOADPROGRESS(self, _int_pr):

        # -------------------------------------------------------------------
        #loadProgress (int)
        #print(_int_pr);
        pass
        # -------------------------------------------------------------------

    # =======================================================================
    def LINK_HOVERED(self, _link):

        # -------------------------------------------------------------------
        self.STATUS_BAR.setText(_link)
        print(_link)
        # -------------------------------------------------------------------

    # =======================================================================
    def LINK_CLICKED(self, _link):

        # -------------------------------------------------------------------
        _link = str(_link.toString())
        self.HISTORY.append(_link)
        self.URL_BAR.setText(_link)
        # -------------------------------------------------------------------

    # =======================================================================
    def GET_CALENDER(self):

        # -------------------------------------------------------------------
        style = "ecoDayBackground=%23000000&"
        style += "defaultFont=%23333333&"
        style += "innerBorderColor=%2300FF00&"
        style += "borderColor=%23000000&"
        style += "ecoDayFontColor=%23FFFFFF&"

        self.MACRO_CALENDER_DATA = """
            <!DOCTYPE html>
            <html lang="en-US">
            <!-- =============================================================================== -->
            <head>

                <!-- ............................................. -->
                <meta charset="utf-8"/>
                <title>Экономический онлайн-календарь</title>

                <!--
                <link rel="stylesheet" type="text/css" href="css/ids.css">
                <script type="text/javascript" src="js/temax-main.js"></script>
                -->
                <script type="text/javascript">

                    window.addEventListener("load", function(){  

                        //alert("Yes we can");

                    });


                </script>

            </head>
            <!-- =============================================================================== -->
            <body>

                <iframe src="http://ec.ru.forexprostools.com?""" + style + """columns=exc_flags,exc_currency,exc_importance,exc_actual,exc_forecast,exc_previous&features=datepicker,timezone&countries=25,4,17,39,72,26,10,6,37,97,96,43,56,36,5,61,22,12,89,110,35&calType=week&timeZone=58&lang=7" width="943" height="450" frameborder="0" allowtransparency="true" marginwidth="0" marginheight="0"> <a href="http://google.com">GOOGLE</a> </iframe>
                <div class="poweredBy" style="font-family: Arial, Helvetica, sans-serif;">
                    <span style="font-size: 11px;color: #333333;text-decoration: none;">
                        <a href="http://ru.investing.com/" rel="nofollow" target="_blank" style="font-size: 11px;color: #06529D; font-weight: bold;" class="underline_link">Investing.com</a>
                    </span>
                </div>

            </body>
            <!-- =============================================================================== -->
            </html>
        """

        self.BROWSER.setHtml(self.MACRO_CALENDER_DATA)
        # -------------------------------------------------------------------

    # =======================================================================
    def AA(self):

        # -------------------------------------------------------------------
        self.BROWSER.stop()
        self.BROWSER.reload()
        #self.BROWSER.print();

        self.BROWSER.back()
        self.BROWSER.forward()
        #QWebHistory self.BROWSER.history();

        # -------------------------------------------------------------------
        self.BROWSER.history()
        # -------------------------------------------------------------------

    # =======================================================================
    def GO_TO(self):

        # -------------------------------------------------------------------
        self.BROWSER.load(QUrl(str(self.URL_BAR.text()).strip()))
        self.update()
        # -------------------------------------------------------------------
        #print( self.BROWSER.history() );
        # -------------------------------------------------------------------

    # =======================================================================
    @pyqtSlot(str)
    def showMessage(self, message):

        # -------------------------------------------------------------------
        print "Message from website:", message
        # -------------------------------------------------------------------

    # =======================================================================
    @pyqtSlot()
    def on_loadFinished(self):

        # -------------------------------------------------------------------
        pass
Пример #5
0
class WebViewWidget(QtGui.QWidget):
    """
    Descript. :
    """
    def __init__(self, parent):
        """
        Descript. :
        """
        QtGui.QWidget.__init__(self, parent)

        self.home_url = None

        self.navigation_bar = QtGui.QWidget(self)
        self.url_ledit = QtGui.QLineEdit(self.navigation_bar)
        self.url_ledit.setReadOnly(True)
        self.home_button = QtGui.QPushButton(self.navigation_bar)
        self.back_button = QtGui.QPushButton(self.navigation_bar)
        self.forward_button = QtGui.QPushButton(self.navigation_bar)

        self.home_button.setIcon(Qt4_Icons.load_icon("Home2"))
        self.back_button.setIcon(Qt4_Icons.load_icon("Left2"))
        self.forward_button.setIcon(Qt4_Icons.load_icon("Right2"))

        if QWEBVIEW_AVAILABLE:
            self.web_page_viewer = QWebView(self)

        _navigation_bar_hlayout = QtGui.QHBoxLayout(self.navigation_bar)
        _navigation_bar_hlayout.addWidget(self.home_button)
        _navigation_bar_hlayout.addWidget(self.back_button)
        _navigation_bar_hlayout.addWidget(self.forward_button)
        _navigation_bar_hlayout.addWidget(self.url_ledit)
        _navigation_bar_hlayout.setSpacing(2)
        _navigation_bar_hlayout.setContentsMargins(2, 2, 2, 2)

        _main_vlayout = QtGui.QVBoxLayout(self)
        _main_vlayout.addWidget(self.navigation_bar)
        _main_vlayout.addWidget(self.web_page_viewer)
        _main_vlayout.setSpacing(2)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)

        self.web_page_viewer.setSizePolicy(QtGui.QSizePolicy.Expanding,
                                           QtGui.QSizePolicy.Expanding)

        self.home_button.clicked.connect(self.go_to_home_page)
        self.back_button.clicked.connect(self.go_back)
        self.forward_button.clicked.connect(self.go_forward)

    def set_url(self, url):
        """
        """
        if QWEBVIEW_AVAILABLE:
            self.home_url = url
            self.navigation_bar.setEnabled(True)
            self.go_to_home_page()

    def set_static_page(self, html_text):
        """
        """
        if QWEBVIEW_AVAILABLE:
            self.web_page_viewer.setHtml(html_text)
            self.navigation_bar.setEnabled(False)

    def go_to_home_page(self):
        """
        """
        self.url_ledit.setText(self.home_url)
        self.web_page_viewer.load(QtCore.QUrl(self.home_url))

    def go_back(self):
        """
        """
        if QWEBVIEW_AVAILABLE:
            self.web_page_viewer.back()

    def go_forward(self):
        """
        """
        if QWEBVIEW_AVAILABLE:
            self.web_page_viewer.forward()
Пример #6
0
class Browser(QFrame):

    # =======================================================================
    def __init__(self, parent=None, _PARENT=None):

        # -------------------------------------------------------------------
        QFrame.__init__(self, parent);

        _SIZE                               = [3, 5, 975, 585];

        self.setGeometry( _SIZE[0], _SIZE[1], _SIZE[2], _SIZE[3] );
        self.PARENT                         = _PARENT;
        self.CONF                           = _PARENT.CONF;

        self.setStyleSheet( "QFrame{ font: 12px 'monospace'; color: #000; background-color: transparent; background-image: url('./data/imgs/TAB_Browser.png'); }" );

        # -------------------------------------------------------------------
        self.BROWSER                    = QWebView(self);
        self.BROWSER.setGeometry(6, 83, 963, 500);
        self.BROWSER.page().setLinkDelegationPolicy( QWebPage.DelegateAllLinks );
        #self.BROWSER.loadFinished.connect( self.on_loadFinished );

        self.connect( self.BROWSER.page(), SIGNAL('linkClicked (QUrl)'), self.LINK_CLICKED );
        self.connect( self.BROWSER.page(), SIGNAL('loadProgress (int)'), self.PAGE_LOADPROGRESS );
        # void linkHovered (const QString&,const QString&,const QString&)
        self.connect( self.BROWSER.page(), SIGNAL('linkHovered (QString, QString, QString)'), self.LINK_HOVERED );


        #self.BROWSER.load(QUrl.fromUserInput(sys.argv[1]))

        # -------------------------------------------------------------------
        self.HISTORY                        = [];
        # -------------------------------------------------------------------
        # CONTROLS

        # BACK
        self.CONTROL_BACK_BTN               = QPushButton("", self);
        self.CONTROL_BACK_BTN.setGeometry(11, 15, 43, 34);
        self.CONTROL_BACK_BTN.setStyleSheet("QPushButton{ background-color: transparent; border-style: none; }")
        self.connect( self.CONTROL_BACK_BTN, SIGNAL('clicked()') , self.BROWSER.back );

        # STOP
        self.CONTROL_STOP_BTN               = QPushButton("", self);
        self.CONTROL_STOP_BTN.setGeometry(55, 15, 49, 34);
        self.CONTROL_STOP_BTN.setStyleSheet("QPushButton{ background-color: transparent; border-style: none; }")
        self.connect( self.CONTROL_STOP_BTN, SIGNAL('clicked()') , self.BROWSER.stop );

        # RELOAD
        self.CONTROL_RELOAD_BTN             = QPushButton("", self);
        self.CONTROL_RELOAD_BTN.setGeometry(105, 15, 52, 34);
        self.CONTROL_RELOAD_BTN.setStyleSheet("QPushButton{ background-color: transparent; border-style: none; }")
        self.connect( self.CONTROL_RELOAD_BTN, SIGNAL('clicked()') , self.BROWSER.reload );

        # FOREWARDE
        self.CONTROL_FOREWARDE_BTN          = QPushButton("", self);
        self.CONTROL_FOREWARDE_BTN.setGeometry(158, 15, 43, 34);
        self.CONTROL_FOREWARDE_BTN.setStyleSheet("QPushButton{ background-color: transparent; border-style: none; }")
        self.connect( self.CONTROL_FOREWARDE_BTN, SIGNAL('clicked()') , self.BROWSER.forward );
        
        # URL-BAR
        self.URL_BAR                        = QLineEdit("tradingview.com/chart/BNC1/BLX/YFDnalUh-The-Road-to-Obsolescence-A-Seven-Year-Cycle-in-Bitcoin/, https://www.bitstamp.net/, https://blockchain.info/charts/market-cap/", self); 
        self.URL_BAR.setGeometry(6, 55, 950, 27);
        self.URL_BAR.setPlaceholderText("bitstamp.net, blockchain.info/charts/market-cap/");
        self.URL_BAR.setStyleSheet("QLineEdit{ background-color: #222; color: #fff; padding-left: 10px; border-style: none; }");
        self.connect( self.URL_BAR, SIGNAL('returnPressed ()') , self.GO_TO );

        # CALENDER
        self.CONTROL_CALENDER_BTN           = QPushButton("", self);
        self.CONTROL_CALENDER_BTN.setGeometry(769, 15, 43, 34);
        self.CONTROL_CALENDER_BTN.setStyleSheet("QPushButton{ background-color: transparent; border-style: none; }")
        self.connect( self.CONTROL_CALENDER_BTN, SIGNAL('clicked()') , self.GET_CALENDER );

        # BC-E HOME
        self.BTCE_HOME_LNK                  = "https://btc-e.com/exchange/ltc_usd";
        self.CONTROL_BTCE_HOME_BTN          = QPushButton("", self);
        self.CONTROL_BTCE_HOME_BTN.setGeometry(812, 15, 49, 34);
        self.CONTROL_BTCE_HOME_BTN.setStyleSheet("QPushButton{ background-color: transparent; border-style: none; }")
        self.connect( self.CONTROL_BTCE_HOME_BTN, SIGNAL('clicked()') , lambda: self.BROWSER.load( QUrl( self.BTCE_HOME_LNK )) );

        # BLOCKCHAIN
        self.BLOCKCHAIN_LNK                 = "https://blockchain.info/charts/market-cap/?showDataPoints=true&timespan=30days&show_header=false&daysAverageString=7&scale=1&address="; 
        self.CONTROL_BLOCKCHAIN_BTN         = QPushButton("", self);
        self.CONTROL_BLOCKCHAIN_BTN.setGeometry(862, 15, 53, 34);
        self.CONTROL_BLOCKCHAIN_BTN.setStyleSheet("QPushButton{ background-color: transparent; border-style: none; }")
        self.connect( self.CONTROL_BLOCKCHAIN_BTN, SIGNAL('clicked()') , lambda: self.BROWSER.load( QUrl( self.BLOCKCHAIN_LNK )) );

        # GOOGLE
        self.GOOGLE_LNK                     = "https://google.com/";
        self.CONTROL_GOOGLE_BTN             = QPushButton("", self);
        self.CONTROL_GOOGLE_BTN.setGeometry(913, 15, 43, 34);
        self.CONTROL_GOOGLE_BTN.setStyleSheet("QPushButton{ background-color: transparent; border-style: none; }")
        self.connect( self.CONTROL_GOOGLE_BTN, SIGNAL('clicked()') , lambda: self.BROWSER.load( QUrl( self.GOOGLE_LNK )) );


        # STATUS-BAR
        self.STATUS_BAR                      = QLineEdit("status-bar", self); 
        self.STATUS_BAR.setGeometry(6, 585-27, 950, 27);
        self.STATUS_BAR.setStyleSheet("QLineEdit{ background-color: #333; color: #fff; padding-left: 10px; border-style: none; }");
        
        # -------------------------------------------------------------------
        self.setMouseTracking(True);
        
        self.MOUSE_X                        = 0; 
        self.MOUSE_Y                        = 0; 


        #self.load(QUrl('https://www.bitstamp.net/market/tradeview/'))
        #self.load(QUrl('https://www.bitstamp.net/'))
        #self.load(QUrl('https://btc-e.com/'))
        #self.BROWSER.load(QUrl('https://google.com/'))

        # -------------------------------------------------------------------
        self.INTI();
        # -------------------------------------------------------------------
        

    # =======================================================================
    def INTI(self):

        # -------------------------------------------------------------------
        #self.GET_CALENDER();
        pass;
        # -------------------------------------------------------------------


    # =======================================================================
    def PAGE_LOADPROGRESS(self, _int_pr):

        # -------------------------------------------------------------------
        #loadProgress (int)
        #print(_int_pr);
        pass;
        # -------------------------------------------------------------------

    # =======================================================================
    def LINK_HOVERED(self, _link):

        # -------------------------------------------------------------------
        self.STATUS_BAR.setText( _link );
        print(_link);
        # -------------------------------------------------------------------

    # =======================================================================
    def LINK_CLICKED(self, _link):

        # -------------------------------------------------------------------
        _link = str(_link.toString());
        self.HISTORY.append( _link );
        self.URL_BAR.setText( _link );
        # -------------------------------------------------------------------

    # =======================================================================
    def GET_CALENDER(self):

        # -------------------------------------------------------------------
        style = "ecoDayBackground=%23000000&"
        style += "defaultFont=%23333333&";
        style += "innerBorderColor=%2300FF00&";
        style += "borderColor=%23000000&";
        style += "ecoDayFontColor=%23FFFFFF&";

        self.MACRO_CALENDER_DATA = """
            <!DOCTYPE html>
            <html lang="en-US">
            <!-- =============================================================================== -->
            <head>

                <!-- ............................................. -->
                <meta charset="utf-8"/>
                <title>Экономический онлайн-календарь</title>

                <!--
                <link rel="stylesheet" type="text/css" href="css/ids.css">
                <script type="text/javascript" src="js/temax-main.js"></script>
                -->
                <script type="text/javascript">

                    window.addEventListener("load", function(){  

                        //alert("Yes we can");

                    });


                </script>

            </head>
            <!-- =============================================================================== -->
            <body>

                <iframe src="http://ec.ru.forexprostools.com?"""+style+"""columns=exc_flags,exc_currency,exc_importance,exc_actual,exc_forecast,exc_previous&features=datepicker,timezone&countries=25,4,17,39,72,26,10,6,37,97,96,43,56,36,5,61,22,12,89,110,35&calType=week&timeZone=58&lang=7" width="943" height="450" frameborder="0" allowtransparency="true" marginwidth="0" marginheight="0"> <a href="http://google.com">GOOGLE</a> </iframe>
                <div class="poweredBy" style="font-family: Arial, Helvetica, sans-serif;">
                    <span style="font-size: 11px;color: #333333;text-decoration: none;">
                        <a href="http://ru.investing.com/" rel="nofollow" target="_blank" style="font-size: 11px;color: #06529D; font-weight: bold;" class="underline_link">Investing.com</a>
                    </span>
                </div>

            </body>
            <!-- =============================================================================== -->
            </html>
        """

        self.BROWSER.setHtml( self.MACRO_CALENDER_DATA );
        # -------------------------------------------------------------------

    # =======================================================================
    def AA(self):

        # -------------------------------------------------------------------
        self.BROWSER.stop();
        self.BROWSER.reload();
        #self.BROWSER.print();

        self.BROWSER.back();
        self.BROWSER.forward();
        #QWebHistory self.BROWSER.history();

        # -------------------------------------------------------------------
        self.BROWSER.history()
        # -------------------------------------------------------------------

    # =======================================================================
    def GO_TO(self):

        # -------------------------------------------------------------------
        self.BROWSER.load(QUrl( str(self.URL_BAR.text()).strip() ));
        self.update();
        # -------------------------------------------------------------------
        #print( self.BROWSER.history() );
        # -------------------------------------------------------------------
    # =======================================================================
    @pyqtSlot(str)  
    def showMessage(self, message):

        # -------------------------------------------------------------------
        print "Message from website:", message
        # -------------------------------------------------------------------

    # =======================================================================
    @pyqtSlot()
    def on_loadFinished(self):

        # -------------------------------------------------------------------
        pass;