removed Dialog_About.[h,cc] from now on we use Gtk::AboutDialog instead of
* include/Makefile.am, include/Win_GParted.h, src/Makefile.am: removed Dialog_About.[h,cc] * src/Win_GParted.cc: from now on we use Gtk::AboutDialog instead of our own AboutDialog. Also use Gtk::Stock items instead of hardcoded paths to images (about and harddisk).
This commit is contained in:
parent
270e931083
commit
7cc702dbdf
|
@ -1,3 +1,11 @@
|
|||
2005-11-25 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||
* include/Makefile.am,
|
||||
include/Win_GParted.h,
|
||||
src/Makefile.am: removed Dialog_About.[h,cc]
|
||||
* src/Win_GParted.cc: from now on we use Gtk::AboutDialog instead of
|
||||
our own AboutDialog. Also use Gtk::Stock items instead of hardcoded
|
||||
paths to images (about and harddisk).
|
||||
|
||||
2005-11-25 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||
* gparted-0.0.9
|
||||
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
/* Copyright (C) 2004 Bart
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
of course i could've used Gnome::UI::About but that would add another dependacy to GParted
|
||||
Besides, i always wanted to build my own creditsdialog :-P
|
||||
*/
|
||||
|
||||
#ifndef DIALOG_ABOUT
|
||||
#define DIALOG_ABOUT
|
||||
|
||||
#include "../include/i18n.h"
|
||||
#include "../include/Utils.h"
|
||||
|
||||
#include <gtkmm/dialog.h>
|
||||
#include <gtkmm/button.h>
|
||||
#include <gtkmm/stock.h>
|
||||
#include <gtkmm/notebook.h>
|
||||
|
||||
namespace GParted
|
||||
{
|
||||
|
||||
class Dialog_About : public Gtk::Dialog
|
||||
{
|
||||
public:
|
||||
Dialog_About() ;
|
||||
|
||||
|
||||
private:
|
||||
void Show_Credits() ;
|
||||
|
||||
Gtk::Button button_credits;
|
||||
Gtk::Image *image ;
|
||||
};
|
||||
|
||||
} //GParted
|
||||
|
||||
|
||||
#endif
|
|
@ -8,7 +8,6 @@ EXTRA_DIST = \
|
|||
i18n.h\
|
||||
Partition.h \
|
||||
VBox_VisualDisk.h \
|
||||
Dialog_About.h \
|
||||
Dialog_Partition_Info.h\
|
||||
ext3.h \
|
||||
Frame_Resizer_Extended.h\
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "../include/Operation.h"
|
||||
#include "../include/Dialog_Progress.h"
|
||||
#include "../include/Dialog_Partition_Resize_Move.h"
|
||||
#include "../include/Dialog_About.h"
|
||||
#include "../include/Dialog_Partition_Copy.h"
|
||||
#include "../include/GParted_Core.h"
|
||||
#include "../include/Dialog_Disklabel.h"
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
/* Copyright (C) 2004 Bart
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "../include/Dialog_About.h"
|
||||
|
||||
namespace GParted
|
||||
{
|
||||
|
||||
Dialog_About::Dialog_About()
|
||||
{
|
||||
/*TO TRANSLATORS: this is the dialog title */
|
||||
this ->set_title( _( "About GParted" ) );
|
||||
this ->set_size_request( 250, 220 ) ;
|
||||
this ->set_resizable( false );
|
||||
this ->set_has_separator( false ) ;
|
||||
|
||||
image = manage( new Gtk::Image( GNOME_ICONDIR "/gparted.png" ) );
|
||||
this ->get_vbox() ->pack_start( *image, Gtk::PACK_SHRINK );
|
||||
|
||||
this ->get_vbox() ->pack_start( * mk_label( "<span size='xx-large'><b>" + (Glib::ustring) _( "GParted" ) + " " + VERSION + "</b></span>", true, false ) ,Gtk::PACK_SHRINK );
|
||||
this ->get_vbox() ->pack_start( * mk_label( "\n" + (Glib::ustring) _( "Gnome Partition Editor" ) + "\n", false, false ) ,Gtk::PACK_SHRINK );
|
||||
this ->get_vbox() ->pack_start( * mk_label( "<span size='small'>Copyright © 2004 Bart Hakvoort</span>", true, false ), Gtk::PACK_SHRINK );
|
||||
this ->get_vbox() ->pack_start( * mk_label( "<span size='small'>http://gparted.sourceforge.net</span>", true, false ), Gtk::PACK_SHRINK );
|
||||
|
||||
button_credits.add_pixlabel( "/usr/share/icons/hicolor/16x16/stock/generic/stock_about.png", "Credits", 0, 0.5 ) ;
|
||||
button_credits.signal_clicked() .connect( sigc::mem_fun( this, &Dialog_About::Show_Credits ) ) ;
|
||||
|
||||
this ->get_action_area() ->set_layout( Gtk::BUTTONBOX_EDGE ) ;
|
||||
this ->get_action_area() ->pack_start( button_credits ) ;
|
||||
this ->add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE );
|
||||
|
||||
this ->show_all_children() ;
|
||||
}
|
||||
|
||||
void Dialog_About::Show_Credits()
|
||||
{
|
||||
Gtk::Dialog dialog( _("Credits"), *this ) ;
|
||||
Gtk::Notebook notebook_credits;
|
||||
Gtk::VBox vbox_written, vbox_translators ;
|
||||
|
||||
//written by
|
||||
vbox_written .set_border_width( 5 ) ;
|
||||
vbox_written .pack_start( * mk_label( "Bart Hakvoort <gparted@users.sf.net>", false ), Gtk::PACK_SHRINK ) ;
|
||||
notebook_credits .set_size_request( -1, 200 ) ;
|
||||
|
||||
/*TO TRANSLATORS: tablabel in aboutdialog */
|
||||
notebook_credits .append_page( vbox_written, _("Written by") ) ;
|
||||
|
||||
/*TO TRANSLATORS: your name(s) here please, if there are more translators put newlines (\n) between the names.
|
||||
It's a good idea to provide the url of your translationteam as well. Thanks! */
|
||||
Glib::ustring str_credits = _("translator-credits") ;
|
||||
if ( str_credits != "translator-credits" )
|
||||
{
|
||||
vbox_translators .set_border_width( 5 ) ;
|
||||
vbox_translators .pack_start( * mk_label( str_credits, false ), Gtk::PACK_SHRINK ) ;
|
||||
/*TO TRANSLATORS: tablabel in aboutdialog */
|
||||
notebook_credits .append_page( vbox_translators, _("Translated by") ) ;
|
||||
}
|
||||
|
||||
dialog .get_vbox() ->pack_start( notebook_credits, Gtk::PACK_SHRINK );
|
||||
dialog .add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE );
|
||||
|
||||
dialog .set_resizable( false );
|
||||
dialog .show_all_children() ;
|
||||
dialog .run() ;
|
||||
}
|
||||
|
||||
}//GParted
|
|
@ -15,7 +15,6 @@ bin_PROGRAMS = gparted
|
|||
|
||||
gparted_SOURCES = \
|
||||
Device.cc\
|
||||
Dialog_About.cc\
|
||||
Dialog_Base_Partition.cc\
|
||||
Dialog_Disklabel.cc \
|
||||
Dialog_Filesystems.cc \
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
#include "../include/Win_GParted.h"
|
||||
|
||||
#include <gtkmm/aboutdialog.h>
|
||||
|
||||
namespace GParted
|
||||
{
|
||||
|
||||
|
@ -31,9 +33,12 @@ Win_GParted::Win_GParted( )
|
|||
|
||||
//==== GUI =========================
|
||||
this ->set_title( _("GParted") );
|
||||
this ->set_icon_from_file( GNOME_ICONDIR "/gparted.png" ) ;
|
||||
this ->set_default_size( 775, 500 );
|
||||
|
||||
try {
|
||||
this ->set_icon_from_file( GNOME_ICONDIR "/gparted.png" ) ;
|
||||
} catch ( Glib::Exception & e ) { std::cout << e .what() << std::endl ; }
|
||||
|
||||
//Pack the main box
|
||||
this ->add( vbox_main );
|
||||
|
||||
|
@ -109,8 +114,8 @@ void Win_GParted::init_menubar( )
|
|||
//help
|
||||
menu = manage( new Gtk::Menu() ) ;
|
||||
menu ->items( ) .push_back(Gtk::Menu_Helpers::StockMenuElem( Gtk::Stock::HELP, sigc::mem_fun(*this, &Win_GParted::menu_help_contents) ) );
|
||||
image = manage( new Gtk::Image( "/usr/share/icons/hicolor/16x16/stock/generic/stock_about.png" ) );
|
||||
menu ->items( ) .push_back(Gtk::Menu_Helpers::ImageMenuElem( _("About"), *image, sigc::mem_fun(*this, &Win_GParted::menu_help_about) ) );
|
||||
menu ->items( ) .push_back( Gtk::Menu_Helpers::StockMenuElem( Gtk::Stock::ABOUT, sigc::mem_fun(*this, &Win_GParted::menu_help_about) ) );
|
||||
|
||||
menubar_main.items( ) .push_back( Gtk::Menu_Helpers::MenuElem(_("_Help"), *menu ) );
|
||||
}
|
||||
|
||||
|
@ -350,7 +355,7 @@ void Win_GParted::Refresh_OptionMenu( )
|
|||
hbox = manage( new Gtk::HBox( ) );
|
||||
|
||||
//the image...
|
||||
image = manage( new Gtk::Image( "/usr/share/icons/gnome/24x24/devices/gnome-dev-harddisk.png" ) );
|
||||
image = manage( new Gtk::Image( Gtk::Stock::HARDDISK, Gtk::ICON_SIZE_LARGE_TOOLBAR) );
|
||||
hbox ->pack_start( *image, Gtk::PACK_SHRINK );
|
||||
|
||||
//the label...
|
||||
|
@ -833,10 +838,38 @@ void Win_GParted::menu_help_contents( )
|
|||
|
||||
void Win_GParted::menu_help_about( )
|
||||
{
|
||||
Dialog_About dialog ;
|
||||
std::vector<Glib::ustring> strings ;
|
||||
|
||||
Gtk::AboutDialog dialog ;
|
||||
dialog .set_transient_for( *this ) ;
|
||||
|
||||
dialog .run( );
|
||||
dialog .set_name( _("GParted") ) ;
|
||||
dialog .set_logo( this ->get_icon( ) ) ;
|
||||
dialog .set_version( VERSION ) ;
|
||||
dialog .set_comments( _( "Gnome Partition Editor" ) ) ;
|
||||
dialog .set_copyright( "Copyright © 2004-2005 Bart Hakvoort" ) ;
|
||||
|
||||
//authors
|
||||
strings .push_back( "Bart Hakvoort <gparted@users.sf.net>" ) ;
|
||||
dialog .set_authors( strings ) ;
|
||||
strings .clear( ) ;
|
||||
|
||||
//artists
|
||||
strings .push_back( "http://gparted.sourceforge.net/artwork.php" ) ;
|
||||
dialog .set_artists( strings ) ;
|
||||
strings .clear( ) ;
|
||||
|
||||
/*TO TRANSLATORS: your name(s) here please, if there are more translators put newlines (\n) between the names.
|
||||
It's a good idea to provide the url of your translationteam as well. Thanks! */
|
||||
Glib::ustring str_credits = _("translator-credits") ;
|
||||
if ( str_credits != "translator-credits" )
|
||||
dialog .set_translator_credits( str_credits ) ;
|
||||
|
||||
|
||||
//the url is not clickable because this would introduce an new dep (gnome-vfsmm)
|
||||
dialog .set_website( "http://gparted.sourceforge.net" ) ;
|
||||
|
||||
dialog .run( ) ;
|
||||
}
|
||||
|
||||
void Win_GParted::mouse_click( GdkEventButton *event, const Partition & partition )
|
||||
|
|
Loading…
Reference in New Issue