24 #include <tdeaboutdata.h>
25 #include <tdeapplication.h>
27 #include <tdehtml_part.h>
28 #include <tdehtmlview.h>
29 #include <kiconloader.h>
30 #include <tdelocale.h>
32 #include <kstandarddirs.h>
34 #include "aboutpage.h"
36 static TQString readFile( const TQString &fileName )
38 TQFile file( fileName );
39 if ( !file.open( IO_ReadOnly ) ) {
40 kdDebug() << "Unable to open file '" << fileName << "'" << endl;
44 TQString content = TQString::fromUtf8( file.readAll() );
51 AboutPage::AboutPage( TQWidget *parent )
52 : TQWidget( parent, "AboutPage" )
54 TQVBoxLayout *layout = new TQVBoxLayout( this );
56 TQString location = locate( "data", "kitchensync/about/main.html" );
57 TQString content = readFile( location );
58 content = content.arg( locate( "data", "libtdepim/about/kde_infopage.css" ) );
59 if ( kapp->reverseLayout() )
60 content = content.arg( "@import \"%1\";" ).arg( locate( "data", "libtdepim/about/kde_infopage_rtl.css" ) );
62 content = content.arg( "" );
64 TDEHTMLPart *part = new TDEHTMLPart( this );
65 layout->addWidget( part->view() );
67 part->begin( KURL( location ) );
69 TQString appName( i18n( "TDE KitchenSync" ) );
70 TQString catchPhrase( i18n( "Get Synchronized!" ) );
71 TQString quickDescription( i18n( "The TDE Synchronization Tool" ) );
73 part->write( content.arg( TQFont().pointSize() + 2 ).arg( appName )
74 .arg( catchPhrase ).arg( quickDescription ).arg( htmlText() ) );
77 connect( part->browserExtension(),
78 TQT_SIGNAL( openURLRequest( const KURL&, const KParts::URLArgs& ) ),
79 TQT_SLOT( handleUrl( const KURL& ) ) );
81 connect( part->browserExtension(),
82 TQT_SIGNAL( createNewWindow( const KURL&, const KParts::URLArgs& ) ),
83 TQT_SLOT( handleUrl( const KURL& ) ) );
86 void AboutPage::handleUrl( const KURL &url )
88 if ( url.protocol() == "exec" ) {
89 if ( url.path() == "/addGroup" )
92 new KRun( url, this );
95 TQString AboutPage::htmlText() const
97 TDEIconLoader *iconloader = TDEGlobal::iconLoader();
98 int iconSize = iconloader->currentSize( TDEIcon::Desktop );
100 TQString handbook_icon_path = iconloader->iconPath( "contents2", TDEIcon::Desktop );
101 TQString html_icon_path = iconloader->iconPath( "text-html", TDEIcon::Desktop );
102 TQString wizard_icon_path = iconloader->iconPath( "wizard", TDEIcon::Desktop );
104 TQString info = i18n( "<h2 style='text-align:center; margin-top: 0px;'>Welcome to KitchenSync %1</h2>"
106 "<table align=\"center\">"
107 "<tr><td><a href=\"%1\"><img width=\"%1\" height=\"%1\" src=\"%1\" /></a></td>"
108 "<td><a href=\"%1\">%1</a><br><span id=\"subtext\"><nobr>%1</td></tr>"
109 "<tr><td><a href=\"%1\"><img width=\"%1\" height=\"%1\" src=\"%1\" /></a></td>"
110 "<td><a href=\"%1\">%1</a><br><span id=\"subtext\"><nobr>%1</td></tr>"
111 "<tr><td><a href=\"%1\"><img width=\"%1\" height=\"%1\" src=\"%1\" /></a></td>"
112 "<td><a href=\"%1\">%1</a><br><span id=\"subtext\"><nobr>%1</td></tr>"
114 .arg( kapp->aboutData()->version() )
115 .arg( i18n( "KitchenSync synchronizes your e-mail, addressbook, calendar, to-do list and more." ) )
116 .arg( "help:/kitchensync" )
119 .arg( handbook_icon_path )
120 .arg( "help:/kitchensync" )
121 .arg( i18n( "Read Manual" ) )
122 .arg( i18n( "Learn more about KitchenSync and its components" ) )
123 .arg( "http://pim.kde.org" )
126 .arg( html_icon_path )
127 .arg( "http://pim.kde.org" )
128 .arg( i18n( "Visit KitchenSync Website" ) )
129 .arg( i18n( "Access online resources and tutorials" ) )
130 .arg( "exec:/addGroup" )
133 .arg( wizard_icon_path )
134 .arg( "exec:/addGroup" )
135 .arg( i18n( "Add Synchronization Group" ) )
136 .arg( i18n( "Create group of devices for synchronization" ) );
141 #include "aboutpage.moc"
|