LookingGlassEffectConfig::LookingGlassEffectConfig(QWidget* parent, const QVariantList& args) :
    KCModule(EffectFactory::componentData(), parent, args)
{
    m_ui = new LookingGlassEffectConfigForm(this);

    QVBoxLayout* layout = new QVBoxLayout(this);

    layout->addWidget(m_ui);

    connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed()));
    connect(m_ui->radiusSpin, SIGNAL(valueChanged(int)), this, SLOT(changed()));

    // Shortcut config. The shortcut belongs to the component "kwin"!
    m_actionCollection = new KActionCollection(this, KComponentData("kwin"));

    m_actionCollection->setConfigGroup("LookingGlass");
    m_actionCollection->setConfigGlobal(true);

    KAction* a;
    a = static_cast< KAction* >(m_actionCollection->addAction(KStandardAction::ZoomIn));
    a->setProperty("isConfigurationAction", true);
    a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Plus));

    a = static_cast< KAction* >(m_actionCollection->addAction(KStandardAction::ZoomOut));
    a->setProperty("isConfigurationAction", true);
    a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Minus));

    a = static_cast< KAction* >(m_actionCollection->addAction(KStandardAction::ActualSize));
    a->setProperty("isConfigurationAction", true);
    a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_0));

    m_ui->editor->addCollection(m_actionCollection);
}
MouseMarkEffectConfig::MouseMarkEffectConfig(QWidget* parent, const QVariantList& args) :
    KCModule(EffectFactory::componentData(), parent, args)
{
    m_ui = new MouseMarkEffectConfigForm(this);

    m_ui->kcfg_LineWidth->setSuffix(ki18np(" pixel", " pixels"));

    QVBoxLayout* layout = new QVBoxLayout(this);

    layout->addWidget(m_ui);

    addConfig(MouseMarkConfig::self(), m_ui);

    // Shortcut config. The shortcut belongs to the component "kwin"!
    m_actionCollection = new KActionCollection(this, KComponentData("kwin"));

    KAction* a = static_cast< KAction* >(m_actionCollection->addAction("ClearMouseMarks"));
    a->setText(i18n("Clear Mouse Marks"));
    a->setProperty("isConfigurationAction", true);
    a->setGlobalShortcut(KShortcut(Qt::SHIFT + Qt::META + Qt::Key_F11));

    a = static_cast< KAction* >(m_actionCollection->addAction("ClearLastMouseMark"));
    a->setText(i18n("Clear Last Mouse Mark"));
    a->setProperty("isConfigurationAction", true);
    a->setGlobalShortcut(KShortcut(Qt::SHIFT + Qt::META + Qt::Key_F12));

    m_ui->editor->addCollection(m_actionCollection);

    load();
}
Beispiel #3
0
MouseMarkEffectConfig::MouseMarkEffectConfig(QWidget* parent, const QVariantList& args) :
        KCModule(EffectFactory::componentData(), parent, args)
    {
    m_ui = new MouseMarkEffectConfigForm(this);

    QVBoxLayout* layout = new QVBoxLayout(this);

    layout->addWidget(m_ui);

    connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed()));
    connect(m_ui->spinWidth, SIGNAL(valueChanged(int)), this, SLOT(changed()));
    connect(m_ui->comboColors, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()));

    // Shortcut config. The shortcut belongs to the component "kwin"!
    m_actionCollection = new KActionCollection( this, KComponentData("kwin") );

    KAction* a = static_cast< KAction* >( m_actionCollection->addAction( "ClearMouseMarks" ));
    a->setText( i18n( "Clear Mouse Marks" ));
    a->setProperty("isConfigurationAction", true);
    a->setGlobalShortcut( KShortcut( Qt::SHIFT + Qt::META + Qt::Key_F11 ));

    a = static_cast< KAction* >( m_actionCollection->addAction( "ClearLastMouseMark" ));
    a->setText( i18n( "Clear Last Mouse Mark" ));
    a->setProperty("isConfigurationAction", true);
    a->setGlobalShortcut( KShortcut( Qt::SHIFT + Qt::META + Qt::Key_F12 ));

    m_ui->editor->addCollection(m_actionCollection);

    load();
    }
