Exemple #1
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    topicModel(new QStandardItemModel(parent)),
    topicFilter(new QSortFilterProxyModel(parent)),
    listModel(new QStandardItemModel(parent)),
    md(nullptr)
{
    ui->setupUi(this);

    // Add the icons
    ui->actionConnect->setIcon(QIcon(":/images/network_server_database.png"));
    ui->actionRefresh->setIcon(QIcon(":/images/refresh.png"));
    ui->actionExit->setIcon(QIcon(":/images/exit.png"));
    ui->actionAbout_mywebQApp->setIcon(QIcon(":/images/info.png"));
    ui->toolBar->addAction(ui->actionConnect);
    ui->toolBar->addAction(ui->actionRefresh);
    ui->toolBar->addSeparator();
    ui->toolBar->addAction(ui->actionExit);
    move(550,100);

    // the topic views
    topicFilter->setSourceModel(topicModel);
    ui->topicTableView->setModel(topicFilter);
    //ui->topicTableView->setSelectionBehavior(QAbstractItemView::SelectRows);

    // the list views
    ui->listTableView->setModel(listModel);

    // signals and slots
    connect( ui->actionConnect, SIGNAL(triggered()), this, SLOT(connect2mysql()) );
    connect( ui->actionAbout_mywebQApp, SIGNAL(triggered()), this, SLOT(about()) );
    connect( ui->actionExit, SIGNAL(triggered()), this, SLOT(close()) );

    // topics and lists
    connect( ui->actionRefresh, SIGNAL(triggered()), this, SLOT(load_topics()) );
    connect( ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filter_topics(QString)) );
    connect( ui->addTopicButton, SIGNAL(clicked()), this, SLOT(new_topic()) );
    connect( ui->saveTopicButton, SIGNAL(clicked()), this, SLOT(save_topic()) );
    connect( ui->deleteTopicButton, SIGNAL(clicked()), this, SLOT(delete_topic()) );
    connect( ui->EditTopicButton, SIGNAL(clicked()), this, SLOT(edit_topic()) );

    connect( ui->topicTableView, SIGNAL(clicked(QModelIndex)), this, SLOT(load_lists()) );
    connect( ui->topicTableView, SIGNAL(activated(QModelIndex)), this, SLOT(load_lists()) );
    connect( ui->addListButton, SIGNAL(clicked()), this, SLOT(new_list()) );
    connect( ui->saveListButton, SIGNAL(clicked()), this, SLOT(save_list()) );
    connect( ui->deleteListButton, SIGNAL(clicked()), this, SLOT(delete_list()) );
    connect( ui->EditListButton, SIGNAL(clicked()), this, SLOT(edit_list()) );
}
Exemple #2
0
int main(int argc, char *argv[]){
  FILE *fin,*fout;
  /*  char seqchar, seqname[MAXLETTER];*/
  /*  char outname[MAXLETTER];*/
  /*  fpos_t position;*/
  /*  int i,sw;*/
  size_t list_size;
  NAMELIST *list, *list2;

  interface(argc, argv, &fin, &fout);

  fprintf(stderr,"Reading index\n");
  list=read_all(fin);
  fclose(fin);

  fprintf(stderr,"Editing index\n");
  list2=edit_list(list, &list_size);

  fprintf(stderr,"Sorting index\n");
  sort_and_output(list2, list_size, fout);
  fclose(fout);
  fprintf(stderr,"fpicupmakebindex finished successfully.\n");
  return 0;
}
Exemple #3
0
/*
 * Execute a multicharacter command.
 */
static void
exec_mca(void)
{
	char *cbuf;

	cmd_exec();
	cbuf = get_cmdbuf();

	switch (mca) {
	case A_F_SEARCH:
	case A_B_SEARCH:
		multi_search(cbuf, (int)number);
		break;
	case A_FILTER:
		search_type ^= SRCH_NO_MATCH;
		set_filter_pattern(cbuf, search_type);
		break;
	case A_FIRSTCMD:
		/*
		 * Skip leading spaces or + signs in the string.
		 */
		while (*cbuf == '+' || *cbuf == ' ')
			cbuf++;
		if (every_first_cmd != NULL)
			free(every_first_cmd);
		if (*cbuf == '\0')
			every_first_cmd = NULL;
		else
			every_first_cmd = save(cbuf);
		break;
	case A_OPT_TOGGLE:
		toggle_option(curropt, opt_lower, cbuf, optflag);
		curropt = NULL;
		break;
	case A_F_BRACKET:
		match_brac(cbuf[0], cbuf[1], 1, (int)number);
		break;
	case A_B_BRACKET:
		match_brac(cbuf[1], cbuf[0], 0, (int)number);
		break;
	case A_EXAMINE:
		if (secure)
			break;

		/* POSIX behavior, but possibly generally useful */
		if (strlen(cbuf) == 0) {
			reopen_curr_ifile();
			jump_back(1);
			break;
		}
		/* POSIX behavior - probably not generally useful */
		if (less_is_more && (strcmp(cbuf, "#") == 0)) {
			if (ntags()) {
				error("No previous file", NULL_PARG);
				break;
			}
			if (edit_prev(1)) {
				error("No previous file", NULL_PARG);
			} else {
				jump_back(1);
			}
			break;
		}
		edit_list(cbuf);
		/* If tag structure is loaded then clean it up. */
		cleantags();
		break;
	case A_SHELL:
		/*
		 * !! just uses whatever is in shellcmd.
		 * Otherwise, copy cmdbuf to shellcmd,
		 * expanding any special characters ("%" or "#").
		 */
		if (*cbuf != '!') {
			if (shellcmd != NULL)
				free(shellcmd);
			shellcmd = fexpand(cbuf);
		}

		if (secure)
			break;
		if (shellcmd == NULL)
			lsystem("", "!done");
		else
			lsystem(shellcmd, "!done");
		break;
	case A_PIPE:
		if (secure)
			break;
		(void) pipe_mark(pipec, cbuf);
		error("|done", NULL_PARG);
		break;
	}
}