void KonqSidebarTree::showToplevelContextMenu() { KonqSidebarTreeTopLevelItem *item = 0; KonqSidebarTreeItem *treeItem = currentItem(); if (treeItem && treeItem->isTopLevelItem()) item = static_cast<KonqSidebarTreeTopLevelItem *>(treeItem); if (!m_collection) { m_collection = new KActionCollection( this, "bookmark actions" ); (void) new KAction( i18n("&Create New Folder..."), "folder_new", 0, this, SLOT( slotCreateFolder() ), m_collection, "create_folder"); (void) new KAction( i18n("Delete Folder"), "editdelete", 0, this, SLOT( slotDelete() ), m_collection, "delete_folder"); (void) new KAction( i18n("Rename"), 0, this, SLOT( slotRename() ), m_collection, "rename"); (void) new KAction( i18n("Delete Link"), "editdelete", 0, this, SLOT( slotDelete() ), m_collection, "delete_link"); (void) new KAction( i18n("Properties"), "edit", 0, this, SLOT( slotProperties() ), m_collection, "item_properties"); (void) new KAction( i18n("Open in New Window"), "window_new", 0, this, SLOT( slotOpenNewWindow() ), m_collection, "open_window"); (void) new KAction( i18n("Open in New Tab"), "tab_new", 0, this, SLOT( slotOpenTab() ), m_collection, "open_tab"); (void) new KAction( i18n("Copy Link Address"), "editcopy", 0, this, SLOT( slotCopyLocation() ), m_collection, "copy_location"); } QPopupMenu *menu = new QPopupMenu; if (item) { if (item->isTopLevelGroup()) { m_collection->action("rename")->plug(menu); m_collection->action("delete_folder")->plug(menu); menu->insertSeparator(); m_collection->action("create_folder")->plug(menu); } else { if (tabSupport()) m_collection->action("open_tab")->plug(menu); m_collection->action("open_window")->plug(menu); m_collection->action("copy_location")->plug(menu); menu->insertSeparator(); m_collection->action("rename")->plug(menu); m_collection->action("delete_link")->plug(menu); } menu->insertSeparator(); m_collection->action("item_properties")->plug(menu); } else { m_collection->action("create_folder")->plug(menu); } m_currentTopLevelItem = item; menu->exec( QCursor::pos() ); delete menu; m_currentTopLevelItem = 0; }
void StatusWidget::handleReplyDeleteButton() { if ( statusData->isOwn || statusData->type == Entry::DirectMessage ) slotDelete(); else slotReply(); }
void BedCorrelationItemView::slotCustomContextMenuRequested(const QPoint& p) { QMenu* m = new QMenu(this); QAction* reloadA = new QAction(tr("Reload"), this); QAction* createA = new QAction(tr("Create BedCorrelation..."), this); QAction* editA = new QAction(tr("Edit..."), this); QAction* deleteA = new QAction(tr("Delete"), this); connect(reloadA, SIGNAL(activated()), this, SLOT(slotReload())); connect(createA, SIGNAL(activated()), this, SLOT(slotCreate())); connect(editA, SIGNAL(activated()), this, SLOT(slotEdit())); connect(deleteA, SIGNAL(activated()), this, SLOT(slotDelete())); m->addAction(createA); if (selectedIndexes().count() == 1) { m->insertSeparator(editA); m->addAction(editA); } if (selectedIndexes().count() > 0) { m->insertSeparator(deleteA); m->addAction(deleteA); } m->addAction(reloadA); m->exec(mapToGlobal(p)); }
// private slot void kpMainWindow::slotCut () { #if DEBUG_KP_MAIN_WINDOW && 1 kdDebug () << "kpMainWindow::slotCut() CALLED" << endl; #endif if (!m_document || !m_document->selection ()) { kdError () << "kpMainWindow::slotCut () doc=" << m_document << " sel=" << (m_document ? m_document->selection () : 0) << endl; return; } QApplication::setOverrideCursor (Qt::waitCursor); if (toolHasBegunShape ()) tool ()->endShapeInternal (); slotCopy (); slotDelete (); QApplication::restoreOverrideCursor (); }
bool KonqSidebarTree::overrideShortcut(const QKeyEvent* e) { const int key = e->key() | e->modifiers(); if (key == Qt::Key_F2) { slotRename(); return true; } else if (key == Qt::Key_Delete) { kDebug() << "delete key -> trash"; slotTrash(); return true; } else if (key == (Qt::SHIFT | Qt::Key_Delete)) { kDebug() << "shift+delete -> delete"; slotDelete(); return true; } else if (KStandardShortcut::copy().contains(key)) { kDebug() << "copy"; emit copy(); return true; } else if (KStandardShortcut::cut().contains(key)) { kDebug() << "cut"; emit cut(); return true; } else if (KStandardShortcut::paste().contains(key)) { kDebug() << "paste"; emit paste(); return true; } return false; }
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; }
CComDlg::CComDlg(QWidget *parent) : QDialog(parent), ui(new Ui::CComDlg) { cSaveQuest = tr("Save current catalogue to disc?"); ui->setupUi(this); setWindowFlags(((windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowCloseButtonHint)); QStandardItemModel *model = new QStandardItemModel(0, 1, NULL); model->setHeaderData(0, Qt::Horizontal, QObject::tr("Name")); ui->listView->setModel(model); ui->listView->activateWindow(); fillList(); updateDlg(); QShortcut *sh1 = new QShortcut(QKeySequence(Qt::Key_Delete), ui->listView, 0, 0, Qt::WidgetShortcut); connect(sh1, SIGNAL(activated()), this, SLOT(slotDelete())); ui->widget->setModel((QSortFilterProxyModel *)ui->listView->model(), 0); connect(ui->widget, SIGNAL(sigSetSelection(QModelIndex&)), this, SLOT(slotSelChange(QModelIndex&))); }
void FVBoxField::setupMenu( ) { contextMenuObj->clear(); if (field->dim() > 1) { contextMenuObj->addAction(tr("&Draw Vectors"), this, SLOT( slotDrawVectors() ) ); QString msg("Field" + this->getName() + " may be drawn as vectors" ); qDebug(msg.toAscii()); } else { QString msg("Field" + this->getName() + " will not be drawn as vectors"); qDebug(msg.toAscii()); } contextMenuObj->addAction(tr("&Draw Colormap"), this, SLOT( slotDrawColormap() ) ); contextMenuObj->addSeparator(); contextMenuObj->addAction(tr("&Add Slice"), this, SLOT( slotSlice() ) ); contextMenuObj->addSeparator(); contextMenuObj->addAction(tr("&Animate Visualisation"), this, SLOT( slotAnimate() ) ); contextMenuObj->addSeparator(); contextMenuObj->addAction(tr("&Reload"), this, SLOT( slotReload() ) ); contextMenuObj->addSeparator(); contextMenuObj->addAction(tr("De&lete"),(QWidget*) manager, SLOT(slotDelete()) ); }
//============================================================================= // Constructor of the class CPhoto. //============================================================================= CPhoto::CPhoto (QString text, QWidget *parent, const char *name) : QLabel (text, parent,name) { mMenu = new QPopupMenu (this); mMenu->insertItem (tr ("&Load"), this, SLOT (slotLoad())); mMenu->insertItem (tr ("&Delete"), this, SLOT (slotDelete())); mContentChanged = false; }
/** * Sets up the action buttons. * @param itemType The item type. * @param parentLayout The parent layout to which this group belongs. */ void ClassifierListPage::setupActionButtons(const QString& itemType, QVBoxLayout* parentLayout) { KDialogButtonBox* buttonBox = new KDialogButtonBox(m_pItemListGB); m_pNewClassifierListItemButton = buttonBox->addButton( itemType, KDialogButtonBox::ActionRole, this, SLOT(slotNewListItem()) ); m_pDeleteListItemButton = buttonBox->addButton( i18n("&Delete"), KDialogButtonBox::ActionRole, this, SLOT(slotDelete()) ); m_pPropertiesButton = buttonBox->addButton( i18n("&Properties"), KDialogButtonBox::ActionRole, this,SLOT(slotProperties()) ); parentLayout->addWidget(buttonBox); }
KonqSidebarBookmarkModule::KonqSidebarBookmarkModule( KonqSidebarTree * parentTree ) : QObject( 0L ), KonqSidebarTreeModule( parentTree ), m_topLevelItem( 0L ), m_ignoreOpenChange(true) { // formats handled by KBookmarkDrag: QStringList formats; formats << "text/uri-list" << "application/x-xbel" << "text/plain"; tree()->setDropFormats(formats); connect(tree(), SIGNAL(moved(QListViewItem*,QListViewItem*,QListViewItem*)), this, SLOT(slotMoved(QListViewItem*,QListViewItem*,QListViewItem*))); connect(tree(), SIGNAL(dropped(KListView*,QDropEvent*,QListViewItem*,QListViewItem*)), this, SLOT(slotDropped(KListView*,QDropEvent*,QListViewItem*,QListViewItem*))); connect(tree(), SIGNAL(expanded(QListViewItem*)), this, SLOT(slotOpenChange(QListViewItem*))); connect(tree(), SIGNAL(collapsed(QListViewItem*)), this, SLOT(slotOpenChange(QListViewItem*))); m_collection = new KActionCollection( this, "bookmark actions" ); (void) new KAction( i18n("&Create New Folder"), "folder_new", 0, this, SLOT( slotCreateFolder() ), m_collection, "create_folder"); (void) new KAction( i18n("Delete Folder"), "editdelete", 0, this, SLOT( slotDelete() ), m_collection, "delete_folder"); (void) new KAction( i18n("Delete Bookmark"), "editdelete", 0, this, SLOT( slotDelete() ), m_collection, "delete_bookmark"); (void) new KAction( i18n("Properties"), "edit", 0, this, SLOT( slotProperties() ), m_collection, "item_properties"); (void) new KAction( i18n("Open in New Window"), "window_new", 0, this, SLOT( slotOpenNewWindow() ), m_collection, "open_window"); (void) new KAction( i18n("Open in New Tab"), "tab_new", 0, this, SLOT( slotOpenTab() ), m_collection, "open_tab"); (void) new KAction( i18n("Open Folder in Tabs"), "tab_new", 0, this, SLOT( slotOpenTab() ), m_collection, "folder_open_tabs"); (void) new KAction( i18n("Copy Link Address"), "editcopy", 0, this, SLOT( slotCopyLocation() ), m_collection, "copy_location"); KStdAction::editBookmarks( KonqBookmarkManager::self(), SLOT( slotEditBookmarks() ), m_collection, "edit_bookmarks" ); connect( KonqBookmarkManager::self(), SIGNAL(changed(const QString &, const QString &) ), SLOT( slotBookmarksChanged(const QString &) ) ); }
void ParameterXML::contextMenu(QPopupMenu& _menu) { _menu.insertItem("Set Parameters", this, SLOT(slotSetParameters())); _menu.insertSeparator(); _menu.insertItem("Up", this, SLOT(up())); _menu.insertItem("Down", this, SLOT(down())); _menu.insertSeparator(); _menu.insertItem("Delete", this, SLOT(slotDelete())); }
/** * Sets up the action buttons. * @param itemType The item type. * @param parentLayout The parent layout to which this group belongs. */ void ClassifierListPage::setupActionButtons(const QString& itemType, QVBoxLayout* parentLayout) { #if QT_VERSION >= 0x050000 QDialogButtonBox* buttonBox = new QDialogButtonBox(m_pItemListGB); m_pNewClassifierListItemButton = buttonBox->addButton(itemType, QDialogButtonBox::ActionRole); connect(m_pNewClassifierListItemButton, SIGNAL(clicked()), this, SLOT(slotNewListItem())); m_pDeleteListItemButton = buttonBox->addButton(i18n("&Delete"), QDialogButtonBox::ActionRole); connect(m_pDeleteListItemButton, SIGNAL(clicked()), this, SLOT(slotDelete())); m_pPropertiesButton = buttonBox->addButton(i18n("&Properties"), QDialogButtonBox::ActionRole); connect(m_pPropertiesButton, SIGNAL(clicked()), this, SLOT(slotProperties())); #else KDialogButtonBox* buttonBox = new KDialogButtonBox(m_pItemListGB); m_pNewClassifierListItemButton = buttonBox->addButton(itemType, KDialogButtonBox::ActionRole, this, SLOT(slotNewListItem())); m_pDeleteListItemButton = buttonBox->addButton(i18n("&Delete"), KDialogButtonBox::ActionRole, this, SLOT(slotDelete())); m_pPropertiesButton = buttonBox->addButton(i18n("&Properties"), KDialogButtonBox::ActionRole, this, SLOT(slotProperties())); #endif parentLayout->addWidget(buttonBox); }
void Cocos2dWidget::initCocos2d() { HWND wnd = (HWND)this->winId(); AppDelegate app; CCApplication::sharedApplication().run(wnd, TEXT("Hello"), 480, 320); cocosTimerId = startTimer(1.0/60.0*1000); m_actDelete = new QAction(tr("delete"), this); connect(m_actDelete, SIGNAL(triggered()), this, SLOT(slotDelete())); }
void KonqSessionDlg::slotSave() { if(!d->m_pListView->currentIndex().isValid()) return; QFileInfo fileInfo( d->m_pModel->itemForIndex(d->m_pListView->currentIndex()).url().path()); QString dirpath = "sessions/" + KIO::encodeFileName(fileInfo.fileName()); slotDelete(); KonqSessionManager::self()->saveCurrentSessions(dirpath); }
ViewDepartments::ViewDepartments(QWidget * parent): ui(new Ui::ViewDepartments) // ?? { ui->setupUi(this); setupModel(); QObject::connect(ui->action_New, SIGNAL(triggered()), this, SLOT(slotAdd())); QObject::connect(ui->action_Delete, SIGNAL(triggered()), this, SLOT(slotDelete())); QObject::connect(ui->action_Edit, SIGNAL(triggered()), this, SLOT(slotEdit())); QObject::connect(ui->action_Yes, SIGNAL(triggered()), this, SLOT(slotSave())); QObject::connect(ui->action_No, SIGNAL(triggered()), this, SLOT(slotCancel())); }
void BedItemModel::slotDeleteCurrentBed() { if (!hasCurrentBed()) { return; } QModelIndex idx = findIndexForBed(getCurrentBed()); if (!idx.isValid()) { return; } QModelIndexList lst; lst << idx; slotDelete(lst); }
IMEditorWidget::IMEditorWidget( QWidget *parent, const QString &preferredIM ) : KDialog( parent ), mReadOnly( false ) { setCaption( i18n( "Edit Instant Messaging Address" ) ); setButtons( Help | Ok | Cancel ); setDefaultButton( Ok ); QWidget *w = new QWidget(this); mWidget = new Ui_IMEditorBase(); mWidget->setupUi( w ); setMainWidget(w); connect( mWidget->btnAdd, SIGNAL( clicked() ), SLOT( slotAdd() ) ); connect( mWidget->btnEdit, SIGNAL( clicked() ), SLOT( slotEdit() ) ); connect( mWidget->btnDelete, SIGNAL( clicked() ), SLOT( slotDelete() ) ); connect( mWidget->btnSetStandard, SIGNAL( clicked()), SLOT( slotSetStandard() ) ); connect( mWidget->lvAddresses, SIGNAL( itemSelectionChanged() ), SLOT( slotUpdateButtons() ) ); connect( mWidget->lvAddresses, SIGNAL( itemDoubleClicked( QTreeWidgetItem *, int ) ), SLOT( slotEdit() ) ); setHelp( "managing-contacts-im-addresses", "kaddressbook" ); mWidget->btnEdit->setEnabled( false ); mWidget->btnDelete->setEnabled( false ); mWidget->btnSetStandard->setEnabled( false ); // Disabled pending implementation //mWidget->btnUp->setEnabled( false ); //mWidget->btnDown->setEnabled( false ); mPreferred = preferredIM; mPreferred = mPreferred.replace( " on ", QString( QChar( 0xE120 ) ), Qt::CaseSensitive ); mProtocols = KPluginInfo::fromServices( KServiceTypeTrader::self()->query( QString::fromLatin1( "KABC/IMProtocol" ) ) ); // order the protocols by putting them in a qmap, then sorting // the set of keys and recreating the list QMap<QString, KPluginInfo> protocolMap; QList<KPluginInfo>::ConstIterator it; QList<KPluginInfo> sorted; for ( it = mProtocols.constBegin(); it != mProtocols.constEnd(); ++it ) { protocolMap.insert( it->name(), (*it) ); } QStringList keys = protocolMap.keys(); keys.sort(); QStringList::ConstIterator keyIt = keys.constBegin(); QStringList::ConstIterator end = keys.constEnd(); for ( ; keyIt != end; ++keyIt ) { sorted.append( protocolMap[*keyIt] ); } mProtocols = sorted; }
JavaDocs::JavaDocs(QWidget* parent, ScribusDoc *doc, ScribusView* vie) : QDialog( parent ) { setModal(true); setWindowTitle( tr( "Edit JavaScripts" ) ); setWindowIcon(loadIcon("AppIcon.png")); Doc = doc; View = vie; JavaDocsLayout = new QHBoxLayout(this); JavaDocsLayout->setMargin(10); JavaDocsLayout->setSpacing(5); Scripts = new QListWidget( this ); Scripts->setMinimumSize( QSize( 150, 200 ) ); QMap<QString,QString>::Iterator it; for (it = Doc->JavaScripts.begin(); it != Doc->JavaScripts.end(); ++it) Scripts->addItem(it.key()); JavaDocsLayout->addWidget( Scripts ); Layout1 = new QVBoxLayout; Layout1->setMargin(0); Layout1->setSpacing(5); EditScript = new QPushButton( tr( "&Edit..." ), this); Layout1->addWidget( EditScript ); AddScript = new QPushButton( tr( "&Add..." ), this); Layout1->addWidget( AddScript ); DeleteScript = new QPushButton( tr( "&Delete" ), this); Layout1->addWidget( DeleteScript ); QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ); Layout1->addItem( spacer ); ExitDia = new QPushButton( tr( "&Close" ), this); ExitDia->setDefault( true ); Layout1->addWidget( ExitDia ); if (Doc->JavaScripts.count() == 0) { EditScript->setEnabled(false); DeleteScript->setEnabled(false); } JavaDocsLayout->addLayout( Layout1 ); connect(AddScript, SIGNAL(clicked()), this, SLOT(slotAdd())); connect(EditScript, SIGNAL(clicked()), this, SLOT(slotEdit())); connect(DeleteScript, SIGNAL(clicked()), this, SLOT(slotDelete())); connect(ExitDia, SIGNAL(clicked()), this, SLOT(accept())); connect(Scripts, SIGNAL(itemActivated (QListWidgetItem *)), this, SLOT(slotEdit())); AddScript->setToolTip( "<qt>" + tr( "Adds a new Script, predefines a function with the same name. If you want to use this script as an \"Open Action\" script be sure not to change the name of the function." ) + "</qt>" ); }
TreeRegions::TreeRegions(QWidget * parent): ui(new Ui::TreeRegions) // ?? { ui->setupUi(this); setupModel(); QObject::connect(ui->action_New, SIGNAL(triggered()), this, SLOT(slotAdd())); QObject::connect(ui->action_NewRoot, SIGNAL(triggered()), this, SLOT(slotAddRoot())); QObject::connect(ui->action_Delete, SIGNAL(triggered()), this, SLOT(slotDelete())); QObject::connect(ui->action_Edit, SIGNAL(triggered()), this, SLOT(slotEdit())); QObject::connect(ui->action_Yes, SIGNAL(triggered()), this, SLOT(slotSave())); QObject::connect(ui->action_No, SIGNAL(triggered()), this, SLOT(slotCancel())); QObject::connect(ui->treeView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, SLOT(slotEnableButtons(const QItemSelection &, const QItemSelection &))); QObject::connect(this, SIGNAL(signalChangeEditMode()), this, SLOT(slotEnableButtons())); slotEnableButtons(QItemSelection(), QItemSelection()); }
ColourConfigurationPage::ColourConfigurationPage(RosegardenDocument *doc, QWidget *parent) : TabbedConfigurationPage(doc, parent) { QFrame *frame = new QFrame(m_tabWidget); frame->setContentsMargins(10, 10, 10, 10); QGridLayout *layout = new QGridLayout(frame); layout->setSpacing(5); m_map = m_doc->getComposition().getSegmentColourMap(); m_colourtable = new ColourTable(frame, m_map, m_listmap); m_colourtable->setFixedHeight(280); layout->addWidget(m_colourtable, 0, 0, 0- 0+1, 1- 0+1); QPushButton* addColourButton = new QPushButton(tr("Add New Color"), frame); layout->addWidget(addColourButton, 1, 0, Qt::AlignHCenter); // disable until we can remove it after release addColourButton->setEnabled(false); QPushButton* deleteColourButton = new QPushButton(tr("Delete Color"), frame); layout->addWidget(deleteColourButton, 1, 1, Qt::AlignHCenter); // disable until we can remove it after release deleteColourButton->setEnabled(false); connect(addColourButton, SIGNAL(clicked()), this, SLOT(slotAddNew())); connect(deleteColourButton, SIGNAL(clicked()), this, SLOT(slotDelete())); connect(this, SIGNAL(docColoursChanged()), m_doc, SLOT(slotDocColoursChanged())); connect(m_colourtable, SIGNAL(entryTextChanged(unsigned int, QString)), this, SLOT(slotTextChanged(unsigned int, QString))); connect(m_colourtable, SIGNAL(entryColourChanged(unsigned int, QColor)), this, SLOT(slotColourChanged(unsigned int, QColor))); addTab(frame, tr("Color Map")); }
KonqSessionDlg::KonqSessionDlg( KonqViewManager *manager, QWidget *parent ) : KDialog( parent ) , d( new KonqSessionDlgPrivate( manager, this ) ) { d->layout()->setMargin( 0 ); setMainWidget( d ); setObjectName( QLatin1String( "konq_session_dialog" ) ); setModal( true ); setCaption( i18nc( "@title:window", "Manage Sessions" ) ); setButtons( BTN_OPEN | Close ); setDefaultButton( Close ); setButtonGuiItem( BTN_OPEN, KGuiItem( i18n( "&Open" ), "document-open" ) ); d->m_pSaveCurrentButton->setIcon(KIcon("document-save")); d->m_pRenameButton->setIcon(KIcon("edit-rename")); d->m_pDeleteButton->setIcon(KIcon("edit-delete")); d->m_pNewButton->setIcon(KIcon("document-new")); QString dir = KStandardDirs::locateLocal("appdata", "sessions/"); d->m_pModel = new KDirModel(d->m_pListView); d->m_pModel->sort(QDir::Name); d->m_pModel->dirLister()->setDirOnlyMode(true); d->m_pModel->dirLister()->openUrl(dir); d->m_pListView->setModel(d->m_pModel); d->m_pListView->setMinimumSize( d->m_pListView->sizeHint() ); connect( d->m_pListView->selectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), this, SLOT( slotSelectionChanged() ) ); enableButton( BTN_OPEN, d->m_pListView->currentIndex().isValid() ); slotSelectionChanged(); d->m_pOpenTabsInsideCurrentWindow->setChecked( KonqSettings::openTabsInsideCurrentWindow()); connect( this,SIGNAL(user1Clicked()),SLOT(slotOpen())); connect( d->m_pNewButton, SIGNAL(clicked()),SLOT(slotNew())); connect( d->m_pSaveCurrentButton, SIGNAL(clicked()),SLOT(slotSave())); connect( d->m_pRenameButton, SIGNAL(clicked()),SLOT(slotRename())); connect( d->m_pDeleteButton, SIGNAL(clicked()),SLOT(slotDelete())); resize( sizeHint() ); }
// 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 (); }
void FVAnimation::setupMenu( ) { contextMenuObj->clear(); acPlay = contextMenuObj->addAction(tr("&Play"), this, SLOT( slotPlay() ) ); acPause = contextMenuObj->addAction(tr("&Pause"), this, SLOT( slotPause() ) ); acStop = contextMenuObj->addAction(tr("&Stop"), this, SLOT( slotStop() ) ); acPause->setEnabled( false ); acStop->setEnabled( false ); contextMenuObj->addSeparator(); contextMenuObj->addAction(tr("&Update"), this, SLOT( slotUpdate() ) ); contextMenuObj->addSeparator(); contextMenuObj->addAction(tr("De&lete"),(QWidget*) manager, SLOT(slotDelete()) ); }
int CDriverList::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QTableWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: signalChanged(); break; case 1: slotAdd(); break; case 2: slotEdit(); break; case 3: slotDelete(); break; case 4: slotLoad(); break; case 5: slotDoubleClick((*reinterpret_cast< QTableWidgetItem*(*)>(_a[1]))); break; } _id -= 6; } return _id; }
void KMMimePartTree::itemRightClicked( QListViewItem* item, const QPoint& point ) { // TODO: remove this member var? mCurrentContextMenuItem = dynamic_cast<KMMimePartTreeItem*>( item ); if ( 0 == mCurrentContextMenuItem ) { kdDebug(5006) << "Item was not a KMMimePartTreeItem!" << endl; } else { kdDebug(5006) << "\n**\n** KMMimePartTree::itemRightClicked() **\n**" << endl; QPopupMenu* popup = new QPopupMenu; if ( mCurrentContextMenuItem->node()->nodeId() > 2 && mCurrentContextMenuItem->node()->typeString() != "Multipart" ) { popup->insertItem( SmallIcon("fileopen"), i18n("to open", "Open"), this, SLOT(slotOpen()) ); popup->insertItem( i18n("Open With..."), this, SLOT(slotOpenWith()) ); popup->insertItem( i18n("to view something", "View"), this, SLOT(slotView()) ); } popup->insertItem( SmallIcon("filesaveas"),i18n( "Save &As..." ), this, SLOT( slotSaveAs() ) ); /* * FIXME mkae optional? popup->insertItem( i18n( "Save as &Encoded..." ), this, SLOT( slotSaveAsEncoded() ) ); */ popup->insertItem( i18n( "Save All Attachments..." ), this, SLOT( slotSaveAll() ) ); // edit + delete only for attachments if ( mCurrentContextMenuItem->node()->nodeId() > 2 && mCurrentContextMenuItem->node()->typeString() != "Multipart" ) { popup->insertItem( SmallIcon("editcopy"), i18n("Copy"), this, SLOT(slotCopy()) ); if ( GlobalSettings::self()->allowAttachmentDeletion() ) popup->insertItem( SmallIcon("editdelete"), i18n( "Delete Attachment" ), this, SLOT( slotDelete() ) ); if ( GlobalSettings::self()->allowAttachmentEditing() ) popup->insertItem( SmallIcon( "edit" ), i18n( "Edit Attachment" ), this, SLOT( slotEdit() ) ); } if ( mCurrentContextMenuItem->node()->nodeId() > 0 ) popup->insertItem( i18n("Properties"), this, SLOT(slotProperties()) ); popup->exec( point ); delete popup; mCurrentContextMenuItem = 0; } }
TracksConfigDialog::TracksConfigDialog(Timeline *timeline, int selected, QWidget* parent) : QDialog(parent), m_timeline(timeline) { setupUi(this); table->setColumnCount(5); table->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); table->setHorizontalHeaderLabels(QStringList() << i18n("Name") << i18n("Type") << i18n("Hidden") << i18n("Muted") << i18n("Locked") << i18n("Composite")); table->setSelectionMode(QAbstractItemView::SingleSelection); table->setItemDelegateForColumn(1, new TracksDelegate(this)); table->verticalHeader()->setHidden(true); buttonReset->setIcon(QIcon::fromTheme(QStringLiteral("document-revert"))); buttonReset->setToolTip(i18n("Reset")); connect(buttonReset, SIGNAL(clicked()), this, SLOT(setupOriginal())); buttonAdd->setIcon(QIcon::fromTheme(QStringLiteral("list-add"))); buttonAdd->setToolTip(i18n("Add Track")); buttonAdd->setEnabled(false); buttonDelete->setIcon(QIcon::fromTheme(QStringLiteral("list-remove"))); buttonDelete->setToolTip(i18n("Delete Track")); connect(buttonDelete, SIGNAL(clicked()), this, SLOT(slotDelete())); buttonUp->setIcon(QIcon::fromTheme(QStringLiteral("arrow-up"))); buttonUp->setToolTip(i18n("Move Track upwards")); buttonUp->setEnabled(false); buttonDown->setIcon(QIcon::fromTheme(QStringLiteral("arrow-down"))); buttonDown->setToolTip(i18n("Move Track downwards")); buttonDown->setEnabled(false); setupOriginal(selected); //table->resizeColumnToContents(0); table->resizeColumnsToContents(); /*QRect rect = table->geometry(); rect.setWidth(table->horizontalHeader()->length()); table->setGeometry(rect);*/ table->horizontalHeader()->setStretchLastSection(true); table->setMinimumSize(table->horizontalHeader()->length(), table->verticalHeader()->length() + table->horizontalHeader()->height() * 2); connect(table, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(slotUpdateRow(QTableWidgetItem*))); }
void TransitionXML::contextMenu(QPopupMenu& _menu) { // build add transition submenu menuSetTarget_ = new QPopupMenu(&_menu); QStringList targets = pattern()->policy()->patternList(); QStringList::const_iterator first, last = targets.end(); for (first = targets.begin(); first != last; ++first) menuSetTarget_->insertItem(*first); connect(menuSetTarget_, SIGNAL(activated(int)), this, SLOT(setTarget(int))); _menu.insertItem("Set Message", this, SLOT(setMessage())); _menu.insertItem("Set Target", menuSetTarget_); _menu.insertSeparator(); _menu.insertItem("Delete", this, SLOT(slotDelete())); }
BedCorrelationItemView::BedCorrelationItemView(QWidget* p, BedCorrelationItemModel* model) : TreeView(p), _profileCorrelation(0) { // setSortingEnabled(true); setEnabled(false); setModel(model); connect(model, SIGNAL(reloaded()), this, SLOT(slotReloaded())); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(activated(const QModelIndex&)), this, SLOT(slotIndexActivated(const QModelIndex&))); connect(this, SIGNAL(clicked(const QModelIndex&)), this, SLOT(slotIndexActivated(const QModelIndex&))); connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(slotCustomContextMenuRequested(const QPoint&))); connect(this, SIGNAL(reloadRequest()), model, SLOT(reload())); connect(this, SIGNAL(createBedCorrelationRequest()), model, SLOT(slotCreate())); connect(this, SIGNAL(editRequest(const QModelIndex&)), model, SLOT(slotEdit(const QModelIndex&))); connect(this, SIGNAL(deleteRequest(QModelIndexList)), model, SLOT(slotDelete(QModelIndexList))); }
/** * Popup menu item selected. */ void ActivityPage::slotMenuSelection(QAction* action) { ListPopupMenu::MenuType sel = ListPopupMenu::typeFromAction(action); switch(sel) { case ListPopupMenu::mt_New_Activity: slotNewActivity(); break; case ListPopupMenu::mt_Delete: slotDelete(); break; case ListPopupMenu::mt_Rename: slotRename(); break; default: uDebug() << "MenuType " << ListPopupMenu::toString(sel) << " not implemented"; } }