mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-05 23:49:20 +00:00
Port to the new snapshot.
Quite bad that menus and icons don't work... svn path=/trunk/playground/graphics/okular/; revision=557452
This commit is contained in:
parent
09f8a96671
commit
12e7a137d2
2
part.cpp
2
part.cpp
|
@ -510,7 +510,7 @@ bool Part::slotImportPSFile()
|
|||
return false;
|
||||
}
|
||||
|
||||
KUrl url = KFileDialog::getOpenURL( QString::null, "application/postscript" );
|
||||
KUrl url = KFileDialog::getOpenURL( KUrl(), "application/postscript", this->widget() );
|
||||
KTempFile tf( QString::null, ".pdf" );
|
||||
|
||||
if ( tf.status() == 0 && url.isLocalFile())
|
||||
|
|
6
part.h
6
part.h
|
@ -23,7 +23,7 @@
|
|||
#include "core/observer.h"
|
||||
#include "core/document.h"
|
||||
|
||||
#include <dbus/qdbus.h>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
class QAction;
|
||||
class QWidget;
|
||||
|
@ -81,8 +81,8 @@ public:
|
|||
static KAboutData* createAboutData();
|
||||
|
||||
public slots: // dbus
|
||||
Q_SCRIPTABLE Q_ASYNC void goToPage(uint page);
|
||||
Q_SCRIPTABLE Q_ASYNC void openDocument(KUrl doc);
|
||||
Q_SCRIPTABLE Q_NOREPLY void goToPage(uint page);
|
||||
Q_SCRIPTABLE Q_NOREPLY void openDocument(KUrl doc);
|
||||
Q_SCRIPTABLE uint pages();
|
||||
Q_SCRIPTABLE uint currentPage();
|
||||
Q_SCRIPTABLE KUrl currentDocument();
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <kdebug.h>
|
||||
#include <kmessagebox.h>
|
||||
|
||||
#include <dbus/qdbus.h>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
// system includes
|
||||
#include <math.h>
|
||||
|
@ -1382,7 +1382,7 @@ if (d->document->handleEvent( e ) )
|
|||
else if ( choice == imageToFile )
|
||||
{
|
||||
// [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() )
|
||||
d->messageWindow->display( i18n( "File not saved." ), PageViewMessage::Warning );
|
||||
else
|
||||
|
@ -1415,8 +1415,13 @@ if (d->document->handleEvent( e ) )
|
|||
// Albert says is this ever necessary?
|
||||
// we already attached on Part constructor
|
||||
// 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
|
||||
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;
|
||||
if (KToolInvocation::startServiceByDesktopName("kttsd", QStringList(), &error))
|
||||
|
@ -1448,9 +1453,9 @@ if (d->document->handleEvent( e ) )
|
|||
client->send("kttsd", "KSpeech", "startText(uint)", data2 );
|
||||
}*/
|
||||
#warning this is probably wrong, check when kttsd is dbus ported
|
||||
QDBusInterfacePtr kspeech("org.kde.kttsd", "/modules/KSpeech", "org.kde.KSpeech");
|
||||
kspeech->call("setText", selectedText, QString());
|
||||
kspeech->call("startText", 0);
|
||||
QDBusInterface kspeech("org.kde.kttsd", "/modules/KSpeech", "org.kde.KSpeech");
|
||||
kspeech.call("setText", selectedText, QString());
|
||||
kspeech.call("startText", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue