paperbox r211 - trunk/src
- From: markoa svn gnome org
- To: svn-commits-list gnome org
- Subject: paperbox r211 - trunk/src
- Date: Mon, 10 Nov 2008 13:20:10 +0000 (UTC)
Author: markoa
Date: Mon Nov 10 13:20:10 2008
New Revision: 211
URL: http://svn.gnome.org/viewvc/paperbox?rev=211&view=rev
Log:
Sketching a menu
Modified:
trunk/src/main-window.cc
trunk/src/main-window.hh
Modified: trunk/src/main-window.cc
==============================================================================
--- trunk/src/main-window.cc (original)
+++ trunk/src/main-window.cc Mon Nov 10 13:20:10 2008
@@ -1,9 +1,7 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-
/*
- * PaperBox - main-window.cc
+ * Paperbox - main-window.cc
*
- * Copyright (C) 2007 Marko Anastasov
+ * Copyright (C) 2007-2008 Marko Anastasov
*
* 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
@@ -233,8 +231,21 @@
{
action_group_ = Gtk::ActionGroup::create();
- action_group_->add(Gtk::Action::create("HelpAbout", Gtk::Stock::ABOUT),
- sigc::mem_fun(*this, &MainWindow::on_menu_about));
+ // actions
+ action_group_->add(Gtk::Action::create("DocumentMenu", "_Document"));
+
+ action_group_->add(
+ Gtk::Action::create("DocumentTag", Gtk::Stock::ADD, "Add _Tag", "tooltip man!"),
+ Gtk::AccelKey("<control>T"),
+ sigc::mem_fun(*this, &MainWindow::on_menu_document_tag));
+
+ action_group_->add(
+ Gtk::Action::create("DocumentQuit", Gtk::Stock::QUIT),
+ sigc::mem_fun(*this, &MainWindow::on_menu_document_quit));
+
+ action_group_->add(
+ Gtk::Action::create("HelpAbout", Gtk::Stock::ABOUT),
+ sigc::mem_fun(*this, &MainWindow::on_menu_about));
ui_manager_ = Gtk::UIManager::create();
ui_manager_->insert_action_group(action_group_);
@@ -243,7 +254,15 @@
Glib::ustring ui_info =
"<ui>"
+ " <menubar name='MenuBar'>"
+ " <menu action='DocumentMenu'>"
+ " <menuitem action='DocumentTag'/>"
+ " <separator/>"
+ " <menuitem action='DocumentQuit'/>"
+ " </menu>"
+ " </menubar>"
" <toolbar name='ToolBar'>"
+ " <toolitem action='DocumentTag'/>"
" <toolitem action='HelpAbout'/>"
" </toolbar>"
"</ui>";
@@ -254,12 +273,16 @@
Glib::ustring msg =
"building menu and toolbar failed: " + ex.what();
LOG_ERROR(msg);
- g_warning(msg.c_str());
}
+ Gtk::Widget* menubar = ui_manager_->get_widget("/MenuBar");
Gtk::Widget* toolbar = ui_manager_->get_widget("/ToolBar");
- if (toolbar)
- menu_vbox_->pack_start(*toolbar, Gtk::PACK_SHRINK);
+ if (menubar && toolbar) {
+ menu_vbox_->pack_start(*menubar, Gtk::PACK_SHRINK);
+ //menu_vbox_->pack_start(*toolbar, Gtk::PACK_SHRINK);
+ } else {
+ LOG_ERROR("could not get menu and toolbar widgets from UIManager");
+ }
}
void
@@ -301,6 +324,19 @@
}
void
+ MainWindow::on_menu_document_tag()
+ {
+ //TODO:
+ g_debug("tagging some document...");
+ }
+
+ void
+ MainWindow::on_menu_document_quit()
+ {
+ hide();
+ }
+
+ void
MainWindow::on_menu_about()
{
Gtk::AboutDialog dialog;
@@ -544,9 +580,7 @@
void
MainWindow::on_sorting_changed()
{
- int sorting = sorting_combo_.get_active_row_number();
doc_vector docs;
-
tile_view_->get_displayed_documents(docs);
sort_documents(docs);
Modified: trunk/src/main-window.hh
==============================================================================
--- trunk/src/main-window.hh (original)
+++ trunk/src/main-window.hh Mon Nov 10 13:20:10 2008
@@ -1,9 +1,7 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-
/*
- * PaperBox - main-window.hh
+ * Paperbox - main-window.hh
*
- * Copyright (C) 2007 Marko Anastasov
+ * Copyright (C) 2007-2008 Marko Anastasov
*
* 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
@@ -78,6 +76,8 @@
const std::vector<boost::shared_ptr<Document> > docs);
/*** Signal handlers ***/
+ void on_menu_document_tag();
+ void on_menu_document_quit();
void on_menu_about();
void on_retrieval_started();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]