Changeset a2853fcd79f1a3d860b57026dad02fe89c2b27c7

Show
Ignore:
Timestamp:
01/06/07 23:29:14 (6 years ago)
Author:
Philipp Kern <phil@…>
Parents:
8b2a3a49c23b0f36032b2321d61dd524ef2f618c
Children:
e76680186b096d86b316b2c0e733c25bfaed5930
git-committer:
Philipp Kern <phil@0x539.de> / 2007-01-06T22:29:14Z+0000
Message:

[project @ Added about dialog]

Original author: Philipp Kern <phil@…>
Date: 2005-04-08 11:03:24+00:00

Files:
5 modified

Legend:

Unmodified
Added
Removed
  • inc/header.hpp

    r59e6131 ra2853fc  
    5151        typedef sigc::signal<void> signal_document_open_type; 
    5252        typedef sigc::signal<void> signal_document_close_type; 
     53        typedef sigc::signal<void> signal_about_type; 
    5354        typedef sigc::signal<void> signal_quit_type; 
    5455 
     
    6263        signal_document_open_type document_open_event() const; 
    6364        signal_document_close_type document_close_event() const; 
     65        signal_about_type about_event() const; 
    6466        signal_quit_type quit_event() const; 
    6567 
     
    7981        void on_app_document_open(); 
    8082        void on_app_document_close(); 
     83        void on_app_about(); 
    8184        void on_app_quit(); 
    8285 
     
    9497        signal_document_open_type m_signal_document_open; 
    9598        signal_document_close_type m_signal_document_close; 
     99        signal_about_type m_signal_about; 
    96100        signal_quit_type m_signal_quit; 
    97101}; 
  • inc/window.hpp

    r8c66072 ra2853fc  
    4343        void on_session_join(); 
    4444        void on_session_quit(); 
     45        void on_about(); 
    4546        void on_quit(); 
    4647 
  • src/header.cpp

    r92f8c62 ra2853fc  
    3939        m_group_app->add(Gtk::Action::create("MenuApp", "Gobby") ); 
    4040 
    41         m_group_app->add(Gtk::Action::create("MenuSession", "Session") ); 
    42  
    4341        // Create session 
    4442        m_group_app->add( 
     
    8381        ); 
    8482 
     83        // Session menu 
     84        m_group_app->add(Gtk::Action::create("MenuSession", "Session") ); 
     85 
    8586        // Create document 
    8687        m_group_app->add( 
     
    124125                ) 
    125126        ); 
    126          
     127 
     128        // Help menu 
     129        m_group_app->add(Gtk::Action::create("Help", "Help") ); 
     130 
     131        // Display about dialog 
     132        m_group_app->add( 
     133                Gtk::Action::create( 
     134                        "About", 
     135                        Gtk::Stock::ABOUT, 
     136                        "About", 
     137                        "Shows Gobby's copyright and credits" 
     138                ), 
     139                sigc::mem_fun( 
     140                        *this, 
     141                        &Header::on_app_about 
     142                ) 
     143        ); 
     144 
    127145        // Quit application 
    128146        m_group_app->add( 
     
    204222} 
    205223 
     224Gobby::Header::signal_about_type 
     225Gobby::Header::about_event() const 
     226{ 
     227        return m_signal_about; 
     228} 
     229 
    206230Gobby::Header::signal_quit_type 
    207231Gobby::Header::quit_event() const 
     
    288312} 
    289313 
     314void Gobby::Header::on_app_about() 
     315{ 
     316        m_signal_about.emit(); 
     317} 
     318 
    290319void Gobby::Header::on_app_quit() 
    291320{ 
  • src/window.cpp

    r7ecb475 ra2853fc  
    1919#include <stdexcept> 
    2020#include <gtkmm/main.h> 
     21#include <gtkmm/aboutdialog.h> 
    2122#include <gtkmm/messagedialog.h> 
    2223#include <libobby/client_buffer.hpp> 
     
    2526#include "joindialog.hpp" 
    2627#include "window.hpp" 
     28#include "features.hpp" 
    2729 
    2830Gobby::Window::Window() 
     
    3739        m_header.session_quit_event().connect( 
    3840                sigc::mem_fun(*this, &Window::on_session_quit) ); 
     41        m_header.about_event().connect( 
     42                sigc::mem_fun(*this, &Window::on_about) ); 
    3943        m_header.quit_event().connect( 
    4044                sigc::mem_fun(*this, &Window::on_quit) ); 
     
    235239} 
    236240 
     241void Gobby::Window::on_about() 
     242{ 
     243        Gtk::AboutDialog dlg; 
     244        dlg.set_name("Gobby"); 
     245        dlg.set_version(PACKAGE_VERSION); 
     246        dlg.set_comments("A collaborative text editor"); 
     247        dlg.set_copyright("Copyright (C) 2005 0x539 dev group <crew@0x539.de>"); 
     248 
     249        std::deque<Glib::ustring> authors; 
     250        authors.push_back("Armin Burgmeier <armin@0x539.de>"); 
     251        authors.push_back("Benjamin Herr <ben@0x539.de>"); 
     252        authors.push_back("Philipp Kern <phil@0x539.de>"); 
     253        dlg.set_authors(authors); 
     254 
     255        dlg.set_license( 
     256                "This program is free software; you can redistribute it\n" 
     257                "and/or modify it under the terms of the GNU General Public\n" 
     258                "License as published by the Free Software Foundation; either\n" 
     259                "version 2 of the License, or (at your option) any later\n" 
     260                "version.\n" 
     261                "\n" 
     262                "This program is distributed in the hope that it will be\n" 
     263                "useful, but WITHOUT ANY WARRANTY; without even the implied\n" 
     264                "warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n" 
     265                "PURPOSE.  See the GNU General Public License for more details." 
     266        ); 
     267        dlg.run(); 
     268} 
     269 
    237270void Gobby::Window::on_quit() 
    238271{ 
  • ui.xml

    r92f8c62 ra2853fc  
    1414      <menuitem action="CloseDocument" /> 
    1515    </menu> 
     16    <menu action="Help"> 
     17      <menuitem action="About" /> 
     18    </menu> 
    1619  </menubar> 
    1720  <toolbar name="ToolMainBar">