Changeset 73d97807520553a5af69d47ed6af664c8404ffb2


Ignore:
Timestamp:
11/03/10 13:01:13 (3 years ago)
Author:
Matias De la Puente <mfpuente.ar@…>
Children:
34bfedc41f1688e9d07a447404324a2d45948ed9
Parents:
accdd3b6e6ec6fba42fccbde7439a6bdf7677506
git-committer:
Matias De la Puente <mfpuente.ar@…> (11/03/10 13:01:13)
Message:

Add new about dialog

Location:
libi4uc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libi4uc/Makefile.am

    rbdc0000 r73d9780  
    33AM_CPPFLAGS = \ 
    44        $(I4UC_CFLAGS) \ 
     5        -DPACKAGE_DATADIR=\""$(pkgdatadir)"\" \ 
     6        -DLOCALE_DIR=\""$(datadir)/locale"\" \ 
     7        -DDOC_DIR=\""$(prefix)/doc/i4uc"\" \ 
     8        -DPIXMAPS_DIR=\""$(pkgdatadir)/pixmaps"\" \ 
     9        -DMODELS_DIR=\""$(pkgdatadir)/models"\" \ 
     10        -DBUILDERS_DIR=\""$(pkgdatadir)/builders"\" \ 
    511        -include $(CONFIG_HEADER) \ 
    612        $(NULL) 
     
    1622libi4uc_la_VALAFLAGS = \ 
    1723        -H i4uc.h --library i4uc-1.0 \ 
     24        --pkg config --vapidir $(top_srcdir)/vapi \ 
     25        --pkg gee-1.0 \ 
    1826        --pkg gtk+-2.0 \ 
    1927        $(NULL) 
  • libi4uc/i4ucmainwindowpresenter.vala

    rbdc0000 r73d9780  
    1919 *      Matias De la Puente <mfpuente.ar@gmail.com> 
    2020 */ 
     21using Gee; 
    2122 
    2223public class I4uc.MainWindowPresenter : GLib.Object 
     
    3334                //Connect view signals 
    3435                _main_window_view.exit_clicked.connect (on_exit_clicked); 
     36                _main_window_view.about_clicked.connect (on_about_clicked); 
    3537        } 
    3638         
     
    3941                return false; 
    4042        } 
     43         
     44        private void on_about_clicked () 
     45        { 
     46                var app_info = new HashMap<string, string> (); 
     47                app_info["program_name"] = "i4uc"; 
     48                app_info["comments"] = _("IDE for microcontrollers"); 
     49                app_info["version"] = Config.VERSION; 
     50                app_info["copyright"] = "Copyright (C) 2009  Matias De la Puente"; 
     51                app_info["website"] = "http://trac.usla.org.ar/proyectos/i4uc/"; 
     52                var authors = new ArrayList<string> (); 
     53                authors.add ("Matias De la Puente <mfpuente.ar@gmail.com>"); 
     54                _main_window_view.show_about_dialog (app_info, authors); 
     55        } 
    4156} 
  • libi4uc/i4ucmainwindowview.vala

    raccdd3b r73d9780  
    2020 */ 
    2121using Gtk; 
     22using Gee; 
    2223 
    2324public class I4uc.MainWindowView : Gtk.Window, MainWindowViewIface 
     
    4849        } 
    4950         
     51        public void show_about_dialog (Gee.Map<string, string> app_info, Gee.List<string> authors) 
     52        { 
     53                var about_dialog = new AboutDialog (); 
     54                about_dialog.program_name = app_info["program_name"]; 
     55                about_dialog.comments = app_info["comments"]; 
     56                about_dialog.version = app_info["version"]; 
     57                var authors_array = new string[authors.size + 1]; 
     58                for (int i=0; i<authors.size; i++) 
     59                        authors_array[i] = authors[i]; 
     60                authors_array[authors.size + 1] = null; 
     61                about_dialog.set_authors (authors_array); 
     62                about_dialog.copyright = app_info["copyright"]; 
     63                about_dialog.website = app_info["website"]; 
     64                about_dialog.logo = this.icon; 
     65                about_dialog.run (); 
     66                about_dialog.destroy (); 
     67        } 
     68         
    5069        private void on_quit () 
    5170        { 
     
    5473        } 
    5574         
     75        private void on_about () 
     76        { 
     77                this.about_clicked (); 
     78        } 
     79         
    5680        private const ActionEntry[] _action_entries = 
    5781        { 
    5882                { "FileMenuAction", null, N_("_File") }, 
    59                         { "QuitAction", STOCK_QUIT, null, null, N_("Quit from i4uc"), on_quit } 
     83                        { "QuitAction", STOCK_QUIT, null, null, N_("Quit from i4uc"), on_quit }, 
     84                { "HelpMenuAction", null, N_("_Help") }, 
     85                        { "AboutAction", STOCK_ABOUT, null, null, N_("About i4uc"), on_about } 
    6086        }; 
    6187         
     
    6995                </menu> 
    7096                <placeholder name="MenuBarOps"/> 
     97                <menu name="HelpMenu" action="HelpMenuAction"> 
     98                        <placeholder name="HelpMenuOps"/> 
     99                        <separator/> 
     100                        <menuitem action="AboutAction"/> 
     101                </menu> 
    71102        </menubar> 
    72103        <toolbar name="MainToolbar"> 
  • libi4uc/i4ucmainwindowviewiface.vala

    rbdc0000 r73d9780  
    1919 *      Matias De la Puente <mfpuente.ar@gmail.com> 
    2020 */ 
     21using Gee; 
    2122 
    2223public interface I4uc.MainWindowViewIface : GLib.Object 
     
    2526         
    2627        public signal bool exit_clicked (); 
     28        public signal void about_clicked (); 
     29         
     30        public abstract void show_about_dialog (Gee.Map<string, string> app_info, Gee.List<string> authors); 
    2731} 
Note: See TracChangeset for help on using the changeset viewer.