4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "aboutprefs.h"
23 #include "bcsignals.h"
26 #include "libzmpeg3.h"
30 #include "versioninfo.h"
34 AboutPrefs::AboutPrefs(MWindow *mwindow, PreferencesWindow *pwindow)
35 : PreferencesDialog(mwindow, pwindow)
39 AboutPrefs::~AboutPrefs()
41 about.remove_all_objects();
44 void AboutPrefs::create_objects()
49 BC_Resources *resources = BC_WindowBase::get_resources();
51 // add_subwindow(new BC_Title(mwindow->theme->preferencestitle_x,
52 // mwindow->theme->preferencestitle_y,
55 // resources->text_default));
57 x = mwindow->theme->preferencesoptions_x;
58 y = mwindow->theme->preferencesoptions_y +
59 get_text_height(LARGEFONT);
62 set_color(resources->text_default);
63 draw_text(x, y, PROGRAM_NAME " " CINELERRA_VERSION);
64 y += 2*get_text_height(MEDIUMFONT);
67 draw_text(x, y, COPYRIGHTTEXT1
68 #if defined(COPYRIGHTTEXT2)
72 y += get_text_height(MEDIUMFONT) * 3;
75 const char *cfg_path = File::get_cindat_path();
76 char msg_path[BCTEXTLEN];
77 snprintf(msg_path, sizeof(msg_path), "%s/msg.txt", cfg_path);
78 FILE *fp = fopen(msg_path, "r");
81 draw_text(x, y, _("About:"));
82 y += get_text_height(LARGEFONT);
84 while( fgets(msg, sizeof(msg), fp) )
85 about.append(new BC_ListBoxItem(msg));
88 add_subwindow(listbox = new BC_ListBox(x, y, 300, 280,
89 LISTBOX_TEXT, &about, 0, 0, 1));
90 y += listbox->get_h() + get_text_height(LARGEFONT) + 10;
93 y += 300 + get_text_height(LARGEFONT) + 10;
96 set_color(resources->text_default);
97 draw_text(x, y, _("License:"));
98 y += get_text_height(LARGEFONT);
101 char license3[BCTEXTLEN];
103 "This program is free software; you can redistribute it and/or modify it under the terms\n"
104 "of the GNU General Public License as published by the Free Software Foundation; either version\n"
105 "2 of the License, or (at your option) any later version.\n"
107 "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n"
108 "without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n"
109 "PURPOSE. See the GNU General Public License for more details.\n"));
110 draw_text(x, y, license3);
111 y += get_text_height(MEDIUMFONT, license3);
114 #define COMPILEDATE "built: " __DATE__ " " __TIME__
116 draw_text(x, y, COMPILEDATE);
117 #if defined(REPOMAINTXT)
118 y += get_text_height(MEDIUMFONT, COMPILEDATE);
119 draw_text(x, y, REPOMAINTXT);
122 x = get_w() - mwindow->theme->about_bg->get_w() - 10;
123 y = mwindow->theme->preferencesoptions_y;
124 BC_Pixmap *temp_pixmap = new BC_Pixmap(this,
125 mwindow->theme->about_bg,
127 draw_pixmap(temp_pixmap,
134 x += mwindow->theme->about_bg->get_w() + 10;
135 y += get_text_height(LARGEFONT) * 2;