Ejemplo n.º 1
0
TaskManager::TaskManager(QObject *parent, const char *name)
    : QObject(parent, name), _active(0), _startup_info( NULL )
{

    kwin_module = new KWinModule();

//    KGlobal::locale()->insertCatalogue("libtaskmanager");
    connect(kwin_module, SIGNAL(windowAdded(WId)), SLOT(windowAdded(WId)));
    connect(kwin_module, SIGNAL(windowRemoved(WId)), SLOT(windowRemoved(WId)));
    connect(kwin_module, SIGNAL(activeWindowChanged(WId)), SLOT(activeWindowChanged(WId)));
    connect(kwin_module, SIGNAL(currentDesktopChanged(int)), SLOT(currentDesktopChanged(int)));
    connect(kwin_module, SIGNAL(windowChanged(WId,unsigned int)), SLOT(windowChanged(WId,unsigned int)));

    // register existing windows
    const QValueList<WId> windows = kwin_module->windows();
    QValueList<WId>::ConstIterator end( windows.end() );
    for (QValueList<WId>::ConstIterator it = windows.begin(); it != end; ++it )
  windowAdded(*it);

    // set active window
    WId win = kwin_module->activeWindow();
    activeWindowChanged(win);

    configure_startup();
}
Ejemplo n.º 2
0
GamerToolkit::GamerToolkit(QObject *parent) :
    QObject(parent),
    bamfClient(),
    gameConfigurations(),
    activeWindow(0)
{
    // Create games
    gameConfigurations.append(new GameConfiguration("Team Fortress 2", "Team Fortress 2 - OpenGL", this));
    gameConfigurations.append(new GameConfiguration("Counter-Strike: Global Offensive", "Counter-Strike: Global Offensive - OpenGL", this));

    // Connect signals
    connect(&bamfClient, SIGNAL(activeWindowChanged(QString)), this, SLOT(activeWindowChanged(QString)));
}
Ejemplo n.º 3
0
void KviMainWindow::windowActivated(KviWindow * wnd, bool bForce)
{
	if(!wnd)
		return; // this can happen?

	// ASSERT(m_pWinList->findRef(wnd))
	// unless we want to bForce the active window to be re-activated
	if(g_pActiveWindow == wnd && !bForce)
		return;

	if(g_pActiveWindow != wnd)
	{
		if(g_pActiveWindow)
			g_pActiveWindow->lostUserFocus();
		g_pActiveWindow = wnd;
	}

	updateWindowTitle(wnd);

	m_pWindowList->setActiveItem(wnd->windowListItem());

	bool bActiveContextChanged = (m_pActiveContext != wnd->context());
	m_pActiveContext = wnd->context();

	if(g_pActiveWindow->view())
		g_pActiveWindow->view()->clearUnreaded();

	emit activeWindowChanged();
	if(bActiveContextChanged)
		emit activeContextChanged();

	KVS_TRIGGER_EVENT_0(KviEvent_OnWindowActivated, wnd);
}
void PlasmoidWrapper::setApplet(QObject *extender)
{
    Plasma::Extender *appletExtender = static_cast<Plasma::Extender *>(extender);

    if(appletExtender){
        Plasma::Applet *applet = appletExtender->applet();
        if(applet){

            Plasma::PackageStructure::Ptr structure = Plasma::Applet::packageStructure();
            const QString workflowPath = KGlobal::dirs()->locate("data", structure->defaultPackageRoot() + "/workflow/");
            Plasma::Package package(workflowPath, structure);

            m_version = package.metadata().version();
            emit versionChanged(m_version);

            m_popupApplet = static_cast<Plasma::PopupApplet *>(applet);

            if(m_popupApplet->containment()){
                m_isInPanel = (m_popupApplet->containment()->containmentType() == Plasma::Containment::PanelContainment);
                emit isInPanelChanged(m_isInPanel);

                connect(m_popupApplet,SIGNAL(geometryChanged()),this,SLOT(geometryChangedSlot()));

                connect(KWindowSystem::self(),SIGNAL(activeWindowChanged(WId)),this,SLOT(activeWindowChangedSlot(WId)));
            }
        }

        delete extender;
    }
}
Ejemplo n.º 5
0
void window_list::handlePropertyNotify(XPropertyEvent* event)
{
    if (event->window == QX11Info::appRootWindow())
    {
        // Windows list changed ...............................
        if (event->atom == XfitMan::atom("_NET_CLIENT_LIST"))
        {
            refreshTaskList();
            return;
        }

        // Activate window ....................................
        if (event->atom == XfitMan::atom("_NET_ACTIVE_WINDOW"))
        {
            activeWindowChanged();
            return;
        }

        // Desktop switch .....................................
        if (event->atom == XfitMan::atom("_NET_CURRENT_DESKTOP"))
        {
            if (this->onlyShowCurrentDesktop)
                refreshTaskList();
            return;
        }
    }
    else
    {
        InstanceOfWindow* btn = buttonByWindow(event->window);
        if (btn)
            btn->handlePropertyNotify(event);
    }
    this->activeWindowChanged();

}
Ejemplo n.º 6
0
KPager::KPager(KPagerMainWindow *parent, const char *name)
	: QFrame (parent, name, WStyle_Customize | WStyle_NoBorder | WStyle_Tool)
    , m_layout(0)
    , m_mnu(0)
    , m_smnu(0)
    , m_dmnu(0)
{
    m_windows.setAutoDelete(true); // delete windows info after removal

    setBackgroundColor( black );
    m_winmodule=new KWinModule(this);
    m_currentDesktop=m_winmodule->currentDesktop();

    m_grabWinTimer=new QTimer(this,"grabWinTimer");
    connect(m_grabWinTimer, SIGNAL(timeout()), this, SLOT(slotGrabWindows()));

    KPagerConfigDialog::initConfiguration();

    KConfig *cfg = kapp->config();
    cfg->setGroup("KPager");
    m_showStickyOption=cfg->readBoolEntry("ShowStickyOption",false);

    int numberOfDesktops=m_winmodule->numberOfDesktops();
    for (int i=0;i<numberOfDesktops;i++)
    {
        Desktop *dsk=new Desktop(i+1,m_winmodule->desktopName(i),this);
        m_desktops.append(dsk);
    }

    m_layoutType=static_cast<enum KPager::LayoutTypes>( KPagerConfigDialog::m_layoutType );

    connect( m_winmodule, SIGNAL( activeWindowChanged(WId)),
             SLOT(slotActiveWindowChanged(WId)));
    connect( m_winmodule, SIGNAL( windowAdded(WId) ),
             SLOT( slotWindowAdded(WId) ) );
    connect( m_winmodule, SIGNAL( windowRemoved(WId) ),
             SLOT( slotWindowRemoved(WId) ) );
    connect( m_winmodule, SIGNAL( windowChanged(WId,unsigned int) ),
             SLOT( slotWindowChanged(WId,unsigned int) ) );
    connect( m_winmodule, SIGNAL( stackingOrderChanged() ),
             SLOT( slotStackingOrderChanged() ) );
    connect( m_winmodule, SIGNAL( desktopNamesChanged() ),
             SLOT( slotDesktopNamesChanged() ) );
    connect( m_winmodule, SIGNAL( numberOfDesktopsChanged(int) ),
             SLOT( slotNumberOfDesktopsChanged(int) ) );
    connect( m_winmodule, SIGNAL( currentDesktopChanged(int)),
             SLOT( slotCurrentDesktopChanged(int) ) );
    connect(kapp, SIGNAL(backgroundChanged(int)),
            SLOT(slotBackgroundChanged(int)));

    QFont defFont(KGlobalSettings::generalFont().family(), 10, QFont::Bold);
    defFont = cfg->readFontEntry("Font", &defFont);
    setFont(defFont);

    m_prefs_action = KStdAction::preferences(this, SLOT(configureDialog()), parent->actionCollection());
    m_quit_action = KStdAction::quit(kapp, SLOT(quit()), parent->actionCollection());

    updateLayout();
}
Ejemplo n.º 7
0
void LayoutMemory::registerListeners()
{
	if( keyboardConfig.switchingPolicy ==  KeyboardConfig::SWITCH_POLICY_WINDOW
			|| keyboardConfig.switchingPolicy ==  KeyboardConfig::SWITCH_POLICY_APPLICATION ) {
		connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), this, SLOT(windowChanged(WId)));
//		connect(KWindowSystem::self(), SIGNAL(windowRemoved(WId)), this, SLOT(windowRemoved(WId)));
	}
	if( keyboardConfig.switchingPolicy ==  KeyboardConfig::SWITCH_POLICY_DESKTOP ) {
		connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, SLOT(desktopChanged(int)));
	}
Ejemplo n.º 8
0
void RazorTaskBar::refreshTaskList()
{
    XfitMan xf = xfitMan();
    QList<Window> tmp = xf.getClientList();

    //qDebug() << "** Fill ********************************";
    //foreach (Window wnd, tmp)
    //    if (xf->acceptWindow(wnd)) qDebug() << XfitMan::debugWindow(wnd);
    //qDebug() << "****************************************";


    QMutableHashIterator<Window, RazorTaskButton*> i(mButtonsHash);
    while (i.hasNext())
    {
        i.next();
        int n = tmp.removeAll(i.key());

        if (!n)
        {
            delete i.value();
            i.remove();
        }
    }

    foreach (Window wnd, tmp)
    {
        if (xf.acceptWindow(wnd))
        {
            RazorTaskButton* btn = new RazorTaskButton(wnd, this);
            btn->setToolButtonStyle(mButtonStyle);
            if (buttonMaxWidth == -1)
            {
                btn->setMaximumWidth(btn->height());
            }
            else
            {
                btn->setMaximumWidth(buttonMaxWidth);
            }
            mButtonsHash.insert(wnd, btn);
            // -1 is here due the last stretchable item
            mLayout->insertWidget(layout()->count()-1, btn);
            // now I want to set higher stretchable priority for buttons
            // to suppress stretchItem (last item) default value which
            // will remove that anoying aggresive space at the end -- petr
            mLayout->setStretch(layout()->count()-2, 1);
        }
    }

    refreshButtonVisibility();

    activeWindowChanged();

}
Ejemplo n.º 9
0
WindowsHandler::WindowsHandler( bool enable_signal_P, QObject* parent_P )
    : QObject( parent_P ), signals_enabled( enable_signal_P ),
        _action_window( 0 ),
        m_isX11(QX11Info::isPlatformX11())
    {
    if( signals_enabled )
        {
        connect( KWindowSystem::self(), SIGNAL(windowAdded(WId)), SLOT(window_added_slot(WId)));
        connect( KWindowSystem::self(), SIGNAL(windowRemoved(WId)), SLOT(window_removed_slot(WId)));
        connect( KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)),
            SLOT(active_window_changed_slot(WId)));
        }
    }
Ejemplo n.º 10
0
void window_list::refreshTaskList()
{
    XfitMan xf = xfitMan();
    QList<Window> tmp = xf.getClientList();

    //qDebug() << "** Fill ********************************";
    //foreach (Window wnd, tmp)
    //    if (xf->acceptWindow(wnd)) qDebug() << XfitMan::debugWindow(wnd);
    //qDebug() << "****************************************";


    QMutableHashIterator<Window, InstanceOfWindow*> i(buttons);
    while (i.hasNext())
    {
        i.next();
        int n = tmp.removeAll(i.key());

        if (!n)
        {
            //delete i.value();
	    i.value()->deleteLater();
            i.remove();
        }
    }

    foreach (Window wnd, tmp)
    {
        if (xf.acceptWindow(wnd))
        {
            InstanceOfWindow* btn = new InstanceOfWindow(this,wnd);
            //btn->setToolButtonStyle();

            buttons.insert(wnd, btn);
            // -1 is here due the last stretchable item
            layout->insertWidget(layout->count()-1, btn);
            // now I want to set higher stretchable priority for buttons
            // to suppress stretchItem (last item) default value which
            // will remove that anoying aggresive space at the end -- petr
            layout->setStretch(layout->count()-2, 1);
	    //layout->addWidget(btn);
        }
    }
    setButtonMaxWidth();
    refreshButtonVisibility();

    activeWindowChanged();
    

}
Ejemplo n.º 11
0
void RazorTaskBar::handlePropertyNotify(XPropertyEvent* event)
{

    if (event->window == mRootWindow)
    {
        // Windows list changed ...............................
        if (event->atom == XfitMan::atom("_NET_CLIENT_LIST"))
        {
            refreshTaskList();
            return;
        }

        // Activate window ....................................
        if (event->atom == XfitMan::atom("_NET_ACTIVE_WINDOW"))
        {
            activeWindowChanged();
            return;
        }

        // Desktop switch .....................................
        if (event->atom == XfitMan::atom("_NET_CURRENT_DESKTOP"))
        {
            if (mShowOnlyCurrentDesktopTasks)
                refreshTaskList();
            return;
        }
    }
    else
    {
        RazorTaskButton* btn = buttonByWindow(event->window);
        if (btn)
            btn->handlePropertyNotify(event);
    }
//    char* aname = XGetAtomName(QX11Info::display(), event->atom);
//    qDebug() << "** XPropertyEvent ********************";
//    qDebug() << "  atom:       0x" << hex << event->atom
//            << " (" << (aname ? aname : "Unknown") << ')';
//    qDebug() << "  window:    " << XfitMan::debugWindow(event->window);
//    qDebug() << "  display:   " << event->display;
//    qDebug() << "  send_event:" << event->send_event;
//    qDebug() << "  serial:    " << event->serial;
//    qDebug() << "  state:     " << event->state;
//    qDebug() << "  time:      " << event->time;
//    qDebug();

}
Ejemplo n.º 12
0
LXQtTaskGroup::LXQtTaskGroup(const QString &groupName, QIcon icon, ILXQtPanelPlugin * plugin, LXQtTaskBar *parent)
    : LXQtTaskButton(0, parent, parent),
    mGroupName(groupName),
    mPopup(new LXQtGroupPopup(this)),
    mPlugin(plugin),
    mPreventPopup(false)
{
    Q_ASSERT(parent);

    setObjectName(groupName);
    setText(groupName);
    setIcon(icon);

    connect(this, SIGNAL(clicked(bool)), this, SLOT(onClicked(bool)));
    connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, SLOT(onDesktopChanged(int)));
    connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), this, SLOT(onActiveWindowChanged(WId)));
    connect(parent, &LXQtTaskBar::windowRemoved, this, &LXQtTaskGroup::onWindowRemoved);
}
Ejemplo n.º 13
0
void RazorTaskBar::refreshTaskList()
{
    XfitMan xf = xfitMan();
    QList<Window> tmp = xf.getClientList();

    //qDebug() << "** Fill ********************************";
    //foreach (Window wnd, tmp)
    //    if (xf->acceptWindow(wnd)) qDebug() << XfitMan::debugWindow(wnd);
    //qDebug() << "****************************************";


    QMutableHashIterator<Window, RazorTaskButton*> i(mButtonsHash);
    while (i.hasNext())
    {
        i.next();
        int n = tmp.removeAll(i.key());

        if (!n)
        {
            delete i.value();
            i.remove();
        }
    }

    foreach (Window wnd, tmp)
    {
        if (xf.acceptWindow(wnd))
        {
            RazorTaskButton* btn = new RazorTaskButton(wnd, this);
            btn->setToolButtonStyle(mButtonStyle);

            mButtonsHash.insert(wnd, btn);
            mLayout->addWidget(btn);
        }
    }
    refreshButtonVisibility();
    mLayout->invalidate();
    activeWindowChanged();
    realign();
}
Ejemplo n.º 14
0
Amor::Amor()
  : mAmor( 0 ),
    mBubble( 0 ),
    mForceHideAmorWidget( false )
{
    new AmorAdaptor( this );
    QDBusConnection::sessionBus().registerObject( QLatin1String( "/Amor" ), this );

    if( !readConfig() ) {
        qApp->quit();
    }

    mTargetWin   = 0;
    mNextTarget  = 0;
    mAmorDialog  = 0;
    mMenu        = 0;
    mCurrAnim    = mBaseAnim;
    mPosition    = mCurrAnim->hotspot().x();
    mState       = Normal;

    mWin = KWindowSystem::self();
    connect( mWin, SIGNAL(activeWindowChanged(WId)), this, SLOT(slotWindowActivate(WId)) );
    connect( mWin, SIGNAL(windowRemoved(WId)), this, SLOT(slotWindowRemove(WId)) );
    connect( mWin, SIGNAL(stackingOrderChanged()), this, SLOT(slotStackingChanged()) );
    connect( mWin, SIGNAL(windowChanged(WId,const ulong*)),
            this, SLOT(slotWindowChange(WId,const ulong*)) );
    connect( mWin, SIGNAL(currentDesktopChanged(int)), this, SLOT(slotDesktopChange(int)) );

    mAmor = new AmorWidget;
    connect( mAmor, SIGNAL(mouseClicked(QPoint)), SLOT(slotMouseClicked(QPoint)) );
    connect( mAmor, SIGNAL(dragged(QPoint,bool)), SLOT(slotWidgetDragged(QPoint,bool)) );
    mAmor->resize(mTheme.maximumSize());

    mTimer = new QTimer( this );
    connect( mTimer, SIGNAL(timeout()), SLOT(slotTimeout()) );

    mStackTimer = new QTimer( this );
    connect( mStackTimer, SIGNAL(timeout()), SLOT(restack()) );

    mBubbleTimer = new QTimer( this );
    connect( mBubbleTimer, SIGNAL(timeout()), SLOT(slotBubbleTimeout()) );

    std::time( &mActiveTime );
    mCursPos = QCursor::pos();
    mCursorTimer = new QTimer( this );
    connect( mCursorTimer, SIGNAL(timeout()), SLOT(slotCursorTimeout()) );
    mCursorTimer->start( 500 );

    if( mWin->activeWindow() ) {
        mNextTarget = mWin->activeWindow();
        selectAnimation( Focus );
        mTimer->setSingleShot( true );
        mTimer->start( 0 );
    }

    if( !QDBusConnection::sessionBus().connect( QString(), QString(), QLatin1String( "org.kde.amor" ),
            QLatin1String( "KDE_stop_screensaver" ), this, SLOT(screenSaverStopped()) ) )
    {
        kDebug(10000) << "Could not attach DBus signal: KDE_stop_screensaver()";
    }

    if( !QDBusConnection::sessionBus().connect( QString(), QString(), QLatin1String( "org.kde.amor" ),
            QLatin1String( "KDE_start_screensaver" ), this, SLOT(screenSaverStarted()) ) )
    {
        kDebug(10000) << "Could not attach DBus signal: KDE_start_screensaver()";
    }

    KStartupInfo::appStarted();
}
Ejemplo n.º 15
0
WindowsModel::WindowsModel (QObject *parent)
    : QAbstractItemModel (parent)
    , CurrentDesktop_ (Util::XWrapper::Instance ().GetCurrentDesktop ())
    , ImageProvider_ (new TaskbarImageProvider (QIcon::fromTheme ("xorg")))
{
    auto& w = Util::XWrapper::Instance ();
    auto windows = w.GetWindows ();
    for (auto wid : windows)
        AddWindow (wid, w);

    connect (&w,
             SIGNAL (windowListChanged ()),
             this,
             SLOT (updateWinList ()));
    connect (&w,
             SIGNAL (activeWindowChanged ()),
             this,
             SLOT (updateActiveWindow ()));

    connect (&w,
             SIGNAL (windowNameChanged (ulong)),
             this,
             SLOT (updateWindowName (ulong)));
    connect (&w,
             SIGNAL (windowIconChanged (ulong)),
             this,
             SLOT (updateWindowIcon (ulong)));
    connect (&w,
             SIGNAL (windowStateChanged (ulong)),
             this,
             SLOT (updateWindowState (ulong)));
    connect (&w,
             SIGNAL (windowActionsChanged (ulong)),
             this,
             SLOT (updateWindowActions (ulong)));
    connect (&w,
             SIGNAL (windowDesktopChanged (ulong)),
             this,
             SLOT (updateWindowDesktop (ulong)));
    connect (&w,
             SIGNAL (desktopChanged ()),
             this,
             SLOT (updateCurrentDesktop ()));

    QHash<int, QByteArray> roleNames;
    roleNames [Role::WindowName] = "windowName";
    roleNames [Role::WindowID] = "windowID";
    roleNames [Role::IconGenID] = "iconGenID";
    roleNames [Role::IsCurrentDesktop] = "isCurrentDesktop";
    roleNames [Role::IsActiveWindow] = "isActiveWindow";
    roleNames [Role::IsMinimizedWindow] = "isMinimizedWindow";
    setRoleNames (roleNames);

    int eventBase, errorBase;
    if (XCompositeQueryExtension (w.GetDisplay (), &eventBase, &errorBase))
    {
        int major = 0, minor = 2;
        XCompositeQueryVersion (w.GetDisplay (), &major, &minor);

        if (major > 0 || minor >= 2)
            qDebug () << "all good, has NamePixmap";
    }
}
Ejemplo n.º 16
0
bool
KWD::Decorator::enableDecorations (Time timestamp)
{
    QList <WId>::ConstIterator it;
    unsigned int nchildren;
    WId       *children;
    WId       root, parent;
    long int  select;

    mDmSnTimestamp = timestamp;

    if (!pluginManager ()->loadPlugin (""))
	return false;

    updateAllShadowOptions ();

    KWD::trapXError ();
    (void) QApplication::desktop (); // trigger creation of desktop widget
    KWD::popXError ();

    updateShadow ();

    /* FIXME: Implement proper decoration lists and remove this */
    mDecorNormal = new KWD::Window (mCompositeWindow,
                                    QX11Info::appRootWindow (),
                                    0, Window::Default);
    mDecorActive = new KWD::Window (mCompositeWindow,
				    QX11Info::appRootWindow (),
				    0, Window::DefaultActive);

    mActiveId = KWindowSystem::activeWindow ();

    connect (KWindowSystem::self (), SIGNAL (windowAdded (WId)),
	     SLOT (handleWindowAdded (WId)));
    connect (KWindowSystem::self (), SIGNAL (windowRemoved (WId)),
	     SLOT (handleWindowRemoved (WId)));
    connect (KWindowSystem::self (), SIGNAL (activeWindowChanged (WId)),
	     SLOT (handleActiveWindowChanged (WId)));
    connect (KWindowSystem::self (),
	     SIGNAL (windowChanged (WId, const unsigned long *)),
	     SLOT (handleWindowChanged (WId, const unsigned long *)));

    foreach (WId id, KWindowSystem::windows ())
	handleWindowAdded (id);

    /* Find the switcher and add it too
     * FIXME: Doing XQueryTree and then
     * XGetWindowProperty on every window
     * like this is really expensive, surely
     * there is a better way to do this */

    XQueryTree (QX11Info::display (), QX11Info::appRootWindow (),
                &root, &parent, &children, &nchildren);

    for (unsigned int i = 0; i < nchildren; i++)
    {
        if (KWD::readWindowProperty (children[i],
                                     Atoms::switchSelectWindow, &select))
        {
            handleWindowAdded(children[i]);
            break;
        }
    }

    connect (Plasma::Theme::defaultTheme (), SIGNAL (themeChanged ()),
	     SLOT (plasmaThemeChanged ()));

    // select for client messages
    XSelectInput (QX11Info::display (), QX11Info::appRootWindow (),
                  SubstructureNotifyMask |
                  StructureNotifyMask |
                  PropertyChangeMask);

    return true;
}
bool MainWindow::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0:
        showProperties((QObject*)static_QUType_ptr.get(_o+1));
        break;
    case 1:
        updateProperties((QObject*)static_QUType_ptr.get(_o+1));
        break;
    case 2:
        showDialogHelp();
        break;
    case 3:
        showDebugStep((QObject*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2));
        break;
    case 4:
        showStackFrame((QObject*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2));
        break;
    case 5:
        showErrorMessage((QObject*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2),(const QString&)static_QUType_QString.get(_o+3));
        break;
    case 6:
        finishedRun();
        break;
    case 7:
        breakPointsChanged();
        break;
    case 8:
        fileNew();
        break;
    case 9:
        fileNewDialog();
        break;
    case 10:
        fileNewFile();
        break;
    case 11:
        fileClose();
        break;
    case 12:
        fileQuit();
        break;
    case 13:
        fileCloseProject();
        break;
    case 14:
        fileOpen();
        break;
    case 15:
        fileOpen((const QString&)static_QUType_QString.get(_o+1),(const QString&)static_QUType_QString.get(_o+2));
        break;
    case 16:
        fileOpen((const QString&)static_QUType_QString.get(_o+1),(const QString&)static_QUType_QString.get(_o+2),(const QString&)static_QUType_QString.get(_o+3));
        break;
    case 17:
        fileOpen((const QString&)static_QUType_QString.get(_o+1),(const QString&)static_QUType_QString.get(_o+2),(const QString&)static_QUType_QString.get(_o+3),(bool)static_QUType_bool.get(_o+4));
        break;
    case 18:
        static_QUType_bool.set(_o,fileSave());
        break;
    case 19:
        static_QUType_bool.set(_o,fileSaveForm());
        break;
    case 20:
        static_QUType_bool.set(_o,fileSaveProject());
        break;
    case 21:
        static_QUType_bool.set(_o,fileSaveAs());
        break;
    case 22:
        fileSaveAll();
        break;
    case 23:
        fileCreateTemplate();
        break;
    case 24:
        editUndo();
        break;
    case 25:
        editRedo();
        break;
    case 26:
        editCut();
        break;
    case 27:
        editCopy();
        break;
    case 28:
        editPaste();
        break;
    case 29:
        editDelete();
        break;
    case 30:
        editSelectAll();
        break;
    case 31:
        editLower();
        break;
    case 32:
        editRaise();
        break;
    case 33:
        editAdjustSize();
        break;
    case 34:
        editLayoutHorizontal();
        break;
    case 35:
        editLayoutVertical();
        break;
    case 36:
        editLayoutHorizontalSplit();
        break;
    case 37:
        editLayoutVerticalSplit();
        break;
    case 38:
        editLayoutGrid();
        break;
    case 39:
        editLayoutContainerHorizontal();
        break;
    case 40:
        editLayoutContainerVertical();
        break;
    case 41:
        editLayoutContainerGrid();
        break;
    case 42:
        editBreakLayout();
        break;
    case 43:
        editAccels();
        break;
    case 44:
        editFunctions();
        break;
    case 45:
        editConnections();
        break;
    case 46:
        static_QUType_ptr.set(_o,editSource());
        break;
    case 47:
        static_QUType_ptr.set(_o,editSource((SourceFile*)static_QUType_ptr.get(_o+1)));
        break;
    case 48:
        static_QUType_ptr.set(_o,openSourceEditor());
        break;
    case 49:
        static_QUType_ptr.set(_o,createSourceEditor((QObject*)static_QUType_ptr.get(_o+1),(Project*)static_QUType_ptr.get(_o+2)));
        break;
    case 50:
        static_QUType_ptr.set(_o,createSourceEditor((QObject*)static_QUType_ptr.get(_o+1),(Project*)static_QUType_ptr.get(_o+2),(const QString&)static_QUType_QString.get(_o+3)));
        break;
    case 51:
        static_QUType_ptr.set(_o,createSourceEditor((QObject*)static_QUType_ptr.get(_o+1),(Project*)static_QUType_ptr.get(_o+2),(const QString&)static_QUType_QString.get(_o+3),(const QString&)static_QUType_QString.get(_o+4)));
        break;
    case 52:
        static_QUType_ptr.set(_o,createSourceEditor((QObject*)static_QUType_ptr.get(_o+1),(Project*)static_QUType_ptr.get(_o+2),(const QString&)static_QUType_QString.get(_o+3),(const QString&)static_QUType_QString.get(_o+4),(bool)static_QUType_bool.get(_o+5)));
        break;
    case 53:
        editFormSettings();
        break;
    case 54:
        editProjectSettings();
        break;
    case 55:
        editPixmapCollection();
        break;
    case 56:
        editDatabaseConnections();
        break;
    case 57:
        editPreferences();
        break;
    case 58:
        projectInsertFile();
        break;
    case 59:
        searchFind();
        break;
    case 60:
        searchIncremetalFindMenu();
        break;
    case 61:
        searchIncremetalFind();
        break;
    case 62:
        searchIncremetalFindNext();
        break;
    case 63:
        searchReplace();
        break;
    case 64:
        searchGotoLine();
        break;
    case 65:
        previewForm();
        break;
    case 66:
        previewForm((const QString&)static_QUType_QString.get(_o+1));
        break;
    case 67:
        toolsCustomWidget();
        break;
    case 68:
        toolsConfigure();
        break;
    case 69:
        helpContents();
        break;
    case 70:
        helpManual();
        break;
    case 71:
        helpAbout();
        break;
    case 72:
        helpAboutQt();
        break;
    case 73:
        helpRegister();
        break;
    case 74:
        activeWindowChanged((QWidget*)static_QUType_ptr.get(_o+1));
        break;
    case 75:
        updateUndoRedo((bool)static_QUType_bool.get(_o+1),(bool)static_QUType_bool.get(_o+2),(const QString&)static_QUType_QString.get(_o+3),(const QString&)static_QUType_QString.get(_o+4));
        break;
    case 76:
        updateEditorUndoRedo();
        break;
    case 77:
        toolSelected((QAction*)static_QUType_ptr.get(_o+1));
        break;
    case 78:
        clipboardChanged();
        break;
    case 79:
        selectionChanged();
        break;
    case 80:
        windowsMenuActivated((int)static_QUType_int.get(_o+1));
        break;
    case 81:
        setupWindowActions();
        break;
    case 82:
        createNewTemplate();
        break;
    case 83:
        projectSelected((QAction*)static_QUType_ptr.get(_o+1));
        break;
    case 84:
        setupRecentlyFilesMenu();
        break;
    case 85:
        setupRecentlyProjectsMenu();
        break;
    case 86:
        recentlyFilesMenuActivated((int)static_QUType_int.get(_o+1));
        break;
    case 87:
        recentlyProjectsMenuActivated((int)static_QUType_int.get(_o+1));
        break;
    case 88:
        emitProjectSignals();
        break;
    case 89:
        showStartDialog();
        break;
    case 90:
        doFunctionsChanged();
        break;
    case 91:
        static_QUType_bool.set(_o,openProjectSettings((Project*)static_QUType_ptr.get(_o+1)));
        break;
    default:
        return QMainWindow::qt_invoke( _id, _o );
    }
    return TRUE;
}
Ejemplo n.º 18
0
bool KXKBApp::settingsRead()
{
    kxkbConfig.load(KxkbConfig::LOAD_ACTIVE_OPTIONS);

    if(kxkbConfig.m_enableXkbOptions)
    {
        kdDebug() << "Setting XKB options " << kxkbConfig.m_options << endl;
        if(!m_extension->setXkbOptions(kxkbConfig.m_options, kxkbConfig.m_resetOldOptions))
        {
            kdDebug() << "Setting XKB options failed!" << endl;
        }
    }

    if(kxkbConfig.m_useKxkb == false)
    {
        kapp->quit();
        return false;
    }

    m_prevWinId = X11Helper::UNKNOWN_WINDOW_ID;

    if(kxkbConfig.m_switchingPolicy == SWITCH_POLICY_GLOBAL)
    {
        delete kWinModule;
        kWinModule = NULL;
    }
    else
    {
        QDesktopWidget desktopWidget;
        if(desktopWidget.numScreens() > 1 && desktopWidget.isVirtualDesktop() == false)
        {
            kdWarning() << "With non-virtual desktop only global switching policy supported on non-primary screens" << endl;
            // TODO: find out how to handle that
        }

        if(kWinModule == NULL)
        {
            kWinModule = new KWinModule(0, KWinModule::INFO_DESKTOP);
            connect(kWinModule, SIGNAL(activeWindowChanged(WId)), SLOT(windowChanged(WId)));
        }
        m_prevWinId = kWinModule->activeWindow();
        kdDebug() << "Active window " << m_prevWinId << endl;
    }

    m_layoutOwnerMap->reset();
    m_layoutOwnerMap->setCurrentWindow(m_prevWinId);

    if(m_rules == NULL)
        m_rules = new XkbRules(false);

    for(int ii = 0; ii < (int)kxkbConfig.m_layouts.count(); ii++)
    {
        LayoutUnit &layoutUnit = kxkbConfig.m_layouts[ii];
        layoutUnit.defaultGroup = m_rules->getDefaultGroup(layoutUnit.layout, layoutUnit.includeGroup);
        kdDebug() << "default group for " << layoutUnit.toPair() << " is " << layoutUnit.defaultGroup << endl;
    }

    m_currentLayout = kxkbConfig.getDefaultLayout();

    if(kxkbConfig.m_layouts.count() == 1)
    {
        QString layoutName = m_currentLayout.layout;
        QString variantName = m_currentLayout.variant;
        QString includeName = m_currentLayout.includeGroup;
        int group = m_currentLayout.defaultGroup;

        if(!m_extension->setLayout(kxkbConfig.m_model, layoutName, variantName, includeName, false) || !m_extension->setGroup(group))
        {
            kdDebug() << "Error switching to single layout " << m_currentLayout.toPair() << endl;
            // TODO: alert user
        }

        if(kxkbConfig.m_showSingle == false)
        {
            kapp->quit();
            return false;
        }
    }
    else
    {
        //		initPrecompiledLayouts();
    }

    initTray();

    KGlobal::config()->reparseConfiguration(); // kcontrol modified kdeglobals
    keys->readSettings();
    keys->updateConnections();

    return true;
}