[pdfmod] Add Invert Selection action (BGO #597761)
- From: Gabriel Burt <gburt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pdfmod] Add Invert Selection action (BGO #597761)
- Date: Thu, 8 Oct 2009 02:00:26 +0000 (UTC)
commit bb2ff310a02b102f619ae6b4a1bfd8effaa3337d
Author: Gabriel Burt <gabriel burt gmail com>
Date: Wed Oct 7 18:57:12 2009 -0700
Add Invert Selection action (BGO #597761)
src/PdfMod/Gui/Actions.cs | 8 +++++++-
src/PdfMod/Gui/DocumentIconView.cs | 4 ++++
src/Resources/UIManager.xml | 1 +
3 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/PdfMod/Gui/Actions.cs b/src/PdfMod/Gui/Actions.cs
index 01dda92..94e7b92 100644
--- a/src/PdfMod/Gui/Actions.cs
+++ b/src/PdfMod/Gui/Actions.cs
@@ -45,7 +45,7 @@ namespace PdfMod.Gui
static string [] require_doc_actions = new string[] {
"Save", "SaveAs", "Properties", "Undo", "Redo", "ZoomFit", "OpenInViewer",
- "SelectAll", "SelectEvens", "SelectOdds", "SelectMatching", "InsertFrom", "ExportImages"
+ "SelectAll", "SelectEvens", "SelectOdds", "SelectMatching", "SelectInverse", "InsertFrom", "ExportImages"
};
static string [] require_page_actions = new string[] {
@@ -79,6 +79,7 @@ namespace PdfMod.Gui
new ActionEntry ("SelectEvens", null, Catalog.GetString ("Select Even Pages"), null, null, OnSelectEvens),
new ActionEntry ("SelectOdds", null, Catalog.GetString ("Select Odd Pages"), null, null, OnSelectOdds),
new ActionEntry ("SelectMatching", null, Catalog.GetString ("Select Matching..."), "<control>F", null, OnSelectMatching),
+ new ActionEntry ("SelectInverse", null, Catalog.GetString ("_Invert Selection"), "<shift><control>I", null, OnSelectInverse),
new ActionEntry ("Undo", Stock.Undo, null, "<control>z", null, OnUndo),
new ActionEntry ("Redo", Stock.Redo, null, "<control>y", null, OnRedo),
@@ -511,6 +512,11 @@ namespace PdfMod.Gui
app.ToggleMatchQuery ();
}
+ void OnSelectInverse (object o, EventArgs args)
+ {
+ app.IconView.SetPageSelectionMode (PageSelectionMode.Inverse);
+ }
+
void OnZoomIn (object o, EventArgs args)
{
app.IconView.Zoom (10);
diff --git a/src/PdfMod/Gui/DocumentIconView.cs b/src/PdfMod/Gui/DocumentIconView.cs
index a805017..381ef36 100644
--- a/src/PdfMod/Gui/DocumentIconView.cs
+++ b/src/PdfMod/Gui/DocumentIconView.cs
@@ -35,6 +35,7 @@ namespace PdfMod.Gui
Evens,
Odds,
Matching,
+ Inverse,
All
}
@@ -542,6 +543,9 @@ namespace PdfMod.Gui
case PageSelectionMode.Matching:
select = matches.Contains (store.GetValue (iter, PageListStore.PageColumn) as Page);
break;
+ case PageSelectionMode.Inverse:
+ select = !PathIsSelected (path);
+ break;
}
if (select) {
diff --git a/src/Resources/UIManager.xml b/src/Resources/UIManager.xml
index b481b2b..a8c68dd 100644
--- a/src/Resources/UIManager.xml
+++ b/src/Resources/UIManager.xml
@@ -28,6 +28,7 @@
<menuitem action="SelectOdds"/>
<menuitem action="SelectEvens"/>
<menuitem action="SelectMatching"/>
+ <menuitem action="SelectInverse"/>
<separator/>
</menu>
<menu action="ViewMenu">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]