FormulaPart::FormulaPart(QObject *parent)
    : KoPart(parent)
{
    // Needed by KoDocument::nativeOasisMimeType().
    // KoEmbeddedDocumentSaver uses that method to
    // get the mimetype of the embedded document.
    setComponentData(KComponentData("math"));
}
Beispiel #5
0
void WicdApplet::notify(const QString &event, const QString &message) const
{
    if (m_status.State != 10) { //don't notify on startup
        KNotification *notify = new KNotification(event);
        notify->setText(message);
        notify->setComponentData(KComponentData("wicd-kde"));
        notify->sendEvent();
    }
}
Beispiel #6
0
void ActivityList::dataUpdated(const QString& source, const Plasma::DataEngine::Data& data)
{
    Q_UNUSED(source)
    Q_ASSERT(m_engine);
    
    int newItems = 0;

    foreach(const QString& key, data.keys()) {
        if (!data.value(key).value<Plasma::DataEngine::Data>().isEmpty()) {
            
            if (m_knownEvents.contains(source + data[key].value<Plasma::DataEngine::Data>().value("id").toString())) {
                continue;
            }
            
            QString id(source + data[key].value<Plasma::DataEngine::Data>().value("id").toString());
            QDateTime time(data[key].value<Plasma::DataEngine::Data>().value("timestamp").toDateTime());
            m_knownEvents.insert(id);

            ActivityWidget* widget = new ActivityWidget(m_engine, m_container);
            widget->setActivityData(data[key].value<Plasma::DataEngine::Data>());

            int i;
            for(i = 0; i < m_layout->count(); ++i) {
                ActivityWidget* widget = static_cast<ActivityWidget*>(m_layout->itemAt(i));
                if (time > widget->timestamp()) {
                    break;
                }
            }
            m_layout->insertItem(i, widget);
            
            ++newItems;
        }
    }
    
    while (m_layout->count() > m_limit) {
        ActivityWidget* widget = static_cast<ActivityWidget*>(m_layout->itemAt(m_layout->count()-1));
        m_layout->removeAt(m_layout->count()-1);
        widget->deleteLater();
    }
    
    // Don't mass-spam the user with notifications
    if (newItems < 4) {
        for(int i = 0; i<newItems; ++i) {
            ActivityWidget* widget = static_cast<ActivityWidget*>(m_layout->itemAt(i));
            KNotification* notification = new KNotification("activity");
            notification->setTitle("OpenDesktop Activities");
            notification->setText(widget->message());
            notification->setComponentData(KComponentData("plasma-applet-opendesktop-activities", "plasma-applet-opendesktop-activities", KComponentData::SkipMainComponentRegistration));
            notification->sendEvent();
        }
    }

    // Go to the top of the list
    setScrollPosition(QPointF(0, 0));
}
KopeteMessage_Test::KopeteMessage_Test()
{
	// change user data dir to avoid messing with user's .kde dir
	setenv( "KDEHOME", QFile::encodeName( QDir::homePath() + "/.kopete-unittest" ), true );

	// create fake objects needed to build a reasonable testeable message
	m_protocol = new Kopete::Test::Mock::Protocol( KComponentData(QByteArray("test-kopete-message")), 0L);
	m_account = new Kopete::Test::Mock::Account(m_protocol, "testaccount");
	m_metaContactMyself = new Kopete::Test::Mock::MetaContact();
	m_metaContactOther = new Kopete::Test::Mock::MetaContact();
	m_contactFrom = new Kopete::Test::Mock::Contact(m_account, QString::fromLatin1("test-myself"), m_metaContactMyself, QString());
	m_contactTo = new Kopete::Test::Mock::Contact(m_account, QString::fromLatin1("test-dest"), m_metaContactOther, QString());
}
Beispiel #8
0
extern "C" int Q_DECL_EXPORT kdemain(int argc, char **argv)
{
    // necessary to use other kio slaves
    QCoreApplication app(argc, argv);
    KComponentData("kio_recentdocuments", "kio_recentdocuments");
    KLocale::global();
    if (argc != 4) {
        fprintf(stderr, "Usage: kio_recentdocuments protocol domain-socket1 domain-socket2\n");
        exit(-1);
    }
    // start the slave
    RecentDocuments slave(argv[2], argv[3]);
    slave.dispatchLoop();
    return 0;
}
PresentWindowsEffectConfig::PresentWindowsEffectConfig(QWidget* parent, const QVariantList& args)
    :   KCModule(EffectFactory::componentData(), parent, args)
{
    m_ui = new PresentWindowsEffectConfigForm(this);

    QVBoxLayout* layout = new QVBoxLayout(this);

    layout->addWidget(m_ui);

    // Shortcut config. The shortcut belongs to the component "kwin"!
    m_actionCollection = new KActionCollection(this, KComponentData("kwin"));

    m_actionCollection->setConfigGroup("PresentWindows");
    m_actionCollection->setConfigGlobal(true);

    KAction* a = (KAction*) m_actionCollection->addAction("ExposeAll");
    a->setText(i18n("Toggle Present Windows (All desktops)"));
    a->setProperty("isConfigurationAction", true);
    a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F10));

    KAction* b = (KAction*) m_actionCollection->addAction("Expose");
    b->setText(i18n("Toggle Present Windows (Current desktop)"));
    b->setProperty("isConfigurationAction", true);
    b->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F9));

    KAction* c = (KAction*)m_actionCollection->addAction("ExposeClass");
    c->setText(i18n("Toggle Present Windows (Window class)"));
    c->setProperty("isConfigurationAction", true);
    c->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F7));

    m_ui->shortcutEditor->addCollection(m_actionCollection);

    connect(m_ui->shortcutEditor, SIGNAL(keyChange()), this, SLOT(changed()));

    addConfig(PresentWindowsConfig::self(), m_ui);

    load();
}
Beispiel #10
0
void KdePlugin::init()
{
	menu_creator_hook = kmenu_creator;
	KAboutData aboutData(QCoreApplication::applicationName().toUtf8(),
						 QByteArray(),
						 ki18n("qutIM Instant Messenger"),
						 QCoreApplication::applicationVersion().toUtf8());
	aboutData.setProgramIconName(QLatin1String("qutim"));
	aboutData.setHomepage("http://qutim.org");

	aboutData.setShortDescription(ki18n("Communicate over IM"));
	aboutData.addLicense(KAboutData::License_GPL_V3);
	aboutData.setBugAddress("https://bugs.launchpad.net/qutim/+filebug");
	aboutData.setOrganizationDomain(QCoreApplication::organizationDomain().toUtf8());
	KGlobal::setActiveComponent(KComponentData(aboutData));

	// Don't transfer options to KDE, we handle all of them ourself in ModuleManager
//	// Don't know better way to know application arguments from here
//	QStringList args = QCoreApplication::arguments();
//	int argc = args.count();
//	char **argv = (char **) malloc(sizeof(char *) * argc);
//	for (int i = 0; i < argc; i++)
//		argv[i] = qstrdup(args.at(i).toLocal8Bit().constData());
	// Whe shouldn't free memory because KCmdLineArgs stores pointers internally to it
	KCmdLineArgs::init(KGlobal::activeComponent().aboutData());

	ExtensionIcon kdeIcon("kde");
	addAuthor(QLatin1String("euroelessar"));
	addAuthor(QLatin1String("sauron"));
	setInfo(QT_TRANSLATE_NOOP("Plugin", "KDE integration"),
			QT_TRANSLATE_NOOP("Plugin", "Integration with K Desktop Environment"),
			KDE_VERSION << 8, kdeIcon);
	addExtension<KdeSystemIntegration>(QT_TRANSLATE_NOOP("Plugin", "KDE Integration"),
	                                   QT_TRANSLATE_NOOP("Plugin", "Full-featured integration with KDE"),
	                                   kdeIcon);
	addExtension<KdeEmoticons>(QT_TRANSLATE_NOOP("Plugin", "KDE Emoticons"),
							   QT_TRANSLATE_NOOP("Plugin", "Using KDE emoticons packs"),
							   kdeIcon);
	addExtension<KdeCrashHandler>(QT_TRANSLATE_NOOP("Plugin", "KDE Crash handler"),
								  QT_TRANSLATE_NOOP("Plugin", "Handles qutIM's craches by KCrash"),
								  kdeIcon);
	addExtension<KdeSpellerLayer>(QT_TRANSLATE_NOOP("Plugin", "KDE Spell checker"),
								  QT_TRANSLATE_NOOP("Plugin", ""),
								  kdeIcon);
	addExtension<KdeIconLoader>(QT_TRANSLATE_NOOP("Plugin", "KDE Icon engine"),
								QT_TRANSLATE_NOOP("Plugin", "Uses KDE Icon engine for providing icons"),
								kdeIcon);
	//deprecated
	//addExtension<KDENotificationLayer>(QT_TRANSLATE_NOOP("Plugin", "KDE Notifications"),
	//								   QT_TRANSLATE_NOOP("Plugin", "Uses KDE notifications"),
	//								   kdeIcon);
	addExtension<KdeTrayIcon>(QT_TRANSLATE_NOOP("Plugin", "KDE Status Notifier"),
							  QT_TRANSLATE_NOOP("Plugin", "Using new KDE DBus tray specification"),
							  kdeIcon);
	addExtension<AboutKdeDialog, StartupModule>(QT_TRANSLATE_NOOP("Plugin", "About KDE dialog"),
	                                            QT_TRANSLATE_NOOP("Plugin", "Show \"About KDE\" menu option"),
	                                            kdeIcon);
	addExtension<KdeAboutAppDialog>(QT_TRANSLATE_NOOP("Plugin", "KDE About application dialog"),
	                                QT_TRANSLATE_NOOP("Plugin", "Use kde-specific application about dialog"),
	                                kdeIcon);
}