Esempio n. 1
0
GtkWidget * gw_notebook_managment_create_and_add ( GtkWindow *window, GtkNotebook *parent)
{
	GtkWidget *tabbed_pane = NULL;
	GtkWidget *managment_tabbed_pane_label;
	gchar *text_utf8 = NULL;


#ifdef GW_DEBUG_GUI_COMPONENT
	g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
#endif

	if ( window != NULL )
	{
		tabbed_pane = gw_notebook_managment_create ( window);

		if ( (parent != NULL) && (tabbed_pane != NULL) )
		{
			gtk_container_add ( GTK_CONTAINER ( parent), tabbed_pane);

			/* Text label of the managment tabbed pane. */
			g_strdup_to_gtk_text ( _( "Management"), text_utf8);
			managment_tabbed_pane_label = gtk_label_new ( text_utf8);
			g_free ( text_utf8);

			/* Store reference to the title of tabbed pane */
			gtk_widget_ref ( managment_tabbed_pane_label);
			gtk_object_set_data_full ( GTK_OBJECT ( window), GW_REF_NOTEBOOK_MANAGMENT_TABBED_PANE_LABEL, managment_tabbed_pane_label,(GtkDestroyNotify) gtk_widget_unref);
			gtk_notebook_set_tab_label ( parent, gtk_notebook_get_nth_page ( parent, 2), managment_tabbed_pane_label);
		}
	}

	return tabbed_pane;
}
Esempio n. 2
0
/* Changes the bookmark label of child. Nothing happens if child is not in notebook. */
int
clip_GTK_NOTEBOOKSETTABLABEL(ClipMachine * cm)
{
	C_widget   *cntb = _fetch_cw_arg(cm);
	C_widget *cchild = _fetch_cwidget(cm,_clip_spar(cm,2));
	C_widget *clabel;
	CHECKCWID(cntb,GTK_IS_NOTEBOOK);
	CHECKARG2(2,MAP_t,NUMERIC_t); CHECKCWID(cchild,GTK_IS_WIDGET);
	CHECKARG3(3,MAP_t,NUMERIC_t,CHARACTER_t);
	if (_clip_parinfo(cm,3)==CHARACTER_t) {
		char   * caption = _clip_parc(cm, 3);
		LOCALE_TO_UTF(caption);
		gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(cntb->widget),
			cchild->widget,caption);
		FREE_TEXT(caption);
	}
	else
	{
		clabel = _fetch_cwidget(cm,_clip_spar(cm,3));
		CHECKCWID(clabel,GTK_IS_WIDGET);
		if (clabel)
			gtk_notebook_set_tab_label(GTK_NOTEBOOK(cntb->widget),
				cchild->widget,clabel->widget);

	}
	return 0;
err:
	return 1;
}
static void
gimp_color_notebook_style_set (GtkWidget *widget,
                               GtkStyle  *prev_style)
{
  GimpColorNotebook *notebook = GIMP_COLOR_NOTEBOOK (widget);
  GList             *list;
  gint               tab_border;
  GtkIconSize        icon_size;

  if (GTK_WIDGET_CLASS (parent_class)->style_set)
    GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);

  gtk_widget_style_get (widget,
                        "tab-border",    &tab_border,
                        "tab-icon_size", &icon_size,
                        NULL);

  g_object_set (notebook->notebook,
                "tab-border", tab_border,
                NULL);

  for (list = notebook->selectors; list; list = g_list_next (list))
    {
      GimpColorSelectorClass *selector_class;
      GtkWidget              *image;

      selector_class = GIMP_COLOR_SELECTOR_GET_CLASS (list->data);

      image = gtk_image_new_from_stock (selector_class->stock_id, icon_size);

      gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook->notebook),
                                  GTK_WIDGET (list->data),
                                  image);
    }
}
Esempio n. 4
0
/**
 * Format notebook finish page.
 * \param pageNum Page (tab) number.
 * \param pageLbl Page (tab) label.
 */
static void imp_ldif_page_finish( gint pageNum, gchar *pageLbl ) {
	GtkWidget *vbox;
	GtkWidget *table;
	GtkWidget *label;
	GtkWidget *labelBook;
	GtkWidget *labelFile;
	GtkWidget *labelRecs;
	gint top;

	vbox = gtk_vbox_new(FALSE, 8);
	gtk_container_add( GTK_CONTAINER( impldif_dlg.notebook ), vbox );
	gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );

	label = gtk_label_new( pageLbl );
	gtk_widget_show( label );
	gtk_notebook_set_tab_label(
		GTK_NOTEBOOK( impldif_dlg.notebook ),
		gtk_notebook_get_nth_page( GTK_NOTEBOOK( impldif_dlg.notebook ), pageNum ),
		label );

	table = gtk_table_new(3, 2, FALSE);
	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
	gtk_container_set_border_width( GTK_CONTAINER(table), 8 );
	gtk_table_set_row_spacings(GTK_TABLE(table), 8);
	gtk_table_set_col_spacings(GTK_TABLE(table), 8);

	/* First row */
	top = 0;
	label = gtk_label_new( _( "Address Book:" ) );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);

	labelBook = gtk_label_new("");
	gtk_table_attach(GTK_TABLE(table), labelBook, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(labelBook), 0, 0.5);

	/* Second row */
	top++;
	label = gtk_label_new( _( "File Name:" ) );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);

	labelFile = gtk_label_new("");
	gtk_table_attach(GTK_TABLE(table), labelFile, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(labelFile), 0, 0.5);

	/* Third row */
	top++;
	label = gtk_label_new( _("Records Imported:") );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);

	labelRecs = gtk_label_new("");
	gtk_table_attach(GTK_TABLE(table), labelRecs, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(labelRecs), 0, 0.5);

	impldif_dlg.labelBook    = labelBook;
	impldif_dlg.labelFile    = labelFile;
	impldif_dlg.labelRecords = labelRecs;
}
Esempio n. 5
0
void linphone_gtk_call_update_tab_header(LinphoneCall *call,gboolean pause) {
    GtkWidget *w=(GtkWidget*)linphone_call_get_user_pointer(call);
    GtkWidget *main_window=linphone_gtk_get_main_window();
    GtkNotebook *notebook=GTK_NOTEBOOK(linphone_gtk_get_widget(main_window,"viewswitch"));
    gint call_index=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"call_index"));
    GtkWidget *new_label=gtk_hbox_new (FALSE,0);
    GtkWidget *i=NULL;
    GtkWidget *l;
    gchar *text;

    if(pause) {
        i=gtk_image_new_from_stock(GTK_STOCK_MEDIA_PAUSE,GTK_ICON_SIZE_SMALL_TOOLBAR);
    } else {
        i=create_pixmap ("startcall-small.png");
    }

    text=g_strdup_printf(_("Call #%i"),call_index);
    l=gtk_label_new (text);
    gtk_box_pack_start (GTK_BOX(new_label),i,FALSE,FALSE,0);
    gtk_box_pack_end(GTK_BOX(new_label),l,TRUE,TRUE,0);

    gtk_notebook_set_tab_label(notebook,w,new_label);
    gtk_widget_show_all(new_label);
    g_free(text);
}
Esempio n. 6
0
/**
 * Format notebook finish page.
 * \param pageNum Page (tab) number.
 * \param pageLbl Page (tab) label.
 */
static void export_html_page_finish( gint pageNum, gchar *pageLbl ) {
	GtkWidget *vbox;
	GtkWidget *table;
	GtkWidget *label;
	GtkWidget *labelBook;
	GtkWidget *labelFile;
	GtkWidget *btnBrowse;
	gint top;

	vbox = gtk_vbox_new(FALSE, 8);
	gtk_container_add( GTK_CONTAINER( exphtml_dlg.notebook ), vbox );
	gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );

	label = gtk_label_new( pageLbl );
	gtk_widget_show( label );
	gtk_notebook_set_tab_label(
		GTK_NOTEBOOK( exphtml_dlg.notebook ),
		gtk_notebook_get_nth_page( GTK_NOTEBOOK( exphtml_dlg.notebook ), pageNum ), label );

	table = gtk_table_new( 3, 3, FALSE );
	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
	gtk_container_set_border_width( GTK_CONTAINER(table), 8 );
	gtk_table_set_row_spacings(GTK_TABLE(table), 8);
	gtk_table_set_col_spacings(GTK_TABLE(table), 8 );

	/* First row */
	top = 0;
	label = gtk_label_new( _( "Address Book :" ) );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);

	labelBook = gtk_label_new("Full name of address book goes here");
	gtk_table_attach(GTK_TABLE(table), labelBook, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(labelBook), 0, 0.5);

	/* Second row */
	top++;
	label = gtk_label_new( _( "File Name :" ) );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);

	labelFile = gtk_label_new("File name goes here");
	gtk_table_attach(GTK_TABLE(table), labelFile, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(labelFile), 0, 0.5);

	/* Third row */
	top++;
	btnBrowse = gtk_button_new_with_label( _( "Open with Web Browser" ) );
	gtk_table_attach(GTK_TABLE(table), btnBrowse, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);

	gtk_widget_show_all(vbox);

	/* Button handlers */
	gtk_signal_connect( GTK_OBJECT(btnBrowse), "clicked",
		GTK_SIGNAL_FUNC(export_html_browse), NULL );

	exphtml_dlg.labelOutBook = labelBook;
	exphtml_dlg.labelOutFile = labelFile;
}
Esempio n. 7
0
static VALUE
rg_set_tab_label(VALUE self, VALUE child, VALUE label)
{
    gtk_notebook_set_tab_label(_SELF(self),
                               RVAL2WIDGET(child),
                               NIL_P(label)?NULL:RVAL2WIDGET(label));
    return self;
}
Esempio n. 8
0
/*****************************************************************************
 * create_param_notebook_page()
 *
 * Create a page of parameter input widgets.
 * Designed to be run out of a loop.
 *****************************************************************************/
void
create_param_notebook_page(GtkWidget *main_window, GtkWidget *notebook,
                           PARAM_PAGE *param_page, int page_num)
{
	GtkWidget       *label;
	GtkWidget       *page;
	GtkWidget       *event;
	GtkWidget       *hbox;
	GtkWidget       *vbox;
	int             j         = 0;
	int             k         = 0;
	int             x         = 0;
	int             max_x     = 0;

	/* Find number of columns for this notebook page */
	for (j = 0; j < NUM_PARAM_GROUPS; j++) {
		if ((param_group[j].notebook_page == page_num) && (param_group[j].notebook_x > max_x)) {
			max_x = param_group[j].notebook_x;
		}
	}

	/* Start with an hbox, so param group columns can be attached,
	   same as in one_page mode. */
	event = gtk_event_box_new();
	widget_set_backing_store(event);
	hbox = gtk_hbox_new(FALSE, 0);
	gtk_container_add(GTK_CONTAINER(event), hbox);

	/* Run through all param groups, and add the ones for this page */
	for (x = 0; x <= max_x; x++) {
		vbox = gtk_vbox_new(FALSE, 0);
		gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0);
		for (j = 0; j < NUM_PARAM_GROUPS; j++) {
			k = notebook_order[j];
			if ((param_group[k].notebook_page == page_num) &&
			    (param_group[k].notebook_x == x)) {
				create_param_group(main_window, vbox, & (param_group[k]), page_num);
			}
		}
	}

	gtk_container_add(GTK_CONTAINER(notebook), event);

	/* Set the label */
	label = gtk_label_new(param_page->label);
	widget_set_custom_font(label, phasex_font_desc);
	widget_set_backing_store(label);

	page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), page_num);

#if GTK_CHECK_VERSION(2, 10, 0)
	gtk_notebook_set_tab_detachable(GTK_NOTEBOOK(notebook), page, FALSE);
#endif
	gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook), page, label);
}
Esempio n. 9
0
static gint
luaH_notebook_set_title(lua_State *L)
{
    size_t len;
    widget_t *w = luaH_checkwidget(L, 1);
    widget_t *child = luaH_checkwidget(L, 2);
    const gchar *title = luaL_checklstring(L, 3, &len);
    GtkWidget *label = gtk_label_new(title);
    gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_MIDDLE);
    gtk_notebook_set_tab_label(GTK_NOTEBOOK(w->widget),
        child->widget, label);
    gtk_container_child_set(GTK_CONTAINER(w->widget), label, "tab-expand", TRUE, "tab-fill", TRUE, NULL);
    return 0;
}
uint8_t  buildOneTab(GtkWidget *nb,int index, diaElemTabs *tab)
{
  GtkWidget *table1,*vbox1,*label;
  
  ADM_assert(tab);
  vbox1 = gtk_vbox_new (0, 18);
  gtk_container_set_border_width (GTK_CONTAINER (vbox1), 12);
  gtk_container_add (GTK_CONTAINER (nb), vbox1);
  gtk_widget_show (vbox1);

  int line=0;
  int i=0;
  while (i<tab->nbElems)
  {
	  if (tab->dias[i]->mySelf == ELEM_FRAME)
	  {
		  addLine(tab->dias[i],nb,vbox1,line);
		  i++;
	  }
	  else
	  {
                  line = 0;
                  int nbLine=0;
                   while (i+nbLine<tab->nbElems && tab->dias[i+nbLine]->mySelf != ELEM_FRAME) 
                    nbLine++;
                  table1 = gtk_table_new (nbLine, 2, FALSE);
                  gtk_table_set_col_spacings (GTK_TABLE (table1), 12);
                  gtk_table_set_row_spacings (GTK_TABLE (table1), 6);
                  gtk_box_pack_start (GTK_BOX(vbox1), table1, FALSE, FALSE, 0);
                  gtk_widget_show (table1);
                  
                  while (i<tab->nbElems && tab->dias[i]->mySelf != ELEM_FRAME)
                  {
                          addLine(tab->dias[i],nb,table1,line);
						  line+=tab->dias[i]->getSize();
						  i++;
                  }
	  }
  }
  

  
  label = gtk_label_new (tab->title);
  gtk_widget_show (label);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (nb), gtk_notebook_get_nth_page (GTK_NOTEBOOK (nb), index), label);

  

  return 1; 
}
Esempio n. 11
0
void linphone_gtk_call_log_clear_missed_call(){
	GtkWidget *mw=linphone_gtk_get_main_window();
	GtkNotebook *notebook=GTK_NOTEBOOK(linphone_gtk_get_widget(mw,"viewswitch"));
	GtkWidget *page=gtk_notebook_get_nth_page(notebook,0);
	GtkWidget *box=gtk_hbox_new(FALSE,0);
	GtkWidget *image=gtk_image_new_from_stock(GTK_STOCK_REFRESH,GTK_ICON_SIZE_MENU);
	GtkWidget *l;
	const gchar*text=gtk_label_get_text(GTK_LABEL(linphone_gtk_get_widget(mw,"label3")));
	
	l=gtk_label_new(text);
	gtk_box_pack_start(GTK_BOX(box),image,FALSE,FALSE,0);
	gtk_box_pack_start(GTK_BOX(box),l,FALSE,FALSE,0);
	gtk_notebook_set_tab_label(notebook,page,box);
	gtk_widget_show_all(box);
}
Esempio n. 12
0
void gui_create_parallel_page(void)
{
	GtkWidget *label;
#ifndef USE_WEBKIT2
	GtkWidget *scrolled_window;
#endif

	/*
	 * parallel page
	 */
	settings.dockedInt = TRUE;

#ifndef USE_WEBKIT2
	scrolled_window = gtk_scrolled_window_new(NULL, NULL);
	gtk_widget_show(scrolled_window);
	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
				       GTK_POLICY_AUTOMATIC,
				       GTK_POLICY_ALWAYS);
	gtk_container_add(GTK_CONTAINER(widgets.notebook_bible_parallel),
			  scrolled_window);
#endif

	widgets.html_parallel =
	    GTK_WIDGET(XIPHOS_HTML_NEW(NULL, FALSE, PARALLEL_TYPE));
	gtk_widget_show(widgets.html_parallel);
#ifdef USE_WEBKIT2
	gtk_container_add(GTK_CONTAINER(widgets.notebook_bible_parallel), widgets.html_parallel);
#else
	widgets.frame_parallel = scrolled_window;
	gtk_container_add(GTK_CONTAINER(scrolled_window),
			  widgets.html_parallel);
#endif

	g_signal_connect((gpointer)widgets.html_parallel,
			 "popupmenu_requested",
			 G_CALLBACK(_popupmenu_requested_cb), NULL);

	label = gtk_label_new(_("Parallel View"));
	gtk_widget_show(label);
	gtk_notebook_set_tab_label(GTK_NOTEBOOK(widgets.notebook_bible_parallel),
				   gtk_notebook_get_nth_page(GTK_NOTEBOOK(widgets.notebook_bible_parallel),
							     1),
				   label);

	g_signal_connect((gpointer)widgets.html_parallel,
			 "enter_notify_event",
			 G_CALLBACK(on_enter_notify_event), NULL);
}
Esempio n. 13
0
void plugin_cleanup(void)
{
    if (have_vte)
    {
        /* move the vte frame back to where it was before */
        gtk_widget_reparent(vte_frame, GTK_WIDGET(vte_old_home)); 
        
        /* put the label back in the old notebook */
        gtk_notebook_set_tab_label(vte_old_home, vte_frame, vte_tab_label);
        
        /* we no longer to to hang on to a reference of the label */
        g_object_unref(G_OBJECT(vte_tab_label));
        
        /* select the vte tab in the message window */
        gtk_notebook_set_current_page(vte_old_home, MSG_VTE);
    }
}
Esempio n. 14
0
/* {EV_NOTEBOOK_IMP}.ensure_tab_label */
void F1106_14788 (EIF_REFERENCE Current, EIF_POINTER arg1)
{
	GTCX
	EIF_POINTER loc1 = (EIF_POINTER) 0;
	EIF_POINTER loc2 = (EIF_POINTER) 0;
	EIF_POINTER loc3 = (EIF_POINTER) 0;
	EIF_POINTER loc4 = (EIF_POINTER) 0;
	EIF_POINTER tp1;
	EIF_POINTER tp2;
	RTLD;
	
	RTLI(1);
	RTLR(0,Current);
	
	RTGC;
	tp1 = F1079_14146(Current);
	{
	/* INLINED CODE (default_pointer) */
	tp2 = (EIF_POINTER)  0;
	/* END INLINED CODE */
	}
	if ((EIF_BOOLEAN)((EIF_POINTER) gtk_notebook_get_tab_label((GtkNotebook*) tp1, (GtkWidget*) arg1) == tp2)) {
		loc1 = (EIF_POINTER) gtk_event_box_new();
		gtk_event_box_set_visible_window((GtkEventBox*) loc1, (gboolean) (EIF_BOOLEAN) 0);
		gtk_widget_show((GtkWidget*) loc1);
		loc2 = (EIF_POINTER) gtk_hbox_new((gboolean) (EIF_BOOLEAN) 0, (gint) ((EIF_INTEGER_32) 2L));
		gtk_container_add((GtkContainer*) loc1, (GtkWidget*) loc2);
		gtk_widget_show((GtkWidget*) loc2);
		loc3 = (EIF_POINTER) gtk_image_new();
		gtk_widget_show((GtkWidget*) loc3);
		gtk_container_add((GtkContainer*) loc2, (GtkWidget*) loc3);
		{
		/* INLINED CODE (default_pointer) */
		tp1 = (EIF_POINTER)  0;
		/* END INLINED CODE */
		}
		tp2 = tp1;
		loc4 = (EIF_POINTER) gtk_label_new((gchar*) tp2);
		gtk_widget_show((GtkWidget*) loc4);
		gtk_container_add((GtkContainer*) loc2, (GtkWidget*) loc4);
		tp1 = F1079_14146(Current);
		gtk_notebook_set_tab_label((GtkNotebook*) tp1, (GtkWidget*) arg1, (GtkWidget*) loc1);
	}
	RTLE;
}
Esempio n. 15
0
void udpate_tab_chat_header(GtkWidget *chat_view,const LinphoneAddress *uri,LinphoneChatRoom *cr){
	GtkWidget *main_window=linphone_gtk_get_main_window();
	GtkNotebook *notebook=GTK_NOTEBOOK(linphone_gtk_get_widget(main_window,"viewswitch"));
	GtkWidget *w=gtk_hbox_new (FALSE,0);
	GtkWidget *i=create_pixmap ("chat.png");
	GtkWidget *l;
	GtkWidget *image=gtk_image_new_from_stock(GTK_STOCK_CLOSE,GTK_ICON_SIZE_MENU);
	GtkWidget *b=gtk_button_new();

	gtk_button_set_image(GTK_BUTTON(b),image);
	gtk_button_set_relief(GTK_BUTTON(b),GTK_RELIEF_NONE);
	gtk_widget_set_size_request(b,25,20);
	g_signal_connect_swapped(G_OBJECT(b),"clicked",G_CALLBACK(linphone_gtk_quit_chatroom),cr);
	l=gtk_label_new (get_display_name(uri));
	gtk_box_pack_start (GTK_BOX(w),i,FALSE,FALSE,0);
	gtk_box_pack_start (GTK_BOX(w),l,FALSE,FALSE,0);
	gtk_box_pack_end(GTK_BOX(w),b,TRUE,TRUE,0);
	gtk_notebook_set_tab_label(notebook,chat_view,w);
	gtk_widget_show_all(w);
}
Esempio n. 16
0
void linphone_gtk_call_log_display_missed_call(int nb){
	GtkWidget *mw=linphone_gtk_get_main_window();
	GtkNotebook *notebook=GTK_NOTEBOOK(linphone_gtk_get_widget(mw,"viewswitch"));
	GtkWidget *page=gtk_notebook_get_nth_page(notebook,0);
	GtkWidget *ebox=gtk_event_box_new();
	GtkWidget *box=gtk_hbox_new(FALSE,0);
	GtkWidget *image=gtk_image_new_from_stock(GTK_STOCK_REFRESH,GTK_ICON_SIZE_MENU);
	GtkWidget *l;
	gchar *buf;
	
	buf=g_markup_printf_escaped(_("<b>Recent calls (%i)</b>"),nb);
	l=gtk_label_new(NULL);
	gtk_label_set_markup(GTK_LABEL(l),buf);
	gtk_box_pack_start(GTK_BOX(box),image,FALSE,FALSE,0);
	gtk_box_pack_start(GTK_BOX(box),l,FALSE,FALSE,0);
	gtk_container_add(GTK_CONTAINER(ebox),box);
	gtk_notebook_set_tab_label(notebook,page,ebox);
	gtk_widget_add_events(ebox,GDK_BUTTON_PRESS_MASK);
	g_signal_connect(G_OBJECT(ebox),"button_press_event",(GCallback)linphone_gtk_call_log_reset_missed_call,NULL);
	gtk_widget_show_all(ebox);
}
Esempio n. 17
0
void plugin_init(GeanyData *data)
{
    /* get a handle on the frame that holds the vte stuff */
    vte_frame = get_vte_frame();
    
    /* make sure it's really the frame holding the vte stuff */
    if (vte_frame == NULL || !holds_vte(vte_frame))
    {
        show_error_message();
        return;
    }
    
    /* set a flag for the cleanup function to use */
    have_vte = TRUE;
    
    /* store where the vte frame is going to go */
    vte_new_home = GTK_NOTEBOOK(geany_data->main_widgets->sidebar_notebook);
    
    /* store where the vte was so we can put it back */
    vte_old_home = GTK_NOTEBOOK(gtk_widget_get_parent(vte_frame));
    
    /* grab the notebook page label so we can set it on the new tab */
    vte_tab_label = gtk_notebook_get_tab_label(vte_old_home, vte_frame);
    
    /* increase the ref count so the label doesn't get destroy when we
     * reparent the notebook child */
    g_object_ref(G_OBJECT(vte_tab_label));
    
    /* move the vte frame to the sidebar notebook */
    gtk_widget_reparent(vte_frame, GTK_WIDGET(vte_new_home));
    
    /* set the label again since it's gone somewhere */
    gtk_notebook_set_tab_label(vte_new_home, GTK_WIDGET(vte_frame), vte_tab_label);
    
    /* select the new vte tab in the sidebar */
    gtk_notebook_set_current_page(vte_new_home, -1);
}
Esempio n. 18
0
void create_mainwindow(void)
{
	char *imagename;
	GtkWidget *vbox_gs;
	GtkWidget *menu;
	GtkWidget *hbox25;
	GtkWidget *tab_button_icon;
	GtkWidget *label;
#ifndef USE_WEBKIT2
	GtkWidget *scrolledwindow;
#endif
	GtkWidget *box_book;
	GdkPixbuf *pixbuf;
	/*
	   GTK_SHADOW_NONE
	   GTK_SHADOW_IN
	   GTK_SHADOW_OUT
	   GTK_SHADOW_ETCHED_IN
	   GTK_SHADOW_ETCHED_OUT
	 */
	settings.shadow_type = GTK_SHADOW_IN;

	XI_print(("%s xiphos-%s\n", "Starting", VERSION));
	XI_print(("%s\n\n", "Building Xiphos interface"));

	widgets.studypad_dialog = NULL;

	/* A rough scektch of the main window (widgets.app) and it's children
	 *                widgets.app
	 *                     |
	 *                  vbox_gs
	 *                     |
	 *                  +--|----+
	 *                  |       |
	 *                 menu   hbox25
	 *                           |
	 *                     widgets.epaned
	 *                         |
	 *                 widgets.vboxMain
	 *                 |              |
	 *           widgets.hboxtb   widgets.page
	 *                            |         |
	 *                     widgets.hpaned  nav_toolbar
	 *                     |            |
	 *              widgets.vpaned---+  +----------------------------widgets.vpaned2---------------+
	 *               |               |                                      |                      |
	 * widgets.vbox_previewer   widgets.vbox_text              widgets.notebook_comm_book   widgets.box_dict
	 *                               |                         |                       |
	 *                widgets.notebook_bible_parallel   widgets.box_comm            box_book
	 *                               |
	 *                     widgets.notebook_text
	 *
	 */

	// The toplevel Xiphos window
	widgets.app = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_window_set_title(GTK_WINDOW(widgets.app), _("Xiphos - Bible Study Software"));
	g_object_set_data(G_OBJECT(widgets.app), "widgets.app", widgets.app);
	gtk_widget_set_size_request(widgets.app, 680, 425);
	gtk_widget_set_can_focus(widgets.app, 1);
	gtk_window_set_resizable(GTK_WINDOW(widgets.app), TRUE);

	// The app icon.
	// FIXME:: This should be a big copy of the logo because GTK does the scaling (GTK 3.16?)
	imagename = image_locator("gs2-48x48.png");
	pixbuf = gdk_pixbuf_new_from_file(imagename, NULL);
	g_free(imagename);
	gtk_window_set_icon(GTK_WINDOW(widgets.app), pixbuf);

	// The main box for our toplevel window.
	UI_VBOX(vbox_gs, FALSE, 0);
	gtk_widget_show(vbox_gs);
	gtk_container_add(GTK_CONTAINER(widgets.app), vbox_gs);

	// Add the main menu.
	menu = gui_create_main_menu();
	gtk_box_pack_start(GTK_BOX(vbox_gs), menu, FALSE, TRUE, 0);

	// Another box
	UI_HBOX(hbox25, FALSE, 0);
	gtk_widget_show(hbox25);
	gtk_box_pack_start(GTK_BOX(vbox_gs), hbox25, TRUE, TRUE, 0);

	// widgets.epaned
	widgets.epaned = UI_HPANE();
	gtk_widget_show(widgets.epaned);
#ifndef HAVE_GTK_314
	gtk_container_set_border_width(GTK_CONTAINER(widgets.epaned), 4);
#endif
	gtk_box_pack_start(GTK_BOX(hbox25), widgets.epaned, TRUE, TRUE, 0);
	// Another box
	UI_VBOX(widgets.vboxMain, FALSE, 0);
	gtk_widget_show(widgets.vboxMain);
	gtk_paned_pack2(GTK_PANED(widgets.epaned), widgets.vboxMain, TRUE, TRUE);
#ifndef HAVE_GTK_314
	gtk_container_set_border_width(GTK_CONTAINER(widgets.vboxMain), 2);
#endif

	/*
	 * Notebook to have separate passages opened at once the passages are not
	 * actually open but are switched between similar to bookmarks
	 */
	UI_HBOX(widgets.hboxtb, FALSE, 0);
	if (settings.browsing)
		gtk_widget_show(widgets.hboxtb);
	gtk_box_pack_start(GTK_BOX(widgets.vboxMain), widgets.hboxtb, FALSE, FALSE, 0);

	widgets.button_new_tab = gtk_button_new();
	// Don't show button here in case !settings.browsing

#ifdef HAVE_GTK_310
	tab_button_icon = gtk_image_new_from_icon_name("tab-new-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR);
#else
	tab_button_icon = gtk_image_new_from_stock(GTK_STOCK_ADD, GTK_ICON_SIZE_SMALL_TOOLBAR);
#endif

	gtk_widget_show(tab_button_icon);
	gtk_container_add(GTK_CONTAINER(widgets.button_new_tab), tab_button_icon);
	gtk_button_set_relief(GTK_BUTTON(widgets.button_new_tab), GTK_RELIEF_NONE);
	gtk_box_pack_start(GTK_BOX(widgets.hboxtb), widgets.button_new_tab, FALSE, FALSE, 0);
	gtk_widget_set_tooltip_text(widgets.button_new_tab, _("Open a new tab"));

	widgets.notebook_main = gtk_notebook_new();
	gtk_widget_show(widgets.notebook_main);
	gtk_box_pack_start(GTK_BOX(widgets.hboxtb), widgets.notebook_main, TRUE, TRUE, 0);
	gtk_widget_set_size_request(widgets.notebook_main, -1, 25);
	gtk_notebook_set_scrollable(GTK_NOTEBOOK(widgets.notebook_main), TRUE);
	gtk_notebook_popup_enable(GTK_NOTEBOOK(widgets.notebook_main));
	gtk_notebook_set_show_border(GTK_NOTEBOOK(widgets.notebook_main), FALSE);
	// Main passage tabbed notebook end

	// Another box
	UI_VBOX(widgets.page, FALSE, 0);
	gtk_widget_show(widgets.page);
	gtk_box_pack_start(GTK_BOX(widgets.vboxMain), widgets.page, TRUE, TRUE, 0);

	//nav toolbar
	nav_toolbar = gui_navbar_versekey_new();
	gtk_box_pack_start(GTK_BOX(widgets.page), nav_toolbar, FALSE, FALSE, 0);

	// widgets.hpaned
	widgets.hpaned = UI_HPANE();
	gtk_widget_show(widgets.hpaned);
	gtk_box_pack_start(GTK_BOX(widgets.page), widgets.hpaned, TRUE, TRUE, 0);

	// widgets.vpaned
	widgets.vpaned = UI_VPANE();
	gtk_widget_show(widgets.vpaned);
	gtk_widget_set_size_request(widgets.vpaned, 50, -1);
	gtk_paned_pack1(GTK_PANED(widgets.hpaned), widgets.vpaned, TRUE, FALSE);

	// widgets.vpaned2
	widgets.vpaned2 = UI_VPANE();
	gtk_widget_show(widgets.vpaned2);
	gtk_widget_set_size_request(widgets.vpaned2, 50, -1);
	gtk_paned_pack2(GTK_PANED(widgets.hpaned), widgets.vpaned2, TRUE, FALSE);

	// widgets.vbox_text
	UI_VBOX(widgets.vbox_text, FALSE, 0);
	gtk_widget_show(widgets.vbox_text);
	gtk_paned_pack1(GTK_PANED(widgets.vpaned), widgets.vbox_text, TRUE, TRUE);

	// Bible/parallel notebook
	widgets.notebook_bible_parallel = gtk_notebook_new();
	gtk_widget_show(widgets.notebook_bible_parallel);
	gtk_box_pack_start(GTK_BOX(widgets.vbox_text), widgets.notebook_bible_parallel, TRUE, TRUE, 0);
	gtk_notebook_set_tab_pos(GTK_NOTEBOOK(widgets.notebook_bible_parallel), GTK_POS_BOTTOM);
	gtk_notebook_set_show_tabs(GTK_NOTEBOOK(widgets.notebook_bible_parallel), TRUE);
	gtk_notebook_set_show_border(GTK_NOTEBOOK(widgets.notebook_bible_parallel), FALSE);
	gtk_container_set_border_width(GTK_CONTAINER(widgets.notebook_bible_parallel), 1);

	g_signal_connect(G_OBJECT(widgets.notebook_bible_parallel), "change-current-page", G_CALLBACK(on_notebook_bible_parallel_switch_page), NULL);

	// Text notebook (The bible text show in the standard view)
	widgets.notebook_text = gui_create_bible_pane();
	gtk_container_add(GTK_CONTAINER(widgets.notebook_bible_parallel), widgets.notebook_text);

	label = gtk_label_new(_("Standard View"));
	gtk_widget_show(label);
	gtk_notebook_set_tab_label(GTK_NOTEBOOK(widgets.notebook_bible_parallel), gtk_notebook_get_nth_page(GTK_NOTEBOOK(widgets.notebook_bible_parallel), 0), label);

	// Another box (For the previewer?)
	UI_VBOX(widgets.vbox_previewer, FALSE, 0);
	gtk_widget_show(widgets.vbox_previewer);
	gtk_paned_pack2(GTK_PANED(widgets.vpaned), widgets.vbox_previewer, TRUE, TRUE);
	gtk_container_set_border_width(GTK_CONTAINER(widgets.vbox_previewer), 2);

#ifndef USE_WEBKIT2
	scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
	gtk_widget_show(scrolledwindow);
	gtk_box_pack_start(GTK_BOX(widgets.vbox_previewer), scrolledwindow, TRUE, TRUE, 0);
	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
	gtk_scrolled_window_set_shadow_type((GtkScrolledWindow *) scrolledwindow, settings.shadow_type);
#endif
	widgets.html_previewer_text = GTK_WIDGET(XIPHOS_HTML_NEW(NULL, FALSE, VIEWER_TYPE));
	gtk_widget_show(widgets.html_previewer_text);
#ifdef USE_WEBKIT2
	gtk_box_pack_start(GTK_BOX(widgets.vbox_previewer), widgets.html_previewer_text, TRUE, TRUE, 0);
#else
	gtk_container_add(GTK_CONTAINER(scrolledwindow), widgets.html_previewer_text);
#endif

	// Commentary/book notebook
	widgets.notebook_comm_book = gtk_notebook_new();
	gtk_widget_show(widgets.notebook_comm_book);

	gtk_paned_pack1(GTK_PANED(widgets.vpaned2), widgets.notebook_comm_book, TRUE, TRUE);
	gtk_container_set_border_width(GTK_CONTAINER(widgets.notebook_comm_book), 1);

	gtk_notebook_set_tab_pos(GTK_NOTEBOOK(widgets.notebook_comm_book), GTK_POS_BOTTOM);
	gtk_notebook_set_show_tabs(GTK_NOTEBOOK(widgets.notebook_comm_book), TRUE);
	gtk_notebook_set_show_border(GTK_NOTEBOOK(widgets.notebook_comm_book), FALSE);

	// Commentary pane
	widgets.box_comm = gui_create_commentary_pane();
	gtk_container_add(GTK_CONTAINER(widgets.notebook_comm_book), widgets.box_comm);

	label = gtk_label_new(_("Commentary View"));
	gtk_widget_show(label);
	gtk_notebook_set_tab_label(GTK_NOTEBOOK(widgets.notebook_comm_book), gtk_notebook_get_nth_page(GTK_NOTEBOOK(widgets.notebook_comm_book), 0), label);

	// Book pane
	box_book = gui_create_book_pane();
	gtk_container_add(GTK_CONTAINER(widgets.notebook_comm_book), box_book);

	label = gtk_label_new(_("Book View"));
	gtk_widget_show(label);
	gtk_notebook_set_tab_label(GTK_NOTEBOOK(widgets.notebook_comm_book), gtk_notebook_get_nth_page(GTK_NOTEBOOK(widgets.notebook_comm_book), 1), label);

	// Dict/lex
	widgets.box_dict = gui_create_dictionary_pane();
	gtk_paned_pack2(GTK_PANED(widgets.vpaned2), widgets.box_dict, TRUE, TRUE);

	// Statusbar
	widgets.appbar = gtk_statusbar_new();
	if (settings.statusbar) {
		gtk_widget_show(widgets.appbar);
	}

#ifndef USE_GTK_3
	gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(widgets.appbar), TRUE);
#endif
	gtk_box_pack_start(GTK_BOX(vbox_gs), widgets.appbar, FALSE, TRUE, 0);
	gui_set_statusbar(_("Welcome to Xiphos"));

	g_signal_connect((gpointer)vbox_gs, "key_press_event", G_CALLBACK(on_vbox1_key_press_event), NULL);
	g_signal_connect((gpointer)vbox_gs, "key_release_event", G_CALLBACK(on_vbox1_key_release_event), NULL);

	g_signal_connect(G_OBJECT(widgets.notebook_comm_book), "switch_page", G_CALLBACK(on_notebook_comm_book_switch_page), NULL);

	g_signal_connect(G_OBJECT(widgets.app), "delete_event", G_CALLBACK(delete_event), NULL);

	g_signal_connect((gpointer)widgets.app, "configure_event", G_CALLBACK(on_configure_event), NULL);
	g_signal_connect(G_OBJECT(widgets.epaned), "button_release_event", G_CALLBACK(epaned_button_release_event), (gchar *)"epaned");
	g_signal_connect(G_OBJECT(widgets.vpaned), "button_release_event", G_CALLBACK(epaned_button_release_event), (gchar *)"vpaned");
	g_signal_connect(G_OBJECT(widgets.vpaned2), "button_release_event", G_CALLBACK(epaned_button_release_event), (gchar *)"vpaned2");
	g_signal_connect(G_OBJECT(widgets.hpaned), "button_release_event", G_CALLBACK(epaned_button_release_event), (gchar *)"hpaned1");

	gtk_widget_grab_focus(navbar_versekey.lookup_entry);

	gtk_window_set_default_size((GtkWindow *)widgets.app, settings.gs_width, settings.gs_height);
	main_window_created = TRUE;
}
Esempio n. 19
0
GtkWidget *create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *notebook1;
  GtkWidget *table1;
  GtkWidget *radioCQ;
  GSList *radioCQ_group = NULL;
  GtkWidget *radioCBR;
  GtkWidget *radio2Pass;
  GtkWidget *entryCQ;
  GtkWidget *entryCBR;
  GtkWidget *entry2Pass;
  GtkWidget *label1;
  GtkWidget *table2;
  GtkWidget *label5;
  GtkWidget *label6;
  GtkWidget *label7;
  GtkObject *spinbuttonMaxIFrame_adj;
  GtkWidget *spinbuttonMaxIFrame;
  GtkWidget *label8;
  GtkObject *spinbuttonMinIFrame_adj;
  GtkWidget *spinbuttonMinIFrame;
  GtkWidget *optionME;
  GtkWidget *menu4;
  GtkWidget *_0___none1;
  GtkWidget *_1__very_low1;
  GtkWidget *_2__low1;
  GtkWidget *_3__medium1;
  GtkWidget *_4__high1;
  GtkWidget *_5__very_high1;
  GtkWidget *_6__ultra_high1;
  GtkWidget *optionQzer;
  GtkWidget *menu5;
  GtkWidget *h263_quantizer1;
  GtkWidget *mpeg_quantizer1;
  GtkWidget *label2;
  GtkWidget *table3;
  GtkWidget *label9;
  GtkWidget *label10;
  GtkWidget *label11;
  GtkWidget *label12;
  GtkObject *spinImin_adj;
  GtkWidget *spinImin;
  GtkObject *spinImax_adj;
  GtkWidget *spinImax;
  GtkObject *spinPmin_adj;
  GtkWidget *spinPmin;
  GtkObject *spinPmax_adj;
  GtkWidget *spinPmax;
  GtkWidget *label3;
  GtkWidget *label13;
  GtkWidget *label4;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), _("Xvid Encoder"));

  dialog_vbox1 = GTK_DIALOG (dialog1)->vbox;
  gtk_widget_show (dialog_vbox1);

  notebook1 = gtk_notebook_new ();
  gtk_widget_show (notebook1);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), notebook1, TRUE, TRUE, 0);

  table1 = gtk_table_new (3, 2, FALSE);
  gtk_widget_show (table1);
  gtk_container_add (GTK_CONTAINER (notebook1), table1);

  radioCQ = gtk_radio_button_new_with_mnemonic (NULL, _("Constant Quantizer"));
  gtk_widget_show (radioCQ);
  gtk_table_attach (GTK_TABLE (table1), radioCQ, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioCQ), radioCQ_group);
  radioCQ_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioCQ));

  radioCBR = gtk_radio_button_new_with_mnemonic (NULL, _("Constant Bitrate (kbps)"));
  gtk_widget_show (radioCBR);
  gtk_table_attach (GTK_TABLE (table1), radioCBR, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioCBR), radioCQ_group);
  radioCQ_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioCBR));

  radio2Pass = gtk_radio_button_new_with_mnemonic (NULL, _("Dual pass (MBytes)"));
  gtk_widget_show (radio2Pass);
  gtk_table_attach (GTK_TABLE (table1), radio2Pass, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio2Pass), radioCQ_group);
  radioCQ_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio2Pass));

  entryCQ = gtk_entry_new ();
  gtk_widget_show (entryCQ);
  gtk_table_attach (GTK_TABLE (table1), entryCQ, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  entryCBR = gtk_entry_new ();
  gtk_widget_show (entryCBR);
  gtk_table_attach (GTK_TABLE (table1), entryCBR, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  entry2Pass = gtk_entry_new ();
  gtk_widget_show (entry2Pass);
  gtk_table_attach (GTK_TABLE (table1), entry2Pass, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label1 = gtk_label_new (_("Basic"));
  gtk_widget_show (label1);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label1);
  gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);

  table2 = gtk_table_new (4, 2, FALSE);
  gtk_widget_show (table2);
  gtk_container_add (GTK_CONTAINER (notebook1), table2);

  label5 = gtk_label_new (_("Motion Search"));
  gtk_widget_show (label5);
  gtk_table_attach (GTK_TABLE (table2), label5, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);

  label6 = gtk_label_new (_("Quantization"));
  gtk_widget_show (label6);
  gtk_table_attach (GTK_TABLE (table2), label6, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);

  label7 = gtk_label_new (_("Max I frame interval "));
  gtk_widget_show (label7);
  gtk_table_attach (GTK_TABLE (table2), label7, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);

  spinbuttonMaxIFrame_adj = gtk_adjustment_new (300, 0, 600, 1, 10, 10);
  spinbuttonMaxIFrame = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonMaxIFrame_adj), 1, 0);
  gtk_widget_show (spinbuttonMaxIFrame);
  gtk_table_attach (GTK_TABLE (table2), spinbuttonMaxIFrame, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonMaxIFrame), TRUE);

  label8 = gtk_label_new (_("Min I frame interval"));
  gtk_widget_show (label8);
  gtk_table_attach (GTK_TABLE (table2), label8, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label8), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);

  spinbuttonMinIFrame_adj = gtk_adjustment_new (1, 0, 600, 1, 10, 10);
  spinbuttonMinIFrame = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonMinIFrame_adj), 1, 0);
  gtk_widget_show (spinbuttonMinIFrame);
  gtk_table_attach (GTK_TABLE (table2), spinbuttonMinIFrame, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonMinIFrame), TRUE);

  optionME = gtk_option_menu_new ();
  gtk_widget_show (optionME);
  gtk_table_attach (GTK_TABLE (table2), optionME, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  menu4 = gtk_menu_new ();

  _0___none1 = gtk_menu_item_new_with_mnemonic (_("0 - None"));
  gtk_widget_show (_0___none1);
  gtk_container_add (GTK_CONTAINER (menu4), _0___none1);

  _1__very_low1 = gtk_menu_item_new_with_mnemonic (_("1- Very low"));
  gtk_widget_show (_1__very_low1);
  gtk_container_add (GTK_CONTAINER (menu4), _1__very_low1);

  _2__low1 = gtk_menu_item_new_with_mnemonic (_("2- Low"));
  gtk_widget_show (_2__low1);
  gtk_container_add (GTK_CONTAINER (menu4), _2__low1);

  _3__medium1 = gtk_menu_item_new_with_mnemonic (_("3- Medium"));
  gtk_widget_show (_3__medium1);
  gtk_container_add (GTK_CONTAINER (menu4), _3__medium1);

  _4__high1 = gtk_menu_item_new_with_mnemonic (_("4- High"));
  gtk_widget_show (_4__high1);
  gtk_container_add (GTK_CONTAINER (menu4), _4__high1);

  _5__very_high1 = gtk_menu_item_new_with_mnemonic (_("5- Very High"));
  gtk_widget_show (_5__very_high1);
  gtk_container_add (GTK_CONTAINER (menu4), _5__very_high1);

  _6__ultra_high1 = gtk_menu_item_new_with_mnemonic (_("6- Ultra High"));
  gtk_widget_show (_6__ultra_high1);
  gtk_container_add (GTK_CONTAINER (menu4), _6__ultra_high1);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (optionME), menu4);

  optionQzer = gtk_option_menu_new ();
  gtk_widget_show (optionQzer);
  gtk_table_attach (GTK_TABLE (table2), optionQzer, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  menu5 = gtk_menu_new ();

 h263_quantizer1 = gtk_menu_item_new_with_mnemonic (_("H263 Quantizer"));
  gtk_widget_show (h263_quantizer1);
  gtk_container_add (GTK_CONTAINER (menu5), h263_quantizer1);


  mpeg_quantizer1 = gtk_menu_item_new_with_mnemonic (_("MPEG Quantizer"));
  gtk_widget_show (mpeg_quantizer1);
  gtk_container_add (GTK_CONTAINER (menu5), mpeg_quantizer1);


  gtk_option_menu_set_menu (GTK_OPTION_MENU (optionQzer), menu5);

  label2 = gtk_label_new (_("Advanced"));
  gtk_widget_show (label2);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label2);
  gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);

  table3 = gtk_table_new (4, 2, FALSE);
  gtk_widget_show (table3);
  gtk_container_add (GTK_CONTAINER (notebook1), table3);

  label9 = gtk_label_new (_("Min I Frame Qzer"));
  gtk_widget_show (label9);
  gtk_table_attach (GTK_TABLE (table3), label9, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label9), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5);

  label10 = gtk_label_new (_("Max I Frame Qzer"));
  gtk_widget_show (label10);
  gtk_table_attach (GTK_TABLE (table3), label10, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label10), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label10), 0, 0.5);

  label11 = gtk_label_new (_("Min P Frame Qzer"));
  gtk_widget_show (label11);
  gtk_table_attach (GTK_TABLE (table3), label11, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label11), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label11), 0, 0.5);

  label12 = gtk_label_new (_("Max P Frame Qzer"));
  gtk_widget_show (label12);
  gtk_table_attach (GTK_TABLE (table3), label12, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label12), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label12), 0, 0.5);

  spinImin_adj = gtk_adjustment_new (2, 2, 31, 1, 10, 10);
  spinImin = gtk_spin_button_new (GTK_ADJUSTMENT (spinImin_adj), 1, 0);
  gtk_widget_show (spinImin);
  gtk_table_attach (GTK_TABLE (table3), spinImin, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinImin), TRUE);

  spinImax_adj = gtk_adjustment_new (2, 2, 31, 1, 10, 10);
  spinImax = gtk_spin_button_new (GTK_ADJUSTMENT (spinImax_adj), 1, 0);
  gtk_widget_show (spinImax);
  gtk_table_attach (GTK_TABLE (table3), spinImax, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinImax), TRUE);

  spinPmin_adj = gtk_adjustment_new (2, 2, 31, 1, 10, 10);
  spinPmin = gtk_spin_button_new (GTK_ADJUSTMENT (spinPmin_adj), 1, 0);
  gtk_widget_show (spinPmin);
  gtk_table_attach (GTK_TABLE (table3), spinPmin, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinPmin), TRUE);

  spinPmax_adj = gtk_adjustment_new (2, 2, 31, 1, 10, 10);
  spinPmax = gtk_spin_button_new (GTK_ADJUSTMENT (spinPmax_adj), 1, 0);
  gtk_widget_show (spinPmax);
  gtk_table_attach (GTK_TABLE (table3), spinPmax, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinPmax), TRUE);

  label3 = gtk_label_new (_("Quantizer"));
  gtk_widget_show (label3);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label3);
  gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);

  label13 = gtk_label_new (_("Not Yet!"));
  gtk_widget_show (label13);
  gtk_container_add (GTK_CONTAINER (notebook1), label13);
  gtk_label_set_justify (GTK_LABEL (label13), GTK_JUSTIFY_LEFT);

  label4 = gtk_label_new (_("B Frames"));
  gtk_widget_show (label4);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), label4);
  gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);

  dialog_action_area1 = GTK_DIALOG (dialog1)->action_area;
  gtk_widget_show (dialog_action_area1);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);

  cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
  gtk_widget_show (cancelbutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), cancelbutton1, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);

  okbutton1 = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (okbutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), okbutton1, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog1, "dialog1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (dialog1, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (dialog1, table1, "table1");
  GLADE_HOOKUP_OBJECT (dialog1, radioCQ, "radioCQ");
  GLADE_HOOKUP_OBJECT (dialog1, radioCBR, "radioCBR");
  GLADE_HOOKUP_OBJECT (dialog1, radio2Pass, "radio2Pass");
  GLADE_HOOKUP_OBJECT (dialog1, entryCQ, "entryCQ");
  GLADE_HOOKUP_OBJECT (dialog1, entryCBR, "entryCBR");
  GLADE_HOOKUP_OBJECT (dialog1, entry2Pass, "entry2Pass");
  GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, table2, "table2");
  GLADE_HOOKUP_OBJECT (dialog1, label5, "label5");
  GLADE_HOOKUP_OBJECT (dialog1, label6, "label6");
  GLADE_HOOKUP_OBJECT (dialog1, label7, "label7");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonMaxIFrame, "spinbuttonMaxIFrame");
  GLADE_HOOKUP_OBJECT (dialog1, label8, "label8");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonMinIFrame, "spinbuttonMinIFrame");
  GLADE_HOOKUP_OBJECT (dialog1, optionME, "optionME");
  GLADE_HOOKUP_OBJECT (dialog1, menu4, "menu4");
  GLADE_HOOKUP_OBJECT (dialog1, _0___none1, "_0___none1");
  GLADE_HOOKUP_OBJECT (dialog1, _1__very_low1, "_1__very_low1");
  GLADE_HOOKUP_OBJECT (dialog1, _2__low1, "_2__low1");
  GLADE_HOOKUP_OBJECT (dialog1, _3__medium1, "_3__medium1");
  GLADE_HOOKUP_OBJECT (dialog1, _4__high1, "_4__high1");
  GLADE_HOOKUP_OBJECT (dialog1, _5__very_high1, "_5__very_high1");
  GLADE_HOOKUP_OBJECT (dialog1, _6__ultra_high1, "_6__ultra_high1");
  GLADE_HOOKUP_OBJECT (dialog1, optionQzer, "optionQzer");
  GLADE_HOOKUP_OBJECT (dialog1, menu5, "menu5");
  GLADE_HOOKUP_OBJECT (dialog1, h263_quantizer1, "h263_quantizer1");
  GLADE_HOOKUP_OBJECT (dialog1, mpeg_quantizer1, "mpeg_quantizer1");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT (dialog1, table3, "table3");
  GLADE_HOOKUP_OBJECT (dialog1, label9, "label9");
  GLADE_HOOKUP_OBJECT (dialog1, label10, "label10");
  GLADE_HOOKUP_OBJECT (dialog1, label11, "label11");
  GLADE_HOOKUP_OBJECT (dialog1, label12, "label12");
  GLADE_HOOKUP_OBJECT (dialog1, spinImin, "spinImin");
  GLADE_HOOKUP_OBJECT (dialog1, spinImax, "spinImax");
  GLADE_HOOKUP_OBJECT (dialog1, spinPmin, "spinPmin");
  GLADE_HOOKUP_OBJECT (dialog1, spinPmax, "spinPmax");
  GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
  GLADE_HOOKUP_OBJECT (dialog1, label13, "label13");
  GLADE_HOOKUP_OBJECT (dialog1, label4, "label4");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (dialog1, cancelbutton1, "cancelbutton1");
  GLADE_HOOKUP_OBJECT (dialog1, okbutton1, "okbutton1");

  return dialog1;
}
Esempio n. 20
0
static void create_window(struct catalog *catalog)
{
        GtkWidget *window;
        GtkWidget *rootvbox;
        struct preferences_catalog *prefs_catalog;
        GtkWidget *catalog_widget;
        GtkWidget *notebook;
        GtkWidget *buttonbox;
        GtkWidget *close;
        GtkWidget *general_widget;
        GtkWidget *label;
        GtkWidget *stop;

        window =  gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_title(GTK_WINDOW(window), "Ocha Preferences");

        rootvbox =  gtk_vbox_new(FALSE, 0);
        gtk_widget_show(rootvbox);
        gtk_container_add(GTK_CONTAINER(window), rootvbox);

        notebook = gtk_notebook_new();
        gtk_widget_show (notebook);
        gtk_box_pack_start (GTK_BOX (rootvbox), notebook, TRUE, TRUE, 0);
        gtk_container_set_border_width (GTK_CONTAINER (notebook), 12);

        buttonbox = gtk_hbutton_box_new ();
        gtk_widget_show (buttonbox);
        gtk_box_pack_start (GTK_BOX (rootvbox), buttonbox, FALSE, TRUE, 0);
        gtk_container_set_border_width (GTK_CONTAINER (buttonbox), 12);
        gtk_button_box_set_layout (GTK_BUTTON_BOX (buttonbox), GTK_BUTTONBOX_END);

        close = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
        gtk_widget_show (close);
        gtk_container_add (GTK_CONTAINER (buttonbox), close);
        GTK_WIDGET_SET_FLAGS (close, GTK_CAN_DEFAULT);

        /* notebook page : general */
        general_widget = preferences_general_widget_new();
        gtk_widget_show(general_widget);
        gtk_container_add(GTK_CONTAINER(notebook), general_widget);

        label = gtk_label_new ("General");
        gtk_widget_show (label);
        gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook),
                                    gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 0),
                                    label);

        /* notebook page : catalog */

        prefs_catalog = preferences_catalog_new(catalog);
        catalog_widget =  preferences_catalog_get_widget(prefs_catalog);
        gtk_widget_show(catalog_widget);
        gtk_container_add(GTK_CONTAINER(notebook), catalog_widget);

        label = gtk_label_new ("Catalog");
        gtk_widget_show (label);
        gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook),
                                    gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 1),
                                    label);

        /* notebook page: stop */

        stop = preferences_stop_create();
        gtk_container_add(GTK_CONTAINER(notebook), stop);

        label = gtk_label_new ("Stop");
        gtk_widget_show (label);
        gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook),
                                    gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 2),
                                    label);


        gtk_window_set_default_size(GTK_WINDOW(window),
                                    250, 300);
        g_signal_connect (G_OBJECT (window), "destroy",
                          G_CALLBACK (destroy_cb),
                          NULL);
        g_signal_connect (G_OBJECT (close), "clicked",
                          G_CALLBACK (destroy_cb),
                          NULL);

        gtk_widget_show(window);
}
Esempio n. 21
0
void
gui_main_init ()
{
    struct t_gui_buffer *ptr_buffer;
    struct t_gui_bar *ptr_bar;
    struct t_gui_bar_window *ptr_bar_win;
    GdkColor color_fg, color_bg;
    
    gui_color_init ();
    
    gui_ok = 1;
    
    /* build prefixes according to config */
    gui_chat_prefix_build ();
    
    /* init clipboard buffer */
    gui_input_clipboard = NULL;
    
    /* create Gtk widgets */
    
    gdk_color_parse ("white", &color_fg);
    gdk_color_parse ("black", &color_bg);
    
    gui_gtk_main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title (GTK_WINDOW (gui_gtk_main_window), PACKAGE_STRING);
    
    g_signal_connect (G_OBJECT (gui_gtk_main_window), "destroy", gtk_main_quit, NULL);
    
    gui_gtk_vbox1 = gtk_vbox_new (FALSE, 0);
    gtk_widget_show (gui_gtk_vbox1);
    gtk_container_add (GTK_CONTAINER (gui_gtk_main_window), gui_gtk_vbox1);
    
    gui_gtk_entry_topic = gtk_entry_new ();
    gtk_widget_show (gui_gtk_entry_topic);
    gtk_box_pack_start (GTK_BOX (gui_gtk_vbox1), gui_gtk_entry_topic, FALSE, FALSE, 0);
    gtk_widget_modify_text (gui_gtk_entry_topic, GTK_STATE_NORMAL, &color_fg);
    gtk_widget_modify_base (gui_gtk_entry_topic, GTK_STATE_NORMAL, &color_bg);
    
    gui_gtk_notebook1 = gtk_notebook_new ();
    gtk_widget_show (gui_gtk_notebook1);
    gtk_box_pack_start (GTK_BOX (gui_gtk_vbox1), gui_gtk_notebook1, TRUE, TRUE, 0);
    gtk_notebook_set_tab_pos (GTK_NOTEBOOK (gui_gtk_notebook1), GTK_POS_BOTTOM);
    
    gui_gtk_vbox2 = gtk_vbox_new (FALSE, 0);
    gtk_widget_show (gui_gtk_vbox2);
    gtk_container_add (GTK_CONTAINER (gui_gtk_notebook1), gui_gtk_vbox2);
    
    gui_gtk_hbox1 = gtk_hbox_new (FALSE, 0);
    gtk_widget_show (gui_gtk_hbox1);
    gtk_box_pack_start (GTK_BOX (gui_gtk_vbox2), gui_gtk_hbox1, TRUE, TRUE, 0);
    
    gui_gtk_hpaned1 = gtk_hpaned_new ();
    gtk_widget_show (gui_gtk_hpaned1);
    gtk_box_pack_start (GTK_BOX (gui_gtk_hbox1), gui_gtk_hpaned1, TRUE, TRUE, 0);
    gtk_paned_set_position (GTK_PANED (gui_gtk_hpaned1), 0);
    
    gui_gtk_scrolledwindow_chat = gtk_scrolled_window_new (NULL, NULL);
    gtk_widget_show (gui_gtk_scrolledwindow_chat);
    gtk_paned_pack1 (GTK_PANED (gui_gtk_hpaned1), gui_gtk_scrolledwindow_chat,
                     FALSE, TRUE);
    //gtk_box_pack_start (GTK_PANED (hpaned1), scrolledwindow_chat, TRUE, TRUE, 0);
    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (gui_gtk_scrolledwindow_chat),
                                    GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
    gtk_widget_modify_text (gui_gtk_scrolledwindow_chat, GTK_STATE_NORMAL, &color_fg);
    gtk_widget_modify_base (gui_gtk_scrolledwindow_chat, GTK_STATE_NORMAL, &color_bg);
    
    gui_gtk_scrolledwindow_nick = gtk_scrolled_window_new (NULL, NULL);
    gtk_widget_show (gui_gtk_scrolledwindow_nick);
    gtk_paned_pack2 (GTK_PANED (gui_gtk_hpaned1), gui_gtk_scrolledwindow_nick,
                     FALSE, TRUE);
    //gtk_box_pack_start (GTK_PANED (hpaned1), scrolledwindow_nick, TRUE, TRUE, 0);
    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (gui_gtk_scrolledwindow_nick),
                                    GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
    gtk_widget_modify_text (gui_gtk_scrolledwindow_nick, GTK_STATE_NORMAL, &color_fg);
    gtk_widget_modify_base (gui_gtk_scrolledwindow_nick, GTK_STATE_NORMAL, &color_bg);
    
    gui_gtk_entry_input = gtk_entry_new ();
    gtk_widget_show (gui_gtk_entry_input);
    gtk_box_pack_start (GTK_BOX (gui_gtk_vbox2), gui_gtk_entry_input, FALSE,
                        FALSE, 0);
    gtk_widget_modify_text (gui_gtk_entry_input, GTK_STATE_NORMAL, &color_fg);
    gtk_widget_modify_base (gui_gtk_entry_input, GTK_STATE_NORMAL, &color_bg);
    
    gui_gtk_label1 = gtk_label_new (_("server"));
    gtk_widget_show (gui_gtk_label1);
    gtk_notebook_set_tab_label (GTK_NOTEBOOK (gui_gtk_notebook1),
                                gtk_notebook_get_nth_page (GTK_NOTEBOOK (gui_gtk_notebook1), 0),
                                gui_gtk_label1);
    gtk_label_set_justify (GTK_LABEL (gui_gtk_label1), GTK_JUSTIFY_LEFT);
    
    gtk_widget_show_all (gui_gtk_main_window);
    
    gui_init_ok = 0;
    
    /* create core buffer */
    ptr_buffer = gui_buffer_new (NULL, "weechat", NULL, NULL, NULL, NULL);
    if (ptr_buffer)
    {
        gui_init_ok = 1;
        
        /* set title for core buffer */
        gui_buffer_set_title (ptr_buffer,
                              "WeeChat " WEECHAT_COPYRIGHT_DATE
                              " - " WEECHAT_WEBSITE);
        
        /* create main window (using full space) */
        if (gui_window_new (NULL, ptr_buffer, 0, 0, 0, 0, 100, 100))
        {
            gui_current_window = gui_windows;
            
            if (CONFIG_BOOLEAN(config_look_set_title))
                gui_window_set_title (PACKAGE_NAME " " PACKAGE_VERSION);
        }
        
        /* create bar windows for root bars (they were read from config,
           but no window was created (GUI was not initialized) */
        for (ptr_bar = gui_bars; ptr_bar; ptr_bar = ptr_bar->next_bar)
        {
            if ((CONFIG_INTEGER(ptr_bar->options[GUI_BAR_OPTION_TYPE]) == GUI_BAR_TYPE_ROOT)
                && (!ptr_bar->bar_window))
            {
                gui_bar_window_new (ptr_bar, NULL);
            }
        }
        for (ptr_bar_win = gui_windows->bar_windows;
             ptr_bar_win; ptr_bar_win = ptr_bar_win->next_bar_window)
        {
            gui_bar_window_calculate_pos_size (ptr_bar_win, gui_windows);
            gui_bar_window_create_win (ptr_bar_win);
        }
    }
}
GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox3b;
  GtkWidget *toolbar1;
  GtkIconSize tmp_toolbar_icon_size;
  GtkWidget *toolbuttonOpen;
  GtkWidget *toolbuttonSave;
  GtkWidget *tmp_image;
  GtkWidget *toolbuttonScript;
  GtkWidget *toolbuttonDVD;
  GtkWidget *toolbuttonHalfD1;
  GtkWidget *toolbuttonSVCD;
  GtkWidget *toolbuttonVCD;
  GtkWidget *hbox11;
  GtkWidget *frame1;
  GtkWidget *alignment1;
  GtkWidget *vbox2;
  GtkWidget *notebook1;
  GtkWidget *scrolledwindow1;
  GtkWidget *treeview1;
  GtkWidget *hbox5;
  GtkWidget *image1;
  GtkWidget *label11;
  GtkWidget *scrolledwindow2;
  GtkWidget *treeview2;
  GtkWidget *hbox6;
  GtkWidget *image2;
  GtkWidget *label17;
  GtkWidget *scrolledwindow3;
  GtkWidget *treeview3;
  GtkWidget *hbox7;
  GtkWidget *image3;
  GtkWidget *label18;
  GtkWidget *scrolledwindow4;
  GtkWidget *treeview4;
  GtkWidget *hbox8;
  GtkWidget *image4;
  GtkWidget *label19;
  GtkWidget *scrolledwindow5;
  GtkWidget *treeview5;
  GtkWidget *hbox9;
  GtkWidget *image5;
  GtkWidget *label20;
  GtkWidget *scrolledwindow6;
  GtkWidget *treeview6;
  GtkWidget *hbox10;
  GtkWidget *image6;
  GtkWidget *label21;
  GtkWidget *scrolledwindow7;
  GtkWidget *treeview7;
  GtkWidget *hbox4;
  GtkWidget *image7;
  GtkWidget *label22;
  GtkWidget *treeview8;
  GtkWidget *label28;
  GtkWidget *hbox13;
  GtkWidget *buttonAdd;
  GtkWidget *image11;
  GtkWidget *label23;
  GtkWidget *frame2;
  GtkWidget *alignment2;
  GtkWidget *hbox1;
  GtkWidget *vbox3;
  GtkWidget *scrolledwindow9;
  GtkWidget *treeview0;
  GtkWidget *hbox14;
  GtkWidget *buttonRemove;
  GtkWidget *image15;
  GtkWidget *buttonDown;
  GtkWidget *image14;
  GtkWidget *buttonUp;
  GtkWidget *image13;
  GtkWidget *buttonPartial;
  GtkWidget *buttonProperties;
  GtkWidget *alignment4;
  GtkWidget *hbox16;
  GtkWidget *label25;
  GtkWidget *label2;
  GtkWidget *dialog_action_area1;
  GtkWidget *buttonPreview;
  GtkWidget *alignment5;
  GtkWidget *hbox17;
  GtkWidget *image17;
  GtkWidget *label26;
  GtkWidget *buttonClose;
  GtkAccelGroup *accel_group;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  accel_group = gtk_accel_group_new ();

  dialog1 = gtk_dialog_new ();
  gtk_container_set_border_width (GTK_CONTAINER (dialog1), 6);
  gtk_window_set_title (GTK_WINDOW (dialog1), QT_TR_NOOP("Video Filter Manager"));
  gtk_window_set_type_hint (GTK_WINDOW (dialog1), GDK_WINDOW_TYPE_HINT_DIALOG);
  gtk_dialog_set_has_separator (GTK_DIALOG (dialog1), FALSE);

  dialog_vbox1 = GTK_DIALOG (dialog1)->vbox;
  gtk_box_set_spacing (GTK_BOX(dialog_vbox1), 12);
  gtk_widget_show (dialog_vbox1);

  vbox3b = gtk_vbox_new (FALSE, 12);
  gtk_widget_show (vbox3b);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox3b, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox3b), 6);

  toolbar1 = gtk_toolbar_new ();
  gtk_widget_show (toolbar1);
  gtk_box_pack_start (GTK_BOX (vbox3b), toolbar1, FALSE, FALSE, 0);
  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_BOTH);
  tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1));

  toolbuttonOpen = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-open");
  gtk_widget_show (toolbuttonOpen);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonOpen);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonOpen), tooltips, QT_TR_NOOP("Open filter list [Ctrl-O]"), NULL);
  gtk_widget_add_accelerator (toolbuttonOpen, "clicked", accel_group,
                              GDK_O, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonOpen), TRUE);

  toolbuttonSave = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-save");
  gtk_widget_show (toolbuttonSave);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonSave);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonSave), tooltips, QT_TR_NOOP("Save filter list [Ctrl-S]"), NULL);
  gtk_widget_add_accelerator (toolbuttonSave, "clicked", accel_group,
                              GDK_S, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonSave), TRUE);

  tmp_image = gtk_image_new_from_stock ("gtk-save-as", tmp_toolbar_icon_size);
  gtk_widget_show (tmp_image);
  toolbuttonScript = (GtkWidget*) gtk_tool_button_new (tmp_image, QT_TR_NOOP("Save Script"));
  gtk_widget_show (toolbuttonScript);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonScript);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonScript), tooltips, QT_TR_NOOP("Save as script [Ctrl-J]"), NULL);
  gtk_widget_add_accelerator (toolbuttonScript, "clicked", accel_group,
                              GDK_J, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonScript), TRUE);

  tmp_image = gtk_image_new_from_stock ("gtk-cdrom", tmp_toolbar_icon_size);
  gtk_widget_show (tmp_image);
  toolbuttonDVD = (GtkWidget*) gtk_tool_button_new (tmp_image, QT_TR_NOOP("DVD Res"));
  gtk_widget_show (toolbuttonDVD);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonDVD);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonDVD), tooltips, QT_TR_NOOP("DVD resolution [Ctrl-1]"), NULL);
  gtk_widget_add_accelerator (toolbuttonDVD, "clicked", accel_group,
                              GDK_1, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonDVD), TRUE);

  tmp_image = gtk_image_new_from_stock ("gtk-cdrom", tmp_toolbar_icon_size);
  gtk_widget_show (tmp_image);
  toolbuttonHalfD1 = (GtkWidget*) gtk_tool_button_new (tmp_image, QT_TR_NOOP("Half D1 Res"));
  gtk_widget_show (toolbuttonHalfD1);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonHalfD1);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonHalfD1), tooltips, QT_TR_NOOP("Half D1 resolution [Ctrl-2]"), NULL);
  gtk_widget_add_accelerator (toolbuttonHalfD1, "clicked", accel_group,
                              GDK_2, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonHalfD1), TRUE);

  tmp_image = gtk_image_new_from_stock ("gtk-cdrom", tmp_toolbar_icon_size);
  gtk_widget_show (tmp_image);
  toolbuttonSVCD = (GtkWidget*) gtk_tool_button_new (tmp_image, QT_TR_NOOP("SVCD Res"));
  gtk_widget_show (toolbuttonSVCD);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonSVCD);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonSVCD), tooltips, QT_TR_NOOP("SVCD resolution [Ctrl-3]"), NULL);
  gtk_widget_add_accelerator (toolbuttonSVCD, "clicked", accel_group,
                              GDK_3, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonSVCD), TRUE);

  tmp_image = gtk_image_new_from_stock ("gtk-cdrom", tmp_toolbar_icon_size);
  gtk_widget_show (tmp_image);
  toolbuttonVCD = (GtkWidget*) gtk_tool_button_new (tmp_image, QT_TR_NOOP("VCD Res"));
  gtk_widget_show (toolbuttonVCD);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolbuttonVCD);
  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbuttonVCD), tooltips, QT_TR_NOOP("VCD resolution [Ctrl-4]"), NULL);
  gtk_widget_add_accelerator (toolbuttonVCD, "clicked", accel_group,
                              GDK_4, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);
  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbuttonVCD), TRUE);

  hbox11 = gtk_hbox_new (FALSE, 12);
  gtk_widget_show (hbox11);
  gtk_box_pack_start (GTK_BOX (vbox3b), hbox11, TRUE, TRUE, 0);

  frame1 = gtk_frame_new (NULL);
  gtk_widget_show (frame1);
  gtk_box_pack_start (GTK_BOX (hbox11), frame1, TRUE, TRUE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_NONE);

  alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment1);
  gtk_container_add (GTK_CONTAINER (frame1), alignment1);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 6, 0, 18, 0);

  vbox2 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox2);
  gtk_container_add (GTK_CONTAINER (alignment1), vbox2);

  notebook1 = gtk_notebook_new ();
  gtk_widget_show (notebook1);
  gtk_box_pack_start (GTK_BOX (vbox2), notebook1, TRUE, TRUE, 0);
  gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook1), FALSE);
  gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook1), GTK_POS_LEFT);

  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow1);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow1);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);

  treeview1 = gtk_tree_view_new ();
  gtk_widget_show (treeview1);
  gtk_container_add (GTK_CONTAINER (scrolledwindow1), treeview1);
  gtk_widget_set_size_request (treeview1, 288, 336);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview1), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview1), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview1), FALSE);

  hbox5 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox5);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), hbox5);

  image1 = create_pixmap (dialog1, "1.png");
  gtk_widget_show (image1);
  gtk_box_pack_start (GTK_BOX (hbox5), image1, FALSE, FALSE, 0);

  label11 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Transform"));
  gtk_widget_show (label11);
  gtk_box_pack_start (GTK_BOX (hbox5), label11, FALSE, FALSE, 4);
  gtk_label_set_use_markup (GTK_LABEL (label11), TRUE);

  scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow2);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow2);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview2 = gtk_tree_view_new ();
  gtk_widget_show (treeview2);
  gtk_container_add (GTK_CONTAINER (scrolledwindow2), treeview2);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview2), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview2), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview2), FALSE);

  hbox6 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox6);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), hbox6);

  image2 = create_pixmap (dialog1, "2.png");
  gtk_widget_show (image2);
  gtk_box_pack_start (GTK_BOX (hbox6), image2, FALSE, FALSE, 0);

  label17 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Interlacing"));
  gtk_widget_show (label17);
  gtk_box_pack_start (GTK_BOX (hbox6), label17, FALSE, FALSE, 4);

  scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow3);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow3);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview3 = gtk_tree_view_new ();
  gtk_widget_show (treeview3);
  gtk_container_add (GTK_CONTAINER (scrolledwindow3), treeview3);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview3), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview3), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview3), FALSE);

  hbox7 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox7);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), hbox7);

  image3 = create_pixmap (dialog1, "4.png");
  gtk_widget_show (image3);
  gtk_box_pack_start (GTK_BOX (hbox7), image3, FALSE, FALSE, 0);

  label18 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Colors"));
  gtk_widget_show (label18);
  gtk_box_pack_start (GTK_BOX (hbox7), label18, FALSE, FALSE, 4);

  scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow4);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow4);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview4 = gtk_tree_view_new ();
  gtk_widget_show (treeview4);
  gtk_container_add (GTK_CONTAINER (scrolledwindow4), treeview4);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview4), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview4), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview4), FALSE);

  hbox8 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox8);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), hbox8);

  image4 = create_pixmap (dialog1, "5.png");
  gtk_widget_show (image4);
  gtk_box_pack_start (GTK_BOX (hbox8), image4, FALSE, FALSE, 0);

  label19 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Noise"));
  gtk_widget_show (label19);
  gtk_box_pack_start (GTK_BOX (hbox8), label19, FALSE, FALSE, 4);

  scrolledwindow5 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow5);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow5);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow5), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview5 = gtk_tree_view_new ();
  gtk_widget_show (treeview5);
  gtk_container_add (GTK_CONTAINER (scrolledwindow5), treeview5);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview5), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview5), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview5), FALSE);

  hbox9 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox9);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 4), hbox9);

  image5 = create_pixmap (dialog1, "3.png");
  gtk_widget_show (image5);
  gtk_box_pack_start (GTK_BOX (hbox9), image5, FALSE, FALSE, 0);

  label20 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Sharpness"));
  gtk_widget_show (label20);
  gtk_box_pack_start (GTK_BOX (hbox9), label20, FALSE, FALSE, 4);

  scrolledwindow6 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow6);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow6);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow6), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview6 = gtk_tree_view_new ();
  gtk_widget_show (treeview6);
  gtk_container_add (GTK_CONTAINER (scrolledwindow6), treeview6);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview6), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview6), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview6), FALSE);

  hbox10 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox10);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 5), hbox10);

  image6 = create_pixmap (dialog1, "7.png");
  gtk_widget_show (image6);
  gtk_box_pack_start (GTK_BOX (hbox10), image6, FALSE, FALSE, 0);

  label21 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Subtitles"));
  gtk_widget_show (label21);
  gtk_box_pack_start (GTK_BOX (hbox10), label21, FALSE, FALSE, 4);

  scrolledwindow7 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow7);
  gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow7);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow7), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview7 = gtk_tree_view_new ();
  gtk_widget_show (treeview7);
  gtk_container_add (GTK_CONTAINER (scrolledwindow7), treeview7);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview7), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview7), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview7), FALSE);

  hbox4 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox4);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 6), hbox4);

  image7 = create_pixmap (dialog1, "6.png");
  gtk_widget_show (image7);
  gtk_box_pack_start (GTK_BOX (hbox4), image7, FALSE, FALSE, 0);

  label22 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Misc"));
  gtk_widget_show (label22);
  gtk_box_pack_start (GTK_BOX (hbox4), label22, FALSE, FALSE, 4);

  treeview8 = gtk_tree_view_new ();
  gtk_widget_show (treeview8);
  gtk_container_add (GTK_CONTAINER (notebook1), treeview8);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview8), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview8), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview8), FALSE);

  label28 = gtk_label_new (QT_TR_NOOP("External"));
  gtk_widget_show (label28);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 7), label28);

  hbox13 = gtk_hbox_new (FALSE, 6);
  gtk_widget_show (hbox13);
  gtk_box_pack_start (GTK_BOX (vbox2), hbox13, FALSE, FALSE, 0);

  buttonAdd = gtk_button_new ();
  gtk_widget_show (buttonAdd);
  gtk_box_pack_end (GTK_BOX (hbox13), buttonAdd, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, buttonAdd, QT_TR_NOOP("Add selected filter to the Active Filters list"), NULL);

  image11 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image11);
  gtk_container_add (GTK_CONTAINER (buttonAdd), image11);

  label23 = gtk_label_new (QT_TR_NOOP("<b>Available Filters</b>"));
  gtk_widget_show (label23);
  gtk_frame_set_label_widget (GTK_FRAME (frame1), label23);
  gtk_label_set_use_markup (GTK_LABEL (label23), TRUE);
  gtk_misc_set_alignment (GTK_MISC (label23), 1, 1);

  frame2 = gtk_frame_new (NULL);
  gtk_widget_show (frame2);
  gtk_box_pack_start (GTK_BOX (hbox11), frame2, TRUE, TRUE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_NONE);

  alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment2);
  gtk_container_add (GTK_CONTAINER (frame2), alignment2);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 6, 0, 18, 0);

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox1);
  gtk_container_add (GTK_CONTAINER (alignment2), hbox1);

  vbox3 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox3);
  gtk_box_pack_start (GTK_BOX (hbox1), vbox3, TRUE, TRUE, 0);

  scrolledwindow9 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow9);
  gtk_box_pack_start (GTK_BOX (vbox3), scrolledwindow9, TRUE, TRUE, 0);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_SHADOW_OUT);

  treeview0 = gtk_tree_view_new ();
  gtk_widget_show (treeview0);
  gtk_container_add (GTK_CONTAINER (scrolledwindow9), treeview0);
  gtk_widget_set_size_request (treeview0, 288, 336);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview0), FALSE);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview0), TRUE);
  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview0), FALSE);

  hbox14 = gtk_hbox_new (FALSE, 6);
  gtk_widget_show (hbox14);
  gtk_box_pack_start (GTK_BOX (vbox3), hbox14, FALSE, FALSE, 0);

  buttonRemove = gtk_button_new ();
  gtk_widget_show (buttonRemove);
  gtk_box_pack_end (GTK_BOX (hbox14), buttonRemove, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, buttonRemove, QT_TR_NOOP("Remove filter"), NULL);

  image15 = gtk_image_new_from_stock ("gtk-remove", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image15);
  gtk_container_add (GTK_CONTAINER (buttonRemove), image15);

  buttonDown = gtk_button_new ();
  gtk_widget_show (buttonDown);
  gtk_box_pack_end (GTK_BOX (hbox14), buttonDown, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, buttonDown, QT_TR_NOOP("Move filter down"), NULL);

  image14 = gtk_image_new_from_icon_name ("gtk-go-down", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image14);
  gtk_container_add (GTK_CONTAINER (buttonDown), image14);

  buttonUp = gtk_button_new ();
  gtk_widget_show (buttonUp);
  gtk_box_pack_end (GTK_BOX (hbox14), buttonUp, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, buttonUp, QT_TR_NOOP("Move filter up"), NULL);

  image13 = gtk_image_new_from_icon_name ("gtk-go-up", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image13);
  gtk_container_add (GTK_CONTAINER (buttonUp), image13);

  buttonPartial = gtk_button_new_with_mnemonic (QT_TR_NOOP("P_artial"));
  gtk_widget_show (buttonPartial);
  gtk_box_pack_end (GTK_BOX (hbox14), buttonPartial, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, buttonPartial, QT_TR_NOOP("Apply the current filter only to a part of the file"), NULL);

  buttonProperties = gtk_button_new ();
  gtk_widget_show (buttonProperties);
  gtk_box_pack_end (GTK_BOX (hbox14), buttonProperties, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, buttonProperties, QT_TR_NOOP("Configure filter"), NULL);

  alignment4 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment4);
  gtk_container_add (GTK_CONTAINER (buttonProperties), alignment4);

  hbox16 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox16);
  gtk_container_add (GTK_CONTAINER (alignment4), hbox16);

  label25 = gtk_label_new_with_mnemonic (QT_TR_NOOP("C_onfigure"));
  gtk_widget_show (label25);
  gtk_box_pack_start (GTK_BOX (hbox16), label25, FALSE, FALSE, 0);

  label2 = gtk_label_new (QT_TR_NOOP("<b >Active Filters</b>"));
  gtk_widget_show (label2);
  gtk_frame_set_label_widget (GTK_FRAME (frame2), label2);
  gtk_label_set_use_markup (GTK_LABEL (label2), TRUE);
  gtk_misc_set_alignment (GTK_MISC (label2), 1, 1);

  dialog_action_area1 = GTK_DIALOG (dialog1)->action_area;
  gtk_widget_show (dialog_action_area1);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);

  buttonPreview = gtk_button_new ();
  gtk_widget_show (buttonPreview);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), buttonPreview, GTK_RESPONSE_APPLY);
  GTK_WIDGET_SET_FLAGS (buttonPreview, GTK_CAN_DEFAULT);

  alignment5 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment5);
  gtk_container_add (GTK_CONTAINER (buttonPreview), alignment5);

  hbox17 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox17);
  gtk_container_add (GTK_CONTAINER (alignment5), hbox17);

  image17 = create_pixmap (dialog1, "preview-button.png");
  gtk_widget_show (image17);
  gtk_box_pack_start (GTK_BOX (hbox17), image17, FALSE, FALSE, 0);

  label26 = gtk_label_new_with_mnemonic (QT_TR_NOOP("_Preview"));
  gtk_widget_show (label26);
  gtk_box_pack_start (GTK_BOX (hbox17), label26, FALSE, FALSE, 0);

  buttonClose = gtk_button_new_from_stock ("gtk-close");
  gtk_widget_show (buttonClose);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), buttonClose, GTK_RESPONSE_CLOSE);
  GTK_WIDGET_SET_FLAGS (buttonClose, GTK_CAN_DEFAULT);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog1, "dialog1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (dialog1, vbox3b, "vbox3b");
  GLADE_HOOKUP_OBJECT (dialog1, toolbar1, "toolbar1");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonOpen, "toolbuttonOpen");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonSave, "toolbuttonSave");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonScript, "toolbuttonScript");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonDVD, "toolbuttonDVD");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonHalfD1, "toolbuttonHalfD1");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonSVCD, "toolbuttonSVCD");
  GLADE_HOOKUP_OBJECT (dialog1, toolbuttonVCD, "toolbuttonVCD");
  GLADE_HOOKUP_OBJECT (dialog1, hbox11, "hbox11");
  GLADE_HOOKUP_OBJECT (dialog1, frame1, "frame1");
  GLADE_HOOKUP_OBJECT (dialog1, alignment1, "alignment1");
  GLADE_HOOKUP_OBJECT (dialog1, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (dialog1, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow1, "scrolledwindow1");
  GLADE_HOOKUP_OBJECT (dialog1, treeview1, "treeview1");
  GLADE_HOOKUP_OBJECT (dialog1, hbox5, "hbox5");
  GLADE_HOOKUP_OBJECT (dialog1, image1, "image1");
  GLADE_HOOKUP_OBJECT (dialog1, label11, "label11");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow2, "scrolledwindow2");
  GLADE_HOOKUP_OBJECT (dialog1, treeview2, "treeview2");
  GLADE_HOOKUP_OBJECT (dialog1, hbox6, "hbox6");
  GLADE_HOOKUP_OBJECT (dialog1, image2, "image2");
  GLADE_HOOKUP_OBJECT (dialog1, label17, "label17");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow3, "scrolledwindow3");
  GLADE_HOOKUP_OBJECT (dialog1, treeview3, "treeview3");
  GLADE_HOOKUP_OBJECT (dialog1, hbox7, "hbox7");
  GLADE_HOOKUP_OBJECT (dialog1, image3, "image3");
  GLADE_HOOKUP_OBJECT (dialog1, label18, "label18");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow4, "scrolledwindow4");
  GLADE_HOOKUP_OBJECT (dialog1, treeview4, "treeview4");
  GLADE_HOOKUP_OBJECT (dialog1, hbox8, "hbox8");
  GLADE_HOOKUP_OBJECT (dialog1, image4, "image4");
  GLADE_HOOKUP_OBJECT (dialog1, label19, "label19");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow5, "scrolledwindow5");
  GLADE_HOOKUP_OBJECT (dialog1, treeview5, "treeview5");
  GLADE_HOOKUP_OBJECT (dialog1, hbox9, "hbox9");
  GLADE_HOOKUP_OBJECT (dialog1, image5, "image5");
  GLADE_HOOKUP_OBJECT (dialog1, label20, "label20");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow6, "scrolledwindow6");
  GLADE_HOOKUP_OBJECT (dialog1, treeview6, "treeview6");
  GLADE_HOOKUP_OBJECT (dialog1, hbox10, "hbox10");
  GLADE_HOOKUP_OBJECT (dialog1, image6, "image6");
  GLADE_HOOKUP_OBJECT (dialog1, label21, "label21");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow7, "scrolledwindow7");
  GLADE_HOOKUP_OBJECT (dialog1, treeview7, "treeview7");
  GLADE_HOOKUP_OBJECT (dialog1, hbox4, "hbox4");
  GLADE_HOOKUP_OBJECT (dialog1, image7, "image7");
  GLADE_HOOKUP_OBJECT (dialog1, label22, "label22");
  GLADE_HOOKUP_OBJECT (dialog1, treeview8, "treeview8");
  GLADE_HOOKUP_OBJECT (dialog1, label28, "label28");
  GLADE_HOOKUP_OBJECT (dialog1, hbox13, "hbox13");
  GLADE_HOOKUP_OBJECT (dialog1, buttonAdd, "buttonAdd");
  GLADE_HOOKUP_OBJECT (dialog1, image11, "image11");
  GLADE_HOOKUP_OBJECT (dialog1, label23, "label23");
  GLADE_HOOKUP_OBJECT (dialog1, frame2, "frame2");
  GLADE_HOOKUP_OBJECT (dialog1, alignment2, "alignment2");
  GLADE_HOOKUP_OBJECT (dialog1, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (dialog1, vbox3, "vbox3");
  GLADE_HOOKUP_OBJECT (dialog1, scrolledwindow9, "scrolledwindow9");
  GLADE_HOOKUP_OBJECT (dialog1, treeview0, "treeview0");
  GLADE_HOOKUP_OBJECT (dialog1, hbox14, "hbox14");
  GLADE_HOOKUP_OBJECT (dialog1, buttonRemove, "buttonRemove");
  GLADE_HOOKUP_OBJECT (dialog1, image15, "image15");
  GLADE_HOOKUP_OBJECT (dialog1, buttonDown, "buttonDown");
  GLADE_HOOKUP_OBJECT (dialog1, image14, "image14");
  GLADE_HOOKUP_OBJECT (dialog1, buttonUp, "buttonUp");
  GLADE_HOOKUP_OBJECT (dialog1, image13, "image13");
  GLADE_HOOKUP_OBJECT (dialog1, buttonPartial, "buttonPartial");
  GLADE_HOOKUP_OBJECT (dialog1, buttonProperties, "buttonProperties");
  GLADE_HOOKUP_OBJECT (dialog1, alignment4, "alignment4");
  GLADE_HOOKUP_OBJECT (dialog1, hbox16, "hbox16");
  GLADE_HOOKUP_OBJECT (dialog1, label25, "label25");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (dialog1, buttonPreview, "buttonPreview");
  GLADE_HOOKUP_OBJECT (dialog1, alignment5, "alignment5");
  GLADE_HOOKUP_OBJECT (dialog1, hbox17, "hbox17");
  GLADE_HOOKUP_OBJECT (dialog1, image17, "image17");
  GLADE_HOOKUP_OBJECT (dialog1, label26, "label26");
  GLADE_HOOKUP_OBJECT (dialog1, buttonClose, "buttonClose");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, tooltips, "tooltips");

  gtk_window_add_accel_group (GTK_WINDOW (dialog1), accel_group);

  return dialog1;
}
Esempio n. 23
0
static void mateweather_pref_create(MateWeatherPref* pref)
{
	GtkWidget* pref_vbox;
	GtkWidget* pref_notebook;
	#ifdef RADARMAP
		GtkWidget* radar_toggle_hbox;
	#endif /* RADARMAP */
	GtkWidget* pref_basic_update_alignment;
	GtkWidget* pref_basic_update_lbl;
	GtkWidget* pref_basic_update_hbox;
	GObject* pref_basic_update_spin_adj;
	GtkWidget* pref_basic_update_sec_lbl;
	GtkWidget* pref_basic_note_lbl;
	GtkWidget* pref_loc_hbox;
	GtkWidget* pref_loc_note_lbl;
	GtkWidget* scrolled_window;
	GtkWidget* label;
	GtkWidget* value_hbox;
	GtkWidget* tree_label;
	GtkTreeSelection *selection;
	GtkWidget* pref_basic_vbox;
	GtkWidget* vbox;
	GtkWidget* frame;
	GtkWidget* temp_label;
	GtkWidget* temp_combo;
	GtkWidget* speed_label;
	GtkWidget* speed_combo;
	GtkWidget* pres_label;
	GtkWidget* pres_combo;
	GtkWidget* dist_label;
	GtkWidget* dist_combo;
#if GTK_CHECK_VERSION (3, 0, 0)
	GtkWidget* unit_grid;
#else
	GtkWidget* unit_table;
#endif
	GtkWidget* pref_find_label;
	GtkWidget* pref_find_hbox;
	GtkWidget* image;


	g_object_set (pref, "destroy-with-parent", TRUE, NULL);
	gtk_window_set_title (GTK_WINDOW (pref), _("Weather Preferences"));
	gtk_dialog_add_buttons (GTK_DIALOG (pref), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, GTK_STOCK_HELP, GTK_RESPONSE_HELP, NULL);
	gtk_dialog_set_default_response (GTK_DIALOG (pref), GTK_RESPONSE_CLOSE);
	gtk_container_set_border_width (GTK_CONTAINER (pref), 5);
	gtk_window_set_resizable (GTK_WINDOW (pref), TRUE);
	gtk_window_set_screen (GTK_WINDOW (pref), gtk_widget_get_screen (GTK_WIDGET (pref->priv->applet->applet)));

	pref_vbox = gtk_dialog_get_content_area (GTK_DIALOG (pref));
	gtk_box_set_spacing (GTK_BOX (pref_vbox), 2);
	gtk_widget_show (pref_vbox);

	pref_notebook = gtk_notebook_new ();
	gtk_container_set_border_width (GTK_CONTAINER (pref_notebook), 5);
	gtk_widget_show (pref_notebook);
	gtk_box_pack_start (GTK_BOX (pref_vbox), pref_notebook, TRUE, TRUE, 0);

  /*
   * General settings page.
   */

#if GTK_CHECK_VERSION (3, 0, 0)
	pref_basic_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
#else
	pref_basic_vbox = gtk_vbox_new (FALSE, 18);
#endif
	gtk_container_set_border_width (GTK_CONTAINER (pref_basic_vbox), 12);
	gtk_container_add (GTK_CONTAINER (pref_notebook), pref_basic_vbox);

	pref_basic_update_alignment = gtk_alignment_new (0, 0.5, 0, 1);
	gtk_widget_show (pref_basic_update_alignment);

	pref->priv->basic_update_btn = gtk_check_button_new_with_mnemonic (_("_Automatically update every:"));
	gtk_widget_show (pref->priv->basic_update_btn);
	gtk_container_add (GTK_CONTAINER (pref_basic_update_alignment), pref->priv->basic_update_btn);
	g_signal_connect (G_OBJECT (pref->priv->basic_update_btn), "toggled", G_CALLBACK (auto_update_toggled), pref);

	if (!g_settings_is_writable (pref->priv->applet->settings, "auto-update"))
	{
		hard_set_sensitive (pref->priv->basic_update_btn, FALSE);
	}

	/*
	 * Units settings page.
	 */

	/* Temperature Unit */
	temp_label = gtk_label_new_with_mnemonic (_("_Temperature unit:"));
	gtk_label_set_use_markup (GTK_LABEL (temp_label), TRUE);
	gtk_label_set_justify (GTK_LABEL (temp_label), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
	gtk_label_set_xalign (GTK_LABEL (label), 0.0);
#else
	gtk_misc_set_alignment (GTK_MISC (temp_label), 0.0, 0.5);
#endif
	gtk_widget_show (temp_label);

	temp_combo = gtk_combo_box_text_new ();
	pref->priv->basic_temp_combo = temp_combo;
	gtk_label_set_mnemonic_widget (GTK_LABEL (temp_label), temp_combo);
	//gtk_combo_box_append_text (GTK_COMBO_BOX (temp_combo), _("Default"));
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (temp_combo), _("Kelvin"));
	/* TRANSLATORS: Celsius is sometimes referred Centigrade */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (temp_combo), _("Celsius"));
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (temp_combo), _("Fahrenheit"));
	gtk_widget_show (temp_combo);

	if ( ! g_settings_is_writable (pref->priv->applet->settings, "temperature-unit"))
	{
		hard_set_sensitive (pref->priv->basic_temp_combo, FALSE);
	}

	/* Speed Unit */
	speed_label = gtk_label_new_with_mnemonic (_("_Wind speed unit:"));
	gtk_label_set_use_markup (GTK_LABEL (speed_label), TRUE);
	gtk_label_set_justify (GTK_LABEL (speed_label), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
	gtk_label_set_xalign (GTK_LABEL (label), 0.0);
#else
	gtk_misc_set_alignment (GTK_MISC (speed_label), 0.0, 0.5);
#endif
	gtk_widget_show (speed_label);

	speed_combo = gtk_combo_box_text_new ();
	pref->priv->basic_speed_combo = speed_combo;
	gtk_label_set_mnemonic_widget (GTK_LABEL (speed_label), speed_combo);
	//gtk_combo_box_append_text (GTK_COMBO_BOX (speed_combo), _("Default"));
	/* TRANSLATOR: The wind speed unit "meters per second" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (speed_combo), _("m/s"));
	/* TRANSLATOR: The wind speed unit "kilometers per hour" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (speed_combo), _("km/h"));
	/* TRANSLATOR: The wind speed unit "miles per hour" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (speed_combo), _("mph"));
	/* TRANSLATOR: The wind speed unit "knots" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (speed_combo), _("knots"));
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (speed_combo), _("Beaufort scale"));
	gtk_widget_show (speed_combo);

	if (!g_settings_is_writable (pref->priv->applet->settings, "speed-unit"))
	{
		hard_set_sensitive (pref->priv->basic_speed_combo, FALSE);
	}

	/* Pressure Unit */
	pres_label = gtk_label_new_with_mnemonic (_("_Pressure unit:"));
	gtk_label_set_use_markup (GTK_LABEL (pres_label), TRUE);
	gtk_label_set_justify (GTK_LABEL (pres_label), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
	gtk_label_set_xalign (GTK_LABEL (label), 0.0);
#else
	gtk_misc_set_alignment (GTK_MISC (pres_label), 0.0, 0.5);
#endif
	gtk_widget_show (pres_label);

	pres_combo = gtk_combo_box_text_new ();
	pref->priv->basic_pres_combo = pres_combo;
	gtk_label_set_mnemonic_widget (GTK_LABEL (pres_label), pres_combo);
	//gtk_combo_box_append_text (GTK_COMBO_BOX (pres_combo), _("Default"));
	/* TRANSLATOR: The pressure unit "kiloPascals" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (pres_combo), _("kPa"));
	/* TRANSLATOR: The pressure unit "hectoPascals" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (pres_combo), _("hPa"));
	/* TRANSLATOR: The pressure unit "millibars" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (pres_combo), _("mb"));
	/* TRANSLATOR: The pressure unit "millibars of mercury" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (pres_combo), _("mmHg"));
	/* TRANSLATOR: The pressure unit "inches of mercury" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (pres_combo), _("inHg"));
	/* TRANSLATOR: The pressure unit "atmospheres" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (pres_combo), _("atm"));
	gtk_widget_show (pres_combo);

	if (!g_settings_is_writable(pref->priv->applet->settings, "pressure-unit"))
	{
		hard_set_sensitive(pref->priv->basic_pres_combo, FALSE);
	}

	/* Distance Unit */
	dist_label = gtk_label_new_with_mnemonic (_("_Visibility unit:"));
	gtk_label_set_use_markup (GTK_LABEL (dist_label), TRUE);
	gtk_label_set_justify (GTK_LABEL (dist_label), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
	gtk_label_set_xalign (GTK_LABEL (label), 0.0);
#else
	gtk_misc_set_alignment (GTK_MISC (dist_label), 0, 0.5);
#endif
	gtk_widget_show (dist_label);

	dist_combo = gtk_combo_box_text_new ();
	pref->priv->basic_dist_combo = dist_combo;
	gtk_label_set_mnemonic_widget (GTK_LABEL (dist_label), dist_combo);
	//gtk_combo_box_append_text (GTK_COMBO_BOX (dist_combo), _("Default"));
	/* TRANSLATOR: The distance unit "meters" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (dist_combo), _("meters"));
	/* TRANSLATOR: The distance unit "kilometers" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (dist_combo), _("km"));
	/* TRANSLATOR: The distance unit "miles" */
	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (dist_combo), _("miles"));
	gtk_widget_show (dist_combo);

	if ( ! g_settings_is_writable (pref->priv->applet->settings, "distance-unit"))
		hard_set_sensitive (pref->priv->basic_dist_combo, FALSE);

#if GTK_CHECK_VERSION (3, 0, 0)
	unit_grid = gtk_grid_new ();
	gtk_grid_set_row_spacing(GTK_GRID(unit_grid), 6);
	gtk_grid_set_column_spacing(GTK_GRID(unit_grid), 12);
	gtk_widget_set_halign (temp_label, GTK_ALIGN_START);
	gtk_grid_attach(GTK_GRID(unit_grid), temp_label, 0, 0, 1, 1);
	gtk_grid_attach(GTK_GRID(unit_grid), temp_combo,  1, 0, 1, 1);
	gtk_widget_set_halign (speed_label, GTK_ALIGN_START);
	gtk_grid_attach(GTK_GRID(unit_grid), speed_label, 0, 1, 1, 1);
	gtk_grid_attach(GTK_GRID(unit_grid), speed_combo, 1, 1, 1, 1);
	gtk_widget_set_halign (pres_label, GTK_ALIGN_START);
	gtk_grid_attach(GTK_GRID(unit_grid), pres_label, 0, 2, 1, 1);
	gtk_grid_attach(GTK_GRID(unit_grid), pres_combo,  1, 2, 1, 1);
	gtk_widget_set_halign (dist_label, GTK_ALIGN_START);
	gtk_grid_attach(GTK_GRID(unit_grid), dist_label, 0, 3, 1, 1);
	gtk_grid_attach(GTK_GRID(unit_grid), dist_combo,  1, 3, 1, 1);
	gtk_widget_show(unit_grid);
#else
	unit_table = gtk_table_new(5, 2, FALSE);
	gtk_table_set_row_spacings(GTK_TABLE(unit_table), 6);
	gtk_table_set_col_spacings(GTK_TABLE(unit_table), 12);
	gtk_table_attach(GTK_TABLE(unit_table), temp_label, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
	gtk_table_attach_defaults(GTK_TABLE(unit_table), temp_combo,  1, 2, 0, 1);
	gtk_table_attach(GTK_TABLE(unit_table), speed_label, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
	gtk_table_attach_defaults(GTK_TABLE(unit_table), speed_combo, 1, 2, 1, 2);
	gtk_table_attach(GTK_TABLE(unit_table), pres_label, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
	gtk_table_attach_defaults(GTK_TABLE(unit_table), pres_combo,  1, 2, 2, 3);
	gtk_table_attach(GTK_TABLE(unit_table), dist_label, 0, 1, 3, 4, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
	gtk_table_attach_defaults(GTK_TABLE(unit_table), dist_combo,  1, 2, 3, 4);
	gtk_widget_show(unit_table);
#endif

	g_signal_connect (temp_combo, "changed", G_CALLBACK (temp_combo_changed_cb), pref);
	g_signal_connect (speed_combo, "changed", G_CALLBACK (speed_combo_changed_cb), pref);
	g_signal_connect (dist_combo, "changed", G_CALLBACK (dist_combo_changed_cb), pref);
	g_signal_connect (pres_combo, "changed", G_CALLBACK (pres_combo_changed_cb), pref);


	#ifdef RADARMAP
		pref->priv->basic_radar_btn = gtk_check_button_new_with_mnemonic (_("Enable _radar map"));
		gtk_widget_show (pref->priv->basic_radar_btn);
		g_signal_connect (G_OBJECT (pref->priv->basic_radar_btn), "toggled", G_CALLBACK (radar_toggled), pref);

		if (!g_settings_is_writable (pref->priv->applet->settings, "enable-radar-map"))
		{
			hard_set_sensitive(pref->priv->basic_radar_btn, FALSE);
		}

#if GTK_CHECK_VERSION (3, 0, 0)
		radar_toggle_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
#else
		radar_toggle_hbox = gtk_hbox_new(FALSE, 12);
#endif
		gtk_widget_show(radar_toggle_hbox);

		label = gtk_label_new ("    ");
		gtk_widget_show (label);
		gtk_box_pack_start (GTK_BOX (radar_toggle_hbox), label, FALSE, FALSE, 0);

		pref->priv->basic_radar_url_btn = gtk_check_button_new_with_mnemonic (_("Use _custom address for radar map"));
		gtk_widget_show (pref->priv->basic_radar_url_btn);
		gtk_box_pack_start (GTK_BOX (radar_toggle_hbox), pref->priv->basic_radar_url_btn, FALSE, FALSE, 0);

		g_signal_connect (G_OBJECT (pref->priv->basic_radar_url_btn), "toggled", G_CALLBACK (use_radar_url_toggled), pref);

		if ( ! g_settings_is_writable (pref->priv->applet->settings, "use-custom-radar-url"))
		{
			hard_set_sensitive (pref->priv->basic_radar_url_btn, FALSE);
		}

#if GTK_CHECK_VERSION (3, 0, 0)
		pref->priv->basic_radar_url_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
#else
		pref->priv->basic_radar_url_hbox = gtk_hbox_new (FALSE, 12);
#endif
		gtk_widget_show (pref->priv->basic_radar_url_hbox);

		label = gtk_label_new ("    ");
		gtk_widget_show (label);
		gtk_box_pack_start (GTK_BOX (pref->priv->basic_radar_url_hbox), label, FALSE, FALSE, 0);

		label = gtk_label_new_with_mnemonic (_("A_ddress:"));
		gtk_widget_show (label);
		gtk_box_pack_start (GTK_BOX (pref->priv->basic_radar_url_hbox), label, FALSE, FALSE, 0);
		pref->priv->basic_radar_url_entry = gtk_entry_new ();
		gtk_widget_show (pref->priv->basic_radar_url_entry);
		gtk_box_pack_start (GTK_BOX (pref->priv->basic_radar_url_hbox), pref->priv->basic_radar_url_entry, TRUE, TRUE, 0);
		g_signal_connect (G_OBJECT (pref->priv->basic_radar_url_entry), "focus_out_event", G_CALLBACK (radar_url_changed), pref);
		if ( ! g_settings_is_writable (pref->priv->applet->settings, "radar"))
		{
			hard_set_sensitive (pref->priv->basic_radar_url_entry, FALSE);
		}
	#endif /* RADARMAP */

    #ifdef HAVE_LIBNOTIFY
		/* setup show-notifications button */
		pref->priv->basic_show_notifications_btn = gtk_check_button_new_with_mnemonic (_("Show _notifications"));

		if (!g_settings_is_writable (pref->priv->applet->settings, "show-notifications"))
		{
			hard_set_sensitive (pref->priv->basic_show_notifications_btn, FALSE);
		}

		g_signal_connect (G_OBJECT (pref->priv->basic_show_notifications_btn), "toggled", G_CALLBACK (show_notifications_toggled), pref);
    #endif

	frame = create_hig_category (pref_basic_vbox, _("Update"));

#if GTK_CHECK_VERSION (3, 0, 0)
	pref_basic_update_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
#else
	pref_basic_update_hbox = gtk_hbox_new (FALSE, 12);
#endif

	pref_basic_update_lbl = gtk_label_new_with_mnemonic (_("_Automatically update every:"));
	gtk_widget_show (pref_basic_update_lbl);

	gtk_widget_show (pref_basic_update_hbox);

	pref_basic_update_spin_adj = gtk_adjustment_new (30, 1, 3600, 5, 25, 1);
	pref->priv->basic_update_spin = gtk_spin_button_new (GTK_ADJUSTMENT (pref_basic_update_spin_adj), 1, 0);
	gtk_widget_show (pref->priv->basic_update_spin);

	gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (pref->priv->basic_update_spin), TRUE);
	gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (pref->priv->basic_update_spin), GTK_UPDATE_IF_VALID);
	g_signal_connect (G_OBJECT (pref->priv->basic_update_spin), "value_changed", G_CALLBACK (update_interval_changed), pref);

	pref_basic_update_sec_lbl = gtk_label_new (_("minutes"));
	gtk_widget_show (pref_basic_update_sec_lbl);

	if ( ! g_settings_is_writable (pref->priv->applet->settings, "auto-update-interval"))
	{
		hard_set_sensitive (pref->priv->basic_update_spin, FALSE);
		hard_set_sensitive (pref_basic_update_sec_lbl, FALSE);
	}

#if GTK_CHECK_VERSION (3, 0, 0)
	value_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
#else
	value_hbox = gtk_hbox_new (FALSE, 6);
#endif

	gtk_box_pack_start (GTK_BOX (pref_basic_update_hbox), pref_basic_update_alignment, FALSE, TRUE, 0);
	gtk_box_pack_start (GTK_BOX (pref_basic_update_hbox), value_hbox, FALSE, FALSE, 0);
	gtk_box_pack_start (GTK_BOX (value_hbox), pref->priv->basic_update_spin, FALSE, FALSE, 0);
	gtk_box_pack_start (GTK_BOX (value_hbox), pref_basic_update_sec_lbl, FALSE, FALSE, 0);

	gtk_container_add (GTK_CONTAINER (frame), pref_basic_update_hbox);

	frame = create_hig_category (pref_basic_vbox, _("Display"));

#if GTK_CHECK_VERSION (3, 0, 0)
	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
#else
	vbox = gtk_vbox_new (FALSE, 6);
#endif

#if GTK_CHECK_VERSION (3, 0, 0)
	gtk_box_pack_start (GTK_BOX (vbox), unit_grid, TRUE, TRUE, 0);
#else
	gtk_box_pack_start (GTK_BOX (vbox), unit_table, TRUE, TRUE, 0);
#endif

	#ifdef RADARMAP
		gtk_box_pack_start (GTK_BOX (vbox), pref->priv->basic_radar_btn, TRUE, TRUE, 0);
		gtk_box_pack_start (GTK_BOX (vbox), radar_toggle_hbox, TRUE, TRUE, 0);
		gtk_box_pack_start (GTK_BOX (vbox), pref->priv->basic_radar_url_hbox, TRUE, TRUE, 0);
	#endif /* RADARMAP */
	
	#ifdef HAVE_LIBNOTIFY
		/* add the show-notification toggle button to the vbox of the display section */
		gtk_box_pack_start (GTK_BOX (vbox), pref->priv->basic_show_notifications_btn, TRUE, TRUE, 0);
	#endif

	gtk_container_add (GTK_CONTAINER (frame), vbox);

	pref_basic_note_lbl = gtk_label_new (_("General"));
	gtk_widget_show (pref_basic_note_lbl);
	gtk_notebook_set_tab_label (GTK_NOTEBOOK (pref_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (pref_notebook), 0), pref_basic_note_lbl);

  /*
   * Location page.
   */
#if GTK_CHECK_VERSION (3, 0, 0)
	pref_loc_hbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
#else
	pref_loc_hbox = gtk_vbox_new (FALSE, 6);
#endif
	gtk_container_set_border_width (GTK_CONTAINER (pref_loc_hbox), 12);
	gtk_container_add (GTK_CONTAINER (pref_notebook), pref_loc_hbox);

	tree_label = gtk_label_new_with_mnemonic (_("_Select a location:"));
#if GTK_CHECK_VERSION (3, 16, 0)
	gtk_label_set_xalign (GTK_LABEL (tree_label), 0.0);
#else
	gtk_misc_set_alignment (GTK_MISC (tree_label), 0.0, 0.5);
#endif
	gtk_box_pack_start (GTK_BOX (pref_loc_hbox), tree_label, FALSE, FALSE, 0);

	scrolled_window = gtk_scrolled_window_new (NULL, NULL);
	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN);
	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

	pref->priv->tree = gtk_tree_view_new ();
	gtk_label_set_mnemonic_widget (GTK_LABEL (tree_label), GTK_WIDGET (pref->priv->tree));
	gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (pref->priv->tree), FALSE);

	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (pref->priv->tree));
	g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (row_selected_cb), pref);

	gtk_container_add (GTK_CONTAINER (scrolled_window), pref->priv->tree);
	gtk_widget_show (pref->priv->tree);
	gtk_widget_show (scrolled_window);
	gtk_box_pack_start (GTK_BOX (pref_loc_hbox), scrolled_window, TRUE, TRUE, 0);
	load_locations(pref);

#if GTK_CHECK_VERSION (3, 0, 0)
	pref_find_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
#else
	pref_find_hbox = gtk_hbox_new (FALSE, 6);
#endif
	pref_find_label = gtk_label_new (_("_Find:"));
	gtk_label_set_use_underline (GTK_LABEL (pref_find_label), TRUE);

	pref->priv->find_entry = gtk_entry_new ();
	gtk_label_set_mnemonic_widget (GTK_LABEL (pref_find_label), pref->priv->find_entry);

	pref->priv->find_next_btn = gtk_button_new_with_mnemonic (_("Find _Next"));
	gtk_widget_set_sensitive (pref->priv->find_next_btn, FALSE);

	image = gtk_image_new_from_stock (GTK_STOCK_FIND, GTK_ICON_SIZE_BUTTON);
	gtk_button_set_image (GTK_BUTTON (pref->priv->find_next_btn), image);

	g_signal_connect (G_OBJECT (pref->priv->find_next_btn), "clicked", G_CALLBACK (find_next_clicked), pref);
	g_signal_connect (G_OBJECT (pref->priv->find_entry), "changed", G_CALLBACK (find_entry_changed), pref);

	gtk_container_set_border_width (GTK_CONTAINER (pref_find_hbox), 0);
	gtk_box_pack_start (GTK_BOX (pref_find_hbox), pref_find_label, FALSE, FALSE, 0);
	gtk_box_pack_start (GTK_BOX (pref_find_hbox), pref->priv->find_entry, TRUE, TRUE, 0);
	gtk_box_pack_start (GTK_BOX (pref_find_hbox), pref->priv->find_next_btn, FALSE, FALSE, 0);

	gtk_box_pack_start (GTK_BOX (pref_loc_hbox), pref_find_hbox, FALSE, FALSE, 0);

	if ( ! g_settings_is_writable (pref->priv->applet->settings, "location0"))
	{
		hard_set_sensitive (scrolled_window, FALSE);
	}

	pref_loc_note_lbl = gtk_label_new (_("Location"));
	gtk_widget_show (pref_loc_note_lbl);
	gtk_notebook_set_tab_label (GTK_NOTEBOOK (pref_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (pref_notebook), 1), pref_loc_note_lbl);


	g_signal_connect (G_OBJECT (pref), "response", G_CALLBACK (response_cb), pref);

	mateweather_pref_set_accessibility (pref);
	gtk_label_set_mnemonic_widget (GTK_LABEL (pref_basic_update_sec_lbl), pref->priv->basic_update_spin);
	gtk_label_set_mnemonic_widget (GTK_LABEL (label), pref->priv->basic_radar_url_entry);
}
Esempio n. 24
0
GtkWidget*
create_ClientMainwindow (void)
{
  GtkWidget *ClientMainwindow;
  GtkWidget *vbox1;
  GtkWidget *menubar1;
  GtkWidget *file1;
  GtkWidget *file1_menu;
  GtkWidget *choosePrinter1;
  GtkWidget *separator2;
  GtkWidget *quit1;
  GtkWidget *articles1;
  GtkWidget *articles1_menu;
  GtkWidget *new1;
  GtkWidget *edit1;
  GtkWidget *save1;
  GtkWidget *separator3;
  GtkWidget *print1;
  GtkWidget *separator1;
  GtkWidget *delete1;
  GtkWidget *toolbar1;
  GtkIconSize tmp_toolbar_icon_size;
  GtkWidget *toolitem1;
  GtkWidget *bChooseClient;
  GtkWidget *alignment1;
  GtkWidget *hbox3;
  GtkWidget *image2;
  GtkWidget *label28;
  GtkWidget *hbox1;
  GtkWidget *lFindNumber;
  GtkWidget *eFindName;
  GtkWidget *lFindDesignation;
  GtkWidget *eFindCity;
  GtkWidget *bSearch;
  GtkWidget *scrolledwindow1;
  GtkWidget *viewport1;
  GtkWidget *tree1;
  GtkWidget *notebook1;
  GtkWidget *vbox2;
  GtkWidget *table1;
  GtkWidget *label17;
  GtkWidget *label18;
  GtkWidget *label19;
  GtkWidget *label20;
  GtkWidget *eName;
  GtkWidget *eDescription;
  GtkWidget *eClientNumber;
  GtkWidget *eAcctPlan;
  GtkWidget *bChooseAddress;
  GtkWidget *hbox2;
  GtkWidget *label27;
  GtkWidget *eAddressID;
  GtkWidget *eLongAcctPlan;
  GtkWidget *scrolledwindow2;
  GtkWidget *tvAddress;
  GtkWidget *label16;
  GtkAccelGroup *accel_group;

  accel_group = gtk_accel_group_new ();

  ClientMainwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (ClientMainwindow), _("Clients"));

  vbox1 = gtk_vbox_new (FALSE, 17);
  gtk_widget_show (vbox1);
  gtk_container_add (GTK_CONTAINER (ClientMainwindow), vbox1);

  menubar1 = gtk_menu_bar_new ();
  gtk_widget_show (menubar1);
  gtk_box_pack_start (GTK_BOX (vbox1), menubar1, FALSE, FALSE, 0);

  file1 = gtk_menu_item_new_with_mnemonic (_("_File"));
  gtk_widget_show (file1);
  gtk_container_add (GTK_CONTAINER (menubar1), file1);

  file1_menu = gtk_menu_new ();
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (file1), file1_menu);

  choosePrinter1 = gtk_menu_item_new_with_mnemonic (_("Print S_etup..."));
  gtk_widget_show (choosePrinter1);
  gtk_container_add (GTK_CONTAINER (file1_menu), choosePrinter1);

  separator2 = gtk_separator_menu_item_new ();
  gtk_widget_show (separator2);
  gtk_container_add (GTK_CONTAINER (file1_menu), separator2);
  gtk_widget_set_sensitive (separator2, FALSE);

  quit1 = gtk_image_menu_item_new_from_stock ("gtk-quit", accel_group);
  gtk_widget_show (quit1);
  gtk_container_add (GTK_CONTAINER (file1_menu), quit1);

  articles1 = gtk_menu_item_new_with_mnemonic (_("Clients"));
  gtk_widget_show (articles1);
  gtk_container_add (GTK_CONTAINER (menubar1), articles1);

  articles1_menu = gtk_menu_new ();
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (articles1), articles1_menu);

  new1 = gtk_image_menu_item_new_from_stock ("gtk-new", accel_group);
  gtk_widget_show (new1);
  gtk_container_add (GTK_CONTAINER (articles1_menu), new1);

  edit1 = gtk_image_menu_item_new_from_stock ("gtk-edit", accel_group);
  gtk_widget_show (edit1);
  gtk_container_add (GTK_CONTAINER (articles1_menu), edit1);

  save1 = gtk_image_menu_item_new_from_stock ("gtk-save", accel_group);
  gtk_widget_show (save1);
  gtk_container_add (GTK_CONTAINER (articles1_menu), save1);

  separator3 = gtk_separator_menu_item_new ();
  gtk_widget_show (separator3);
  gtk_container_add (GTK_CONTAINER (articles1_menu), separator3);
  gtk_widget_set_sensitive (separator3, FALSE);

  print1 = gtk_image_menu_item_new_from_stock ("gtk-print", accel_group);
  gtk_widget_show (print1);
  gtk_container_add (GTK_CONTAINER (articles1_menu), print1);

  separator1 = gtk_separator_menu_item_new ();
  gtk_widget_show (separator1);
  gtk_container_add (GTK_CONTAINER (articles1_menu), separator1);
  gtk_widget_set_sensitive (separator1, FALSE);

  delete1 = gtk_image_menu_item_new_from_stock ("gtk-delete", accel_group);
  gtk_widget_show (delete1);
  gtk_container_add (GTK_CONTAINER (articles1_menu), delete1);

  toolbar1 = gtk_toolbar_new ();
  gtk_widget_show (toolbar1);
  gtk_box_pack_start (GTK_BOX (vbox1), toolbar1, FALSE, FALSE, 0);
  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_BOTH);
  tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1));

  toolitem1 = (GtkWidget*) gtk_tool_item_new ();
  gtk_widget_show (toolitem1);
  gtk_container_add (GTK_CONTAINER (toolbar1), toolitem1);

  bChooseClient = gtk_button_new ();
  gtk_widget_show (bChooseClient);
  gtk_container_add (GTK_CONTAINER (toolitem1), bChooseClient);
  gtk_widget_add_accelerator (bChooseClient, "clicked", accel_group,
                              GDK_A, (GdkModifierType) GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  alignment1 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment1);
  gtk_container_add (GTK_CONTAINER (bChooseClient), alignment1);

  hbox3 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox3);
  gtk_container_add (GTK_CONTAINER (alignment1), hbox3);

  image2 = gtk_image_new_from_stock ("gtk-refresh", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image2);
  gtk_box_pack_start (GTK_BOX (hbox3), image2, FALSE, FALSE, 0);

  label28 = gtk_label_new_with_mnemonic (_("Choose"));
  gtk_widget_show (label28);
  gtk_box_pack_start (GTK_BOX (hbox3), label28, FALSE, FALSE, 0);

  hbox1 = gtk_hbox_new (TRUE, 0);
  gtk_widget_show (hbox1);
  gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);

  lFindNumber = gtk_label_new (_("Number"));
  gtk_widget_show (lFindNumber);
  gtk_box_pack_start (GTK_BOX (hbox1), lFindNumber, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (lFindNumber), GTK_JUSTIFY_CENTER);

  eFindName = gtk_entry_new ();
  gtk_widget_show (eFindName);
  gtk_box_pack_start (GTK_BOX (hbox1), eFindName, FALSE, FALSE, 0);

  lFindDesignation = gtk_label_new (_("Designation"));
  gtk_widget_show (lFindDesignation);
  gtk_box_pack_start (GTK_BOX (hbox1), lFindDesignation, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (lFindDesignation), GTK_JUSTIFY_CENTER);

  eFindCity = gtk_entry_new ();
  gtk_widget_show (eFindCity);
  gtk_box_pack_start (GTK_BOX (hbox1), eFindCity, FALSE, FALSE, 0);

  bSearch = gtk_button_new_with_mnemonic (_("Search"));
  gtk_widget_show (bSearch);
  gtk_box_pack_start (GTK_BOX (hbox1), bSearch, FALSE, FALSE, 0);

  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow1);
  gtk_box_pack_start (GTK_BOX (vbox1), scrolledwindow1, TRUE, TRUE, 0);
  GTK_WIDGET_UNSET_FLAGS (scrolledwindow1, GTK_CAN_FOCUS);

  viewport1 = gtk_viewport_new (NULL, NULL);
  gtk_widget_show (viewport1);
  gtk_container_add (GTK_CONTAINER (scrolledwindow1), viewport1);

  tree1 = gtk_tree_view_new ();
  gtk_widget_show (tree1);
  gtk_container_add (GTK_CONTAINER (viewport1), tree1);
  GTK_WIDGET_UNSET_FLAGS (tree1, GTK_CAN_FOCUS);

  notebook1 = gtk_notebook_new ();
  gtk_widget_show (notebook1);
  gtk_box_pack_start (GTK_BOX (vbox1), notebook1, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (notebook1), 1);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox2);
  gtk_container_add (GTK_CONTAINER (notebook1), vbox2);

  table1 = gtk_table_new (4, 4, FALSE);
  gtk_widget_show (table1);
  gtk_box_pack_start (GTK_BOX (vbox2), table1, TRUE, TRUE, 0);

  label17 = gtk_label_new (_("Name"));
  gtk_widget_show (label17);
  gtk_table_attach (GTK_TABLE (table1), label17, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label17), 0, 0.5);

  label18 = gtk_label_new (_("Description"));
  gtk_widget_show (label18);
  gtk_table_attach (GTK_TABLE (table1), label18, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label18), 0, 0.5);

  label19 = gtk_label_new (_("Client-Nr."));
  gtk_widget_show (label19);
  gtk_table_attach (GTK_TABLE (table1), label19, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label19), 0, 0.5);

  label20 = gtk_label_new (_("Account-Plan"));
  gtk_widget_show (label20);
  gtk_table_attach (GTK_TABLE (table1), label20, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label20), 0, 0.5);

  eName = gtk_entry_new ();
  gtk_widget_show (eName);
  gtk_table_attach (GTK_TABLE (table1), eName, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  eDescription = gtk_entry_new ();
  gtk_widget_show (eDescription);
  gtk_table_attach (GTK_TABLE (table1), eDescription, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  eClientNumber = gtk_entry_new ();
  gtk_widget_show (eClientNumber);
  gtk_table_attach (GTK_TABLE (table1), eClientNumber, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  eAcctPlan = gtk_entry_new ();
  gtk_widget_show (eAcctPlan);
  gtk_table_attach (GTK_TABLE (table1), eAcctPlan, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_widget_add_accelerator (eAcctPlan, "activate", accel_group,
                              GDK_F1, (GdkModifierType) 0,
                              GTK_ACCEL_VISIBLE);

  bChooseAddress = gtk_button_new_with_mnemonic (_("choose ..."));
  gtk_widget_show (bChooseAddress);
  gtk_table_attach (GTK_TABLE (table1), bChooseAddress, 3, 4, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  hbox2 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox2);
  gtk_table_attach (GTK_TABLE (table1), hbox2, 2, 3, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  label27 = gtk_label_new (_("Address-ID"));
  gtk_widget_show (label27);
  gtk_box_pack_start (GTK_BOX (hbox2), label27, FALSE, FALSE, 0);

  eAddressID = gtk_entry_new ();
  gtk_widget_show (eAddressID);
  gtk_box_pack_start (GTK_BOX (hbox2), eAddressID, TRUE, TRUE, 0);

  eLongAcctPlan = gtk_entry_new ();
  gtk_widget_show (eLongAcctPlan);
  gtk_table_attach (GTK_TABLE (table1), eLongAcctPlan, 2, 3, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_editable_set_editable (GTK_EDITABLE (eLongAcctPlan), FALSE);

  scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow2);
  gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow2, TRUE, TRUE, 0);

  tvAddress = gtk_text_view_new ();
  gtk_widget_show (tvAddress);
  gtk_container_add (GTK_CONTAINER (scrolledwindow2), tvAddress);

  label16 = gtk_label_new (_("Clients"));
  gtk_widget_show (label16);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label16);

  g_signal_connect ((gpointer) choosePrinter1, "activate",
                    G_CALLBACK (on_choosePrinter1_activate),
                    NULL);
  g_signal_connect ((gpointer) quit1, "activate",
                    G_CALLBACK (on_quit1_activate),
                    NULL);
  g_signal_connect ((gpointer) new1, "activate",
                    G_CALLBACK (on_new1_activate),
                    NULL);
  g_signal_connect ((gpointer) edit1, "activate",
                    G_CALLBACK (on_edit1_activate),
                    NULL);
  g_signal_connect ((gpointer) save1, "activate",
                    G_CALLBACK (on_save1_activate),
                    NULL);
  g_signal_connect ((gpointer) print1, "activate",
                    G_CALLBACK (on_print1_activate),
                    NULL);
  g_signal_connect ((gpointer) delete1, "activate",
                    G_CALLBACK (on_delete1_activate),
                    NULL);
  g_signal_connect ((gpointer) bChooseClient, "clicked",
                    G_CALLBACK (on_bChooseClient_clicked),
                    NULL);
  g_signal_connect ((gpointer) bSearch, "clicked",
                    G_CALLBACK (on_bSearch_clicked),
                    NULL);
  g_signal_connect ((gpointer) tree1, "row_activated",
                    G_CALLBACK (on_tree1_row_activated),
                    NULL);
  g_signal_connect ((gpointer) eAcctPlan, "activate",
                    G_CALLBACK (on_eAcctPlan_activate),
                    NULL);
  g_signal_connect ((gpointer) eAcctPlan, "changed",
                    G_CALLBACK (on_eAcctPlan_changed),
                    NULL);
  g_signal_connect ((gpointer) bChooseAddress, "clicked",
                    G_CALLBACK (on_bChooseAddress_clicked),
                    NULL);
  g_signal_connect ((gpointer) eAddressID, "changed",
                    G_CALLBACK (on_eAddressID_changed),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (ClientMainwindow, ClientMainwindow, "ClientMainwindow");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, menubar1, "menubar1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, file1, "file1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, file1_menu, "file1_menu");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, choosePrinter1, "choosePrinter1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, separator2, "separator2");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, quit1, "quit1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, articles1, "articles1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, articles1_menu, "articles1_menu");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, new1, "new1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, edit1, "edit1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, save1, "save1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, separator3, "separator3");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, print1, "print1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, separator1, "separator1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, delete1, "delete1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, toolbar1, "toolbar1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, toolitem1, "toolitem1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, bChooseClient, "bChooseClient");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, alignment1, "alignment1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, hbox3, "hbox3");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, image2, "image2");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, label28, "label28");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, lFindNumber, "lFindNumber");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, eFindName, "eFindName");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, lFindDesignation, "lFindDesignation");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, eFindCity, "eFindCity");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, bSearch, "bSearch");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, scrolledwindow1, "scrolledwindow1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, viewport1, "viewport1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, tree1, "tree1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, table1, "table1");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, label17, "label17");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, label18, "label18");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, label19, "label19");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, label20, "label20");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, eName, "eName");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, eDescription, "eDescription");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, eClientNumber, "eClientNumber");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, eAcctPlan, "eAcctPlan");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, bChooseAddress, "bChooseAddress");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, hbox2, "hbox2");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, label27, "label27");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, eAddressID, "eAddressID");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, eLongAcctPlan, "eLongAcctPlan");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, scrolledwindow2, "scrolledwindow2");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, tvAddress, "tvAddress");
  GLADE_HOOKUP_OBJECT (ClientMainwindow, label16, "label16");

  gtk_window_add_accel_group (GTK_WINDOW (ClientMainwindow), accel_group);

  return ClientMainwindow;
}
Esempio n. 25
0
GtkWidget*
create_bsv_viewer_pref_dlg (void)
{
  GtkWidget *bsv_viewer_pref_dlg;
  GtkWidget *dialog_vbox1;
  GtkWidget *notebook1;
  GtkWidget *vbox2;
  GtkWidget *hbox19;
  GtkWidget *label3;
  GtkObject *chanperscreen_spinb_adj;
  GtkWidget *chanperscreen_spinb;
  GtkWidget *hbox20;
  GtkWidget *label4;
  GtkObject *hrange_spinb_adj;
  GtkWidget *hrange_spinb;
  GtkWidget *label5;
  GtkWidget *label1;
  GtkWidget *vbox3;
  GtkWidget *hbox21;
  GtkWidget *label6;
  GtkWidget *logfile_entry;
  GtkWidget *button15;
  GtkWidget *image17;
  GtkWidget *hbox22;
  GtkWidget *label7;
  GtkWidget *patid_entry;
  GtkWidget *hbox23;
  GtkWidget *label8;
  GtkWidget *recid_entry;
  GtkWidget *label2;
  GtkWidget *dialog_action_area1;
  GtkWidget *okbutton1;

  bsv_viewer_pref_dlg = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (bsv_viewer_pref_dlg), _("Viewer Preferences"));

  dialog_vbox1 = GTK_DIALOG (bsv_viewer_pref_dlg)->vbox;
  gtk_widget_show (dialog_vbox1);

  notebook1 = gtk_notebook_new ();
  gtk_widget_show (notebook1);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), notebook1, TRUE, TRUE, 0);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox2);
  gtk_container_add (GTK_CONTAINER (notebook1), vbox2);

  hbox19 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox19);
  gtk_box_pack_start (GTK_BOX (vbox2), hbox19, FALSE, TRUE, 0);

  label3 = gtk_label_new (_("Channels per Screen: "));
  gtk_widget_show (label3);
  gtk_box_pack_start (GTK_BOX (hbox19), label3, FALSE, FALSE, 0);

  chanperscreen_spinb_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
  chanperscreen_spinb = gtk_spin_button_new (GTK_ADJUSTMENT (chanperscreen_spinb_adj), 1, 0);
  gtk_widget_show (chanperscreen_spinb);
  gtk_box_pack_start (GTK_BOX (hbox19), chanperscreen_spinb, FALSE, TRUE, 0);

  hbox20 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox20);
  gtk_box_pack_start (GTK_BOX (vbox2), hbox20, FALSE, TRUE, 0);

  label4 = gtk_label_new (_("Horizontal Time Range: "));
  gtk_widget_show (label4);
  gtk_box_pack_start (GTK_BOX (hbox20), label4, FALSE, FALSE, 0);

  hrange_spinb_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
  hrange_spinb = gtk_spin_button_new (GTK_ADJUSTMENT (hrange_spinb_adj), 1, 0);
  gtk_widget_show (hrange_spinb);
  gtk_box_pack_start (GTK_BOX (hbox20), hrange_spinb, FALSE, TRUE, 0);

  label5 = gtk_label_new (_(" sec"));
  gtk_widget_show (label5);
  gtk_box_pack_start (GTK_BOX (hbox20), label5, FALSE, FALSE, 0);

  label1 = gtk_label_new (_("Viewer"));
  gtk_widget_show (label1);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label1);

  vbox3 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox3);
  gtk_container_add (GTK_CONTAINER (notebook1), vbox3);

  hbox21 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox21);
  gtk_box_pack_start (GTK_BOX (vbox3), hbox21, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox21), 2);

  label6 = gtk_label_new (_("GDF Logfile: "));
  gtk_widget_show (label6);
  gtk_box_pack_start (GTK_BOX (hbox21), label6, FALSE, FALSE, 0);

  logfile_entry = gtk_entry_new ();
  gtk_widget_show (logfile_entry);
  gtk_box_pack_start (GTK_BOX (hbox21), logfile_entry, TRUE, TRUE, 0);

  button15 = gtk_button_new ();
  gtk_widget_show (button15);
  gtk_box_pack_start (GTK_BOX (hbox21), button15, FALSE, FALSE, 0);

  image17 = gtk_image_new_from_stock ("gtk-floppy", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image17);
  gtk_container_add (GTK_CONTAINER (button15), image17);

  hbox22 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox22);
  gtk_box_pack_start (GTK_BOX (vbox3), hbox22, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox22), 2);

  label7 = gtk_label_new (_("Patient ID: "));
  gtk_widget_show (label7);
  gtk_box_pack_start (GTK_BOX (hbox22), label7, FALSE, FALSE, 0);

  patid_entry = gtk_entry_new ();
  gtk_widget_show (patid_entry);
  gtk_box_pack_start (GTK_BOX (hbox22), patid_entry, TRUE, TRUE, 0);

  hbox23 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox23);
  gtk_box_pack_start (GTK_BOX (vbox3), hbox23, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox23), 2);

  label8 = gtk_label_new (_("Record ID: "));
  gtk_widget_show (label8);
  gtk_box_pack_start (GTK_BOX (hbox23), label8, FALSE, FALSE, 0);

  recid_entry = gtk_entry_new ();
  gtk_widget_show (recid_entry);
  gtk_box_pack_start (GTK_BOX (hbox23), recid_entry, TRUE, TRUE, 0);

  label2 = gtk_label_new (_("Logfile"));
  gtk_widget_show (label2);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label2);

  dialog_action_area1 = GTK_DIALOG (bsv_viewer_pref_dlg)->action_area;
  gtk_widget_show (dialog_action_area1);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);

  okbutton1 = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (okbutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (bsv_viewer_pref_dlg), okbutton1, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) bsv_viewer_pref_dlg, "delete_event",
                    G_CALLBACK (update_viewer_settings),
                    NULL);
  g_signal_connect ((gpointer) button15, "clicked",
                    G_CALLBACK (show_fs_dlg),
                    NULL);
  g_signal_connect ((gpointer) okbutton1, "clicked",
                    G_CALLBACK (update_viewer_settings_but),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (bsv_viewer_pref_dlg, bsv_viewer_pref_dlg, "bsv_viewer_pref_dlg");
  GLADE_HOOKUP_OBJECT_NO_REF (bsv_viewer_pref_dlg, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox19, "hbox19");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label3, "label3");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, chanperscreen_spinb, "chanperscreen_spinb");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox20, "hbox20");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label4, "label4");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hrange_spinb, "hrange_spinb");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label5, "label5");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label1, "label1");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, vbox3, "vbox3");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox21, "hbox21");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label6, "label6");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, logfile_entry, "logfile_entry");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, button15, "button15");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, image17, "image17");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox22, "hbox22");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label7, "label7");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, patid_entry, "patid_entry");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox23, "hbox23");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label8, "label8");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, recid_entry, "recid_entry");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label2, "label2");
  GLADE_HOOKUP_OBJECT_NO_REF (bsv_viewer_pref_dlg, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, okbutton1, "okbutton1");

  return bsv_viewer_pref_dlg;
}
Esempio n. 26
0
/**
 * Format notebook file specification page.
 * \param pageNum Page (tab) number.
 * \param pageLbl Page (tab) label.
 */
static void export_ldif_page_file( gint pageNum, gchar *pageLbl ) {
	GtkWidget *vbox;
	GtkWidget *table;
	GtkWidget *label;
	GtkWidget *labelBook;
	GtkWidget *entryLdif;
	GtkWidget *btnFile;
	gint top;

	vbox = gtk_vbox_new(FALSE, 8);
	gtk_container_add( GTK_CONTAINER( expldif_dlg.notebook ), vbox );
	gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );

	label = gtk_label_new( pageLbl );
	gtk_widget_show( label );
	gtk_notebook_set_tab_label(
		GTK_NOTEBOOK( expldif_dlg.notebook ),
		gtk_notebook_get_nth_page(
			GTK_NOTEBOOK( expldif_dlg.notebook ), pageNum ),
		label );

	table = gtk_table_new( 3, 3, FALSE );
	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
	gtk_container_set_border_width( GTK_CONTAINER(table), 8 );
	gtk_table_set_row_spacings(GTK_TABLE(table), 8);
	gtk_table_set_col_spacings(GTK_TABLE(table), 8 );

	/* First row */
	top = 0;
	label = gtk_label_new( _( "Address Book" ) );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1),
		GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);

	labelBook = gtk_label_new( "Address book name goes here" );
	gtk_table_attach(GTK_TABLE(table), labelBook, 1, 2, top, (top + 1),
		GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(labelBook), 0, 0.5);

	/* Second row */
	top++;
	label = gtk_label_new( _( "LDIF Output File" ) );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1),
		GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);

	entryLdif = gtk_entry_new();
	gtk_table_attach(GTK_TABLE(table), entryLdif, 1, 2, top, (top + 1),
		GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);

	btnFile = gtkut_get_browse_file_btn(_("B_rowse"));
	gtk_table_attach(GTK_TABLE(table), btnFile, 2, 3, top, (top + 1),
		GTK_FILL, 0, 3, 0);

	gtk_widget_show_all(vbox);

	/* Button handler */
	g_signal_connect(G_OBJECT(btnFile), "clicked",
			 G_CALLBACK(exp_ldif_file_select), NULL);

	expldif_dlg.labelBook = labelBook;
	expldif_dlg.entryLdif = entryLdif;
}
void addressbook_edit_person_page_attrib_ldap(PersonEditDlg *dialog, gint pageNum, gchar *pageLbl) {
	GtkWidget *combo_box;
	GtkWidget *vbox;
	GtkWidget *hbox;
	GtkWidget *vboxl;
	GtkWidget *vboxb;
	GtkWidget *vbuttonbox;
	GtkWidget *buttonDel;
	GtkWidget *buttonMod;
	GtkWidget *buttonAdd;

	GtkWidget *table;
	GtkWidget *label;
	GtkWidget *clist_swin;
	GtkWidget *clist;
	GtkWidget *entry_value;
	gint top;

	personEditDlg = dialog;

	gchar *titles[ATTRIB_N_COLS];
	gint i;

	titles[ATTRIB_COL_NAME] = N_("Name");
	titles[ATTRIB_COL_VALUE] = N_("Value");

	vbox = gtk_vbox_new(FALSE, 8);
	gtk_widget_show(vbox);
	gtk_container_add(GTK_CONTAINER(personEditDlg->notebook), vbox);
	gtk_container_set_border_width(GTK_CONTAINER(vbox), BORDER_WIDTH);

	label = gtk_label_new_with_mnemonic(pageLbl);
	gtk_widget_show(label);
	gtk_notebook_set_tab_label(
		GTK_NOTEBOOK(personEditDlg->notebook),
		gtk_notebook_get_nth_page(GTK_NOTEBOOK(personEditDlg->notebook), pageNum), label);

	/* Split into two areas */
	hbox = gtk_hbox_new(FALSE, 0);
	gtk_container_add(GTK_CONTAINER(vbox), hbox);

	/* Attribute list */
	vboxl = gtk_vbox_new(FALSE, 4);
	gtk_container_add(GTK_CONTAINER(hbox), vboxl);
	gtk_container_set_border_width(GTK_CONTAINER(vboxl), 4);

	clist_swin = gtk_scrolled_window_new(NULL, NULL);
	gtk_container_add(GTK_CONTAINER(vboxl), clist_swin);
	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(clist_swin),
				       GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

	clist = gtk_cmclist_new_with_titles(ATTRIB_N_COLS, titles);
	gtk_container_add(GTK_CONTAINER(clist_swin), clist);
	gtk_cmclist_set_selection_mode(GTK_CMCLIST(clist), GTK_SELECTION_BROWSE);
	gtk_cmclist_set_column_width(GTK_CMCLIST(clist), ATTRIB_COL_NAME, ATTRIB_COL_WIDTH_NAME);
	gtk_cmclist_set_column_width(GTK_CMCLIST(clist), ATTRIB_COL_VALUE, ATTRIB_COL_WIDTH_VALUE);
	gtk_cmclist_set_compare_func(GTK_CMCLIST(clist), edit_person_attrib_compare_func);
	gtk_cmclist_set_auto_sort(GTK_CMCLIST(clist), TRUE);

	for (i = 0; i < ATTRIB_N_COLS; i++)
		gtkut_widget_set_can_focus(GTK_CMCLIST(clist)->column[i].button, FALSE);

	/* Data entry area */
	table = gtk_table_new(4, 2, FALSE);
	gtk_box_pack_start(GTK_BOX(vboxl), table, FALSE, FALSE, 0);
	gtk_container_set_border_width(GTK_CONTAINER(table), 4);
	gtk_table_set_row_spacings(GTK_TABLE(table), 4);
	gtk_table_set_col_spacings(GTK_TABLE(table), 4);

	/* First row */
	top = 0;
	label = gtk_label_new(N_("Name"));
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);

	gchar **attribute = (gchar **) ATTRIBUTE;

	combo_box = gtk_combo_box_new_text();

	while (*attribute) {
		if (!strcmp(*attribute, "jpegPhoto")) {
			attribute++;
			continue;
		}
		gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), *attribute++);
	}
	gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), 0);

	gtk_table_attach(GTK_TABLE(table), combo_box, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);

	/* Next row */
	++top;
	label = gtk_label_new(N_("Value"));
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);

	entry_value = gtk_entry_new();
	gtk_table_attach(GTK_TABLE(table), entry_value, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);

	/* Button box */
	vboxb = gtk_vbox_new(FALSE, 4);
	gtk_box_pack_start(GTK_BOX(hbox), vboxb, FALSE, FALSE, 2);

	vbuttonbox = gtk_vbutton_box_new();
	gtk_button_box_set_layout(GTK_BUTTON_BOX(vbuttonbox), GTK_BUTTONBOX_START);
	gtk_box_set_spacing(GTK_BOX(vbuttonbox), 8);
	gtk_container_set_border_width(GTK_CONTAINER(vbuttonbox), 4);
	gtk_container_add(GTK_CONTAINER(vboxb), vbuttonbox);

	/* Buttons */
	buttonDel = gtk_button_new_from_stock(GTK_STOCK_DELETE);
	gtk_container_add(GTK_CONTAINER(vbuttonbox), buttonDel);

	buttonMod = gtk_button_new_from_stock(GTK_STOCK_SAVE);
	gtk_container_add(GTK_CONTAINER(vbuttonbox), buttonMod);

	buttonAdd = gtk_button_new_from_stock(GTK_STOCK_ADD);
	gtk_container_add(GTK_CONTAINER(vbuttonbox), buttonAdd);
	
	gtk_widget_set_sensitive(buttonDel,FALSE);
	gtk_widget_set_sensitive(buttonMod,FALSE);
	gtk_widget_set_sensitive(buttonAdd,FALSE);

	gtk_widget_show_all(vbox);
	
	/* Event handlers */
	g_signal_connect(G_OBJECT(clist), "select_row",
			  G_CALLBACK( edit_person_attrib_list_selected), NULL);
	g_signal_connect(G_OBJECT(buttonDel), "clicked",
			  G_CALLBACK(edit_person_attrib_delete), NULL);
	g_signal_connect(G_OBJECT(buttonMod), "clicked",
			  G_CALLBACK(edit_person_attrib_modify), NULL);
	g_signal_connect(G_OBJECT(buttonAdd), "clicked",
			  G_CALLBACK(edit_person_attrib_add), NULL);
	g_signal_connect(G_OBJECT(combo_box), "changed",
			 G_CALLBACK(edit_person_entry_att_changed), NULL);
	g_signal_connect(G_OBJECT(entry_value), "key_press_event",
			 G_CALLBACK(edit_person_entry_att_pressed), NULL);
	g_signal_connect(G_OBJECT(combo_box), "changed",
			 G_CALLBACK(edit_person_combo_box_changed), clist);

	personEditDlg->clist_attrib  = clist;
	personEditDlg->entry_atname  = combo_box;
	personEditDlg->entry_atvalue = entry_value;
	personEditDlg->attrib_add = buttonAdd;
	personEditDlg->attrib_del = buttonDel;
	personEditDlg->attrib_mod = buttonMod;
}
Esempio n. 28
0
static GtkWidget *create_window(void)
{
    stwidgets.accel_group = gtk_accel_group_new();

    // Basic window
    stwidgets.startwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title(GTK_WINDOW(stwidgets.startwin), apptitle);	// NOTE: use global app title
    gtk_window_set_position(GTK_WINDOW(stwidgets.startwin), GTK_WIN_POS_CENTER);
    gtk_window_set_resizable(GTK_WINDOW(stwidgets.startwin), FALSE);
    gtk_window_set_type_hint(GTK_WINDOW(stwidgets.startwin), GDK_WINDOW_TYPE_HINT_DIALOG);

    // Horizontal layout of banner and controls
    stwidgets.hlayout = gtk_hbox_new(FALSE, 0);
    gtk_container_add(GTK_CONTAINER(stwidgets.startwin), stwidgets.hlayout);

    // banner
    {
        GdkPixbuf *pixbuf = load_banner();
        stwidgets.banner = gtk_image_new_from_pixbuf(pixbuf);
        g_object_unref((gpointer)pixbuf);
    }
    gtk_box_pack_start(GTK_BOX(stwidgets.hlayout), stwidgets.banner, FALSE, FALSE, 0);
    gtk_misc_set_alignment(GTK_MISC(stwidgets.banner), 0.5, 0);

    // Vertical layout of tab control and start+cancel buttons
    stwidgets.vlayout = gtk_vbox_new(FALSE, 0);
    gtk_box_pack_start(GTK_BOX(stwidgets.hlayout), stwidgets.vlayout, TRUE, TRUE, 0);

    // Tab control
    stwidgets.tabs = gtk_notebook_new();
    gtk_box_pack_start(GTK_BOX(stwidgets.vlayout), stwidgets.tabs, TRUE, TRUE, 0);
    gtk_container_set_border_width(GTK_CONTAINER(stwidgets.tabs), 4);

    // layout table of config page
	stwidgets.configtlayout = gtk_table_new(4, 3, FALSE);
	gtk_container_add(GTK_CONTAINER(stwidgets.tabs), stwidgets.configtlayout);

    // 2D video mode label
    stwidgets.vmode2dlabel = gtk_label_new_with_mnemonic("_2D Video mode:");
    gtk_misc_set_alignment (GTK_MISC(stwidgets.vmode2dlabel), 0.3, 0);
    gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dlabel, 0,1, 0,1, GTK_FILL, 0, 4, 6);
    
    // 2D video mode combo
    {
        GtkListStore *list = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
        GtkCellRenderer *cell;

        stwidgets.vmode2dcombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(list));
        g_object_unref(G_OBJECT(list));

        cell = gtk_cell_renderer_text_new();
        gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.vmode2dcombo), cell, FALSE);
        gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.vmode2dcombo), cell, "text", 0, NULL);
    }
    gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dcombo, 1,2, 0,1, GTK_EXPAND | GTK_FILL, 0, 4, 6);
    gtk_widget_add_accelerator(stwidgets.vmode2dcombo, "grab_focus", stwidgets.accel_group,
                               GDK_2, GDK_MOD1_MASK,
                               GTK_ACCEL_VISIBLE);
	
	// Fullscreen checkbox
    stwidgets.fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen");
    gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.fullscreencheck, 2,3, 0,1, GTK_FILL, 0, 4, 6);
    gtk_widget_add_accelerator(stwidgets.fullscreencheck, "grab_focus", stwidgets.accel_group,
                               GDK_F, GDK_MOD1_MASK,
                               GTK_ACCEL_VISIBLE);
                               
    // 3D video mode label
    stwidgets.vmode3dlabel = gtk_label_new_with_mnemonic("_3D Video mode:");
    gtk_misc_set_alignment (GTK_MISC(stwidgets.vmode3dlabel), 0.3, 0);
    gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 1,2, GTK_FILL, 0, 4, 6);

    // 3D video mode combo
    {
        GtkListStore *list = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
        GtkCellRenderer *cell;

        stwidgets.vmode3dcombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(list));
        g_object_unref(G_OBJECT(list));

        cell = gtk_cell_renderer_text_new();
        gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, FALSE);
        gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, "text", 0, NULL);
    }
    gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 1,2, GTK_EXPAND | GTK_FILL, 0, 4, 0);
    gtk_widget_add_accelerator(stwidgets.vmode3dcombo, "grab_focus", stwidgets.accel_group,
                               GDK_3, GDK_MOD1_MASK,
                               GTK_ACCEL_VISIBLE);
	// Empty horizontal layout
	stwidgets.emptyhlayout = gtk_hbox_new(TRUE, 0);
	gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,1, 2,3, 0, GTK_EXPAND | GTK_FILL, 0, 0);
	
    // Always show config checkbox
    stwidgets.alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show configuration on start");
    gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.alwaysshowcheck, 0,2, 3,4, GTK_FILL, 0, 4, 6);
    gtk_widget_add_accelerator(stwidgets.alwaysshowcheck, "grab_focus", stwidgets.accel_group,
                               GDK_A, GDK_MOD1_MASK,
                               GTK_ACCEL_VISIBLE);

    // Configuration tab
    stwidgets.configtab = gtk_label_new("Configuration");
    gtk_notebook_set_tab_label(GTK_NOTEBOOK(stwidgets.tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(stwidgets.tabs), 0), stwidgets.configtab);

    // Messages scrollable area
    stwidgets.messagesscroll = gtk_scrolled_window_new(NULL, NULL);
    gtk_container_add(GTK_CONTAINER(stwidgets.tabs), stwidgets.messagesscroll);
    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(stwidgets.messagesscroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);

    // Messages text area
    stwidgets.messagestext = gtk_text_view_new();
    gtk_container_add(GTK_CONTAINER(stwidgets.messagesscroll), stwidgets.messagestext);
    gtk_text_view_set_editable(GTK_TEXT_VIEW(stwidgets.messagestext), FALSE);
    gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(stwidgets.messagestext), GTK_WRAP_WORD);
    gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(stwidgets.messagestext), FALSE);
    gtk_text_view_set_left_margin(GTK_TEXT_VIEW(stwidgets.messagestext), 2);
    gtk_text_view_set_right_margin(GTK_TEXT_VIEW(stwidgets.messagestext), 2);

    // Messages tab
    stwidgets.messagestab = gtk_label_new("Messages");
    gtk_notebook_set_tab_label(GTK_NOTEBOOK(stwidgets.tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(stwidgets.tabs), 1), stwidgets.messagestab);

    // Dialogue box buttons layout
    stwidgets.buttons = gtk_hbutton_box_new();
    gtk_box_pack_start(GTK_BOX(stwidgets.vlayout), stwidgets.buttons, FALSE, TRUE, 0);
    gtk_container_set_border_width(GTK_CONTAINER(stwidgets.buttons), 3);
    gtk_button_box_set_layout(GTK_BUTTON_BOX(stwidgets.buttons), GTK_BUTTONBOX_END);

    // Cancel button
    stwidgets.cancelbutton = gtk_button_new();
    gtk_container_add(GTK_CONTAINER(stwidgets.buttons), stwidgets.cancelbutton);
    GTK_WIDGET_SET_FLAGS(stwidgets.cancelbutton, GTK_CAN_DEFAULT);
    gtk_widget_add_accelerator(stwidgets.cancelbutton, "grab_focus", stwidgets.accel_group,
                               GDK_C, GDK_MOD1_MASK,
                               GTK_ACCEL_VISIBLE);
    gtk_widget_add_accelerator(stwidgets.cancelbutton, "clicked", stwidgets.accel_group,
                               GDK_Escape, 0,
                               GTK_ACCEL_VISIBLE);

    stwidgets.cancelbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
    gtk_container_add(GTK_CONTAINER(stwidgets.cancelbutton), stwidgets.cancelbuttonalign);

    stwidgets.cancelbuttonlayout = gtk_hbox_new(FALSE, 2);
    gtk_container_add(GTK_CONTAINER(stwidgets.cancelbuttonalign), stwidgets.cancelbuttonlayout);

    stwidgets.cancelbuttonicon = gtk_image_new_from_stock("gtk-cancel", GTK_ICON_SIZE_BUTTON);
    gtk_box_pack_start(GTK_BOX(stwidgets.cancelbuttonlayout), stwidgets.cancelbuttonicon, FALSE, FALSE, 0);

    stwidgets.cancelbuttonlabel = gtk_label_new_with_mnemonic("_Cancel");
    gtk_box_pack_start(GTK_BOX(stwidgets.cancelbuttonlayout), stwidgets.cancelbuttonlabel, FALSE, FALSE, 0);

    // Start button
    stwidgets.startbutton = gtk_button_new();
    gtk_container_add(GTK_CONTAINER(stwidgets.buttons), stwidgets.startbutton);
    GTK_WIDGET_SET_FLAGS(stwidgets.startbutton, GTK_CAN_DEFAULT);
    gtk_widget_add_accelerator(stwidgets.startbutton, "grab_focus", stwidgets.accel_group,
                               GDK_S, GDK_MOD1_MASK,
                               GTK_ACCEL_VISIBLE);
    gtk_widget_add_accelerator(stwidgets.startbutton, "clicked", stwidgets.accel_group,
                               GDK_Return, 0,
                               GTK_ACCEL_VISIBLE);

    stwidgets.startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
    gtk_container_add(GTK_CONTAINER(stwidgets.startbutton), stwidgets.startbuttonalign);

    stwidgets.startbuttonlayout = gtk_hbox_new(FALSE, 2);
    gtk_container_add(GTK_CONTAINER(stwidgets.startbuttonalign), stwidgets.startbuttonlayout);

    stwidgets.startbuttonicon = gtk_image_new_from_stock("gtk-execute", GTK_ICON_SIZE_BUTTON);
    gtk_box_pack_start(GTK_BOX(stwidgets.startbuttonlayout), stwidgets.startbuttonicon, FALSE, FALSE, 0);

    stwidgets.startbuttonlabel = gtk_label_new_with_mnemonic("_Start");
    gtk_box_pack_start(GTK_BOX(stwidgets.startbuttonlayout), stwidgets.startbuttonlabel, FALSE, FALSE, 0);

    // Wire up the signals
    g_signal_connect((gpointer) stwidgets.startwin, "delete_event",
                     G_CALLBACK(on_startwin_delete_event),
                     NULL);
    g_signal_connect((gpointer) stwidgets.vmode2dcombo, "changed",
                     G_CALLBACK(on_vmode2dcombo_changed),
                     NULL);
    g_signal_connect((gpointer) stwidgets.vmode3dcombo, "changed",
                     G_CALLBACK(on_vmode3dcombo_changed),
                     NULL);
    g_signal_connect((gpointer) stwidgets.fullscreencheck, "toggled",
                     G_CALLBACK(on_fullscreencheck_toggled),
                     NULL);
    g_signal_connect((gpointer) stwidgets.alwaysshowcheck, "toggled",
                     G_CALLBACK(on_alwaysshowcheck_toggled),
                     NULL);
    g_signal_connect((gpointer) stwidgets.cancelbutton, "clicked",
                     G_CALLBACK(on_cancelbutton_clicked),
                     NULL);
    g_signal_connect((gpointer) stwidgets.startbutton, "clicked",
                     G_CALLBACK(on_startbutton_clicked),
                     NULL);

    // Associate labels with their controls
    gtk_label_set_mnemonic_widget(GTK_LABEL(stwidgets.vmode2dlabel), stwidgets.vmode2dcombo);
    gtk_label_set_mnemonic_widget(GTK_LABEL(stwidgets.vmode3dlabel), stwidgets.vmode3dcombo);

    gtk_window_add_accel_group(GTK_WINDOW(stwidgets.startwin), stwidgets.accel_group);

    return stwidgets.startwin;
}
Esempio n. 29
0
/**
 * Format notebook distinguished name page.
 * \param pageNum Page (tab) number.
 * \param pageLbl Page (tab) label.
 */
static void export_ldif_page_dn( gint pageNum, gchar *pageLbl ) {
	GtkWidget *vbox;
	GtkWidget *table;
	GtkWidget *label;
	GtkWidget *entrySuffix;
	GtkWidget *optmenuRDN;
	GtkWidget *labelRDN;
	GtkWidget *checkUseDN;
	GtkWidget *checkEMail;
	GtkListStore *store;
	GtkTreeIter iter;
	gint top;

	vbox = gtk_vbox_new(FALSE, 8);
	gtk_container_add( GTK_CONTAINER( expldif_dlg.notebook ), vbox );
	gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );

	label = gtk_label_new( pageLbl );
	gtk_widget_show( label );
	gtk_notebook_set_tab_label(
		GTK_NOTEBOOK( expldif_dlg.notebook ),
		gtk_notebook_get_nth_page(
			GTK_NOTEBOOK( expldif_dlg.notebook ), pageNum ),
		label );

	table = gtk_table_new( 6, 2, FALSE );
	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
	gtk_container_set_border_width( GTK_CONTAINER(table), 8 );
	gtk_table_set_row_spacings(GTK_TABLE(table), 8);
	gtk_table_set_col_spacings(GTK_TABLE(table), 8 );

	/* First row */
	top = 0;
	label = gtk_label_new( _( "Suffix" ) );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1),
		GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);

	entrySuffix = gtk_entry_new();
	gtk_table_attach(GTK_TABLE(table), entrySuffix, 1, 2, top, (top + 1),
		GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);

	CLAWS_SET_TIP(entrySuffix, _(
		"The suffix is used to create a \"Distinguished Name\" " \
		"(or DN) for an LDAP entry. Examples include:\n" \
		"  dc=claws-mail,dc=org\n" \
		"  ou=people,dc=domainname,dc=com\n" \
		"  o=Organization Name,c=Country\n"));

	/* Second row */
	top++;
	label = gtk_label_new( _( "Relative DN" ) );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1),
		GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);

	optmenuRDN = gtkut_sc_combobox_create(NULL, TRUE);
	store = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(optmenuRDN)));
	
	COMBOBOX_ADD(store, _("Unique ID"), EXPORT_LDIF_ID_UID);
	COMBOBOX_ADD(store, _("Display Name"), EXPORT_LDIF_ID_DNAME);
	COMBOBOX_ADD(store, _("Email Address"), EXPORT_LDIF_ID_EMAIL);

	gtk_table_attach(GTK_TABLE(table), optmenuRDN, 1, 2, top, (top + 1),
		GTK_FILL, 0, 0, 0);

	CLAWS_SET_TIP(optmenuRDN, _(
		"The LDIF file contains several data records that " \
		"are usually loaded into an LDAP server. Each data " \
		"record in the LDIF file is uniquely identified by " \
		"a \"Distinguished Name\" (or DN). The suffix is " \
		"appended to the \"Relative Distinguished Name\" "\
		"(or RDN) to create the DN. Please select one of " \
		"the available RDN options that will be used to " \
		"create the DN."));
	
	/* Third row*/
	top++;
	labelRDN = gtk_label_new("");
	gtk_label_set_line_wrap(GTK_LABEL(labelRDN), TRUE);
	gtk_label_set_justify(GTK_LABEL(labelRDN), GTK_JUSTIFY_CENTER);
	gtk_table_attach(GTK_TABLE(table), labelRDN, 0, 2, top, (top + 1),
		GTK_FILL, 0, 0, 0);
		
	/* Fourth row */
	top++;
	checkUseDN = gtk_check_button_new_with_label(
			_( "Use DN attribute if present in data" ) );
	gtk_table_attach(GTK_TABLE(table), checkUseDN, 1, 2, top, (top + 1),
		GTK_FILL, 0, 0, 0);

	CLAWS_SET_TIP(checkUseDN, _(
		"The addressbook may contain entries that were " \
		"previously imported from an LDIF file. The " \
		"\"Distinguished Name\" (DN) user attribute, if " \
		"present in the address book data, may be used in " \
		"the exported LDIF file. The RDN selected above " \
		"will be used if the DN user attribute is not found."));

	/* Fifth row */
	top++;
	checkEMail = gtk_check_button_new_with_label(
			_( "Exclude record if no Email Address" ) );
	gtk_table_attach(GTK_TABLE(table), checkEMail, 1, 2, top, (top + 1),
		GTK_FILL, 0, 0, 0);

	CLAWS_SET_TIP(checkEMail, _(
		"An addressbook may contain entries without " \
		"Email Addresses. Check this option to ignore " \
		"these records."));


	gtk_widget_show_all(vbox);

	g_signal_connect(G_OBJECT(optmenuRDN), "changed",
		G_CALLBACK(export_ldif_relative_dn_changed), labelRDN);
	gtk_combo_box_set_active(GTK_COMBO_BOX(optmenuRDN), 0);


	expldif_dlg.entrySuffix = entrySuffix;
	expldif_dlg.optmenuRDN  = optmenuRDN;
	expldif_dlg.checkUseDN  = checkUseDN;
	expldif_dlg.checkEMail  = checkEMail;
}
Esempio n. 30
0
static void
xfburn_preferences_dialog_init (XfburnPreferencesDialog * obj)
{
  GtkBox *box = GTK_BOX (GTK_DIALOG (obj)->vbox);
  XfburnPreferencesDialogPrivate *priv = XFBURN_PREFERENCES_DIALOG_GET_PRIVATE (obj);
  
  GtkWidget *vbox, *vbox2, *vbox3, *hbox;
  GtkWidget *label;
  GtkWidget *frame;
  GtkWidget *scrolled_window;
  GtkListStore *icon_store, *store;
  gint x,y;
  GdkPixbuf *icon = NULL;
  GtkTreeIter iter;
  GtkTreeViewColumn *column_name;
  GtkCellRenderer *cell_icon, *cell_name;
  GtkWidget *button_close;
  gint idx;
  
  gtk_window_set_title (GTK_WINDOW (obj), _("Preferences"));
  xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (obj), _("Tune how Xfburn behaves"));
  gtk_window_set_default_size (GTK_WINDOW (obj), 775, 400);
  gtk_window_set_destroy_with_parent (GTK_WINDOW (obj), TRUE);
  gtk_window_set_icon_name (GTK_WINDOW (obj), GTK_STOCK_PREFERENCES);
  gtk_dialog_set_has_separator (GTK_DIALOG (obj), FALSE);
  
  hbox = gtk_hbox_new (FALSE, 0);
  gtk_box_pack_start (box, hbox, TRUE, TRUE, 0);
  gtk_widget_show (hbox);

  scrolled_window = gtk_scrolled_window_new (NULL, NULL);
  g_object_set (G_OBJECT (scrolled_window),
                "hscrollbar-policy", GTK_POLICY_NEVER,
                "shadow-type", GTK_SHADOW_IN,
                "vscrollbar-policy", GTK_POLICY_NEVER,
                NULL);
  gtk_box_pack_start (GTK_BOX (hbox), scrolled_window, FALSE, FALSE, 0);
  gtk_widget_show (scrolled_window);

  /* icon bar */
  icon_store = gtk_list_store_new (SETTINGS_LIST_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
  priv->icon_bar = exo_icon_bar_new_with_model (GTK_TREE_MODEL (icon_store));
  exo_icon_bar_set_pixbuf_column (EXO_ICON_BAR (priv->icon_bar), SETTINGS_LIST_PIXBUF_COLUMN);
  exo_icon_bar_set_text_column (EXO_ICON_BAR (priv->icon_bar), SETTINGS_LIST_TEXT_COLUMN);
  gtk_container_add (GTK_CONTAINER (scrolled_window), priv->icon_bar);
  gtk_widget_show (priv->icon_bar);
  
  /* notebook */
  priv->notebook = gtk_notebook_new ();
  gtk_container_set_border_width (GTK_CONTAINER (priv->notebook), BORDER);
  g_object_set (G_OBJECT (priv->notebook),
                "show-border", FALSE,
                "show-tabs", FALSE,
                NULL);
  gtk_box_pack_start (GTK_BOX (hbox), priv->notebook, TRUE, TRUE, BORDER);
  gtk_widget_show (priv->notebook);

  /* general tab */
  vbox = gtk_vbox_new (FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER);
  idx = gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), vbox, NULL);
  gtk_widget_show (vbox);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox2);

  frame = xfce_gtk_frame_box_new_with_content (_("Temporary directory"), vbox2);
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, BORDER);
  gtk_widget_show (frame);

  priv->chooser_button = gtk_file_chooser_button_new (_("Temporary directory"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
  gtk_box_pack_start (GTK_BOX (vbox2), priv->chooser_button, FALSE, FALSE, BORDER);
  gtk_widget_show (priv->chooser_button);

  priv->check_clean_tmpdir = gtk_check_button_new_with_mnemonic (_("_Clean temporary directory on exit"));
  gtk_box_pack_start (GTK_BOX (vbox2), priv->check_clean_tmpdir, FALSE, FALSE, BORDER);
  gtk_widget_show (priv->check_clean_tmpdir);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox2);

  frame = xfce_gtk_frame_box_new_with_content (_("File browser"), vbox2);
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, BORDER);
  gtk_widget_show (frame);

  priv->check_show_hidden = gtk_check_button_new_with_mnemonic (_("Show _hidden files"));
  gtk_box_pack_start (GTK_BOX (vbox2), priv->check_show_hidden, FALSE, FALSE, BORDER);
  gtk_widget_show (priv->check_show_hidden);
  g_signal_connect (G_OBJECT (priv->check_show_hidden), "clicked", G_CALLBACK (cb_show_hidden_clicked), NULL);

  priv->check_show_human_readable = gtk_check_button_new_with_mnemonic (_("Show human_readable filesizes"));
  gtk_box_pack_start (GTK_BOX (vbox2), priv->check_show_human_readable, FALSE, FALSE, BORDER);
  gtk_widget_show (priv->check_show_human_readable);

  icon = gtk_widget_render_icon (GTK_WIDGET (priv->icon_bar),
                                 GTK_STOCK_PROPERTIES,
                                 GTK_ICON_SIZE_DIALOG,
                                 NULL);
  gtk_list_store_append (icon_store, &iter);
  gtk_list_store_set (icon_store, &iter,
                      SETTINGS_LIST_PIXBUF_COLUMN, icon,
                      SETTINGS_LIST_TEXT_COLUMN, _("General"),
                      SETTINGS_LIST_INDEX_COLUMN, idx,
                      -1);
  g_object_unref (G_OBJECT (icon));
  
  /* devices tab */
  vbox = gtk_vbox_new (FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER);
  idx = gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), vbox, NULL);
  gtk_widget_show (vbox);

  label = gtk_label_new (_("Devices"));
  gtk_widget_show (label);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (priv->notebook),
                              gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), 1), label);
  gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox2);

  frame = xfce_gtk_frame_box_new_with_content (_("Detected devices"), vbox2);
  gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, BORDER);
  gtk_widget_show (frame);

  scrolled_window = gtk_scrolled_window_new (NULL, NULL);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN);
  gtk_widget_show (scrolled_window);
  gtk_box_pack_start (GTK_BOX (vbox2), scrolled_window, TRUE, TRUE, BORDER);

  store = gtk_list_store_new (DEVICE_LIST_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
                              G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
                              G_TYPE_BOOLEAN);
  priv->treeview_devices = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), DEVICE_LIST_COLUMN_NAME, GTK_SORT_ASCENDING);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (priv->treeview_devices), TRUE);
  gtk_widget_show (priv->treeview_devices);
  gtk_container_add (GTK_CONTAINER (scrolled_window), priv->treeview_devices);
  g_object_unref (store);
  
  /* add columns */
  column_name = gtk_tree_view_column_new ();
  gtk_tree_view_column_set_title (column_name, _("Name"));
  gtk_tree_view_column_set_expand (column_name, TRUE);

  cell_icon = gtk_cell_renderer_pixbuf_new ();
  gtk_tree_view_column_pack_start (column_name, cell_icon, FALSE);
  gtk_tree_view_column_set_attributes (column_name, cell_icon, "pixbuf", DEVICE_LIST_COLUMN_ICON, NULL);
  g_object_set (cell_icon, "xalign", 0.0, "ypad", 0, NULL);

  cell_name = gtk_cell_renderer_text_new ();
  gtk_tree_view_column_pack_start (column_name, cell_name, TRUE);
  gtk_tree_view_column_set_attributes (column_name, cell_name, "text", DEVICE_LIST_COLUMN_NAME, NULL);

  gtk_tree_view_append_column (GTK_TREE_VIEW (priv->treeview_devices), column_name);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Node"),
                                               gtk_cell_renderer_text_new (), "text", DEVICE_LIST_COLUMN_NODE, NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write CD-R"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_CDR, NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write CD-RW"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_CDRW,
                                               NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write DVD-R"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_DVDR,
                                               NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write DVD-RAM"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_DVDRAM,
                                               NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write Blu-ray"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_BD,
                                               NULL);

  hbox = gtk_hbox_new (FALSE, 0);
  gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, BORDER);
  gtk_widget_show (hbox);

  priv->button_scan = xfce_gtk_button_new_mixed (GTK_STOCK_CDROM, _("Sc_an for devices"));
  gtk_box_pack_end (GTK_BOX (hbox), priv->button_scan, FALSE, FALSE, BORDER);
  g_signal_connect (G_OBJECT (priv->button_scan), "clicked", G_CALLBACK (scan_button_clicked_cb), obj);
  gtk_widget_show (priv->button_scan);

  gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &x, &y);
  icon = gtk_icon_theme_load_icon ( gtk_icon_theme_get_default(), "media-optical", x, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
  if (!icon)
    icon = gtk_icon_theme_load_icon ( gtk_icon_theme_get_default(), "media-cdrom", x, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
  if (!icon)
    icon = gtk_icon_theme_load_icon ( gtk_icon_theme_get_default(), GTK_STOCK_CDROM, x, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);

  
  gtk_list_store_append (icon_store, &iter);
  gtk_list_store_set (icon_store, &iter,
                      SETTINGS_LIST_PIXBUF_COLUMN, icon,
                      SETTINGS_LIST_TEXT_COLUMN, _("Devices"),
                      SETTINGS_LIST_INDEX_COLUMN, idx,
                      -1);
  if (icon)
    g_object_unref (G_OBJECT (icon));
  
  exo_mutual_binding_new (G_OBJECT (priv->notebook), "page", G_OBJECT (priv->icon_bar), "active");


  /* below the device list */
#if 0
  priv->check_empty_speed_list = gtk_check_button_new_with_mnemonic (_("Show warning on _empty speed list"));
  gtk_box_pack_start (GTK_BOX (vbox2), priv->check_empty_speed_list, FALSE, FALSE, BORDER);
  gtk_widget_show (priv->check_empty_speed_list);
#endif

  /* fifo */
  vbox3 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox3);

  frame = xfce_gtk_frame_box_new_with_content (_("FIFO buffer size (in kb)"), vbox3);
  gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, BORDER);
  gtk_widget_show (frame);

  priv->scale_fifo = gtk_hscale_new_with_range (0.0, FIFO_MAX_SIZE, 32.0);
  gtk_scale_set_value_pos (GTK_SCALE (priv->scale_fifo), GTK_POS_LEFT);
  gtk_range_set_value (GTK_RANGE (priv->scale_fifo), 0);
  gtk_box_pack_start (GTK_BOX (vbox3), priv->scale_fifo, FALSE, FALSE, BORDER/2);
  gtk_widget_show (priv->scale_fifo);

  
  /* action buttons */
  button_close = gtk_button_new_from_stock ("gtk-close");
  gtk_widget_show (button_close);
  gtk_dialog_add_action_widget (GTK_DIALOG (obj), button_close, GTK_RESPONSE_CLOSE);
  GTK_WIDGET_SET_FLAGS (button_close, GTK_CAN_DEFAULT);
  gtk_widget_grab_focus (button_close);
  gtk_widget_grab_default (button_close);

  g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (xfburn_preferences_dialog_response_cb), priv);
  
  refresh_devices_list (obj);
  
  g_object_unref (icon_store);
}