コード例 #1
0
// Primary constructor to establish the dialog
US_XpnRunAuc::US_XpnRunAuc( QString& runID ) 
: US_WidgetsDialog( 0, 0 ), runID( runID )
{
   setWindowTitle( tr( "US3 Directories with Optima-derived .auc Files" ) );

   setPalette( US_GuiSettings::frameColor() );

   runID             = "";
   QVBoxLayout* main = new QVBoxLayout( this );
   main->setSpacing        ( 2 );
   main->setContentsMargins( 2, 2, 2, 2 );

   // Search
   QHBoxLayout* search       = new QHBoxLayout;
   QLabel*      lb_search    = us_label( tr( "Search" ) );
                le_search    = us_lineedit( "" );
   search      ->addWidget( lb_search );
   search      ->addWidget( le_search );
   connect( le_search, SIGNAL( textChanged( const QString& ) ),
            this,      SLOT  ( limit_data ( const QString& ) ) );

   // Load the runInfo structure with current data
   load_runs();

   // Tree
   tw                     = new QTableWidget( runInfo.size(), 3, this );
   populate_list();

   // Button Row
   QHBoxLayout* buttons   = new QHBoxLayout;

   QPushButton* pb_cancel = us_pushbutton( tr( "Cancel" ) );
   connect( pb_cancel, SIGNAL( clicked() ), SLOT( reject() ) );
   buttons->addWidget( pb_cancel );

   QPushButton* pb_accept = us_pushbutton( tr( "Select" ) );
   connect( pb_accept, SIGNAL( clicked() ), SLOT( select() ) );
   buttons->addWidget( pb_accept );

   main->addLayout( search );
   main->addWidget( tw );
   main->addLayout( buttons );
qDebug() << "gDBr: size" << size();

   resize( 600, 300 );
qDebug() << "gDBr: size" << size();
}
コード例 #2
0
ファイル: rldb_mysql.c プロジェクト: mezun7/ejudge
static struct rldb_plugin_cnts *
open_func(
        struct rldb_plugin_data *data,
        struct runlog_state *rl_state,
        const struct ejudge_cfg *config,
        const struct contest_desc *cnts,
        const struct section_global_data *global,
        int flags,
        time_t init_duration,
        time_t init_sched_time,
        time_t init_finish_time)
{
  struct rldb_mysql_state *state = (struct rldb_mysql_state*) data;
  struct rldb_mysql_cnts *cs = 0;
  int r;

  ASSERT(state);
  XCALLOC(cs, 1);
  cs->plugin_state = state;
  state->nref++;
  cs->rl_state = rl_state;
  if (cnts) cs->contest_id = cnts->id;
  if (!cs->contest_id) {
    err("undefined contest_id");
    goto fail;
  }

  if (do_open(state) < 0) goto fail;
  if ((r = load_header(cs, flags, init_duration, init_sched_time,
                       init_finish_time)) < 0)
    goto fail;
  if (!r) return (struct rldb_plugin_cnts*) cs;
  if (load_runs(cs) < 0) goto fail;
  state->mi->free_res(state->md);
  return (struct rldb_plugin_cnts*) cs;

 fail:
  state->mi->free_res(state->md);
  close_func((struct rldb_plugin_cnts*) cs);
  return 0;
}