Changeset 502:4c67de476ea3 in qutecom-2.2


Ignore:
Timestamp:
Feb 23, 2010 12:39:31 AM (3 years ago)
Author:
laurent@…
Branch:
default
Message:

bug fix : chat theme on windows

Location:
wengophone/src/presentation/qt
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wengophone/src/presentation/qt/QtBrowserWidget.cpp

    r491 r502  
    167167                //} 
    168168        }*/ 
    169         else if(surl.contains(ANCHOR_SECRET_PERMANENT)) 
    170         { 
    171                 openwengo_secret_permanent_signal(); 
    172         } 
    173         else if(surl.contains(ANCHOR_SFR_FR)) 
    174         { 
    175                 QDesktopServices::openUrl(QUrl("http://www.sfr.fr")); 
    176         } 
    177         else if(surl.contains(ANCHOR_MON_COMPTE)) 
    178         { 
    179                 QDesktopServices::openUrl(QUrl("http://www.sfr.fr/acces/index.jsp")); 
    180         } 
    181         else if(surl.contains(ANCHOR_REPONDEUR)) 
    182         { 
    183                 QDesktopServices::openUrl(QUrl("https://moncompte-neufbox.sfr.fr/moncompte-webapp/moncompte/servicesWeb/consulterMessagerie.action")); 
    184         } 
    185169} 
  • wengophone/src/presentation/qt/QtToolBar.cpp

    r499 r502  
    607607#if defined(OS_MACOSX) 
    608608        EnumToolBarMode::ToolBarMode toolBarMode = EnumToolBarMode::ToolBarModeIconsOnly; 
    609 #elif    
     609#else    
    610610        Config & config = ConfigManager::getInstance().getCurrentConfig(); 
    611611        std::string text = config.getToolBarMode(); 
  • wengophone/src/presentation/qt/chat/QtChatHistoryWidget.cpp

    r499 r502  
    7373        QUrl url_css("data:text/css;charset=utf-8;base64,"+file.readAll().toBase64()); 
    7474        page()->settings()->setUserStyleSheetUrl(url_css); 
    75         //QString css = _theme->getStyleSheet(); 
    76         //document()->setDefaultStyleSheet(css); 
    77          
    78         //QFile file_css(list_base.at(i)+"main.css"); 
    79         //file_css.open(QIODevice::ReadOnly); 
    80         //QUrl url_css("data:text/css;charset=utf-8;base64,"+css.toLatin1().toBase64()); 
    81         //page()->settings()->setUserStyleSheetUrl(url_css); 
    8275} 
    8376 
     
    163156        else 
    164157                _data += html; 
    165          
    166         setHtml(_data,QUrl("file://"+_theme->getCurrentThemePath())); 
    167         //scrollToBottom(); 
     158 
     159        updateHtml(); 
    168160} 
    169161 
     
    182174         
    183175        _data += html; 
    184         setHtml(_data,QUrl("file://"+_theme->getCurrentThemePath())); 
    185         //ensureCursorVisible(); 
     176 
     177        updateHtml();    
    186178} 
    187179 
     
    190182} 
    191183 
    192 QVariant QtChatHistoryWidget::loadResource(int type, const QUrl& url) { 
    193         /*if (type != QTextDocument::ImageResource || url.scheme() != "avatar") { 
     184/*QVariant QtChatHistoryWidget::loadResource(int type, const QUrl& url) { 
     185        if (type != QTextDocument::ImageResource || url.scheme() != "avatar") { 
    194186                return QTextBrowser::loadResource(type, url); 
    195187        } 
     
    218210        } 
    219211 
    220         return QVariant(pixmap);*/ 
    221 } 
     212        return QVariant(pixmap); 
     213}*/ 
    222214 
    223215void QtChatHistoryWidget::scrollToBottom() { 
     
    239231        scrollToBottom(); 
    240232} 
     233 
     234void QtChatHistoryWidget::updateHtml() 
     235{ 
     236#if defined(OS_WINDOWS) 
     237        setHtml(_data,QUrl(_theme->getCurrentThemePath())); 
     238#else 
     239        setHtml(_data,QUrl("file://"+_theme->getCurrentThemePath())); 
     240#endif 
     241} 
  • wengophone/src/presentation/qt/chat/QtChatHistoryWidget.h

    r499 r502  
    6363         * Overloaded to implement avatar loading 
    6464         */ 
    65         virtual QVariant loadResource(int type, const QUrl& url); 
     65        //virtual QVariant loadResource(int type, const QUrl& url); 
    6666 
    6767        void setAvatarPixmap(const QString& name, const QPixmap& pixmap); 
     
    8181         
    8282private: 
     83        void updateHtml(); 
     84 
    8385        QString _data; 
    8486         
  • wengophone/src/presentation/qt/chat/QtChatTheme.cpp

    r499 r502  
    7171        if (baseDir.isEmpty()) { 
    7272                Config & config = ConfigManager::getInstance().getCurrentConfig(); 
    73                 baseDir = QString::fromUtf8(config.getResourcesDir().c_str()) 
    74                         + "/chat/"; 
     73                baseDir = QString::fromUtf8(config.getResourcesDir().c_str()); 
     74 
     75#if defined(OS_WINDOWS) 
     76                baseDir = baseDir.replace("\\","/"); 
     77#endif 
     78                baseDir += "/chat/"; 
    7579        } 
    7680        return baseDir; 
Note: See TracChangeset for help on using the changeset viewer.