paperbox r212 - trunk/src



Author: markoa
Date: Mon Nov 10 21:03:57 2008
New Revision: 212
URL: http://svn.gnome.org/viewvc/paperbox?rev=212&view=rev

Log:
Tag from menu too

Modified:
   trunk/src/document-tile-view.hh
   trunk/src/document-tile.cc
   trunk/src/document-tile.hh
   trunk/src/main-window.cc

Modified: trunk/src/document-tile-view.hh
==============================================================================
--- trunk/src/document-tile-view.hh	(original)
+++ trunk/src/document-tile-view.hh	Mon Nov 10 21:03:57 2008
@@ -1,9 +1,7 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-
 /*
  *  PaperBox - document-tile-view.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

Modified: trunk/src/document-tile.cc
==============================================================================
--- trunk/src/document-tile.cc	(original)
+++ trunk/src/document-tile.cc	Mon Nov 10 21:03:57 2008
@@ -1,9 +1,7 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-
 /*
  *  PaperBox - document-tile.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
@@ -445,4 +443,10 @@
         return doc_;
     }
 
+    void
+    DocumentTile::show_add_tag_dialog()
+    {
+        on_tag_add_clicked();
+    }
+
 } // namespace paperbox

Modified: trunk/src/document-tile.hh
==============================================================================
--- trunk/src/document-tile.hh	(original)
+++ trunk/src/document-tile.hh	Mon Nov 10 21:03:57 2008
@@ -1,9 +1,7 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-
 /*
  *  PaperBox - document-tile.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
@@ -63,10 +61,13 @@
 
         // The signal that forwards the event of clicking on a tag
         // within the tile to the view (DocumentTileView).
-        SignalTagClicked& signal_tag_clicked();
+        virtual SignalTagClicked& signal_tag_clicked();
 
         // Hides additional containers and widgets.
-        void hide_extra_info();
+        virtual void hide_extra_info();
+
+        // The add tag action can be requested from a eg menu item too.
+        virtual void show_add_tag_dialog();
 
     protected:
         virtual void connect_thumbnailer_signals(Thumbnailer& thumbnailer);

Modified: trunk/src/main-window.cc
==============================================================================
--- trunk/src/main-window.cc	(original)
+++ trunk/src/main-window.cc	Mon Nov 10 21:03:57 2008
@@ -235,7 +235,7 @@
         action_group_->add(Gtk::Action::create("DocumentMenu", "_Document"));
 
         action_group_->add(
-                Gtk::Action::create("DocumentTag", Gtk::Stock::ADD, "Add _Tag", "tooltip man!"),
+                Gtk::Action::create("DocumentTag", Gtk::Stock::ADD, "Add _Tag"),
                 Gtk::AccelKey("<control>T"),
                 sigc::mem_fun(*this, &MainWindow::on_menu_document_tag));
 
@@ -243,6 +243,8 @@
                 Gtk::Action::create("DocumentQuit", Gtk::Stock::QUIT),
                 sigc::mem_fun(*this, &MainWindow::on_menu_document_quit));
 
+        action_group_->add(Gtk::Action::create("HelpMenu", "_Help"));
+
         action_group_->add(
                 Gtk::Action::create("HelpAbout", Gtk::Stock::ABOUT),
                 sigc::mem_fun(*this, &MainWindow::on_menu_about));
@@ -260,6 +262,9 @@
             "           <separator/>"
             "           <menuitem action='DocumentQuit'/>"
             "       </menu>"
+            "       <menu action='HelpMenu'>"
+            "           <menuitem action='HelpAbout'/>"
+            "       </menu>"
             "   </menubar>"
             "   <toolbar name='ToolBar'>"
             "       <toolitem action='DocumentTag'/>"
@@ -326,8 +331,11 @@
     void
     MainWindow::on_menu_document_tag()
     {
-        //TODO:
-        g_debug("tagging some document...");
+        DocumentTile* tile =
+            dynamic_cast<DocumentTile*>(tile_view_->get_selection());
+        if (! tile) return;
+
+        tile->show_add_tag_dialog();
     }
 
     void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]