예제 #1
0
KoDetailsPane::KoDetailsPane(QWidget* parent, const KComponentData &_componentData, const QString& header)
        : QWidget(parent),
        Ui_KoDetailsPaneBase(),
        d(new KoDetailsPanePrivate(_componentData))
{
    d->m_model->setHorizontalHeaderItem(0, new QStandardItem(header));

    setupUi(this);

    m_previewLabel->installEventFilter(this);
    m_documentList->installEventFilter(this);
    m_documentList->setIconSize(QSize(64, 64));
    m_documentList->setModel(d->m_model);
    m_splitter->setSizes(QList<int>() << 2 << 1);

    changePalette();

    connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(changePalette()));

    connect(m_documentList->selectionModel(), SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)),
            this, SLOT(selectionChanged(const QModelIndex&)));
    connect(m_documentList, SIGNAL(doubleClicked(const QModelIndex&)),
            this, SLOT(openFile(const QModelIndex&)));
    connect(m_openButton, SIGNAL(clicked()), this, SLOT(openFile()));
}
예제 #2
0
TaskBarExtension::TaskBarExtension(const QString& configFile, Type type,
                                   int actions, QWidget *parent, const char *name)
    : KPanelExtension(configFile, type, actions, parent, name),
      m_bgImage(0),
      m_bgFilename(0),
      m_rootPixmap(0)
{
    QHBoxLayout *layout = new QHBoxLayout(this);
    m_container = new TaskBarContainer(false, this);
    m_container->setBackgroundOrigin(AncestorOrigin);
    positionChange(position());
    layout->addWidget(m_container);

    connect(m_container, SIGNAL(containerCountChanged()),
            SIGNAL(updateLayout()));

    kapp->dcopClient()->setNotifications(true);
    connectDCOPSignal("kicker", "kicker", "configurationChanged()",
                      "configure()", false);

    connect(kapp, SIGNAL(kdisplayPaletteChanged()),
            SLOT(setBackgroundTheme()));

    QTimer::singleShot(0, this, SLOT(setBackgroundTheme()));
}
예제 #3
0
PropertyPanel::PropertyPanel( QWidget* parent, const char* name, WFlags fl )
	: PropertyPanelBase( parent, name, fl ),
	  component(0L),
	  port(0L)
{
	setTitleFont();
	setTitleColors();
	connect( kapp, SIGNAL( kdisplayFontChanged() ),
			 this, SLOT( setTitleFont() ));
	connect( kapp, SIGNAL( kdisplayPaletteChanged() ),
			 this, SLOT( setTitleColors() ));
	connect( portValueGroup, SIGNAL( clicked(int) ),
			 this, SLOT( pvModeChanged(int) ));
	connect( constantValueEdit, SIGNAL( returnPressed() ),
			 this, SLOT( writePortProperties() ));
	connect( constantValueComboBox, SIGNAL( activated(int) ),
			 this, SLOT( writePortProperties() ));
	connect( portCombo, SIGNAL( activated(int) ),
			 this, SLOT( comboPortSelected(int) ));
	connect( connectButton, SIGNAL( clicked() ),
			 this, SLOT( connectButtonClicked() ));

	constantValueComboBox->hide();
	setEnabled( false );
	tipLabel->hide();
}
예제 #4
0
MyObject::MyObject()
    : QObject(0L, "testobj")
{
    connect(kapp, SIGNAL(kdisplayPaletteChanged()), SLOT(slotPaletteChanged()));
    connect(kapp, SIGNAL(kdisplayFontChanged()), SLOT(slotFontChanged()));
    connect(kapp, SIGNAL(kdisplayStyleChanged()), SLOT(slotStyleChanged()));
    connect(kapp, SIGNAL(backgroundChanged(int)), SLOT(slotBackgroundChanged(int)));
    connect(kapp, SIGNAL(appearanceChanged()), SLOT(slotAppearanceChanged()));
    connect(kapp, SIGNAL(kipcMessage(int,int)), SLOT(slotMessage(int,int)));
}
DolphinFileItemDelegate::DolphinFileItemDelegate(QObject* parent) :
    KFileItemDelegate(parent),
    m_hasMinimizedNameColumn(false),
    m_cachedSize(),
    m_cachedEmblems(),
    m_cachedInactiveTextColorDirty(true)
{
    setJobTransfersVisible(true);
    connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(handleDisplayPaletteChange()));
}
InfoBox::InfoBox(QWidget * parent):QWidget (parent) 
{
    //Set up title bar
    m_titleBar = new QWidget;
    m_titleBar->setAutoFillBackground(true);
    m_titleBar->setPalette(QApplication::palette());
    connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(updateTitleColors())); 
    
    QHBoxLayout * titleLayout = new QHBoxLayout;
    titleLayout->setContentsMargins(0,0,0,0);
    titleLayout->setSpacing(0);
    
    m_icon = new QLabel;
    m_icon->setMaximumSize(QSize(20,20));
    m_icon->setAlignment(Qt::AlignCenter);
    m_title = new QLabel;
    m_title->setFont(KGlobalSettings::smallestReadableFont());
    m_title->setAlignment(Qt::AlignCenter);
    QLabel * spacer = new QLabel;
    spacer->setMaximumSize(QSize(20,20));
    titleLayout->addWidget(m_icon);
    titleLayout->addWidget(m_title);
    titleLayout->addWidget(spacer);
    m_titleBar->setLayout(titleLayout);
    m_titleBar->setMinimumHeight(20);
    
    //Set up media view
    QVBoxLayout * layout = new QVBoxLayout;
    layout->setContentsMargins(0,0,0,0);
    layout->setSpacing(0);
    m_mediaView = new MediaView();
    m_mediaView->setFocusPolicy(Qt::ClickFocus);
    connect((MediaItemModel *)m_mediaView->sourceModel(), SIGNAL(mediaListChanged()), this, SLOT(mediaListChanged()));
    layout->addWidget(m_titleBar);
    layout->addWidget(m_mediaView);
    
    //Complete setup
    setLayout(layout);
}
예제 #7
0
void PanelKMenu::initialize()
{
//    kDebug(1210) << "PanelKMenu::initialize()";
    updateRecent();

    if (initialized())
    {
        return;
    }

    if (loadSidePixmap())
    {
        // in case we've been through here before, let's disconnect
        disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
                   this, SLOT(paletteChanged()));
        connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
                this, SLOT(paletteChanged()));
    }
    else
    {
        sidePixmap = sideTilePixmap = QPixmap();
    }

    // add services
    PanelServiceMenu::initialize();

    /*
     FIXME: no more insertTitle! now what?
    if (KickerSettings::showMenuTitles())
    {
        int id;
        id = insertTitle(i18n("All Applications"), -1, 0);
        setItemEnabled( id, false );
        id = insertTitle(i18n("Actions"), -1 , -1);
        setItemEnabled( id, false );
    }
    */

    // create recent menu section
    createRecentMenuItems();

    bool need_separator = false;

    // insert bookmarks
    if (KickerSettings::useBookmarks() && KAuthorized::authorizeKAction("bookmarks"))
    {
        // Need to create a new popup each time, it's deleted by subMenus.clear()
        KMenu * bookmarkParent = new KMenu(this);
        bookmarkParent->setObjectName("bookmarks" );
        delete bookmarkMenu; // can't reuse old one, the popup has been deleted
        bookmarkMenu = new KBookmarkMenu( KBookmarkManager::userBookmarksManager(), 0, bookmarkParent, actionCollection );

        insertItem(Plasma::menuIconSet("bookmark"),
                   i18n("Bookmarks"), bookmarkParent);

        subMenus.append(bookmarkParent);
        need_separator = true;
    }

    // insert quickbrowser
    if (KickerSettings::useBrowser())
    {
        PanelQuickBrowser *browserMnu = new PanelQuickBrowser(this);
        browserMnu->initialize();

        insertItem(Plasma::menuIconSet("kdisknav"),
                   i18n("Quick Browser"),
                   Plasma::reduceMenu(browserMnu));
        subMenus.append(browserMnu);
        need_separator = true;
    }

    // insert dynamic menus
    QStringList menu_ext = KickerSettings::menuExtensions();
    if (!menu_ext.isEmpty())
    {
        for (QStringList::ConstIterator it=menu_ext.begin(); it!=menu_ext.end(); ++it)
        {
            MenuInfo info(*it);
            if (!info.isValid())
               continue;

            KPanelMenu *menu = info.load();
            if (menu)
            {
                insertItem(Plasma::menuIconSet(info.icon()), info.name(), menu);
                dynamicSubMenus.append(menu);
                need_separator = true;
            }
        }
    }

    if (need_separator)
        addSeparator();

    // run command
    if (KAuthorized::authorizeKAction("run_command"))
    {
        insertItem(Plasma::menuIconSet("system-run"),
                   i18n("Run Command..."),
                   this,
                   SLOT( slotRunCommand()));
        addSeparator();
    }

    if (KDisplayManager().isSwitchable() && KAuthorized::authorizeKAction("switch_user"))
    {
        sessionsMenu = new QMenu( this );
        insertItem(Plasma::menuIconSet("switchuser"),
                   i18n("Switch User"), sessionsMenu);
        connect( sessionsMenu, SIGNAL(aboutToShow()), SLOT(slotPopulateSessions()) );
        connect( sessionsMenu, SIGNAL(activated(int)), SLOT(slotSessionActivated(int)) );
    }

    /*
      If  the user configured ksmserver to
    */
    KConfig ksmserver("ksmserverrc", KConfig::CascadeConfig);
    if (ksmserver.group("General").readEntry( "loginMode" ) == "restoreSavedSession")
    {
        insertItem(Plasma::menuIconSet("document-save"),
                   i18n("Save Session"), this, SLOT(slotSaveSession()));
    }

    if (KAuthorized::authorizeKAction("lock_screen"))
    {
        insertItem(Plasma::menuIconSet("system-lock-screen"),
                   i18n("Lock Session"), this, SLOT(slotLock()));
    }

    if (KAuthorized::authorizeKAction("logout"))
    {
        insertItem(Plasma::menuIconSet("application-exit"),
                   i18n("Log Out..."), this, SLOT(slotLogout()));
    }

