[Debtags-commits] [svn] r2043 - in debtags-edit/1.2: . src
Enrico Zini
enrico at alioth.debian.org
Wed Nov 1 02:26:54 CET 2006
Author: enrico
Date: Wed Nov 1 02:26:53 2006
New Revision: 2043
Modified:
debtags-edit/1.2/ (props changed)
debtags-edit/1.2/src/TagEditor.cc
debtags-edit/1.2/src/TagEditor.h
debtags-edit/1.2/src/TagSelector.cc
debtags-edit/1.2/src/TagSelector.h
Log:
r3592 at viaza: enrico | 2006-11-01 02:26:29 +0100
Removed pieces of old unused code that were still around
Modified: debtags-edit/1.2/src/TagEditor.cc
==============================================================================
--- debtags-edit/1.2/src/TagEditor.cc (original)
+++ debtags-edit/1.2/src/TagEditor.cc Wed Nov 1 02:26:53 2006
@@ -103,43 +103,6 @@
}
template<class DOC>
-bool TagEditor<DOC>::on_facetAdd_event(GdkEvent* e, Facet facet)
-{
- if (e->type == GDK_BUTTON_PRESS)
- {
- TagMenu<DOC>* addMenu = manage(new TagMenu<DOC>());
- addMenu->populateUnselected(doc, doc.currentTags(), facet);
- addMenu->signal_selected().connect(
- sigc::mem_fun(*this, &TagEditor<DOC>::on_add_to_selection));
- addMenu->popup(e->button.button, e->button.time);
- return true;
- }
- return false;
-}
-
-template<class DOC>
-bool TagEditor<DOC>::on_tag_popup_event(GdkEvent* e, Tag tag)
-{
- if (e->type == GDK_BUTTON_PRESS && e->button.button == 3)
- {
- Gtk::Menu* itemPopup = manage(new Gtk::Menu());
-
- itemPopup->items().push_back(Gtk::Menu_Helpers::MenuElem(
- "Add to all/selected items",
- sigc::bind<Tag>(
- sigc::mem_fun(*this, &TagEditor<DOC>::do_add_tag), tag)));
- itemPopup->items().push_back(Gtk::Menu_Helpers::MenuElem(
- "Remove from all/selected items",
- sigc::bind<Tag>(
- sigc::mem_fun(*this, &TagEditor<DOC>::do_remove_tag), tag)));
-
- itemPopup->popup(e->button.button, e->button.time);
- return true;
- }
- return false;
-}
-
-template<class DOC>
void TagEditor<DOC>::on_add_to_selection(Tag tag)
{
//printf("Add to sel: %.*s\n", PFSTR(tag));
Modified: debtags-edit/1.2/src/TagEditor.h
==============================================================================
--- debtags-edit/1.2/src/TagEditor.h (original)
+++ debtags-edit/1.2/src/TagEditor.h Wed Nov 1 02:26:53 2006
@@ -23,10 +23,8 @@
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/box.h>
-#include <gtkmm/table.h>
#include <gtkmm/treeview.h>
#include <gtkmm/liststore.h>
-#include <gtkmm/menu.h>
#include "TagsetList.h"
template<class DOC>
@@ -77,8 +75,6 @@
void updateView();
- bool on_facetAdd_event(GdkEvent* e, Facet facet);
- bool on_tag_popup_event(GdkEvent* e, Tag tag);
void on_add_to_selection(Tag tag);
void on_del_from_selection(Tag tag);
@@ -98,19 +94,6 @@
//void do_changed();
void do_add_tag(Tag tag);
void do_remove_tag(Tag tag);
-
- /*
- void setSelected(const Debtags::TagSet& tagset) throw ();
-
- const Debtags::TagSet& selected() const throw () { return _selected; }
- const Debtags::TagSet& selected(const Debtags::TagSet& tagset) throw ()
- {
- _selected = tagset;
- updateView();
- do_changed();
- return _selected;
- }
- */
};
// vim:set ts=4 sw=4:
Modified: debtags-edit/1.2/src/TagSelector.cc
==============================================================================
--- debtags-edit/1.2/src/TagSelector.cc (original)
+++ debtags-edit/1.2/src/TagSelector.cc Wed Nov 1 02:26:53 2006
@@ -38,53 +38,10 @@
if (selected.size() < 2)
{
-#if 0
- this->itemPopup.items().push_back(Gtk::Menu_Helpers::MenuElem("Select this tag",
- sigc::bind< Tag >(
- sigc::mem_fun(*this, &TagEditor<DOC>::do_signal_select_tag), tag)));
-#endif
- this->itemPopup.items().push_back(Gtk::Menu_Helpers::MenuElem("Delete this tag",
- sigc::bind< Tag >(
- sigc::mem_fun(ts, &TagSelector::on_del_from_selection), tag)));
+ this->itemPopup.items().push_back(
+ Gtk::Menu_Helpers::MenuElem("Unselect tag " + tag.fullname(),
+ sigc::bind< Tag >(sigc::mem_fun(ts, &TagSelector::on_del_from_selection), tag)));
}
- else
- {
-#if 0
- // TODO: build the tag set with all the selected tags
- this->itemPopup.items().push_back(Gtk::Menu_Helpers::MenuElem("Merge",
- sigc::mem_fun(*this, &ItemList::do_signal_request_tagset_merge)));
- this->itemPopup.items().push_back(Gtk::Menu_Helpers::MenuElem("Intersect",
- sigc::mem_fun(*this, &ItemList::do_signal_request_tagset_intersect)));
-#endif
- }
-#if 0
- this->itemPopup.items().push_back(Gtk::Menu_Helpers::MenuElem("Copy to other panel",
- sigc::mem_fun(*this, &ItemList::do_signal_request_item_copy)));
- this->itemPopup.items().push_back(Gtk::Menu_Helpers::MenuElem("Move to other panel",
- sigc::mem_fun(*this, &ItemList::do_signal_request_item_move)));
-#endif
-
-#if 0
- TagMenu<TagcollDocument<string> >* addMenu = new TagMenu<TagcollDocument<string> >();
- addMenu->set_manage();
- addMenu->populateUnselected(doc, ts);
- string stag = tag;
- addMenu->signal_selected().connect(
- sigc::mem_fun(*this, &ItemList::on_add_tag));
- itemPopup.items().push_back(Gtk::Menu_Helpers::MenuElem("_Add...", *addMenu));
-#endif
-
-#if 0
- if (!ts.empty())
- {
- itemPopup.items().push_back(Gtk::Menu_Helpers::SeparatorElem());
- for (TagSet::const_iterator i = ts.begin();
- i != ts.end(); i++)
- itemPopup.items().push_back(Gtk::Menu_Helpers::MenuElem("Remove " + i->fullname(),
- sigc::bind<Tag>(
- sigc::mem_fun(*this, &ItemList::on_remove_tag), *i)));
- }
-#endif
return true;
}
@@ -94,51 +51,6 @@
_signal_changed.emit();
}
-void TagSelector::do_add_tag(DebtagsDocument::Tag tag)
-{
- _signal_add_tag.emit(tag);
-}
-
-void TagSelector::do_remove_tag(DebtagsDocument::Tag tag)
-{
- _signal_remove_tag.emit(tag);
-}
-
-bool TagSelector::on_facetAdd_event(GdkEvent* e, DebtagsDocument::Facet facet)
-{
- if (e->type == GDK_BUTTON_PRESS)
- {
- TagMenu<DebtagsDocument>* addMenu = manage(new TagMenu<DebtagsDocument>());
- addMenu->populateAvailable(doc, _selected, facet);
- addMenu->signal_selected().connect(
- sigc::mem_fun(*this, &TagSelector::on_add_to_selection));
- addMenu->popup(e->button.button, e->button.time);
- return true;
- }
- return false;
-}
-
-bool TagSelector::on_tag_popup_event(GdkEvent* e, DebtagsDocument::Tag tag)
-{
- if (e->type == GDK_BUTTON_PRESS && e->button.button == 3)
- {
- Gtk::Menu* itemPopup = manage(new Gtk::Menu());
-
- itemPopup->items().push_back(Gtk::Menu_Helpers::MenuElem(
- "Add to all/selected items",
- sigc::bind<DebtagsDocument::Tag>(
- sigc::mem_fun(*this, &TagSelector::do_add_tag), tag)));
- itemPopup->items().push_back(Gtk::Menu_Helpers::MenuElem(
- "Remove from all/selected items",
- sigc::bind<DebtagsDocument::Tag>(
- sigc::mem_fun(*this, &TagSelector::do_remove_tag), tag)));
-
- itemPopup->popup(e->button.button, e->button.time);
- return true;
- }
- return false;
-}
-
void TagSelector::on_add_to_selection(DebtagsDocument::Tag tag)
{
//printf("Add to sel: %.*s\n", PFSTR(tag));
Modified: debtags-edit/1.2/src/TagSelector.h
==============================================================================
--- debtags-edit/1.2/src/TagSelector.h (original)
+++ debtags-edit/1.2/src/TagSelector.h Wed Nov 1 02:26:53 2006
@@ -35,8 +35,6 @@
public:
typedef SigC::Signal0<void> type_signal_changed;
- typedef SigC::Signal1<void, DebtagsDocument::Tag> type_signal_add_tag;
- typedef SigC::Signal1<void, DebtagsDocument::Tag> type_signal_remove_tag;
protected:
class TagList : public TagsetList<DebtagsDocument>
@@ -65,15 +63,11 @@
Gtk::ScrolledWindow scrolledItemList;
type_signal_changed _signal_changed;
- type_signal_add_tag _signal_add_tag;
- type_signal_remove_tag _signal_remove_tag;
void updateView();
- bool on_facetAdd_event(GdkEvent* e, DebtagsDocument::Facet facet);
- bool on_tag_popup_event(GdkEvent* e, DebtagsDocument::Tag tag);
- void on_add_to_selection(DebtagsDocument::Tag tag);
- void on_del_from_selection(DebtagsDocument::Tag tag);
+ void on_add_to_selection(Tag tag);
+ void on_del_from_selection(Tag tag);
void on_document_changed();
@@ -85,13 +79,9 @@
virtual ~TagSelector() {}
type_signal_changed signal_changed() throw () { return _signal_changed; }
- type_signal_add_tag signal_add_tag() throw () { return _signal_add_tag; }
- type_signal_remove_tag signal_remove_tag() throw () { return _signal_remove_tag; }
std::set<Tag> currentTags() const { return _selected; }
virtual void do_changed();
- virtual void do_add_tag(DebtagsDocument::Tag tag);
- virtual void do_remove_tag(DebtagsDocument::Tag tag);
const std::set<DebtagsDocument::Tag>& selected() const throw () { return _selected; }
const std::set<DebtagsDocument::Tag>& selected(const std::set<DebtagsDocument::Tag>& tagset) throw ()
More information about the Debtags-commits
mailing list