mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 19:05:37 +00:00
app: add about dialog
This commit is contained in:
parent
82c8e8be59
commit
0265bc834f
1 changed files with 34 additions and 13 deletions
|
@ -36,17 +36,17 @@ public class MediaInfo.App : Window
|
||||||
set_title (_("GStreamer Media Info"));
|
set_title (_("GStreamer Media Info"));
|
||||||
set_default_size (500, 350);
|
set_default_size (500, 350);
|
||||||
destroy.connect (Gtk.main_quit);
|
destroy.connect (Gtk.main_quit);
|
||||||
|
|
||||||
VBox vbox = new VBox( false, 0);
|
VBox vbox = new VBox( false, 0);
|
||||||
add (vbox);
|
add (vbox);
|
||||||
|
|
||||||
// add a menubar
|
// add a menubar
|
||||||
vbox.pack_start (create_menu(), false, false, 0);
|
vbox.pack_start (create_menu(), false, false, 0);
|
||||||
|
|
||||||
HPaned paned = new HPaned ();
|
HPaned paned = new HPaned ();
|
||||||
paned.set_border_width (0);
|
paned.set_border_width (0);
|
||||||
vbox.pack_start (paned, true, true, 3);
|
vbox.pack_start (paned, true, true, 3);
|
||||||
|
|
||||||
// add a file-chooser with info pane as preview widget
|
// add a file-chooser with info pane as preview widget
|
||||||
chooser = new FileChooserWidget (FileChooserAction.OPEN);
|
chooser = new FileChooserWidget (FileChooserAction.OPEN);
|
||||||
paned.pack1 (chooser, true, true);
|
paned.pack1 (chooser, true, true);
|
||||||
|
@ -70,20 +70,20 @@ public class MediaInfo.App : Window
|
||||||
MenuItem item;
|
MenuItem item;
|
||||||
Menu sub_menu;
|
Menu sub_menu;
|
||||||
AccelGroup accel_group;
|
AccelGroup accel_group;
|
||||||
|
|
||||||
accel_group = new AccelGroup ();
|
accel_group = new AccelGroup ();
|
||||||
this.add_accel_group (accel_group);
|
this.add_accel_group (accel_group);
|
||||||
|
|
||||||
item = new MenuItem.with_label (_("File"));
|
item = new MenuItem.with_label (_("File"));
|
||||||
menu_bar.append (item);
|
menu_bar.append (item);
|
||||||
|
|
||||||
sub_menu = new Menu ();
|
sub_menu = new Menu ();
|
||||||
item.set_submenu (sub_menu);
|
item.set_submenu (sub_menu);
|
||||||
|
|
||||||
// TODO: add "open uri" item
|
// TODO: add "open uri" item
|
||||||
// -> dialog with text entry
|
// -> dialog with text entry
|
||||||
// -> discover that uri and clear selection in browser
|
// -> discover that uri and clear selection in browser
|
||||||
|
|
||||||
item = new ImageMenuItem.from_stock (STOCK_QUIT, accel_group);
|
item = new ImageMenuItem.from_stock (STOCK_QUIT, accel_group);
|
||||||
sub_menu.append (item);
|
sub_menu.append (item);
|
||||||
item.activate.connect (Gtk.main_quit);
|
item.activate.connect (Gtk.main_quit);
|
||||||
|
@ -91,23 +91,32 @@ public class MediaInfo.App : Window
|
||||||
item = new MenuItem.with_label (_("View"));
|
item = new MenuItem.with_label (_("View"));
|
||||||
//item.set_accel_path ("<GstMi-Main>/MainMenu/View");
|
//item.set_accel_path ("<GstMi-Main>/MainMenu/View");
|
||||||
menu_bar.append (item);
|
menu_bar.append (item);
|
||||||
|
|
||||||
sub_menu = new Menu ();
|
sub_menu = new Menu ();
|
||||||
item.set_submenu (sub_menu);
|
item.set_submenu (sub_menu);
|
||||||
|
|
||||||
CheckMenuItem citem = new CheckMenuItem.with_label (_("Full Screen"));
|
CheckMenuItem citem = new CheckMenuItem.with_label (_("Full Screen"));
|
||||||
// see http://bugzilla.gnome.org/show_bug.cgi?id=551184
|
// see http://bugzilla.gnome.org/show_bug.cgi?id=551184
|
||||||
// FIXME: we're also not getting a proper accelerator shown in the menu item
|
// FIXME: we're also not getting a proper accelerator shown in the menu item
|
||||||
citem.add_accelerator("activate", accel_group, Gdk.keyval_from_name ("F11"), 0, 0);
|
citem.add_accelerator("activate", accel_group, Gdk.keyval_from_name ("F11"), 0, 0);
|
||||||
//citem.set_accel_path ("<GstMi-Main>/MainMenu/View/FullScreen");
|
//citem.set_accel_path ("<GstMi-Main>/MainMenu/View/FullScreen");
|
||||||
//AccelMap.add_entry ("<GstMi-Main>/MainMenu/View/FullScreen", 0xffc8, 0);
|
//AccelMap.add_entry ("<GstMi-Main>/MainMenu/View/FullScreen", 0xffc8, 0);
|
||||||
|
|
||||||
sub_menu.append (citem);
|
sub_menu.append (citem);
|
||||||
citem.toggled.connect (on_fullscreen_toggled);
|
citem.toggled.connect (on_fullscreen_toggled);
|
||||||
|
|
||||||
// TODO: add "help" menu with "about" item
|
// add "help" menu with "about" item
|
||||||
|
item = new MenuItem.with_label (_("Help"));
|
||||||
|
menu_bar.append (item);
|
||||||
|
|
||||||
return (menu_bar);
|
sub_menu = new Menu ();
|
||||||
|
item.set_submenu (sub_menu);
|
||||||
|
|
||||||
|
item = new ImageMenuItem.from_stock (STOCK_ABOUT, accel_group);
|
||||||
|
sub_menu.append (item);
|
||||||
|
item.activate.connect (on_about_clicked);
|
||||||
|
|
||||||
|
return (menu_bar);
|
||||||
}
|
}
|
||||||
|
|
||||||
// signal handler
|
// signal handler
|
||||||
|
@ -122,7 +131,7 @@ public class MediaInfo.App : Window
|
||||||
}
|
}
|
||||||
chooser.set_preview_widget_active (res);
|
chooser.set_preview_widget_active (res);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void on_fullscreen_toggled (CheckMenuItem item)
|
private void on_fullscreen_toggled (CheckMenuItem item)
|
||||||
{
|
{
|
||||||
if (item.active) {
|
if (item.active) {
|
||||||
|
@ -131,5 +140,17 @@ public class MediaInfo.App : Window
|
||||||
unfullscreen();
|
unfullscreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void on_about_clicked (MenuItem item)
|
||||||
|
{
|
||||||
|
AboutDialog dlg = new AboutDialog ();
|
||||||
|
|
||||||
|
dlg.set_version(Config.PACKAGE_VERSION);
|
||||||
|
dlg.set_program_name("GStreamer Media Info");
|
||||||
|
dlg.set_comments(_("Quickly browse, play and analyze media files."));
|
||||||
|
dlg.set_copyright("Stefan Sauer <ensonic@users.sf.net>");
|
||||||
|
dlg.run();
|
||||||
|
dlg.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue