Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 4675 → Rev 4676

/branches/Version13x/Scribus/scribus/helpbrowser.h
33,7 → 33,7
#include <qdialog.h>
#include <qstring.h>
#include <qlistview.h>
 
#include <qtextbrowser.h>
#include "scribusapi.h"
 
class QVBoxLayout;
42,7 → 42,6
class QSpacerItem;
class QTabWidget;
class QWidget;
class QTextBrowser;
class QToolButton;
class QPopupMenu;
class QSplitter;
82,7 → 81,23
int compare(QListViewItem *i, int col, bool asc) const;
};
 
/*! \brief Text browser widget used in help browser.
On Windows, launch automatically default browser when an http link is clicked
*/
class SCRIBUS_API TextBrowser : public QTextBrowser
{
Q_OBJECT
public:
TextBrowser(QWidget * parent = 0, const char * name = 0);
 
public slots:
/*! \brief Sets the name of the displayed document to name.
On Windows, the default web browser is launched if a web link is clicked
*/
virtual void setSource(const QString &name);
};
 
 
/*! \brief This is the Help dialog for Scribus. */
class SCRIBUS_API HelpBrowser : public QWidget
{
/branches/Version13x/Scribus/scribus/helpbrowser.cpp
67,6 → 67,11
#include "prefsmanager.h"
#include "prefsfile.h"
 
#if defined(_WIN32)
#include <windows.h>
#include <shellapi.h>
#endif
 
extern QPixmap loadIcon(QString nam);
 
 
183,6 → 188,29
return QListViewItem::compare(i, col, asc);
}
 
TextBrowser::TextBrowser(QWidget * parent, const char * name) : QTextBrowser(parent, name)
{
}
 
void TextBrowser::setSource(const QString &name)
{
#if defined(_WIN32)
int index = name.find( "http:/" );
if ( index >=0 )
{
QString url = name.right(name.length() - index);
//textBrowser->setSource( textBrowser->source() );
QT_WA( {
ShellExecute( winId(), 0, (TCHAR*)url.ucs2(), 0, 0, SW_SHOWNORMAL );
} , {
ShellExecuteA( winId(), 0, url.local8Bit(), 0, 0, SW_SHOWNORMAL );
} );
return;
}
#endif
QTextBrowser::setSource(name);
}
 
HelpBrowser::HelpBrowser( QWidget* parent, QString /*caption*/, QString guiLanguage, QString jumpToSection, QString jumpToFile)
: QWidget( parent, "Help", WType_TopLevel | WDestructiveClose | WGroupLeader )
{
288,7 → 316,7
bookmarksMainLayout->addLayout(bookmarksButtonLayout);
tabWidget->insertTab(tabBookmarks, tr("Book&marks"));
 
textBrowser = new QTextBrowser( splitter, "textBrowser" );
textBrowser = new TextBrowser( splitter, "textBrowser" );
textBrowser->setSizePolicy( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum, false ) );
textBrowser->setFrameShape( QTextBrowser::StyledPanel );
QMimeSourceFactory *textBrowserMSF=textBrowser->mimeSourceFactory();