Logo Search packages:      
Sourcecode: pan version File versions  Download package

ScoreAddDialog::ScoreAddDialog ( Data data,
GtkWidget *  parent,
const Quark group,
const Article article,
Mode  mode 
)

workarea

Definition at line 595 of file score-add-ui.cc.

                                                        :
  _data (data),
  _article (article),
  _group (group),
  _root (0)
{
  std::string s (_("Pan"));
  s += ": ";
  s += _("New Scoring Rule");
  GtkWidget * w = _root = gtk_dialog_new_with_buttons (s.c_str(),
    GTK_WINDOW(gtk_widget_get_toplevel(parent)),
    GTK_DIALOG_DESTROY_WITH_PARENT,
    GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
    GTK_STOCK_ADD, GTK_RESPONSE_OK,
    NULL);
  g_object_set_data_full (G_OBJECT(w), "dialog", this, delete_score_add_dialog);
  GtkWidget * button = create_rescore_button ();
  gtk_widget_show (button);
  gtk_dialog_add_action_widget (GTK_DIALOG(w), button, GTK_RESPONSE_APPLY);
  g_signal_connect (w, "response", G_CALLBACK(response_cb), this);

  /**
  ***  workarea
  **/

  int row = 0;
  GtkWidget * t = HIG :: workarea_create ();
  gtk_box_pack_start (GTK_BOX(GTK_DIALOG(_root)->vbox), t, true, true, 0);
  HIG::workarea_add_section_title (t, &row, _("New Scoring Rule"));
    HIG::workarea_add_section_spacer (t, row, 4);

    // section
    GtkWidget * h = gtk_hbox_new (false, PAD);
    GtkTreeModel * model = text_tree_model_new (false);
    w = _section_menu = value_combo_new (model);
    g_object_unref (G_OBJECT(model));
    gtk_box_pack_start (GTK_BOX(h), w, false, false, 0);
    w = _section_entry = gtk_entry_new ();
    gtk_box_pack_start (GTK_BOX(h), w, true, true, 0);
    HIG::workarea_add_row (t, &row, _("If the group name"), h);
    gtk_widget_show_all (h);

    // criteria
    w = criteria_line_new (_field_menu, _criteria_menu,
                           _text_criteria_entry, _numeric_criteria_spin,
                           &_article);
    HIG::workarea_add_row (t, &row, _("And the article's"), w);
    gtk_widget_show (w);

    // score
    h = gtk_hbox_new (false, PAD_SMALL); 
    model = score_tree_model_new ();
    w = _score_menu = value_combo_new (model);
    g_object_unref (model);
    gtk_box_pack_start (GTK_BOX(h), w, true, true, 0);
    GtkObject * a = gtk_adjustment_new (100, INT_MIN, INT_MAX, 1.0, 1.0, 1.0);
    w = _score_spin = gtk_spin_button_new (GTK_ADJUSTMENT(a), 100.0, 0u);
    gtk_box_pack_start (GTK_BOX(h), w, true, true, 0);
    HIG::workarea_add_wide_control (t, &row, h);
    gtk_widget_show_all (h);
    g_signal_connect (_score_menu, "changed", G_CALLBACK(score_combo_changed_cb), w);

    // duration
    model = time_tree_model_new ();
    w = _duration_menu = value_combo_new (model);
    g_object_unref (model);
    HIG::workarea_add_wide_control (t, &row, w);
    gtk_widget_show (w);

  populate (group, article, mode);
  gtk_widget_show (t);
}
}


Generated by  Doxygen 1.6.0   Back to index