Add source list menu
authorPhilipp Zabel <philipp.zabel@gmail.com>
Thu, 19 Nov 2009 14:17:15 +0000 (15:17 +0100)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Thu, 19 Nov 2009 16:22:03 +0000 (17:22 +0100)
Makefile.am
po/POTFILES.in
src/source-list-menu.vala [new file with mode: 0644]
src/source-list-window.vala

index 99d866a..bc34bef 100644 (file)
@@ -45,6 +45,7 @@ cinaest_SOURCES = \
        src/poster/movie-poster-factory.c \
        src/settings-dialog.c \
        src/source-dialog.c \
+       src/source-list-menu.c \
        src/source-list-view.c \
        src/source-list-window.c
 
@@ -66,6 +67,7 @@ cinaest_VALASOURCES = \
        src/poster/movie-poster-factory.vala \
        src/settings-dialog.vala \
        src/source-dialog.vala \
+       src/source-list-menu.vala \
        src/source-list-view.vala \
        src/source-list-window.vala
 
index 8176160..ec25323 100644 (file)
@@ -8,4 +8,5 @@ src/plugins/imdb-plugin.vala
 src/plugins/google-plugin.vala
 src/settings-dialog.vala
 src/source-dialog.vala
+src/source-list-menu.vala
 src/source-list-window.vala
diff --git a/src/source-list-menu.vala b/src/source-list-menu.vala
new file mode 100644 (file)
index 0000000..035a2a9
--- /dev/null
@@ -0,0 +1,46 @@
+/* This file is part of Cinaest.
+ *
+ * Copyright (C) 2009 Philipp Zabel
+ *
+ * Cinaest 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Cinaest 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Cinaest. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+using Gtk;
+using Hildon;
+
+public class SourceListMenu : AppMenu {
+       private SourceListWindow source_list_window;
+
+       public SourceListMenu (SourceListWindow window) {
+               source_list_window = window;
+       }
+
+       construct {
+               // Add view menu buttons
+               var settings = new Gtk.Button.with_label (_("Settings"));
+
+               // Connect signals
+               settings.clicked.connect (on_settings_clicked);
+
+               append (settings);
+
+               show_all ();
+       }
+
+       public void on_settings_clicked (Gtk.Button button) {
+               var dialog = new SettingsDialog (source_list_window);
+
+               dialog.run ();
+       }
+}
index 2e3eb3b..3f739d7 100644 (file)
@@ -25,6 +25,11 @@ public class SourceListWindow : StackableWindow {
        construct {
                set_title ("Cinæst");
 
+               // View menu
+               var menu = new SourceListMenu (this);
+
+               set_main_menu (menu);
+
                var sources = new List<MovieSource> ();
                source_list = new SourceListView (sources);