Commit 12e7a137 authored by Pino Toscano's avatar Pino Toscano

Port to the new snapshot.

Quite bad that menus and icons don't work...

svn path=/trunk/playground/graphics/okular/; revision=557452
parent 09f8a966
...@@ -510,7 +510,7 @@ bool Part::slotImportPSFile() ...@@ -510,7 +510,7 @@ bool Part::slotImportPSFile()
return false; return false;
} }
KUrl url = KFileDialog::getOpenURL( QString::null, "application/postscript" ); KUrl url = KFileDialog::getOpenURL( KUrl(), "application/postscript", this->widget() );
KTempFile tf( QString::null, ".pdf" ); KTempFile tf( QString::null, ".pdf" );
if ( tf.status() == 0 && url.isLocalFile()) if ( tf.status() == 0 && url.isLocalFile())
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "core/observer.h" #include "core/observer.h"
#include "core/document.h" #include "core/document.h"
#include <dbus/qdbus.h> #include <QtDBus/QtDBus>
class QAction; class QAction;
class QWidget; class QWidget;
...@@ -81,8 +81,8 @@ public: ...@@ -81,8 +81,8 @@ public:
static KAboutData* createAboutData(); static KAboutData* createAboutData();
public slots: // dbus public slots: // dbus
Q_SCRIPTABLE Q_ASYNC void goToPage(uint page); Q_SCRIPTABLE Q_NOREPLY void goToPage(uint page);
Q_SCRIPTABLE Q_ASYNC void openDocument(KUrl doc); Q_SCRIPTABLE Q_NOREPLY void openDocument(KUrl doc);
Q_SCRIPTABLE uint pages(); Q_SCRIPTABLE uint pages();
Q_SCRIPTABLE uint currentPage(); Q_SCRIPTABLE uint currentPage();
Q_SCRIPTABLE KUrl currentDocument(); Q_SCRIPTABLE KUrl currentDocument();
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <kdebug.h> #include <kdebug.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <dbus/qdbus.h> #include <QtDBus/QtDBus>
// system includes // system includes
#include <math.h> #include <math.h>
...@@ -1382,7 +1382,7 @@ if (d->document->handleEvent( e ) ) ...@@ -1382,7 +1382,7 @@ if (d->document->handleEvent( e ) )
else if ( choice == imageToFile ) else if ( choice == imageToFile )
{ {
// [3] save pixmap to file // [3] save pixmap to file
QString fileName = KFileDialog::getSaveFileName( QString::null, "image/png image/jpeg", this ); QString fileName = KFileDialog::getSaveFileName( KUrl(), "image/png image/jpeg", this );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
d->messageWindow->display( i18n( "File not saved." ), PageViewMessage::Warning ); d->messageWindow->display( i18n( "File not saved." ), PageViewMessage::Warning );
else else
...@@ -1415,8 +1415,13 @@ if (d->document->handleEvent( e ) ) ...@@ -1415,8 +1415,13 @@ if (d->document->handleEvent( e ) )
// Albert says is this ever necessary? // Albert says is this ever necessary?
// we already attached on Part constructor // we already attached on Part constructor
// If KTTSD not running, start it. // If KTTSD not running, start it.
#warning check if this is the right wat to check if a service is active
#warning need to check the name the kttsd service gets and fix it here #warning need to check the name the kttsd service gets and fix it here
if (!QDBus::sessionBus().busService()->nameHasOwner("org.kde.kttsd")) QDBusReply<bool> reply = QDBus::sessionBus().interface()->isServiceRegistered("org.kde.kttsd");
bool kttsdactive = false;
if ( reply.isValid() )
kttsdactive = reply.value();
if ( kttsdactive )
{ {
QString error; QString error;
if (KToolInvocation::startServiceByDesktopName("kttsd", QStringList(), &error)) if (KToolInvocation::startServiceByDesktopName("kttsd", QStringList(), &error))
...@@ -1448,9 +1453,9 @@ if (d->document->handleEvent( e ) ) ...@@ -1448,9 +1453,9 @@ if (d->document->handleEvent( e ) )
client->send("kttsd", "KSpeech", "startText(uint)", data2 ); client->send("kttsd", "KSpeech", "startText(uint)", data2 );
}*/ }*/
#warning this is probably wrong, check when kttsd is dbus ported #warning this is probably wrong, check when kttsd is dbus ported
QDBusInterfacePtr kspeech("org.kde.kttsd", "/modules/KSpeech", "org.kde.KSpeech"); QDBusInterface kspeech("org.kde.kttsd", "/modules/KSpeech", "org.kde.KSpeech");
kspeech->call("setText", selectedText, QString()); kspeech.call("setText", selectedText, QString());
kspeech->call("startText", 0); kspeech.call("startText", 0);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment