Show
Ignore:
Timestamp:
04/18/08 09:40:19 (8 months ago)
Author:
eugene
Message:
  • Somewhat remade the chat settings page layout to make it look good in non-KDE mode;
  • fixed some typos;
  • simplified URL viewer invocation (no more signals);
  • made KDE mode be fully dependent on desktop setting of browser/mailer, while non-KDE mode can still fallback to daemon's settings in case Qt autodetection failes (current Qt rules could be found here: http://psi-im.org/wiki/Browser_X11).
Location:
trunk/qt4-gui/src/core
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt4-gui/src/core/licqgui.cpp

    r6153 r6160  
    4040#include <KDE/KUrl> 
    4141#else 
     42# include <QDesktopServices> 
    4243# include <QStyle> 
    4344# include <QStyleFactory> 
     45# include <QUrl> 
    4446#endif 
    4547 
     
    858860 
    859861  UserViewEvent* e = new UserViewEvent(id, ppid); 
    860   connect(e, SIGNAL(viewUrl(QWidget*, QString)), SLOT(viewUrl(QWidget*, QString))); 
    861862 
    862863  e->show(); 
     
    969970  if (e == NULL) return NULL; 
    970971 
    971   connect(e, SIGNAL(viewUrl(QWidget*, QString)), SLOT(viewUrl(QWidget*, QString))); 
    972  
    973972  QWidget* msgWindow = e; 
    974973  if (Config::Chat::instance()->tabbedChatting()) 
     
    10421041} 
    10431042 
    1044 void LicqGui::viewUrl(QWidget* parent, QString url) 
     1043void LicqGui::viewUrl(QString url) 
    10451044{ 
    10461045#ifdef USE_KDE 
     
    10481047    KToolInvocation::invokeMailer(KUrl(url)); 
    10491048  else 
    1050   // If no URL viewer is set, use KDE default 
    1051   if (!myLicqDaemon->getUrlViewer()) 
    10521049    KToolInvocation::invokeBrowser(url); 
    1053   else 
    10541050#else 
    1055   // If no URL viewer is set, try DEFAULT_URL_VIEWER (mozilla) 
    1056   if (!myLicqDaemon->getUrlViewer()) 
    1057     myLicqDaemon->setUrlViewer(DEFAULT_URL_VIEWER); 
     1051  if (!QDesktopServices::openUrl(QUrl(url))) 
     1052  { 
     1053    if (!myLicqDaemon->getUrlViewer()) 
     1054      myLicqDaemon->setUrlViewer(DEFAULT_URL_VIEWER); 
     1055    if (!myLicqDaemon->ViewUrl(url.toLocal8Bit().data())) 
     1056      WarnUser(NULL, tr("Licq is unable to start your browser and open the URL.\n" 
     1057            "You will need to start the browser and open the URL manually.")); 
     1058  } 
    10581059#endif 
    1059   { 
    1060     if (!myLicqDaemon->ViewUrl(url.toLocal8Bit().data())) 
    1061       WarnUser(parent, 
    1062           tr("Licq is unable to start your browser and open the URL.\n" 
    1063             "You will need to start the browser and open the URL manually.")); 
    1064   } 
    10651060} 
    10661061 
  • trunk/qt4-gui/src/core/licqgui.h

    r6153 r6160  
    194194  void changeStatus(unsigned long status, unsigned long ppid, bool invisible = false); 
    195195 
     196  /** 
     197   * Invoke the desktop-aware URL viewer 
     198   * 
     199   * @param url The URL to open 
     200   */ 
     201  void viewUrl(QString url); 
     202 
    196203public slots: 
    197204  /** 
     
    222229  void sendFileTransfer(QString id, unsigned long ppid, const QString& filename, const QString& description); 
    223230  void sendChatRequest(QString id, unsigned long ppid); 
    224  
    225   void viewUrl(QWidget* parent, QString url); 
    226231 
    227232private slots: