示例#1
0
void BEditEditorModulePrivate::init()
{
    document = 0;
    //
    actCut = new QAction(this);
      actCut->setIcon(BApplication::icon("editcut"));
      actCut->setShortcut(QKeySequence::Cut);
    actCopy = new QAction(this);
      actCopy->setIcon(BApplication::icon("editcopy"));
      actCopy->setShortcut(QKeySequence::Copy);
    actPaste = new QAction(this);
      actPaste->setIcon(BApplication::icon("editpaste"));
      actPaste->setShortcut(QKeySequence::Paste);
    actUndo = new QAction(this);
      actUndo->setIcon(BApplication::icon("undo"));
      actUndo->setShortcut(QKeySequence::Undo);
    actRedo = new QAction(this);
      actRedo->setIcon(BApplication::icon("redo"));
      actRedo->setShortcut(QKeySequence::Redo);
    actSwitchMode = new QAction(this);
      connect(actSwitchMode, SIGNAL(triggered()), this, SLOT(actSwitchModeTriggered()));
    //
    resetSwitchModeAction(false);
    checkActions();
    retranslateUi();
    connect(bApp, SIGNAL(languageChanged()), this, SLOT(retranslateUi()));
}
void FmFileDialogPrivate::_q_handleFileActivated( const QString &path )
{
    if( mFileNameLineEdit ) {
        mFileNameLineEdit->setText( path );
    }
    checkActions();
}
示例#3
0
void BOpenSaveEditorModulePrivate::init()
{
    actNewFile = new QAction(this);
      actNewFile->setIcon(BApplication::icon("filenew"));
      actNewFile->setShortcut(QKeySequence::New);
    actOpenFiles = new QAction(this);
      actOpenFiles->setIcon(BApplication::icon("fileopen"));
      actOpenFiles->setShortcut(QKeySequence::Open);
    actReopenFile = new QAction(this);
      actReopenFile->setIcon(BApplication::icon("reload"));
      BTextCodecMenu *mnu = new BTextCodecMenu(BTextCodecMenu::StructuredStyle);
      mnu->setMapping(this, SLOT(codecTriggered(QString)));
      actReopenFile->setMenu(mnu);
    actSaveFile = new QAction(this);
      actSaveFile->setIcon(BApplication::icon("filesave"));
      actSaveFile->setShortcut(QKeySequence::Save);
    actSaveFileAs = new QAction(this);
      actSaveFileAs->setIcon(BApplication::icon("filesaveas"));
    actSaveAllFiles = new QAction(this);
      actSaveAllFiles->setIcon(BApplication::icon("save_all"));
      actSaveAllFiles->setShortcut(QKeySequence("Ctrl+Shift+S"));
    actCloseFile = new QAction(this);
      actCloseFile->setIcon(BApplication::icon("fileclose"));
      actCloseFile->setShortcut(QKeySequence::Close);
    actCloseAllFiles = new QAction(this);
      actCloseAllFiles->setIcon(BApplication::icon("fileclose"));
    mnuFileHistory = new QMenu;
      mnuFileHistory->setIcon(BApplication::icon("history"));
    //
    checkActions();
    retranslateUi();
    connect(bApp, SIGNAL(languageChanged()), this, SLOT(retranslateUi()));
}
示例#4
0
文件: irc.cpp 项目: Harak/irc-mind
void irc::run()
{
  if ((_buf = _sock->recv()) == "")
    return;
  if (Utils::getToken(_buf, " ", 1) == "PING")
    pong();
  checkActions();
}
示例#5
0
static int
checkSubActions (FileInfo * nested, const char **mainActions, const char
		 **subActions)
{
  int subAction;
  mainActionNumber = NOTFOUND;
  subAction = checkActions (nested, subActions);
  if (subAction != NOTFOUND && nested->value == NULL)
    {
      configureError (nested, "column 2 is required");
      return NOTFOUND;
    }
  if (subAction == NOTFOUND)
    {
      mainActionNumber = checkActions (nested, mainActions);
      if (mainActionNumber == NOTFOUND)
	configureError (nested, "word %s in first column not recognized",
			nested->action);
      return NOTFOUND;
    }
  return (subActionNumber = subAction);
}
void FmFileDialogPrivate::_q_handlePathChanged( const QString &path )
{
    if( path.isEmpty() ) {
        mCurrentPathLabel->setPlainText( QString( FmPlaceholderString ) );
    } else {
        mCurrentPathLabel->setPlainText( path );
    }
    
    if( mFileNameLineEdit && mArgs.mDialogMode == GetFileMode ) {
        mFileNameLineEdit->setText( QString() );
    }

    checkUpButton();
    checkBottomFileWidget();
    checkActions();
}
bool Server::winEvent(MSG *m, long *result)
{

//    HandleDevice *thread = new HandleDevice(m, result, this);
//    connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
//    thread->start();
//    return true;

    if(WM_INPUT == m->message){
        HandleDevice *t = new HandleDevice(m, result, this);
        connect(t, SIGNAL(finished()), t, SLOT(deleteLater()));
        connect(t,SIGNAL(buttonAction(QString)), Mapper::instance(), SLOT(checkActions(QString)));
        t->start();
        t->wait();
        //return QWidget::winEvent(m, result);
        return true;
    }
    else{
        return false;
    }
}
/** Generate possible moves */
void generateMoves(node *Node, int moveList[MAX_POSSIBLE_MOVES])
{
    /** Iterator */
    int i;
    
    /** 2D position of the BLANK space */
    int posX = 0, posY = 0;

    /** Moves possible stored into a 2D array */
    /** 
     * Up      {-1, 0}
     * Down  { 1, 0} 
     * Left     { 0,-1} 
     * Right   { 0, 1}
     */
    int movesPossible[MAX_POSSIBLE_MOVES][DIMENSIONS] = {{-1,0}, {1,0}, {0,-1}, {0,1}};

    /** Loop to find the BLANK space */
    for(i = 0; i < SIZE; i++)
    {
        if(Node->state[i] == BLANK)
        {
            /** Get the 2D position for the Blank space */
            posX = i / ROWWIDTH;
            posY = i % COLHEIGHT;
            break;
        }
    }

    /** Loop to determine the possible moves */
    for(i = 0; i < MAX_POSSIBLE_MOVES; i++)
    {
        /** The tile position after performing each of the moves possible */
        int x = posX + movesPossible[i][0];
         int y = posY + movesPossible[i][1];

        /** Check if it is a valid action */
        moveList[i] = checkActions(x, y);
    }
}
void FmSingleTextQuery::init()
{
    setObjectName( "SingleTextQuery " );
    setDismissPolicy( HbPopup::NoDismiss );
    mContentWidget = new HbWidget();
    mContentWidget->setObjectName( "SingleTextContentWidget" );
    setContentWidget( mContentWidget );
	

    QGraphicsLinearLayout *vLayout = new QGraphicsLinearLayout();
    vLayout->setOrientation( Qt::Vertical );

    mTextEdit = new HbLineEdit();
    mTextEdit->setEchoMode( mEchoMode );
    mTextEdit->setFontSpec( HbFontSpec( HbFontSpec::Primary ) );
    mTextEdit->setObjectName( "textLineEdit" );
	vLayout->addItem( mTextEdit );

    mContentWidget->setLayout( vLayout );

    setTimeout( NoTimeout );

    connect( mTextEdit, SIGNAL(contentsChanged()), this, SLOT(checkActions()) );
}
void FmFileDialogPrivate::_q_handleTextChanged(const QString &text)
{
    Q_UNUSED( text );
    checkActions();
}
Run::Run( QObject *parent) : QThread(parent)
{
    connect(this,SIGNAL(sendActionWii(QString)), Mapper::instance(), SLOT(checkActions(QString)));

}
示例#12
0
文件: Reports.cpp 项目: majeski/NUBZ
void Reports::checkEvents(const Experiment &experiment, const std::vector<Report::Event> &events) {
    checkActions(experiment, events);
    checkBreakActions(experiment, events);
    checkDurations(events);
}
示例#13
0
    addDependency->setIcon( KIcon("list-add") );
    removeDependency->setIcon( KIcon("list-remove") );
    moveDepUp->setIcon( KIcon("go-up") );
    moveDepDown->setIcon( KIcon("go-down") );
    browseProject->setIcon(KIcon("folder-document"));
    
    connect( addDependency, SIGNAL(clicked(bool)), SIGNAL(changed()) );
    connect( removeDependency, SIGNAL(clicked(bool)), SIGNAL(changed()) );
    connect( moveDepDown, SIGNAL(clicked(bool)), SIGNAL(changed()) );
    connect( moveDepUp, SIGNAL(clicked(bool)), SIGNAL(changed()) );
    connect( browseProject, SIGNAL(clicked(bool)), targetDependency, SLOT(selectItemDialog()));
    connect( addDependency, SIGNAL(clicked(bool)), SLOT(addDep()) );
    connect( removeDependency, SIGNAL(clicked(bool)), SLOT(removeDep()) );
    connect( moveDepDown, SIGNAL(clicked(bool)), SLOT(moveDependencyDown()) );
    connect( moveDepUp, SIGNAL(clicked(bool)), SLOT(moveDependencyUp()) );
    connect( dependencies->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(checkActions(QItemSelection,QItemSelection)) );
    connect( targetDependency, SIGNAL(textChanged(QString)), SLOT(depEdited(QString)));
}

void PlasmoidExecutionConfig::saveToConfiguration( KConfigGroup cfg, KDevelop::IProject* project ) const
{
    Q_UNUSED( project );
    cfg.writeEntry("PlasmoidIdentifier", identifier->lineEdit()->text());
    QStringList args;
    args += "--formfactor";
    args += formFactor->currentText();
    if(!themes->currentText().isEmpty()) {
        args += "--theme";
        args += themes->currentText();
    }
    cfg.writeEntry("Arguments", args);
示例#14
0
static int
compileConfig (FileInfo * nested)
{
  static const char *mainActions[] = {
    "outputFormat",
    "0",
    "style",
    "1",
    "translation",
    "2",
    "xml",
    "3",
    "include",
    "5",
    NULL
  };
  static const char *yesNo[] = {
    "no",
    "0",
    "yes",
    "1",
    NULL
  };
  int k;
  if (!parseLine (nested))
    return 1;			/*No configuration, run with defaults */
  mainActionNumber = checkActions (nested, mainActions);
  if (mainActionNumber == NOTFOUND)
    {
      configureError (nested,
		      "word %s in first column not recognized",
		      nested->action);
      return 0;
    }
choseMainAction:
  switch (mainActionNumber)
    {
    case 0:			/*outputFormat */
      {
	static const char *actions[] = {
	  "cellsPerLine",
	  "0",
	  "linesPerPage",
	  "1",
	  "interpoint",
	  "2",
	  "lineEnd",
	  "3",
	  "pageEnd",
	  "4",
	  "beginningPageNumber",
	  "5",
	  "braillePages",
	  "6",
	  "paragraphs",
	  "7",
	  "fileEnd",
	  "8",
	  "printPages",
	  "9",
	  "printPageNumberAt",
	  "10",
	  "braillePageNumberAt",
	  "11",
	  "hyphenate",
	  "12",
	  "encoding",
	  "13",
	  "backFormat",
	  "14",
	  "backLineLength",
	  "15",
	  "interline",
	  "16",
	  NULL
	};
	static const char *topBottom[] = {
	  "bottom",
	  "0",
	  "top",
	  "1",
	  NULL
	};
	static const char *encodings[] = {
	  "utf8",
	  "0",
	  "utf16",
	  "1",
	  "utf32",
	  "2",
	  "ascii8",
	  "3",
	  NULL
	};
	static const char *backFormats[] = {
	  "plain",
	  "0",
	  "html",
	  "1",
	  NULL
	};

	while (parseLine (nested))
	  {
	    checkSubActions (nested, mainActions, actions);
	    if (mainActionNumber != NOTFOUND)
	      goto choseMainAction;
	    switch (subActionNumber)
	      {
	      case NOTFOUND:
		break;
	      case 0:
		ud->cells_per_line = atoi (nested->value);
		break;
	      case 1:
		ud->lines_per_page = atoi (nested->value);
		break;
	      case 2:
		if ((k = checkValues (nested, yesNo)) != NOTFOUND)
		  ud->interpoint = k;
		break;
	      case 3:
		if (controlCharValue (nested))
		  memcpy (ud->lineEnd, nested->value,
			  nested->valueLength + 1);
		break;
	      case 4:
		if (controlCharValue (nested))

		  memcpy (ud->pageEnd, nested->value,
			  nested->valueLength + 1);
		break;
	      case 5:
		ud->beginning_braille_page_number = atoi (nested->value);
		break;
	      case 6:
		if ((k = checkValues (nested, yesNo)) != NOTFOUND)
		  ud->braille_pages = k;
		break;
	      case 7:
		if ((k = checkValues (nested, yesNo)) != NOTFOUND)
		  ud->paragraphs = k;
		break;
	      case 8:
		if (controlCharValue (nested))
		  memcpy (ud->fileEnd, nested->value,
			  nested->valueLength + 1);
		break;
	      case 9:
		if ((k = checkValues (nested, yesNo)) != NOTFOUND)
		  ud->print_pages = k;
		break;
	      case 10:
		if ((k = checkValues (nested, topBottom)) != NOTFOUND)
		  ud->print_page_number_at = ud->braille_page_number_at = k;
		break;
	      case 11:
		if ((k = checkValues (nested, topBottom)) != NOTFOUND)
		  {
		    if (k)
		      k = 0;
		    else
		      k = 1;
		    ud->print_page_number_at = ud->braille_page_number_at = k;
		  }
		break;
	      case 12:
		if ((k = checkValues (nested, yesNo)) != NOTFOUND)
		  ud->hyphenate = k;
		break;
	      case 13:
		if ((k = checkValues (nested, encodings)) != NOTFOUND)
		  ud->output_encoding = k;
		break;
	      case 14:
		if ((k = checkValues (nested, backFormats)) != NOTFOUND)
		  ud->back_text = k;
		break;
	      case 15:
		ud->back_line_length = atoi (nested->value);
		break;
	      case 16:
		if ((k = checkValues (nested, yesNo)) != NOTFOUND)
		  ud->interline = k;
		break;
	      default:
		configureError (nested, "Program error in readconfig.c");
		continue;
	      }
	  }
	if (!((ud->print_page_number_at && ud->braille_page_number_at) ||
	      (!ud->print_page_number_at && !ud->braille_page_number_at)))
	  configureError (nested,
			  "invalid combination of braille and print page number placements");
	break;

    case 1:			/*style */
	{
	  static const char *actions[] = {
	    "linesBefore",
	    "0",
	    "linesAfter",
	    "1",
	    "leftMargin",
	    "2",
	    "firstLineIndent",
	    "3",
	    "translate",
	    "6",
	    "skipNumberLines",
	    "7",
	    "format",
	    "8",
	    "newPageBefore",
	    "9",
	    "newPageAfter",
	    "10",
	    "rightHandPage",
	    "11",
	    NULL
	  };
	  static const char *formats[] = {
	    "leftJustified",
	    "0",
	    "rightJustified",
	    "1",
	    "centered",
	    "2",
	    "alignColumnsLeft",
	    "3",
	    "alignColumnsRight",
	    "4",
	    "listColumns",
	    "5",
	    "listLines",
	    "6",
	    "computerCoded",
	    "7",
	    NULL
	  };
	  static int styleCount = 0;
	  StyleType *style;
	  sem_act styleAction;
	  if (nested->value == NULL)
	    {
	      configureError (nested, "no style name given in second column");
	      break;
	    }
	  styleCount++;
	  styleAction = find_semantic_number (nested->value);
	  style = style_cases (styleAction);
	  if (style == NULL)
	    {
	      configureError (nested,
			      "invalid style name %s in column two",
			      nested->value);
	      break;
	    }
	  if (style->action == document)
	    {
	      if (styleCount != 1)
		{
		  configureError (nested,
				  "docunent style must be the first one specified");
		  break;
		}
	      else
		memcpy (&ud->para_style, &ud->document_style,
			(&ud->scratch_style - &ud->para_style));
	    }
	  style->action = styleAction;
	  while (parseLine (nested))
	    {
	      checkSubActions (nested, mainActions, actions);
	      if (mainActionNumber != NOTFOUND)
		goto choseMainAction;
	      switch (subActionNumber)
		{
		case NOTFOUND:
		  break;
		case 0:
		  style->lines_before = atoi (nested->value);
		  break;
		case 1:
		  style->lines_after = atoi (nested->value);
		  break;
		case 2:
		  style->left_margin = atoi (nested->value);
		  break;
		case 3:
		  style->first_line_indent = atoi (nested->value);
		  break;
		case 6:
		  switch ((k = find_semantic_number (nested->value)))
		    {
		    case contracted:
		    case uncontracted:
		    case compbrl:
		      style->translate = k;
		      break;
		    default:
		      configureError (nested, "no such translation");
		      break;
		    }
		  break;
		case 7:
		  if ((k = checkValues (nested, yesNo)) != NOTFOUND)
		    style->skip_number_lines = k;
		  break;
		case 8:
		  if ((k = checkValues (nested, formats)) != NOTFOUND)
		    style->format = k;
		  break;
		case 9:
		  if ((k = checkValues (nested, yesNo)) != NOTFOUND)
		    style->newpage_before = k;
		  break;
		case 10:
		  if ((k = checkValues (nested, yesNo)) != NOTFOUND)
		    style->newpage_after = k;
		  break;
		case 11:
		  if ((k = checkValues (nested, yesNo)) != NOTFOUND)
		    style->righthand_page = k;
		  break;
		default:
		  configureError (nested, "Program error in readconfig.c");
		  continue;
		}
	    }
	  break;

    case 2:			/*translation */
	  {
	    static const char *actions[] = {
	      "contractedTable",
	      "0",
	      "literarytextTable",
	      "0",
	      "editTable",
	      "1",
	      "uncontractedTable",
	      "2",
	      "compbrlTable",
	      "3",
	      "mathtextTable",
	      "4",
	      "mathexprTable",
	      "5",
	      "interlineBackTable",
	      "6",
	      NULL
	    };
	    while (parseLine (nested))
	      {
		checkSubActions (nested, mainActions, actions);
		if (mainActionNumber != NOTFOUND)
		  goto choseMainAction;
		switch (subActionNumber)
		  {
		  case NOTFOUND:
		    break;
		  case 0:
		    findTable (nested, nested->value,
			       ud->contracted_table_name);
		    break;
		  case 1:
		    findTable (nested, nested->value, ud->edit_table_name);
		    break;
		  case 2:
		    findTable (nested, nested->value,
			       ud->uncontracted_table_name);
		    break;
		  case 3:
		    findTable (nested, nested->value, ud->compbrl_table_name);
		    break;
		  case 4:
		    findTable (nested, nested->value,
			       ud->mathtext_table_name);
		    break;
		  case 5:
		    findTable (nested, nested->value,
			       ud->mathexpr_table_name);
		    break;
		  case 6:
		    findTable (nested, nested->value,
			       ud->interline_back_table_name);
		    break;
		  default:
		    configureError (nested, "Program error in readconfig.c");
		    continue;
		  }
	      }
	    break;

    case 3:			/*xml */
	    {
	      static const char *actions[] = {
		"xmlHeader",
		"0",
		"entity",
		"1",
		"internetAccess",
		"2",
		"semanticFiles",
		"3",
		"newEntries",
		"4",
		NULL
	      };
	      while (parseLine (nested))
		{
		  checkSubActions (nested, mainActions, actions);
		  if (mainActionNumber != NOTFOUND)
		    goto choseMainAction;
		  switch (subActionNumber)
		    {
		    case NOTFOUND:
		      break;
		    case 0:
		      if (entities)
			{
			  configureError
			    (nested,
			     "The header definition must precede all entity definitions.");
			  break;
			}
		      strncpy (ud->xml_header, nested->value,
			       nested->valueLength);
		      break;
		    case 1:
		      if (!entities)
			strcat (ud->xml_header, "<!DOCTYPE entities [\n");
		      entities = 1;
		      strcat (ud->xml_header, "<!ENTITY ");
		      strcat (ud->xml_header, nested->value);
		      strcat (ud->xml_header, " \"");
		      strcat (ud->xml_header, nested->value2);
		      strcat (ud->xml_header, "\">\n");
		      break;
		    case 2:
		      if ((k = checkValues (nested, yesNo)) != NOTFOUND)
			ud->internet_access = k;
		      break;
		    case 3:
		      strcpy (ud->semantic_files, nested->value);
		      break;
		    case 4:
		      if ((k = checkValues (nested, yesNo)) != NOTFOUND)
			ud->new_entries = k;
		      break;
		    default:
		      configureError (nested,
				      "Program error in readconfig.c");
		      continue;
		    }
		}
	      break;

    case 4:			/*reserved */
	      {
		static const char *actions[] = {
		  NULL
		};
		while (parseLine (nested))
		  {
		    checkSubActions (nested, mainActions, actions);
		    if (mainActionNumber != NOTFOUND)
		      goto choseMainAction;
		    switch (subActionNumber)
		      {
		      case NOTFOUND:
			break;
		      default:
			configureError (nested,
					"Program error in readconfig.c");
			continue;
		      }
		  }
		break;

    case 5:			/*include */
		{
		  static const char *actions[] = { NULL };
		  if (nested->value == NULL)
		    configureError (nested,
				    "a file name in column 2 is required");
		  else
		    config_compileFile (nested->value);
		  parseLine (nested);
		  checkSubActions (nested, mainActions, actions);
		  if (mainActionNumber != NOTFOUND)
		    goto choseMainAction;
		}
		break;

    default:
		configureError (nested, "Program error in readconfig.c");
		break;
	      }
	    }
	  }
	}
      }
    }
  return 1;
}