Began to implement the about dialog
This commit is contained in:
parent
7abaa175f1
commit
2f90f7b3d0
@ -64,5 +64,5 @@ void on_help_about(gpointer data)
|
|||||||
{
|
{
|
||||||
Todo * todo = data;
|
Todo * todo = data;
|
||||||
|
|
||||||
/* FIXME implement */
|
todo_about(todo);
|
||||||
}
|
}
|
||||||
|
54
src/todo.c
54
src/todo.c
@ -1,17 +1,19 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
/* Copyright (c) 2009 Pierre Pronchery <khorben@defora.org> */
|
static char _copyright[] =
|
||||||
|
"Copyright (c) 2009 Pierre Pronchery <khorben@defora.org>";
|
||||||
/* This file is part of DeforaOS Desktop Todo */
|
/* This file is part of DeforaOS Desktop Todo */
|
||||||
/* This program is free software: you can redistribute it and/or modify
|
static char const _license[] =
|
||||||
* it under the terms of the GNU General Public License as published by
|
"This program is free software: you can redistribute it and/or modify\n"
|
||||||
* the Free Software Foundation, version 3 of the License.
|
"it under the terms of the GNU General Public License as published by\n"
|
||||||
*
|
"the Free Software Foundation, version 3 of the License.\n"
|
||||||
* This program is distributed in the hope that it will be useful,
|
"\n"
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
"This program is distributed in the hope that it will be useful,\n"
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
|
||||||
* GNU General Public License for more details.
|
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
|
||||||
*
|
"GNU General Public License for more details.\n"
|
||||||
* You should have received a copy of the GNU General Public License
|
"\n"
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
"You should have received a copy of the GNU General Public License\n"
|
||||||
|
"along with this program. If not, see <http://www.gnu.org/licenses/>.\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -24,6 +26,7 @@
|
|||||||
#include <Desktop.h>
|
#include <Desktop.h>
|
||||||
#include "callbacks.h"
|
#include "callbacks.h"
|
||||||
#include "todo.h"
|
#include "todo.h"
|
||||||
|
#include "../config.h"
|
||||||
|
|
||||||
|
|
||||||
/* Todo */
|
/* Todo */
|
||||||
@ -36,6 +39,7 @@ struct _Todo
|
|||||||
GtkListStore * store;
|
GtkListStore * store;
|
||||||
GtkWidget * view;
|
GtkWidget * view;
|
||||||
GtkWidget * statusbar;
|
GtkWidget * statusbar;
|
||||||
|
GtkWidget * about;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -46,6 +50,13 @@ enum { TD_COL_DONE, TD_COL_TITLE };
|
|||||||
|
|
||||||
|
|
||||||
/* variables */
|
/* variables */
|
||||||
|
static char const * _authors[] =
|
||||||
|
{
|
||||||
|
"Pierre Pronchery <khorben@defora.org>",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
static DesktopMenu _file_menu[] =
|
static DesktopMenu _file_menu[] =
|
||||||
{
|
{
|
||||||
{ "_Close", G_CALLBACK(on_file_close), GTK_STOCK_CLOSE, GDK_W },
|
{ "_Close", G_CALLBACK(on_file_close), GTK_STOCK_CLOSE, GDK_W },
|
||||||
@ -118,6 +129,7 @@ Todo * todo_new(void)
|
|||||||
/* statusbar */
|
/* statusbar */
|
||||||
todo->statusbar = gtk_statusbar_new();
|
todo->statusbar = gtk_statusbar_new();
|
||||||
gtk_box_pack_start(GTK_BOX(vbox), todo->statusbar, FALSE, TRUE, 0);
|
gtk_box_pack_start(GTK_BOX(vbox), todo->statusbar, FALSE, TRUE, 0);
|
||||||
|
todo->about = NULL;
|
||||||
gtk_container_add(GTK_CONTAINER(todo->window), vbox);
|
gtk_container_add(GTK_CONTAINER(todo->window), vbox);
|
||||||
gtk_widget_show_all(todo->window);
|
gtk_widget_show_all(todo->window);
|
||||||
return todo;
|
return todo;
|
||||||
@ -141,6 +153,24 @@ void todo_delete(Todo * todo)
|
|||||||
|
|
||||||
|
|
||||||
/* useful */
|
/* useful */
|
||||||
|
/* todo_about */
|
||||||
|
void todo_about(Todo * todo)
|
||||||
|
{
|
||||||
|
if(todo->about != NULL)
|
||||||
|
{
|
||||||
|
gtk_widget_show(todo->about);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
todo->about = desktop_about_dialog_new();
|
||||||
|
desktop_about_dialog_set_authors(todo->about, _authors);
|
||||||
|
desktop_about_dialog_set_copyright(todo->about, _copyright);
|
||||||
|
desktop_about_dialog_set_license(todo->about, _license);
|
||||||
|
desktop_about_dialog_set_name(todo->about, PACKAGE);
|
||||||
|
desktop_about_dialog_set_version(todo->about, VERSION);
|
||||||
|
gtk_widget_show(todo->about);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* todo_delete_selection */
|
/* todo_delete_selection */
|
||||||
void todo_delete_selection(Todo * todo)
|
void todo_delete_selection(Todo * todo)
|
||||||
{
|
{
|
||||||
|
@ -29,6 +29,8 @@ Todo * todo_new(void);
|
|||||||
void todo_delete(Todo * todo);
|
void todo_delete(Todo * todo);
|
||||||
|
|
||||||
/* useful */
|
/* useful */
|
||||||
|
void todo_about(Todo * todo);
|
||||||
|
|
||||||
void todo_delete_selection(Todo * todo);
|
void todo_delete_selection(Todo * todo);
|
||||||
void todo_select_all(Todo * todo);
|
void todo_select_all(Todo * todo);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user