status_t RuleRunner::RunAction(const BMessage &action, entry_ref &ref) { BString actionname; if (action.FindString("name",&actionname) != B_OK) { debugger("Couldn't find action name in RuleRunner::RunAction"); return B_ERROR; } if (actionname.Compare("Move it to…") == 0) return MoveAction(action,ref); else if (actionname.Compare("Copy it to…") == 0) return CopyAction(action,ref); else if (actionname.Compare("Rename it to…") == 0) return RenameAction(action,ref); else if (actionname.Compare("Open it") == 0) return OpenAction(action,ref); else if (actionname.Compare("Add it to the archive…") == 0) return ArchiveAction(action,ref); else if (actionname.Compare("Terminal command…") == 0) return CommandAction(action,ref); else if (actionname.Compare("Move it to the Trash") == 0) return TrashAction(action,ref); else if (actionname.Compare("Delete it") == 0) return DeleteAction(action,ref); return B_ERROR; }
void DoOpen( void ) { //================ // Do the actual open of a file. ftnfile *fcb; byte action; fcb = IOCB->fileinfo; action = fcb->action; OpenAction( fcb ); fcb->flags &= ~FTN_FSEXIST; if( fcb->fileptr != NULL ) { fcb->flags |= FTN_FSEXIST; } ChkIOErr( fcb ); }
void Ui::Ui_MainWindow::setupUi(){ raw = 0; if (this->objectName().isEmpty()) this->setObjectName(QString::fromUtf8("MainWindow")); QSettings settings(QSettings::IniFormat, QSettings::UserScope,"brainpower", "bp-nfoview"); settings.setDefaultFormat(QSettings::IniFormat); resize(settings.value("general/width", 680).toInt(),settings.value("general/height", 720).toInt()); QIcon mainIcon(":/img/logo.png"); setWindowIcon(mainIcon); actionOpen = new QAction(this); actionOpen->setObjectName(QString::fromUtf8("actionOpen")); actionOpen->setShortcut(QKeySequence(QKeySequence::Open)); actionSaveImage = new QAction(this); actionQuit = new QAction(this); actionQuit->setObjectName(QString::fromUtf8("actionQuit")); actionQuit->setShortcut(QKeySequence(QKeySequence::Quit)); actionAbout = new QAction(this); actionAbout->setObjectName(QString::fromUtf8("actionAbout")); actionSB = new QAction(this); actionSB->setObjectName(QString::fromUtf8("actionSB")); actionSB->setCheckable(true); actionColor = new QAction(this); actionDefaultColor = new QAction(this); actionFont = new QAction(this); actionDefaultFont = new QAction(this); actionCodecUTF8 = new QAction(this); actionCodecUTF8->setCheckable(true); actionCodecCP437 = new QAction(this); actionCodecCP437->setCheckable(true); agCodec = new QActionGroup(this); actionCodecUTF8->setActionGroup(agCodec); actionCodecCP437->setActionGroup(agCodec); centralwidget = new QWidget(this); centralwidget->setObjectName(QString::fromUtf8("centralwidget")); textEdit = new QTextEdit(centralwidget); textEdit->setObjectName(QString::fromUtf8("textEdit")); textEdit->setGeometry(QRect(0, 0, 671, 641)); //sizePolicy.setHeightForWidth(textEdit->sizePolicy().hasHeightForWidth()); //textEdit->setSizePolicy(sizePolicy); //QFont font = defaultFont; defaultFont.setFamily(QString::fromUtf8("DejaVu Sans Mono")); defaultFont.setPointSize(10); defaultFont.setStyleHint(QFont::Monospace); cFont = settings.value("GUI/font", defaultFont).value<QFont>(); textEdit->setFont(cFont); textEdit->setAcceptDrops(false); textEdit->setFrameShape(QFrame::NoFrame); textEdit->setFrameShadow(QFrame::Plain); textEdit->setUndoRedoEnabled(false); textEdit->setReadOnly(true); textEdit->setLineWrapMode(QTextEdit::NoWrap); textEdit->setPalette(settings.value("GUI/colors", defaultPalette).value<QPalette>()); //defaultPalette = textEdit->palette(); setCentralWidget(centralwidget); menubar = new QMenuBar(this); menubar->setObjectName(QString::fromUtf8("menubar")); menubar->setGeometry(QRect(0, 0, 682, 28)); menuFile = new QMenu(menubar); menuFile->setObjectName(QString::fromUtf8("menuFile")); menuView = new QMenu(menubar); menuViewCodec = new QMenu(menuView); menuHelp = new QMenu(menubar); menuHelp->setObjectName(QString::fromUtf8("menuHelp")); setMenuBar(menubar); statusbar = new QStatusBar(this); statusbar->setObjectName(QString::fromUtf8("statusbar")); //statusbar->setBackgroundRole(QPalette::Highlight); //statusbar->setAutoFillBackground(true); setStatusBar(statusbar); if(settings.value("general/sb", 23) == 23){ actionSB->setChecked(true); sboffset = 23; } else{ sboffset = 0; SBaction(false); } menubar->addAction(menuFile->menuAction()); menubar->addAction(menuView->menuAction()); menubar->addAction(menuHelp->menuAction()); menuFile->addAction(actionOpen); menuFile->addAction(actionSaveImage); menuFile->addAction(actionQuit); menuView->addAction(actionSB); menuView->addAction(actionColor); menuView->addAction(actionDefaultColor); menuView->addAction(actionFont); menuView->addAction(actionDefaultFont); menuView->addAction(menuViewCodec->menuAction()); menuHelp->addAction(actionAbout); menuViewCodec->addAction(actionCodecCP437); menuViewCodec->addAction(actionCodecUTF8); retranslateUi(); updateGeometries(); connect(actionSB, SIGNAL(toggled(bool)),this, SLOT(SBaction(bool))); connect(actionQuit, SIGNAL(triggered()),qApp, SLOT(quit())); connect(actionOpen, SIGNAL(triggered()),this, SLOT(OpenAction())); connect(actionAbout, SIGNAL(triggered()),this, SLOT(AboutAction())); connect(actionColor, SIGNAL(triggered()),this, SLOT(ColorAction())); connect(actionDefaultColor, SIGNAL(triggered()),this, SLOT(DefaultColorAction())); connect(actionFont, SIGNAL(triggered()),this, SLOT(FontAction())); connect(actionDefaultFont, SIGNAL(triggered()),this, SLOT(DefaultFontAction())); connect(actionSaveImage, SIGNAL(triggered()),this,SLOT(saveImageAction())); connect(actionCodecUTF8, SIGNAL(triggered()), this, SLOT(switchCodecUTF8Action())); connect(actionCodecCP437, SIGNAL(triggered()), this, SLOT(switchCodecCP437Action())); QMetaObject::connectSlotsByName(this); } // setupUi