ValgrindGenericConfigPage::ValgrindGenericConfigPage(ValgrindPlugin *plugin, QWidget *parent)
    : LaunchConfigurationPage(parent)
{
    ui = new Ui::ValgrindGenericConfig();
    ui->setupUi(this);

    connect( ui->valgrindExecutable, SIGNAL(textChanged(QString)), SIGNAL(changed()) );
    connect( ui->valgrindExecutable, SIGNAL(urlSelected(QUrl)), SIGNAL(changed()) );
    connect( ui->valgrindParameters, SIGNAL(textEdited(QString)), SIGNAL(changed()) );
    connect( ui->limitErrors, SIGNAL(toggled(bool)), SIGNAL(changed()) );
    connect( ui->maxStackSize, SIGNAL(valueChanged(int)), SIGNAL(changed()) );
    connect( ui->stackDepth, SIGNAL(valueChanged(int)), SIGNAL(changed()) );

    QStringList	tools;

    tools << "memcheck";

    /*
    ** Unimplemented tools: See valgrindlauncher.cpp to activate their configuration tab
    */
    // tools << "cachegrind";
    // tools << "callgrind";
    // tools << "helgrind";
    // tools << "massif";

    ui->currentTool->addItems(tools);

    connect( ui->currentTool, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
    connect( this, SIGNAL(newCurrentTool(QString)), plugin, SLOT(updateCurrentTool(QString)) );
}
StartMainPage::StartMainPage(QWidget* parent, GvCore* gvCore)
: QFrame(parent)
, d(new StartMainPagePrivate)
{
    d->q = this;
    d->mGvCore = gvCore;
    d->mSearchUiInitialized = false;

    d->setupUi(this);
    if (styleIsGtkBased()) {
        // Gtk-based styles do not apply the correct background color on tabs.
        // As a workaround, use the Plastique style instead.
        QStyle* fix = new QPlastiqueStyle();
        fix->setParent(this);
        d->mHistoryWidget->tabBar()->setStyle(fix);
        d->mPlacesTagsWidget->tabBar()->setStyle(fix);
    }
    setFrameStyle(QFrame::NoFrame);

    // Bookmark view
    d->mBookmarksModel = new KFilePlacesModel(this);

    d->mBookmarksView->setModel(d->mBookmarksModel);
    d->mBookmarksView->setAutoResizeItemsEnabled(false);

    connect(d->mBookmarksView, SIGNAL(urlChanged(KUrl)),
            SIGNAL(urlSelected(KUrl)));

    // Tag view
    connect(d->mTagView, SIGNAL(clicked(QModelIndex)),
            SLOT(slotTagViewClicked(QModelIndex)));

    // Recent folder view
    connect(d->mRecentFoldersView, SIGNAL(indexActivated(QModelIndex)),
            SLOT(slotListViewActivated(QModelIndex)));

    connect(d->mRecentFoldersView, SIGNAL(customContextMenuRequested(QPoint)),
            SLOT(showRecentFoldersViewContextMenu(QPoint)));

    // Url bag view
    d->mRecentUrlsView->setItemDelegate(new HistoryViewDelegate(d->mRecentUrlsView));

    connect(d->mRecentUrlsView, SIGNAL(customContextMenuRequested(QPoint)),
            SLOT(showRecentFoldersViewContextMenu(QPoint)));

    if (KGlobalSettings::singleClick()) {
        if (KGlobalSettings::changeCursorOverIcon()) {
            d->mRecentUrlsView->setCursor(Qt::PointingHandCursor);
        }
        connect(d->mRecentUrlsView, SIGNAL(clicked(QModelIndex)),
                SLOT(slotListViewActivated(QModelIndex)));
    } else {
        connect(d->mRecentUrlsView, SIGNAL(doubleClicked(QModelIndex)),
                SLOT(slotListViewActivated(QModelIndex)));
    }

    d->updateHistoryTab();
    connect(GwenviewConfig::self(), SIGNAL(configChanged()),
            SLOT(slotConfigChanged()));
}
示例#3
0
void SearchListView::onListItemSelected(const QModelIndex & index)
{
    if(index.isValid())
    {
        TreeItem *itm = static_cast<TreeItem*>(index.internalPointer());
        if(itm != NULL && itm->getType() == ModelUtil::Link)
            emit urlSelected(itm->getLink());
    }
}
SvnImportMetadataWidget::SvnImportMetadataWidget( QWidget *parent )
    : VcsImportMetadataWidget( parent ), m_ui(new Ui::SvnImportMetadataWidget)
    , useSourceDirForDestination( false )
{
    m_ui->setupUi( this );
    m_ui->srcEdit->setUrl( QUrl() );
    connect( m_ui->srcEdit, SIGNAL(textChanged(QString)), SIGNAL(changed()) );
    connect( m_ui->srcEdit, SIGNAL(urlSelected(QUrl)), SIGNAL(changed()) );
    connect( m_ui->dest, SIGNAL(textChanged(QString)), this, SIGNAL(changed()) );
    connect( m_ui->message, SIGNAL(textChanged()), this, SIGNAL(changed()) );
}
示例#5
0
void StartMainPage::slotTagViewClicked(const QModelIndex& index)
{
#ifdef GWENVIEW_SEMANTICINFO_BACKEND_NEPOMUK
    if (!index.isValid()) {
        return;
    }
    // FIXME: Check label encoding
    Nepomuk2::Tag tagr(index.data().toString());
    KUrl url = KUrl(tagr.uri()).url();
    emit urlSelected(url);
#endif
}
void k9ChapterEdit::setAviFile(k9AviFile *_aviFile) {
    this->setEnabled(_aviFile!=NULL);
    m_aviFile=_aviFile;
    if (_aviFile) {
	setEnabled(true);
        m_noUpdate=true;
	Ui_chapterEdit.ckBreakStart->setEnabled(_aviFile->getReencode());
	Ui_chapterEdit.ckBreakEnd->setEnabled(_aviFile->getReencode());
	Ui_chapterEdit.twstart->setEnabled(_aviFile->getReencode());
	Ui_chapterEdit.twend->setEnabled(_aviFile->getReencode());


        urlSelected(m_aviFile->getFileName());

        k9AviFile *p=m_aviFile->getPrevious();
        k9AviFile *n=m_aviFile->getNext();
	QTime end(0,0,0);
	m_minTime=end;;
	end=end.addSecs((int)(m_aviDecode->getDuration()));
	m_maxTime=end;

        if (p) {
            if(p->getFileName() !=_aviFile->getFileName()) {
                Ui_chapterEdit.ckBreakStart->setEnabled(false);
                m_minTime.setHMS(0,0,0,0);
            } else {
                Ui_chapterEdit.ckBreakStart->setEnabled(true);
                m_minTime=p->getStart();
            }
        }
        if (n) {
            if(n->getFileName() !=_aviFile->getFileName()) {
                Ui_chapterEdit.ckBreakEnd->setEnabled(false);
                m_maxTime=_aviFile->getEnd();
            } else {
                Ui_chapterEdit.ckBreakEnd->setEnabled(true);
                m_maxTime=n->getEnd();
            }
        }


        Ui_chapterEdit.twstart->setTime(m_aviFile->getStart());
        Ui_chapterEdit.twend->setTime(m_aviFile->getEnd());
        Ui_chapterEdit.urFile->setUrl(m_aviFile->getFileName());

        Ui_chapterEdit.ckBreakStart->setChecked(m_aviFile->getBreakPrevious());
        Ui_chapterEdit.ckBreakEnd->setChecked(m_aviFile->getBreakNext());
    } else
	setEnabled(false);
    m_noUpdate=false;

}
示例#7
0
MainWindowView::MainWindowView(MainWindow *parent)
    : m_ui(new Ui::MainWindowView)
    , m_parent(parent)
    , m_model(0)
    , m_pt(0)
{
    m_ui->setupUi(this);
	m_ui->splitter->setStretchFactor(1, 3);
    
    QMenu* moreButtonMenu = new QMenu(m_ui->moreButton);
    moreButtonMenu->addAction(QIcon::fromTheme("view-preview"), i18n("New Image"))->setProperty("type", int(CARD_IMAGE));
    moreButtonMenu->addAction(QIcon::fromTheme("preferences-plugin"), i18n("New Logic Relation"))->setProperty("type", int(CARD_LOGIC));
    moreButtonMenu->addAction(QIcon::fromTheme("preferences-desktop-text-to-speech"), i18n("New Sound"))->setProperty("type", int(CARD_SOUND));
    moreButtonMenu->addAction(QIcon::fromTheme("preferences-desktop-font"), i18n("New Word"))->setProperty("type", int(CARD_WORD));
    moreButtonMenu->addAction(QIcon::fromTheme("dialog-ok-apply"), i18n("New Found Sound"))->setProperty("type", int(CARD_FOUND));
	connect(moreButtonMenu, SIGNAL(triggered(QAction*)), this, SLOT(addFeature(QAction*)));
    m_ui->moreButton->setMenu(moreButtonMenu);

	connect(m_ui->fileKurl, SIGNAL(urlSelected(KUrl)), this, SLOT(fileSelected()));
	connect(m_ui->backKurl, SIGNAL(urlSelected(KUrl)), this, SLOT(backSelected()));
	connect(m_ui->wordEdit, SIGNAL(textChanged(QString)), this, SLOT(wordChanged(QString)));
	connect(m_ui->playButton, SIGNAL(clicked()), this, SLOT(playSound()));
	connect(m_ui->delButton, SIGNAL(clicked()), this, SLOT(deleteElement()));
	connect(m_ui->addButton, SIGNAL(clicked()), this, SLOT(addElement()));

	connect(m_ui->titleEdit, SIGNAL(textEdited(QString)), this, SIGNAL(changed()));
	connect(m_ui->descriptionEdit, SIGNAL(textEdited(QString)), this, SIGNAL(changed()));
	connect(m_ui->authorEdit, SIGNAL(textEdited(QString)), this, SIGNAL(changed()));
	connect(m_ui->versionEdit, SIGNAL(textEdited(QString)), this, SIGNAL(changed()));
	connect(m_ui->dateEdit, SIGNAL(dateChanged(QDate)), this, SIGNAL(changed()));
	connect(m_ui->maintypeBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed()));


    m_media = new Phonon::MediaObject(this);
    Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::GameCategory, this);
    createPath(m_media, audioOutput);

}
示例#8
0
void StartMainPage::slotListViewActivated(const QModelIndex& index)
{
    if (!index.isValid()) {
        return;
    }
    QVariant data = index.data(KFilePlacesModel::UrlRole);
    KUrl url = data.toUrl();

    // Prevent dir lister error
    if (!url.isValid()) {
        kError() << "Tried to open an invalid url";
        return;
    }
    emit urlSelected(url);
}
ScriptAppConfigPage::ScriptAppConfigPage( QWidget* parent )
    : LaunchConfigurationPage( parent )
{
    setupUi(this);
    interpreter->lineEdit()->setPlaceholderText(i18n("Type or select an interpreter"));

    //Set workingdirectory widget to ask for directories rather than files
    workingDirectory->setMode(KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly);

    KDevelop::EnvironmentGroupList env( KGlobal::config() );
    environment->addItems( env.groups() );


    //connect signals to changed signal
    connect( interpreter->lineEdit(), SIGNAL(textEdited(QString)), SIGNAL(changed()) );
    connect( executablePath->lineEdit(), SIGNAL(textEdited(QString)), SIGNAL(changed()) );
    connect( executablePath, SIGNAL(urlSelected(KUrl)), SIGNAL(changed()) );
    connect( arguments, SIGNAL(textEdited(QString)), SIGNAL(changed()) );
    connect( workingDirectory, SIGNAL(urlSelected(KUrl)), SIGNAL(changed()) );
    connect( workingDirectory->lineEdit(), SIGNAL(textEdited(QString)), SIGNAL(changed()) );
    connect( environment, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
    connect( remoteHostCheckbox, SIGNAL(toggled(bool)), remoteHost, SLOT(setEnabled(bool)));
    //connect( runInTerminal, SIGNAL(toggled(bool)), SIGNAL(changed()) );
}
示例#10
0
HomeView::HomeView(QWidget *parent)
    : QWidget(parent)
    , m_addressBar(0)
{
    m_addressBar = new AddressBar(parent);
    connect(m_addressBar, SIGNAL(addressEntered(QString)), SLOT(gotoAddress(QString)));

    m_bookmarks = new BookmarksView(parent);
    connect(m_bookmarks, SIGNAL(urlSelected(QUrl)), SIGNAL(urlActivated(QUrl)));

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setMargin(4);
    layout->setSpacing(4);
    layout->addWidget(m_addressBar);
    layout->addWidget(m_bookmarks);
}
示例#11
0
DesktopViewProxy::DesktopViewProxy(MainWindow* mainWindow, KisMainWindow* parent)
    : QObject(parent)
    , d(new Private(mainWindow, parent))
{
    Q_ASSERT(parent); // "There MUST be a KisMainWindow assigned, otherwise everything will blow up");

    // Hide this one... as it doesn't work at all well and release happens :P
    QAction* closeAction = d->desktopWindow->actionCollection()->action("file_close");
    closeAction->setVisible(false);

    // Concept is simple - simply steal all the actions we require to work differently, and reconnect them to local functions
    QAction* newAction = d->desktopWindow->actionCollection()->action("file_new");
    newAction->disconnect(d->desktopWindow);
    connect(newAction, SIGNAL(triggered(bool)), this, SLOT(fileNew()));
    QAction* openAction = d->desktopWindow->actionCollection()->action("file_open");
    openAction->disconnect(d->desktopWindow);
    connect(openAction, SIGNAL(triggered(bool)), this, SLOT(fileOpen()));
    QAction* saveAction = d->desktopWindow->actionCollection()->action("file_save");
    saveAction->disconnect(d->desktopWindow);
    connect(saveAction, SIGNAL(triggered(bool)), this, SLOT(fileSave()));
    QAction* saveasAction = d->desktopWindow->actionCollection()->action("file_save_as");
    saveasAction->disconnect(d->desktopWindow);
    connect(saveasAction, SIGNAL(triggered(bool)), this, SLOT(fileSaveAs()));
    QAction* reloadAction = d->desktopWindow->actionCollection()->action("file_reload_file");
    reloadAction->disconnect(d->desktopWindow);
    connect(reloadAction, SIGNAL(triggered(bool)), this, SLOT(reload()));
    QAction* loadExistingAsNewAction = d->desktopWindow->actionCollection()->action("file_import_file");
    //Hide the "Load existing as new" action. It serves little purpose and currently
    //does the same as open. We cannot just remove it from the action collection though
    //since that causes a crash in KisMainWindow.
    loadExistingAsNewAction->setVisible(false);

    // Recent files need a touch more work, as they aren't simply an action.
    KRecentFilesAction* recent = qobject_cast<KRecentFilesAction*>(d->desktopWindow->actionCollection()->action("file_open_recent"));
    recent->disconnect(d->desktopWindow);
    connect(recent, SIGNAL(urlSelected(QUrl)), this, SLOT(slotFileOpenRecent(QUrl)));
    recent->clear();
    recent->loadEntries(KGlobal::config()->group("RecentFiles"));

    connect(d->desktopWindow, SIGNAL(documentSaved()), this, SIGNAL(documentSaved()));

    // XXX: Shortcut editor is untested in Gemini since refactoring.
    connect(KisActionRegistry::instance(), SIGNAL(shortcutsUpdated()), this, SLOT(updateShortcuts()));

}
示例#12
0
Palapeli::PuzzleCreatorDialog::PuzzleCreatorDialog()
	: m_result(0)
	, m_imageSelector(new KUrlRequester)
	, m_nameEdit(new KLineEdit)
	, m_commentEdit(new KLineEdit)
	, m_authorEdit(new KLineEdit)
	, m_slicerSelector(new Palapeli::SlicerSelector)
	, m_slicerConfigMasterWidget(new QStackedWidget)
{
	//setup dialog
	setCaption(i18nc("@title:window", "Create new puzzle"));
	showButton(KDialog::Help, false);
	//setup image selector
	m_imageSelector->setMode(KFile::File | KFile::LocalOnly | KFile::ExistingOnly);
	//build sublayouts
	QFormLayout* sourceLayout = new QFormLayout;
	sourceLayout->addRow(i18nc("@label:chooser", "Image file:"), m_imageSelector);
	sourceLayout->addRow(new QLabel(i18nc("@info", "Please describe below the image which you have chosen.")));
	sourceLayout->addRow(i18nc("@label:textbox", "Image name:"), m_nameEdit);
	sourceLayout->addRow(i18nc("@label:textbox (like in: This comment is optional.)", "Optional comment:"), m_commentEdit);
	sourceLayout->addRow(i18nc("@label:textbox", "Name of image author:"), m_authorEdit);
	foreach (const Pala::Slicer* slicer, m_slicerSelector->slicers())
	{
		m_slicerConfigWidgets[slicer] = new Palapeli::SlicerConfigWidget(slicer);
		m_slicerConfigMasterWidget->addWidget(m_slicerConfigWidgets[slicer]);
	}
	//build page widget items
	m_sourcePage = addPage(new QWidget, i18nc("@item:inlistbox (page name in an assistant dialog)", "Choose image"));
	m_sourcePage->setHeader(i18nc("@title:tab (page header in an assistant dialog)", "Specify the source image to be sliced into pieces"));
	m_sourcePage->widget()->setLayout(sourceLayout);
	m_slicerPage = addPage(m_slicerSelector, i18nc("@item:inlistbox (page name in an assistant dialog)", "Choose slicer"));
	m_slicerPage->setHeader(i18nc("@title:tab (page header in an assistant dialog)", "Choose a slicing method"));
	m_slicerConfigPage = addPage(m_slicerConfigMasterWidget, i18nc("@item:inlistbox (page name in an assistant dialog)", "Configure slicer"));
	m_slicerConfigPage->setHeader(i18nc("@title:tab (page header in an assistant dialog)", "Tweak the parameters of the chosen slicing method"));
	//wire up stuff
	connect(this, SIGNAL(accepted()), this, SLOT(createPuzzle()));
	connect(m_imageSelector, SIGNAL(urlSelected(KUrl)), this, SLOT(checkData()));
	connect(m_nameEdit, SIGNAL(textChanged(QString)), this, SLOT(checkData()));
	connect(m_authorEdit, SIGNAL(textChanged(QString)), this, SLOT(checkData()));
	checkData(); //to invalidate first page
	connect(m_slicerSelector, SIGNAL(currentSelectionChanged(Palapeli::SlicerSelection)), this, SLOT(updateSlicerSelection(Palapeli::SlicerSelection)));
}
示例#13
0
void BasicTab::initConnections()
{
    // general tab's components
    connect(_nameEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
    connect(_descriptionEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
    connect(_commentEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
    connect(_execEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
    connect(_execEdit, SIGNAL(urlSelected(KUrl)), SLOT(slotExecSelected()));
    connect(_launchCB, SIGNAL(clicked()), SLOT(launchcb_clicked()));
    connect(_systrayCB, SIGNAL(clicked()), SLOT(systraycb_clicked()));
    connect(_onlyShowInKdeCB, SIGNAL(clicked()), SLOT(onlyshowcb_clicked()));
    connect(_hiddenEntryCB, SIGNAL(clicked()), SLOT(hiddenentrycb_clicked()));
    connect(_iconButton, SIGNAL(iconChanged(QString)), SLOT(slotChanged()));

    // advanced tab's components
    connect(_pathEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
    connect(_terminalCB, SIGNAL(clicked()), SLOT(termcb_clicked()));
    connect(_terminalOptionsEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
    connect(_userCB, SIGNAL(clicked()), SLOT(uidcb_clicked()));
    connect(_userNameEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()));
    connect(_keyBindingEdit, SIGNAL(keySequenceChanged(QKeySequence)), this, SLOT(slotCapturedKeySequence(QKeySequence)));
}
示例#14
0
void k9ChapterEdit::setAviFile(k9AviFile *_aviFile) {
    this->setEnabled(_aviFile!=NULL);
    m_aviFile=_aviFile;
    if (_aviFile) {
        m_noUpdate=true;
        k9AviFile *p=m_aviFile->getPrevious();
        k9AviFile *n=m_aviFile->getNext();
	m_minTime=m_aviFile->getStart();
	m_maxTime=m_aviFile->getEnd();
        if (p) {
            if(p->getFileName() !=_aviFile->getFileName()) {
                ckBreakStart->setEnabled(false);
                m_minTime.setHMS(0,0,0,0);
            } else {
                ckBreakStart->setEnabled(true);
                m_minTime=p->getStart();
            }
        }
        if (n) {
            if(n->getFileName() !=_aviFile->getFileName()) {
                ckBreakEnd->setEnabled(false);
                m_maxTime=_aviFile->getEnd();
            } else {
                ckBreakEnd->setEnabled(true);
                m_maxTime=n->getEnd();
            }
        }


        twstart->setTime(m_aviFile->getStart());
        twend->setTime(m_aviFile->getEnd());
        urFile->setURL(m_aviFile->getFileName());
        urlSelected(m_aviFile->getFileName());
        ckBreakStart->setChecked(m_aviFile->getBreakPrevious());
        ckBreakEnd->setChecked(m_aviFile->getBreakNext());
    }
    m_noUpdate=false;

}
示例#15
0
// link this page to SimpleViewer to gain acess to settings container.
FirstRunPage::FirstRunPage(KAssistantDialog* const dlg)
    : KPWizardPage(dlg, i18n("First Run")),
      d(new FirstRunPagePriv)
{
    KVBox* vbox   = new KVBox(this);
//    QVBoxLayout* topLayout = new QVBoxLayout(vbox);
    QLabel* info1 = new QLabel(vbox);
    info1->setWordWrap(true);
    info1->setText( i18n("<p>SimpleViewer's plugins are Flash components which are free to use, "
                         "but use a license which comes into conflict with several distributions. "
                         "Due to the license it is not possible to ship it with this tool.</p>"
                         "<p>You can now download plugin from its homepage and point this tool "
                         "to the downloaded archive. The archive will be stored with the plugin configuration, "
                         "so it is available for further use.</p>"
                         "<p><b>Note: Please download the plugin that you selected on the first page.</b></p>"));

    QLabel* info2   = new QLabel(vbox);
    info2->setText(i18n("<p>1.) Download plugin from the following url:</p>"));

    KUrlLabel* link = new KUrlLabel(vbox);
    link->setText("http://www.simpleviewer.net");
    link->setUrl("http://www.simpleviewer.net");

    connect(link, SIGNAL(leftClickedUrl(QString)),
            this, SLOT(slotDownload(QString)));

    QLabel* info3   = new QLabel(vbox);
    info3->setText(i18n("<p>2.) Point this tool to the downloaded archive</p>"));

    d->urlRequester = new KUrlRequester(vbox);
    connect(d->urlRequester, SIGNAL(urlSelected(KUrl)),
            this, SLOT(slotUrlSelected(KUrl)));

    setPageWidget(vbox);
    setLeftBottomPix(DesktopIcon("flash", 128));
}
示例#16
0
BasicTab::BasicTab( QWidget *parent )
    : KTabWidget(parent)
{
    _menuFolderInfo = 0;
    _menuEntryInfo = 0;

    // general group
    QWidget *general_group = new QWidget();
    QGridLayout *grid = new QGridLayout(general_group);
    grid->setMargin( KDialog::marginHint() );
    grid->setSpacing( KDialog::spacingHint() );

    general_group->setAcceptDrops(false);

    // setup line inputs
    _nameEdit = new KLineEdit(general_group);
    _nameEdit->setAcceptDrops(false);
    _descriptionEdit = new KLineSpellChecking(general_group);
    _descriptionEdit->setAcceptDrops(false);
    _commentEdit = new KLineSpellChecking(general_group);
    _commentEdit->setAcceptDrops(false);
    _execEdit = new KUrlRequester(general_group);
    _execEdit->lineEdit()->setAcceptDrops(false);
    _execEdit->setWhatsThis(i18n(
                                "Following the command, you can have several place holders which will be replaced "
                                "with the actual values when the actual program is run:\n"
                                "%f - a single file name\n"
                                "%F - a list of files; use for applications that can open several local files at once\n"
                                "%u - a single URL\n"
                                "%U - a list of URLs\n"
                                "%d - the folder of the file to open\n"
                                "%D - a list of folders\n"
                                "%i - the icon\n"
                                "%m - the mini-icon\n"
                                "%c - the caption"));

    _launchCB = new QCheckBox(i18n("Enable &launch feedback"), general_group);
    _systrayCB = new QCheckBox(i18n("&Place in system tray"), general_group);
    _onlyShowInKdeCB = new QCheckBox( i18n( "Only show in KDE" ), general_group );
    _hiddenEntryCB = new QCheckBox( i18n( "Hidden entry" ), general_group );
    _hiddenEntryCB->hide();

    // setup labels
    _nameLabel = new QLabel(i18n("&Name:"),general_group);
    _nameLabel->setBuddy(_nameEdit);
    _descriptionLabel = new QLabel(i18n("&Description:"),general_group);
    _descriptionLabel->setBuddy(_descriptionEdit);
    _commentLabel = new QLabel(i18n("&Comment:"),general_group);
    _commentLabel->setBuddy(_commentEdit);
    _execLabel = new QLabel(i18n("Co&mmand:"),general_group);
    _execLabel->setBuddy(_execEdit);
    grid->addWidget(_nameLabel, 0, 0);
    grid->addWidget(_descriptionLabel, 1, 0);
    grid->addWidget(_commentLabel, 2, 0);
    grid->addWidget(_execLabel, 3, 0);

    // connect line inputs
    connect(_nameEdit, SIGNAL(textChanged(QString)),
            SLOT(slotChanged()));
    connect(_descriptionEdit, SIGNAL(textChanged(QString)),
            SLOT(slotChanged()));
    connect(_commentEdit, SIGNAL(textChanged(QString)),
            SLOT(slotChanged()));
    connect(_execEdit, SIGNAL(textChanged(QString)),
            SLOT(slotChanged()));
    connect(_execEdit, SIGNAL(urlSelected(KUrl)),
            SLOT(slotExecSelected()));
    connect(_launchCB, SIGNAL(clicked()), SLOT(launchcb_clicked()));
    connect(_systrayCB, SIGNAL(clicked()), SLOT(systraycb_clicked()));
    connect(_onlyShowInKdeCB, SIGNAL(clicked()), SLOT(onlyshowcb_clicked()) );
    connect( _hiddenEntryCB, SIGNAL(clicked()), SLOT(hiddenentrycb_clicked()) );
    // add line inputs to the grid
    grid->addWidget(_nameEdit, 0, 1, 1, 1);
    grid->addWidget(_descriptionEdit, 1, 1, 1, 1);
    grid->addWidget(_commentEdit, 2, 1, 1, 2);
    grid->addWidget(_execEdit, 3, 1, 1, 2);
    grid->addWidget(_launchCB, 4, 0, 1, 3 );
    grid->addWidget(_systrayCB, 5, 0, 1, 3 );
    grid->addWidget(_onlyShowInKdeCB, 6, 0, 1, 3 );
    grid->addWidget(_hiddenEntryCB, 7, 0, 1, 3 );

    // setup icon button
    _iconButton = new KIconButton(general_group);
    _iconButton->setFixedSize(56,56);
    _iconButton->setIconSize(32);
    connect(_iconButton, SIGNAL(iconChanged(QString)), SLOT(slotChanged()));
    grid->addWidget(_iconButton, 0, 2, 2, 1);
    grid->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding), 8, 0, 1, 3);

    // add the general group to the main layout
    addTab(general_group, i18n("General"));

    QWidget *advanced = new QWidget();
    QVBoxLayout *advancedLayout = new QVBoxLayout(advanced);

    // path group
    _path_group = new QGroupBox(this);
    QHBoxLayout *hboxLayout1 = new QHBoxLayout(_path_group);
    hboxLayout1->setSpacing(KDialog::spacingHint());
    hboxLayout1->setMargin(KDialog::marginHint());

    _pathLabel = new QLabel(i18n("&Work path:"), _path_group);
    hboxLayout1->addWidget(_pathLabel);
    _pathEdit = new KUrlRequester(_path_group);
    hboxLayout1->addWidget(_pathEdit);
    _pathEdit->setMode(KFile::Directory | KFile::LocalOnly);
    _pathEdit->lineEdit()->setAcceptDrops(false);

    _pathLabel->setBuddy(_pathEdit);

    connect(_pathEdit, SIGNAL(textChanged(QString)),
            SLOT(slotChanged()));
    advancedLayout->addWidget(_path_group);

    // terminal group
    _term_group = new QGroupBox(this);
    QVBoxLayout *vbox = new QVBoxLayout(_term_group);
    vbox->setMargin(KDialog::marginHint());
    vbox->setSpacing(KDialog::spacingHint());

    _terminalCB = new QCheckBox(i18n("Run in term&inal"), _term_group);
    connect(_terminalCB, SIGNAL(clicked()), SLOT(termcb_clicked()));
    vbox->addWidget(_terminalCB);

    QWidget *hbox = new QWidget(_term_group);
    QHBoxLayout *hboxLayout2 = new QHBoxLayout(hbox);
    hbox->setLayout(hboxLayout2);
    hboxLayout2->setSpacing(KDialog::spacingHint());
    _termOptLabel = new QLabel(i18n("Terminal &options:"), hbox);
    hboxLayout2->addWidget(_termOptLabel);
    _termOptEdit = new KLineEdit(hbox);
    hboxLayout2->addWidget(_termOptEdit);
    _termOptEdit->setAcceptDrops(false);
    _termOptLabel->setBuddy(_termOptEdit);

    connect(_termOptEdit, SIGNAL(textChanged(QString)),
            SLOT(slotChanged()));
    vbox->addWidget(hbox);
    advancedLayout->addWidget(_term_group);

    _termOptEdit->setEnabled(false);

    // uid group
    _uid_group = new QGroupBox(this);
    vbox = new QVBoxLayout(_uid_group);
    vbox->setMargin(KDialog::marginHint());
    vbox->setSpacing(KDialog::spacingHint());

    _uidCB = new QCheckBox(i18n("&Run as a different user"), _uid_group);
    connect(_uidCB, SIGNAL(clicked()), SLOT(uidcb_clicked()));
    vbox->addWidget(_uidCB);

    hbox = new QWidget(_uid_group);
    QHBoxLayout *hboxLayout3 = new QHBoxLayout(hbox);
    hbox->setLayout(hboxLayout3);
    hboxLayout3->setSpacing(KDialog::spacingHint());
    _uidLabel = new QLabel(i18n("&Username:"******"Current shortcut &key:"), general_group_keybind);
    l->setBuddy( _keyEdit );
    keybindLayout->addWidget(l);
    connect( _keyEdit, SIGNAL(keySequenceChanged(QKeySequence)),
             this, SLOT(slotCapturedKeySequence(QKeySequence)));
    keybindLayout->addWidget(_keyEdit);
    advancedLayout->addWidget( general_group_keybind );

    advancedLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding));

    addTab(advanced, i18n("Advanced"));
    if (!KHotKeys::present())
        general_group_keybind->hide();
    slotDisableAction();
}
示例#17
0
void BookmarksView::activate(QListWidgetItem *item)
{
    QUrl url = item->text().prepend("http://");
    emit urlSelected(url);
}