void KgpgApp::initActions() { KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(slotFileNew()), actionCollection()); KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(slotFileOpen()), actionCollection()); KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(slotFileSaveAs()), actionCollection()); KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotFileQuit()), actionCollection()); KStdAction::cut(TQT_TQOBJECT(this), TQT_SLOT(slotEditCut()), actionCollection()); KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(slotEditCopy()), actionCollection()); KStdAction::paste(TQT_TQOBJECT(this), TQT_SLOT(slotEditPaste()), actionCollection()); KStdAction::selectAll(TQT_TQOBJECT(this), TQT_SLOT(slotSelectAll()), actionCollection()); KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotOptions()), actionCollection(),"kgpg_config"); //KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); //KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(slotConfigureToolbars()), actionCollection()); fileSave = KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(slotFileSave()), actionCollection()); (void) new TDEAction(i18n("&Encrypt File..."), "encrypted", 0,TQT_TQOBJECT(this), TQT_SLOT(slotFilePreEnc()), actionCollection(),"file_encrypt"); (void) new TDEAction(i18n("&Decrypt File..."), "decrypted", 0,TQT_TQOBJECT(this), TQT_SLOT(slotFilePreDec()), actionCollection(),"file_decrypt"); (void) new TDEAction(i18n("&Open Key Manager"), "kgpg", 0,TQT_TQOBJECT(this), TQT_SLOT(slotKeyManager()), actionCollection(),"key_manage"); editUndo = KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(slotundo()), actionCollection()); editRedo = KStdAction::redo(TQT_TQOBJECT(this), TQT_SLOT(slotredo()), actionCollection()); //(void) new TDEAction(i18n("&Manage Keys"), "kgpg_manage", CTRL+Key_K,TQT_TQOBJECT(this), TQT_SLOT(slotManageKey()), actionCollection(),"keys_manage"); (void) new TDEAction(i18n("&Generate Signature..."),0, TQT_TQOBJECT(this), TQT_SLOT(slotPreSignFile()), actionCollection(), "sign_generate"); (void) new TDEAction(i18n("&Verify Signature..."),0, TQT_TQOBJECT(this), TQT_SLOT(slotPreVerifyFile()), actionCollection(), "sign_verify"); (void) new TDEAction(i18n("&Check MD5 Sum..."), 0,TQT_TQOBJECT(this), TQT_SLOT(slotCheckMd5()), actionCollection(), "sign_check"); KStdAction::print(TQT_TQOBJECT(this), TQT_SLOT(slotFilePrint()), actionCollection()); // comment out for now, only confusing //encodingAction=new TDEToggleAction(i18n("&Unicode (utf-8) Encoding"), 0, 0,this, TQT_SLOT(slotSetCharset()),actionCollection(),"charsets"); }
int FunctionManager::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: slotModeChanged((*reinterpret_cast< Doc::Mode(*)>(_a[1]))); break; case 1: slotFunctionRemoved((*reinterpret_cast< quint32(*)>(_a[1]))); break; case 2: slotTreeSelectionChanged(); break; case 3: slotTreeContextMenuRequested((*reinterpret_cast< const QPoint(*)>(_a[1]))); break; case 4: slotBusTriggered((*reinterpret_cast< QAction*(*)>(_a[1]))); break; case 5: slotBusNameChanged((*reinterpret_cast< quint32(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2]))); break; case 6: slotAddScene(); break; case 7: slotAddChaser(); break; case 8: slotAddCollection(); break; case 9: slotAddEFX(); break; case 10: slotWizard(); break; case 11: { int _r = slotEdit(); if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; case 12: slotClone(); break; case 13: slotDelete(); break; case 14: slotSelectAll(); break; default: ; } _id -= 15; } return _id; }
void KSlovar::registerButtons() { m_newDictionary = new KAction(i18n("&New dictionary"), "filenew", KShortcut(KKey("CTRL+n")), this, SLOT(slotNewDictionary()), actionCollection(), "newDictionary"); m_openDictionary = KStdAction::open(this, SLOT(slotFileOpen()), actionCollection()); m_quit = KStdAction::quit(kapp, SLOT(quit()), actionCollection()); m_back=KStdAction::back(this, SLOT(slotPrevPhrase()), actionCollection()); m_forward=KStdAction::forward(this, SLOT(slotNextPhrase()), actionCollection()); m_home=KStdAction::home(this, SLOT(slotHome()), actionCollection()); m_editDictionary = new KAction(i18n("&Edit dictionary"), "edit", KShortcut(KKey("CTRL+e")), this, SLOT(slotEditDictionary()), actionCollection(), "editDictionary"); m_close=KStdAction::close(this, SLOT(slotClose()), actionCollection()); m_find = KStdAction::find(this, SLOT(slotFind()), actionCollection()); m_findNext = KStdAction::findNext(this, SLOT(slotFindNext()), actionCollection()); m_literalSearch = new KToggleAction(i18n("&Literal search"), "filter", KShortcut(KKey("CTRL+l")), this, SLOT(slotToggleLiteral()), actionCollection(), "literalSearch"); m_backSearch = new KToggleAction(i18n("Ba&ck search"), "previous", KShortcut(KKey("CTRL+b")), this, SLOT(slotToggleBack()), actionCollection(), "backSearch"); m_print=KStdAction::print(this, SLOT(slotPrint()), actionCollection()); m_selectAll=KStdAction::selectAll(this, SLOT(slotSelectAll()), actionCollection()); m_addPhrase=new KAction(i18n("&Add phrase"), "filenew", KShortcut(KKey("CTRL+a")), this, SLOT(slotAddPhrase()), actionCollection(), "addPhrase"); m_editPhrase=new KAction(i18n("Edi&t phrase"), "edit", KShortcut(KKey("CTRL+t")), this, SLOT(slotEditPhrase()), actionCollection(), "editPhrase"); m_removePhrase=new KAction(i18n("&Remove phrase"), "editdelete", KShortcut(KKey("Delete")), this, SLOT(slotRemovePhrase()), actionCollection(), "removePhrase"); m_listPopup=new QPopupMenu; m_addPhrase->plug(m_listPopup); m_editPhrase->plug(m_listPopup); m_removePhrase->plug(m_listPopup); m_config = KStdAction::preferences(this, SLOT(slotConfigure()), actionCollection()); m_conversion = new KAction(i18n("Edit &conversion table"), "conversion", this, SLOT(slotConversionTable()), actionCollection(), "editConversion"); m_update = new KAction(i18n("Update &languages"), "ktalkd", KShortcut(KKey("")), this, SLOT(slotDownloadLanguage()), actionCollection(), "updateLanguages"); m_wizard = new KAction(i18n("Run &First-time wizard"), "wizard", KShortcut(KKey("")), this, SLOT(slotFirstRunWizard()), actionCollection(), "firstRunWizard"); }
void PlotWindow::createActions() { mpaToggleLogX = new QAction("Log &X", this); mpaToggleLogX->setCheckable(true); mpaToggleLogX->setToolTip("Toggle x-axis logscale."); connect(mpaToggleLogX, SIGNAL(toggled(bool)), this, SLOT(toggleLogX(bool))); mpaToggleLogY = new QAction("Log &Y", this); mpaToggleLogY->setCheckable(true); mpaToggleLogY->setToolTip("Toggle y-axis logscale."); connect(mpaToggleLogY, SIGNAL(toggled(bool)), this, SLOT(toggleLogY(bool))); mpaPrint = new QAction("Print", this); mpaPrint ->setToolTip("Print Plot"); mpaPrint -> setShortcut(Qt::CTRL + Qt::Key_P); connect(mpaPrint, SIGNAL(triggered()), this, SLOT(printPlot())); mpaSaveImage = new QAction("Save Image", this); mpaSaveImage ->setShortcut(Qt::CTRL + Qt::Key_S); mpaSaveImage ->setToolTip("Save Plot as Image"); connect(mpaSaveImage, SIGNAL(triggered()), this, SLOT(printAsImage())); mpaSaveData = new QAction("Save Data", this); mpaSaveData ->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_S); mpaSaveData ->setToolTip("Save Data"); connect(mpaSaveData, SIGNAL(triggered()), this, SLOT(slotSaveData())); mpaZoomOut = new QAction("Zoom out", this); mpaZoomOut ->setShortcut(Qt::CTRL + Qt::Key_0); mpaZoomOut ->setToolTip("Zoom out"); connect(mpaZoomOut, SIGNAL(triggered()), this, SLOT(slotZoomOut())); mpaShowAll = new QAction("Show All", this); mpaShowAll ->setShortcut(Qt::CTRL + Qt::Key_A); mpaShowAll ->setToolTip("Show all curves"); connect(mpaShowAll, SIGNAL(triggered()), this, SLOT(slotSelectAll())); mpaHideAll = new QAction("Hide All", this); mpaHideAll ->setShortcut(Qt::CTRL + Qt::Key_D); mpaHideAll ->setToolTip("Hide all curves"); connect(mpaHideAll, SIGNAL(triggered()), this, SLOT(slotDeselectAll())); mpaCloseWindow = new QAction("Close", this); mpaCloseWindow->setObjectName("close"); mpaCloseWindow->setShortcut(Qt::CTRL + Qt::Key_W); connect(mpaCloseWindow, SIGNAL(triggered()), this, SLOT(slotCloseWindow())); }
// private void kpMainWindow::setupEditMenuActions () { KActionCollection *ac = actionCollection (); // Undo/Redo // CONFIG: need GUI m_commandHistory = new kpCommandHistory (true/*read config*/, this); if (m_configFirstTime) { // (so that cfg-file-editing user can modify in the meantime) m_commandHistory->writeConfig (); } m_actionCut = KStdAction::cut (this, SLOT (slotCut ()), ac); m_actionCopy = KStdAction::copy (this, SLOT (slotCopy ()), ac); m_actionPaste = KStdAction::paste (this, SLOT (slotPaste ()), ac); m_actionPasteInNewWindow = new KAction (i18n ("Paste in &New Window"), Qt::CTRL + Qt::SHIFT + Qt::Key_V, this, SLOT (slotPasteInNewWindow ()), ac, "edit_paste_in_new_window"); //m_actionDelete = KStdAction::clear (this, SLOT (slotDelete ()), ac); m_actionDelete = new KAction (i18n ("&Delete Selection"), 0, this, SLOT (slotDelete ()), ac, "edit_clear"); m_actionSelectAll = KStdAction::selectAll (this, SLOT (slotSelectAll ()), ac); m_actionDeselect = KStdAction::deselect (this, SLOT (slotDeselect ()), ac); m_actionCopyToFile = new KAction (i18n ("C&opy to File..."), 0, this, SLOT (slotCopyToFile ()), ac, "edit_copy_to_file"); m_actionPasteFromFile = new KAction (i18n ("Paste &From File..."), 0, this, SLOT (slotPasteFromFile ()), ac, "edit_paste_from_file"); m_editMenuDocumentActionsEnabled = false; enableEditMenuDocumentActions (false); // Paste should always be enabled, as long as there is something paste // (independent of whether we have a document or not) connect (QApplication::clipboard (), SIGNAL (dataChanged ()), this, SLOT (slotEnablePaste ())); slotEnablePaste (); }
/** * Konstruktor */ BB_WidgetToolSelect::BB_WidgetToolSelect( BB_ToolMove* parentTool ) : BB_AbstractToolWidget(parentTool) { m_Selection = NULL; m_Ui.setupUi( this ); m_Ui.lineEdit_ObjectName->setText( "" ); m_Ui.lineEdit_ObjectName->setEnabled( false ); m_Ui.textEdit_ObjectDesc->setPlainText( "" ); m_Ui.textEdit_ObjectDesc->setEnabled( false ); connect( m_Ui.lineEdit_ObjectName, SIGNAL( editingFinished() ), this, SLOT( slotNameFinished() ) ); connect( m_Ui.textEdit_ObjectDesc, SIGNAL( textChanged() ), this, SLOT( slotDescFinished() ) ); connect( m_Ui.button_Delete, SIGNAL( released() ), this, SLOT( slotDeleteSelection() ) ); connect( m_Ui.button_SelectAll, SIGNAL( released() ), this, SLOT( slotSelectAll() ) ); }
void KWebKitPart::initActions() { actionCollection()->addAction(KStandardAction::SaveAs, "saveDocument", m_browserExtension, SLOT(slotSaveDocument())); QAction* action = new QAction(i18n("Save &Frame As..."), this); actionCollection()->addAction("saveFrame", action); connect(action, SIGNAL(triggered(bool)), m_browserExtension, SLOT(slotSaveFrame())); action = new QAction(KIcon("document-print-preview"), i18n("Print Preview"), this); actionCollection()->addAction("printPreview", action); connect(action, SIGNAL(triggered(bool)), m_browserExtension, SLOT(slotPrintPreview())); action = new QAction(KIcon("zoom-in"), i18nc("zoom in action", "Zoom In"), this); actionCollection()->addAction("zoomIn", action); actionCollection()->setDefaultShortcuts(action, QList<QKeySequence>() << QKeySequence(Qt::CTRL+Qt::Key_Plus) << QKeySequence(Qt::CTRL+Qt::Key_Equal)); connect(action, SIGNAL(triggered(bool)), m_browserExtension, SLOT(zoomIn())); action = new QAction(KIcon("zoom-out"), i18nc("zoom out action", "Zoom Out"), this); actionCollection()->addAction("zoomOut", action); actionCollection()->setDefaultShortcuts(action, QList<QKeySequence>() << QKeySequence(Qt::CTRL+Qt::Key_Minus) << QKeySequence(Qt::CTRL+Qt::Key_Underscore)); connect(action, SIGNAL(triggered(bool)), m_browserExtension, SLOT(zoomOut())); action = new QAction(KIcon("zoom-original"), i18nc("reset zoom action", "Actual Size"), this); actionCollection()->addAction("zoomNormal", action); actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL+Qt::Key_0)); connect(action, SIGNAL(triggered(bool)), m_browserExtension, SLOT(zoomNormal())); action = new QAction(i18n("Zoom Text Only"), this); action->setCheckable(true); KConfigGroup cgHtml(KGlobal::config(), "HTML Settings"); bool zoomTextOnly = cgHtml.readEntry("ZoomTextOnly", false); action->setChecked(zoomTextOnly); actionCollection()->addAction("zoomTextOnly", action); connect(action, SIGNAL(triggered(bool)), m_browserExtension, SLOT(toogleZoomTextOnly())); action = new QAction(i18n("Zoom To DPI"), this); action->setCheckable(true); bool zoomToDPI = cgHtml.readEntry("ZoomToDPI", false); action->setChecked(zoomToDPI); actionCollection()->addAction("zoomToDPI", action); connect(action, SIGNAL(triggered(bool)), m_browserExtension, SLOT(toogleZoomToDPI())); action = actionCollection()->addAction(KStandardAction::SelectAll, "selectAll", m_browserExtension, SLOT(slotSelectAll())); action->setShortcutContext(Qt::WidgetShortcut); m_webView->addAction(action); KCodecAction *codecAction = new KCodecAction( KIcon("character-set"), i18n( "Set &Encoding" ), this, true ); actionCollection()->addAction( "setEncoding", codecAction ); connect(codecAction, SIGNAL(triggered(QTextCodec*)), SLOT(slotSetTextEncoding(QTextCodec*))); action = new QAction(i18n("View Do&cument Source"), this); actionCollection()->addAction("viewDocumentSource", action); actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL+Qt::Key_U)); connect(action, SIGNAL(triggered(bool)), m_browserExtension, SLOT(slotViewDocumentSource())); action = new QAction(i18nc("Secure Sockets Layer", "SSL"), this); actionCollection()->addAction("security", action); connect(action, SIGNAL(triggered(bool)), SLOT(slotShowSecurity())); action = new KToggleAction(i18n("Toggle Caret Mode"), this); actionCollection()->addAction("caretMode", action); actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::Key_F7)); action->setChecked(isCaretMode()); connect(action, SIGNAL(triggered(bool)), SLOT(slotToggleCaretMode())); action = actionCollection()->addAction(KStandardAction::Find, "find", this, SLOT(slotShowSearchBar())); action->setWhatsThis(i18nc("find action \"whats this\" text", "<h3>Find text</h3>" "Shows a dialog that allows you to find text on the displayed page.")); }
KVBox *box = new KVBox(this); setMainWidget(box); new QLabel(i18n("<qt>The following documents have been modified. Do you want to save them before closing?</qt>"), box); m_list = new QTreeWidget(box); m_list->setColumnCount(2); m_list->setHeaderLabels(QStringList() << i18n("Documents") << i18n("Location")); m_list->setRootIsDecorated(true); foreach (KTextEditor::Document* doc, documents) { m_list->addTopLevelItem(new KateSaveModifiedDocumentCheckListItem(doc)); } m_list->resizeColumnToContents(0); connect(m_list, SIGNAL(itemChanged(QTreeWidgetItem*,int)), SLOT(slotItemActivated(QTreeWidgetItem*,int))); connect(new QPushButton(i18n("Se&lect All"), box), SIGNAL(clicked()), this, SLOT(slotSelectAll())); } KateSaveModifiedDialog::~KateSaveModifiedDialog() {} void KateSaveModifiedDialog::slotItemActivated(QTreeWidgetItem*, int) { bool enableSaveButton = false; for (int i = 0; i < m_list->topLevelItemCount(); ++i) { if (m_list->topLevelItem(i)->checkState(0) == Qt::Checked) { enableSaveButton = true; break; } }
LibraryDialog::LibraryDialog(SimguiApp *App_, QTreeWidgetItem *SchematicList) : QDialog(App_) { App = App_; setWindowTitle(tr("Create Library")); Expr.setPattern("[\\w_]+"); Validator = new QRegExpValidator(Expr, this); curDescr = 0; // description counter, prev, next // ........................................................... all = new QVBoxLayout(this); all->setMargin(5); all->setSpacing(6); stackedWidgets = new QStackedWidget(this); all->addWidget(stackedWidgets); // stacked 0 - select subcirbuit, name, and descriptions // ........................................................... QWidget *selectSubckt = new QWidget(); stackedWidgets->addWidget(selectSubckt); QVBoxLayout *selectSubcktLayout = new QVBoxLayout(); selectSubckt->setLayout(selectSubcktLayout); QHBoxLayout *h1 = new QHBoxLayout(); selectSubcktLayout->addLayout(h1); theLabel = new QLabel(tr("Library Name:")); h1->addWidget(theLabel); NameEdit = new QLineEdit(); h1->addWidget(NameEdit); NameEdit->setValidator(Validator); // ........................................................... Group = new QGroupBox(tr("Choose subcircuits:")); selectSubcktLayout->addWidget(Group); QScrollArea *scrollArea = new QScrollArea(Group); scrollArea->setWidgetResizable(true); QWidget *scrollWidget = new QWidget(); QVBoxLayout *checkBoxLayout = new QVBoxLayout(); scrollWidget->setLayout(checkBoxLayout); scrollArea->setWidget(scrollWidget); QVBoxLayout *areaLayout = new QVBoxLayout(); areaLayout->addWidget(scrollArea); Group->setLayout(areaLayout); // ........................................................... QHBoxLayout *hCheck = new QHBoxLayout(); selectSubcktLayout->addLayout(hCheck); checkDescr = new QCheckBox(tr("Add subcircuit description")); checkDescr->setChecked(true); hCheck->addWidget(checkDescr); hCheck->addStretch(); connect(checkDescr, SIGNAL(stateChanged(int)), this, SLOT(slotCheckDescrChanged(int))); // ........................................................... QGridLayout *gridButts = new QGridLayout(); selectSubcktLayout->addLayout(gridButts); ButtSelectAll = new QPushButton(tr("Select All")); gridButts->addWidget(ButtSelectAll, 0, 0); connect(ButtSelectAll, SIGNAL(clicked()), SLOT(slotSelectAll())); ButtSelectNone = new QPushButton(tr("Deselect All")); gridButts->addWidget(ButtSelectNone, 0, 1); connect(ButtSelectNone, SIGNAL(clicked()), SLOT(slotSelectNone())); // ........................................................... ButtCancel = new QPushButton(tr("Cancel")); gridButts->addWidget(ButtCancel, 1, 0); connect(ButtCancel, SIGNAL(clicked()), SLOT(reject())); ButtCreateNext = new QPushButton(tr("Next >>")); gridButts->addWidget(ButtCreateNext, 1, 1); connect(ButtCreateNext, SIGNAL(clicked()), SLOT(slotCreateNext())); ButtCreateNext->setDefault(true); // stacked 1 - enter description, loop over checked subckts // ........................................................... QWidget *subcktDescr = new QWidget(); stackedWidgets->addWidget(subcktDescr); QVBoxLayout *subcktDescrLayout = new QVBoxLayout(); subcktDescr->setLayout(subcktDescrLayout); QHBoxLayout *hbox = new QHBoxLayout(); subcktDescrLayout->addLayout(hbox); QLabel *libName = new QLabel(tr("Enter description for:")); hbox->addWidget(libName); checkedCktName = new QLabel(); checkedCktName->setText("dummy"); hbox->addWidget(checkedCktName); QGroupBox *descrBox = new QGroupBox(tr("Description:")); subcktDescrLayout->addWidget(descrBox); textDescr = new QTextEdit(); textDescr->setTextFormat(Qt::PlainText); textDescr->setWordWrapMode(QTextOption::NoWrap); connect(textDescr, SIGNAL(textChanged()), SLOT(slotUpdateDescription())); QVBoxLayout *vGroup = new QVBoxLayout; vGroup->addWidget(textDescr); descrBox->setLayout(vGroup); // ........................................................... gridButts = new QGridLayout(); subcktDescrLayout->addLayout(gridButts); prevButt = new QPushButton(tr("Previous")); gridButts->addWidget(prevButt, 0, 0); prevButt->setDisabled(true); connect(prevButt, SIGNAL(clicked()), SLOT(slotPrevDescr())); nextButt = new QPushButton(tr("Next >>")); nextButt->setDefault(true); gridButts->addWidget(nextButt, 0, 1); connect(nextButt, SIGNAL(clicked()), SLOT(slotNextDescr())); // ........................................................... ButtCancel = new QPushButton(tr("Cancel")); gridButts->addWidget(ButtCancel, 1, 0); connect(ButtCancel, SIGNAL(clicked()), SLOT(reject())); createButt = new QPushButton(tr("Create")); connect(createButt, SIGNAL(clicked()), SLOT(slotSave())); gridButts->addWidget(createButt, 1, 1); createButt->setDisabled(true); // stacked 2 - show error / sucess message // ........................................................... QWidget *msg = new QWidget(); stackedWidgets->addWidget(msg); QVBoxLayout *msgLayout = new QVBoxLayout(); msg->setLayout(msgLayout); QHBoxLayout *hbox1 = new QHBoxLayout(); msgLayout->addLayout(hbox1); QLabel *finalLabel = new QLabel(tr("Library Name:")); hbox1->addWidget(finalLabel); libSaveName = new QLabel(); hbox1->addWidget(libSaveName); QGroupBox *msgBox = new QGroupBox(tr("Message:")); msgLayout->addWidget(msgBox); ErrText = new QTextEdit(); ErrText->setTextFormat(Qt::PlainText); ErrText->setWordWrapMode(QTextOption::NoWrap); ErrText->setReadOnly(true); QVBoxLayout *vbox1 = new QVBoxLayout(); vbox1->addWidget(ErrText); msgBox->setLayout(vbox1); QHBoxLayout *hbox2 = new QHBoxLayout(); hbox2->addStretch(); QPushButton *close = new QPushButton(tr("Close")); hbox2->addWidget(close); connect(close, SIGNAL(clicked()), SLOT(reject())); msgLayout->addLayout(hbox2); // ........................................................... // insert all subcircuits of into checklist QTreeWidgetItem *p ; for(int i=0; i < SchematicList->childCount(); i++){ p = SchematicList->child(i); if(p->parent() == 0) break; if(!p->text(1).isEmpty()){ QCheckBox *subCheck = new QCheckBox(p->text(0)); checkBoxLayout->addWidget(subCheck); BoxList.append(subCheck); } } if(BoxList.isEmpty()) { ButtCreateNext->setEnabled(false); QLabel *noProj = new QLabel(tr("No projects!")); checkBoxLayout->addWidget(noProj); } }
void WebView::editableContentActionPopupMenu(KParts::BrowserExtension::ActionGroupMap& partGroupMap) { QList<QAction*> editableContentActions; KActionMenu* menu = new KActionMenu(i18nc("Text direction", "Direction"), this); QActionGroup* group = new QActionGroup(this); group->setExclusive(true); QAction *action = m_actionCollection->addAction(QL1S("text-direction-default"), m_part->browserExtension(), SLOT(slotTextDirectionChanged())); action->setText(i18n("Default")); action->setCheckable(true); action->setData(QWebPage::SetTextDirectionDefault); action->setEnabled(pageAction(QWebPage::SetTextDirectionDefault)->isEnabled()); action->setCheckable(pageAction(QWebPage::SetTextDirectionDefault)->isChecked()); action->setActionGroup(group); menu->addAction(action); action = m_actionCollection->addAction(QL1S("text-direction-left-to-right"), m_part->browserExtension(), SLOT(slotTextDirectionChanged())); action->setText(i18n("Left to right")); action->setCheckable(true); action->setData(QWebPage::SetTextDirectionLeftToRight); action->setEnabled(pageAction(QWebPage::SetTextDirectionLeftToRight)->isEnabled()); action->setChecked(pageAction(QWebPage::SetTextDirectionLeftToRight)->isChecked()); action->setActionGroup(group); menu->addAction(action); action = m_actionCollection->addAction(QL1S("text-direction-right-to-left"), m_part->browserExtension(), SLOT(slotTextDirectionChanged())); action->setText(i18n("Right to left")); action->setCheckable(true); action->setData(QWebPage::SetTextDirectionRightToLeft); action->setEnabled(pageAction(QWebPage::SetTextDirectionRightToLeft)->isEnabled()); action->setChecked(pageAction(QWebPage::SetTextDirectionRightToLeft)->isChecked()); action->setActionGroup(group); menu->addAction(action); editableContentActions.append(menu); action = new QAction(m_actionCollection); action->setSeparator(true); editableContentActions.append(action); action = m_actionCollection->addAction(KStandardAction::Copy, QL1S("copy"), m_part->browserExtension(), SLOT(copy())); action->setEnabled(pageAction(QWebPage::Copy)->isEnabled()); editableContentActions.append(action); action = m_actionCollection->addAction(KStandardAction::Cut, QL1S("cut"), m_part->browserExtension(), SLOT(cut())); action->setEnabled(pageAction(QWebPage::Cut)->isEnabled()); editableContentActions.append(action); action = m_actionCollection->addAction(KStandardAction::Paste, QL1S("paste"), m_part->browserExtension(), SLOT(paste())); action->setEnabled(pageAction(QWebPage::Paste)->isEnabled()); editableContentActions.append(action); action = new QAction(m_actionCollection); action->setSeparator(true); editableContentActions.append(action); const bool hasContent = (!m_result.element().evaluateJavaScript(QL1S("this.value")).toString().isEmpty()); action = m_actionCollection->addAction(KStandardAction::SelectAll, QL1S("selectall"), m_part->browserExtension(), SLOT(slotSelectAll())); action->setEnabled((pageAction(QWebPage::SelectAll)->isEnabled() && hasContent)); editableContentActions.append(action); if (showSpellCheckAction(m_result.element())) { action = new QAction(m_actionCollection); action->setSeparator(true); editableContentActions.append(action); action = m_actionCollection->addAction(KStandardAction::Spelling, QL1S("spelling"), m_part->browserExtension(), SLOT(slotCheckSpelling())); action->setText(i18n("Check Spelling...")); action->setEnabled(hasContent); editableContentActions.append(action); const bool hasSelection = (hasContent && m_result.isContentSelected()); action = m_actionCollection->addAction(KStandardAction::Spelling, QL1S("spellcheckSelection"), m_part->browserExtension(), SLOT(slotSpellCheckSelection())); action->setText(i18n("Spellcheck selection...")); action->setEnabled(hasSelection); editableContentActions.append(action); } if (settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled)) { if (!m_webInspector) { m_webInspector = new QWebInspector; m_webInspector->setPage(page()); connect(page(), SIGNAL(destroyed()), m_webInspector, SLOT(deleteLater())); } action = new QAction(m_actionCollection); action->setSeparator(true); editableContentActions.append(action); editableContentActions.append(pageAction(QWebPage::InspectElement)); } partGroupMap.insert("editactions" , editableContentActions); }