#if 0
    // WABA: tear off handles don't work together with dynamically updated
    // menus. We can't update the menu while torn off, and we don't know
    // when it is torn off.
    if (KGlobalSettings::insertTearOffHandle())
      insertTearOffHandle();
#endif

    setInitialized(true);
}
예제 #8
0
KTitleBarActionsConfig::KTitleBarActionsConfig(bool _standAlone, KConfig *_config, QWidget *parent, const char *)
    : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone)
{
    QString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3;
    QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());
    QGrid *grid;
    QGroupBox *box;
    QLabel *label;
    QString strMouseButton1, strMouseButton3, strMouseWheel;
    QString txtButton1, txtButton3, txtButton4;
    QStringList items;
    bool leftHandedMouse = (KGlobalSettings::mouseSettings().handed == KGlobalSettings::KMouseSettings::LeftHanded);

    /** Titlebar doubleclick ************/

    QHBoxLayout *hlayout = new QHBoxLayout(layout);

    label = new QLabel(i18n("&Titlebar double-click:"), this);
    hlayout->addWidget(label);
    QWhatsThis::add(label, i18n("Here you can customize mouse click behavior when double clicking on the"
                                " titlebar of a window."));

    QComboBox *combo = new QComboBox(this);
    combo->insertItem(i18n("Maximize"));
    combo->insertItem(i18n("Maximize (vertical only)"));
    combo->insertItem(i18n("Maximize (horizontal only)"));
    combo->insertItem(i18n("Minimize"));
    combo->insertItem(i18n("Shade"));
    combo->insertItem(i18n("Lower"));
    combo->insertItem(i18n("On All Desktops"));
    combo->insertItem(i18n("Nothing"));
    combo->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));
    connect(combo, SIGNAL(activated(int)), SLOT(changed()));
    hlayout->addWidget(combo);
    coTiDbl = combo;
    QWhatsThis::add(combo, i18n("Behavior on <em>double</em> click into the titlebar."));

    label->setBuddy(combo);

    /** Mouse Wheel Events  **************/
    QHBoxLayout *hlayoutW = new QHBoxLayout(layout);
    strMouseWheel = i18n("Titlebar wheel event:");
    label = new QLabel(strMouseWheel, this);
    hlayoutW->addWidget(label);
    txtButton4 = i18n("Handle mouse wheel events");
    QWhatsThis::add(label, txtButton4);

    // Titlebar and frame mouse Wheel
    QComboBox *comboW = new QComboBox(this);
    comboW->insertItem(i18n("Raise/Lower"));
    comboW->insertItem(i18n("Shade/Unshade"));
    comboW->insertItem(i18n("Maximize/Restore"));
    comboW->insertItem(i18n("Keep Above/Below"));
    comboW->insertItem(i18n("Move to Previous/Next Desktop"));
    comboW->insertItem(i18n("Change Opacity"));
    comboW->insertItem(i18n("Nothing"));
    comboW->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));
    connect(comboW, SIGNAL(activated(int)), SLOT(changed()));
    hlayoutW->addWidget(comboW);
    coTiAct4 = comboW;
    QWhatsThis::add(comboW, txtButton4);
    label->setBuddy(comboW);

    /** Titlebar and frame  **************/

    box = new QVGroupBox(i18n("Titlebar && Frame"), this, "Titlebar and Frame");
    box->layout()->setMargin(KDialog::marginHint());
    box->layout()->setSpacing(KDialog::spacingHint());
    layout->addWidget(box);
    QWhatsThis::add(box, i18n("Here you can customize mouse click behavior when clicking on the"
                              " titlebar or the frame of a window."));

    grid = new QGrid(4, Qt::Vertical, box);


    new QLabel(grid); // dummy

    strMouseButton1 = i18n("Left button:");
    txtButton1 = i18n(
        "In this row you can customize left click behavior when clicking into"
        " the titlebar or the frame.");

    strMouseButton3 = i18n("Right button:");
    txtButton3 = i18n(
        "In this row you can customize right click behavior when clicking into"
        " the titlebar or the frame.");

    if(leftHandedMouse)
    {
        qSwap(strMouseButton1, strMouseButton3);
        qSwap(txtButton1, txtButton3);
    }

    label = new QLabel(strMouseButton1, grid);
    QWhatsThis::add(label, txtButton1);

    label = new QLabel(i18n("Middle button:"), grid);
    QWhatsThis::add(label, i18n("In this row you can customize middle click behavior when clicking into"
                                " the titlebar or the frame."));

    label = new QLabel(strMouseButton3, grid);
    QWhatsThis::add(label, txtButton3);


    label = new QLabel(i18n("Active"), grid);
    label->setAlignment(AlignCenter);
    QWhatsThis::add(label, i18n("In this column you can customize mouse clicks into the titlebar"
                                " or the frame of an active window."));

    // Titlebar and frame, active, mouse button 1
    combo = new QComboBox(grid);
    combo->insertItem(i18n("Raise"));
    combo->insertItem(i18n("Lower"));
    combo->insertItem(i18n("Operations Menu"));
    combo->insertItem(i18n("Toggle Raise & Lower"));
    combo->insertItem(i18n("Nothing"));
    connect(combo, SIGNAL(activated(int)), SLOT(changed()));
    coTiAct1 = combo;

    txtButton1 = i18n(
        "Behavior on <em>left</em> click into the titlebar or frame of an "
        "<em>active</em> window.");

    txtButton3 = i18n(
        "Behavior on <em>right</em> click into the titlebar or frame of an "
        "<em>active</em> window.");

    // Be nice to left handed users
    if(leftHandedMouse)
        qSwap(txtButton1, txtButton3);

    QWhatsThis::add(combo, txtButton1);

    // Titlebar and frame, active, mouse button 2

    items << i18n("Raise") << i18n("Lower") << i18n("Operations Menu") << i18n("Toggle Raise & Lower") << i18n("Nothing") << i18n("Shade");

    combo = new QComboBox(grid);
    combo->insertStringList(items);
    connect(combo, SIGNAL(activated(int)), SLOT(changed()));
    coTiAct2 = combo;
    QWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>active</em> window."));

    // Titlebar and frame, active, mouse button 3
    combo = new QComboBox(grid);
    combo->insertStringList(items);
    connect(combo, SIGNAL(activated(int)), SLOT(changed()));
    coTiAct3 = combo;
    QWhatsThis::add(combo, txtButton3);

    txtButton1 = i18n(
        "Behavior on <em>left</em> click into the titlebar or frame of an "
        "<em>inactive</em> window.");

    txtButton3 = i18n(
        "Behavior on <em>right</em> click into the titlebar or frame of an "
        "<em>inactive</em> window.");

    // Be nice to left handed users
    if(leftHandedMouse)
        qSwap(txtButton1, txtButton3);

    label = new QLabel(i18n("Inactive"), grid);
    label->setAlignment(AlignCenter);
    QWhatsThis::add(label, i18n("In this column you can customize mouse clicks into the titlebar"
                                " or the frame of an inactive window."));

    items.clear();
    items << i18n("Activate & Raise") << i18n("Activate & Lower") << i18n("Activate") << i18n("Shade") << i18n("Operations Menu") << i18n("Raise")
          << i18n("Lower") << i18n("Nothing");

    combo = new QComboBox(grid);
    combo->insertStringList(items);
    connect(combo, SIGNAL(activated(int)), SLOT(changed()));
    coTiInAct1 = combo;
    QWhatsThis::add(combo, txtButton1);

    combo = new QComboBox(grid);
    combo->insertStringList(items);
    connect(combo, SIGNAL(activated(int)), SLOT(changed()));
    coTiInAct2 = combo;
    QWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>inactive</em> window."));

    combo = new QComboBox(grid);
    combo->insertStringList(items);
    connect(combo, SIGNAL(activated(int)), SLOT(changed()));
    coTiInAct3 = combo;
    QWhatsThis::add(combo, txtButton3);

    /**  Maximize Button ******************/

    box = new QHGroupBox(i18n("Maximize Button"), this, "Maximize Button");
    box->layout()->setMargin(KDialog::marginHint());
    box->layout()->setSpacing(KDialog::spacingHint());
    layout->addWidget(box);
    QWhatsThis::add(box, i18n("Here you can customize behavior when clicking on the maximize button."));

    QString strMouseButton[] = {i18n("Left button:"), i18n("Middle button:"), i18n("Right button:")};

    QString txtButton[] = {i18n("Behavior on <em>left</em> click onto the maximize button."),
                           i18n("Behavior on <em>middle</em> click onto the maximize button."),
                           i18n("Behavior on <em>right</em> click onto the maximize button.")};

    if(leftHandedMouse) // Be nice to lefties
    {
        qSwap(strMouseButton[0], strMouseButton[2]);
        qSwap(txtButton[0], txtButton[2]);
    }

    createMaxButtonPixmaps();
    for(int b = 0; b < 3; ++b)
    {
        if(b != 0)
            new QWidget(box); // Spacer

        QLabel *label = new QLabel(strMouseButton[b], box);
        QWhatsThis::add(label, txtButton[b]);
        label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum));

        coMax[b] = new ToolTipComboBox(box, tbl_Max);
        for(int t = 0; t < 3; ++t)
            coMax[b]->insertItem(maxButtonPixmaps[t]);
        connect(coMax[b], SIGNAL(activated(int)), SLOT(changed()));
        connect(coMax[b], SIGNAL(activated(int)), coMax[b], SLOT(changed()));
        QWhatsThis::add(coMax[b], txtButton[b]);
        coMax[b]->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum));
    }

    connect(kapp, SIGNAL(kdisplayPaletteChanged()), SLOT(paletteChanged()));

    layout->addStretch();

    load();
}
예제 #9
0
KateGlobal::KateGlobal ()
 : KTextEditor::Editor (0)
 , m_aboutData ("katepart", 0, ki18n("Kate Part"), katePartVersion().toLatin1(),
             ki18n( "Embeddable editor component" ), KAboutData::License_LGPL_V2,
             ki18n( "(c) 2000-2009 The Kate Authors" ), KLocalizedString(), "http://www.kate-editor.org")
 , m_componentData (&m_aboutData)
{
  // set s_self
  s_self = this;

  // load the kate part translation catalog
  KGlobal::locale()->insertCatalog("katepart4");

  //
  // fill about data
  //
  m_aboutData.setProgramIconName("preferences-plugin");
  m_aboutData.addAuthor (ki18n("Christoph Cullmann"), ki18n("Maintainer"), "*****@*****.**", "http://www.babylon2k.de");
  m_aboutData.addAuthor (ki18n("Dominik Haumann"), ki18n("Core Developer"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Joseph Wenninger"), ki18n("Core Developer"), "*****@*****.**","http://stud3.tuwien.ac.at/~e9925371");
  m_aboutData.addAuthor (ki18n("Erlend Hamberg"), ki18n("Vi Input Mode"), "*****@*****.**", "http://hamberg.no/erlend");
  m_aboutData.addAuthor (ki18n("Bernhard Beschow"), ki18n("Developer"), "*****@*****.**", "https://user.cs.tu-berlin.de/~bbeschow");
  m_aboutData.addAuthor (ki18n("Anders Lund"), ki18n("Core Developer"), "*****@*****.**", "http://www.alweb.dk");
  m_aboutData.addAuthor (ki18n("Michel Ludwig"), ki18n("On-the-fly spell checking"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Pascal Létourneau"), ki18n("Large scale bug fixing"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Hamish Rodda"), ki18n("Core Developer"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Waldo Bastian"), ki18n( "The cool buffersystem" ), "*****@*****.**" );
  m_aboutData.addAuthor (ki18n("Charles Samuels"), ki18n("The Editing Commands"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Matt Newell"), ki18n("Testing, ..."), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Michael Bartl"), ki18n("Former Core Developer"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Michael McCallum"), ki18n("Core Developer"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Michael Koch"), ki18n("KWrite port to KParts"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Christian Gebauer"), KLocalizedString(), "*****@*****.**" );
  m_aboutData.addAuthor (ki18n("Simon Hausmann"), KLocalizedString(), "*****@*****.**" );
  m_aboutData.addAuthor (ki18n("Glen Parker"), ki18n("KWrite Undo History, Kspell integration"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Scott Manson"), ki18n("KWrite XML Syntax highlighting support"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("John Firebaugh"), ki18n("Patches and more"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Andreas Kling"), ki18n("Developer"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Mirko Stocker"), ki18n("Various bugfixes"), "*****@*****.**", "http://misto.ch/");
  m_aboutData.addAuthor (ki18n("Matthew Woehlke"), ki18n("Selection, KColorScheme integration"), "*****@*****.**");
  m_aboutData.addAuthor (ki18n("Sebastian Pipping"), ki18n("Search bar back- and front-end"), "*****@*****.**", "http://www.hartwork.org/");
  m_aboutData.addAuthor (ki18n("Jochen Wilhelmy"), ki18n( "Original KWrite Author" ), "*****@*****.**" );

  m_aboutData.addCredit (ki18n("Matteo Merli"), ki18n("Highlighting for RPM Spec-Files, Perl, Diff and more"), "*****@*****.**");
  m_aboutData.addCredit (ki18n("Rocky Scaletta"), ki18n("Highlighting for VHDL"), "*****@*****.**");
  m_aboutData.addCredit (ki18n("Yury Lebedev"), ki18n("Highlighting for SQL"),"");
  m_aboutData.addCredit (ki18n("Chris Ross"), ki18n("Highlighting for Ferite"),"");
  m_aboutData.addCredit (ki18n("Nick Roux"), ki18n("Highlighting for ILERPG"),"");
  m_aboutData.addCredit (ki18n("Carsten Niehaus"), ki18n("Highlighting for LaTeX"),"");
  m_aboutData.addCredit (ki18n("Per Wigren"), ki18n("Highlighting for Makefiles, Python"),"");
  m_aboutData.addCredit (ki18n("Jan Fritz"), ki18n("Highlighting for Python"),"");
  m_aboutData.addCredit (ki18n("Daniel Naber"));
  m_aboutData.addCredit (ki18n("Roland Pabel"), ki18n("Highlighting for Scheme"),"");
  m_aboutData.addCredit (ki18n("Cristi Dumitrescu"), ki18n("PHP Keyword/Datatype list"),"");
  m_aboutData.addCredit (ki18n("Carsten Pfeiffer"), ki18n("Very nice help"), "");
  m_aboutData.addCredit (ki18n("Bruno Massa"), ki18n("Highlighting for Lua"), "*****@*****.**");

  m_aboutData.addCredit (ki18n("All people who have contributed and I have forgotten to mention"));

  m_aboutData.setTranslator(ki18nc("NAME OF TRANSLATORS","Your names"), ki18nc("EMAIL OF TRANSLATORS","Your emails"));

  //
  // dir watch
  //
  m_dirWatch = new KDirWatch ();

  //
  // command manager
  //
  m_cmdManager = new KateCmd ();

  //
  // hl manager
  //
  m_hlManager = new KateHlManager ();

  //
  // mode man
  //
  m_modeManager = new KateModeManager ();

  //
  // schema man
  //
  m_schemaManager = new KateSchemaManager ();

  //
  // vi input mode global
  //
  m_viInputModeGlobal = new KateViGlobal ();

  //
  // spell check manager
  //
  m_spellCheckManager = new KateSpellCheckManager ();

  // config objects
  m_globalConfig = new KateGlobalConfig ();
  m_documentConfig = new KateDocumentConfig ();
  m_viewConfig = new KateViewConfig ();
  m_rendererConfig = new KateRendererConfig ();

  // create script manager (search scripts)
  m_scriptManager = new KateScriptManager ();

  //
  // plugin manager
  //
  m_pluginManager = new KatePartPluginManager ();

  //
  // init the cmds
  //
  m_cmds.push_back (new KateCommands::CoreCommands());
  m_cmds.push_back (new KateCommands::ViCommands());
  m_cmds.push_back (new KateCommands::AppCommands());
  m_cmds.push_back (new KateCommands::SedReplace ());
  m_cmds.push_back (new KateCommands::Character ());
  m_cmds.push_back (new KateCommands::Date ());

  for ( QList<KTextEditor::Command *>::iterator it = m_cmds.begin(); it != m_cmds.end(); ++it )
    m_cmdManager->registerCommand (*it);

  // global word completion model
  m_wordCompletionModel = new KateWordCompletionModel (this);

  //
  // finally setup connections
  //
  connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(updateColorPalette()));
}
예제 #10
0
void PanelKMenu::initialize()
{
//    kdDebug(1210) << "PanelKMenu::initialize()" << endl;
    updateRecent();

    if (initialized())
    {
        return;
    }

    if (loadSidePixmap())
    {
        // in case we've been through here before, let's disconnect
        disconnect(kapp, SIGNAL(kdisplayPaletteChanged()),
                   this, SLOT(paletteChanged()));
        connect(kapp, SIGNAL(kdisplayPaletteChanged()),
                this, SLOT(paletteChanged()));
    }
    else
    {
        sidePixmap = sideTilePixmap = QPixmap();
    }

    // add services
    PanelServiceMenu::initialize();

    if (KickerSettings::showMenuTitles())
    {
        int id;
        id = insertItem(new PopupMenuTitle(i18n("All Applications"), font()), -1 /* id */, 0);
        setItemEnabled( id, false );
        id = insertItem(new PopupMenuTitle(i18n("Actions"), font()), -1 /* id */, -1);
        setItemEnabled( id, false );
    }

    // create recent menu section
    createRecentMenuItems();

    bool need_separator = false;

    // insert bookmarks
    if (KickerSettings::useBookmarks() && kapp->authorizeKAction("bookmarks"))
    {
        // Need to create a new popup each time, it's deleted by subMenus.clear()
        KPopupMenu * bookmarkParent = new KPopupMenu( this, "bookmarks" );
        if(!bookmarkOwner)
            bookmarkOwner = new KBookmarkOwner;
        delete bookmarkMenu; // can't reuse old one, the popup has been deleted
        bookmarkMenu = new KBookmarkMenu( KonqBookmarkManager::self(), bookmarkOwner, bookmarkParent, actionCollection, true, false );

        insertItem(KickerLib::menuIconSet("bookmark"), i18n("Bookmarks"), bookmarkParent);

        subMenus.append(bookmarkParent);
        need_separator = true;
    }

    // insert quickbrowser
    if (KickerSettings::useBrowser())
    {
        PanelQuickBrowser *browserMnu = new PanelQuickBrowser(this);
        browserMnu->initialize();

        insertItem(KickerLib::menuIconSet("kdisknav"),
                   i18n("Quick Browser"),
                   KickerLib::reduceMenu(browserMnu));
        subMenus.append(browserMnu);
        need_separator = true;
    }

    // insert dynamic menus
    QStringList menu_ext = KickerSettings::menuExtensions();
    if (!menu_ext.isEmpty())
    {
        for (QStringList::ConstIterator it=menu_ext.begin(); it!=menu_ext.end(); ++it)
        {
            MenuInfo info(*it);
            if (!info.isValid())
               continue;

            KPanelMenu *menu = info.load();
            if (menu)
            {
                insertItem(KickerLib::menuIconSet(info.icon()), info.name(), menu);
                dynamicSubMenus.append(menu);
                need_separator = true;
            }
        }
    }

    if (need_separator)
        insertSeparator();

    // insert client menus, if any
    if (clients.count() > 0) {
        QIntDictIterator<KickerClientMenu> it(clients);
        while (it){
            if (it.current()->text.at(0) != '.')
                insertItem(
                    it.current()->icon,
                    it.current()->text,
                    it.current(),
                    it.currentKey()
                    );
            ++it;
        }
        insertSeparator();
    }

    // run command
    if (kapp->authorize("run_command"))
    {
        insertItem(KickerLib::menuIconSet("run"),
                   i18n("Run Command..."),
                   this,
                   SLOT( slotRunCommand()));
        insertSeparator();
    }

    if (DM().isSwitchable() && kapp->authorize("switch_user"))
    {
        sessionsMenu = new QPopupMenu( this );
        insertItem(KickerLib::menuIconSet("switchuser"), i18n("Switch User"), sessionsMenu);
        connect( sessionsMenu, SIGNAL(aboutToShow()), SLOT(slotPopulateSessions()) );
        connect( sessionsMenu, SIGNAL(activated(int)), SLOT(slotSessionActivated(int)) );
    }

    /*
      If  the user configured ksmserver to
    */
    KConfig ksmserver("ksmserverrc", false, false);
    ksmserver.setGroup("General");
    if (ksmserver.readEntry( "loginMode" ) == "restoreSavedSession")
    {
        insertItem(KickerLib::menuIconSet("filesave"), i18n("Save Session"), this, SLOT(slotSaveSession()));
    }

    if (kapp->authorize("lock_screen"))
    {
        insertItem(KickerLib::menuIconSet("lock"), i18n("Lock Session"), this, SLOT(slotLock()));
    }

    if (kapp->authorize("logout"))
    {
        insertItem(KickerLib::menuIconSet("exit"), i18n("Log Out..."), this, SLOT(slotLogout()));
    }

#if 0
    // WABA: tear off handles don't work together with dynamically updated
    // menus. We can't update the menu while torn off, and we don't know
    // when it is torn off.
    if (KGlobalSettings::insertTearOffHandle())
      insertTearOffHandle();
#endif

    setInitialized(true);
}
예제 #11
0
GDBOutputWidget::GDBOutputWidget(CppDebuggerPlugin* plugin, QWidget *parent) :
    QWidget(parent),
    m_userGDBCmdEditor(0),
    m_Interrupt(0),
    m_gdbView(0),
    showInternalCommands_(false),
    maxLines_(5000)
{
//     setWindowIcon(KIcon("inline_image"));
    setWindowIcon(KIcon("debugger"));
    setWindowTitle(i18n("GDB Output"));
    setWhatsThis(i18n("<b>GDB output</b><p>"
                    "Shows all gdb commands being executed. "
                    "You can also issue any other gdb command while debugging.</p>"));

    m_gdbView = new OutputTextEdit(this);
    m_gdbView->setReadOnly(true);

    m_userGDBCmdEditor = new KHistoryComboBox (this);

    QLabel *label = new QLabel(i18n("&GDB cmd:"), this);
    label->setBuddy(m_userGDBCmdEditor);

    m_Interrupt = new QToolButton( this );
    m_Interrupt->setIcon ( KIcon ( "media-playback-pause" ) );
    m_Interrupt->setToolTip( i18n ( "Pause execution of the app to enter gdb commands" ) );

    QVBoxLayout *topLayout = new QVBoxLayout(this);
    topLayout->addWidget(m_gdbView);
    topLayout->setStretchFactor(m_gdbView, 1);
    topLayout->setMargin(0);

    QBoxLayout *userGDBCmdEntry = new QHBoxLayout();
    userGDBCmdEntry->addWidget(label);
    userGDBCmdEntry->addWidget(m_userGDBCmdEditor);
    userGDBCmdEntry->setStretchFactor(m_userGDBCmdEditor, 1);
    userGDBCmdEntry->addWidget(m_Interrupt);
    topLayout->addLayout(userGDBCmdEntry);

    setLayout(topLayout);

    slotStateChanged(s_none, s_dbgNotStarted);

    connect( m_userGDBCmdEditor, SIGNAL(returnPressed()), SLOT(slotGDBCmd()) );
    connect( m_Interrupt,        SIGNAL(clicked()),       SIGNAL(breakInto()));

    updateTimer_.setSingleShot(true);
    connect( &updateTimer_, SIGNAL(timeout()),
             this,  SLOT(flushPending()));

    connect(KDevelop::ICore::self()->debugController(), 
            SIGNAL(currentSessionChanged(KDevelop::IDebugSession*)),
            SLOT(currentSessionChanged(KDevelop::IDebugSession*)));

    connect(plugin, SIGNAL(reset()), this, SLOT(clear()));
    connect(plugin, SIGNAL(raiseGdbConsoleViews()), SIGNAL(requestRaise()));

    currentSessionChanged(KDevelop::ICore::self()->debugController()->currentSession());

    connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
            this, SLOT(updateColors()));
    updateColors();

}