From 1608fb847e86518b656c2212f95b414439cc24e1 Mon Sep 17 00:00:00 2001 From: Victoria Date: Thu, 1 Feb 2024 16:18:11 +0100 Subject: [PATCH 1/4] [26141] added message dialog for outdated views --- .../src/ch/elexis/agenda/ui/AgendaParallel.java | 12 ++++++++++++ .../src/ch/elexis/agenda/ui/week/AgendaWeek.java | 13 +++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java index 19b4e7758d..d771156d69 100644 --- a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java +++ b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java @@ -21,6 +21,7 @@ import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.events.SelectionAdapter; @@ -28,6 +29,7 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; @@ -53,6 +55,7 @@ public class AgendaParallel extends BaseView { private ProportionalSheet sheet; private ColumnHeader header; private Composite wrapper; + private boolean isFirstTime = true; public AgendaParallel() { @@ -87,6 +90,12 @@ protected void create(Composite parent) { @Override public void setFocus() { + if (isFirstTime) { + MessageDialog.openInformation(Display.getDefault().getActiveShell(), "Ansicht veraltet", "Die Ansicht " + + getTitle() + + " ist veraltet und wird nicht mehr unterstützt. Bitte verwenden Sie die Agenda Web Ansicht."); + isFirstTime = false; + } sheet.setFocus(); } @@ -185,16 +194,19 @@ public void run() { setImageDescriptor(Activator.getImageDescriptor("icons/zoom.png")); //$NON-NLS-1$ setMenuCreator(new IMenuCreator() { + @Override public void dispose() { mine.dispose(); } + @Override public Menu getMenu(Control parent) { mine = new Menu(parent); fillMenu(); return mine; } + @Override public Menu getMenu(Menu parent) { mine = new Menu(parent); fillMenu(); diff --git a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/week/AgendaWeek.java b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/week/AgendaWeek.java index a051959b43..807e20398e 100644 --- a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/week/AgendaWeek.java +++ b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/week/AgendaWeek.java @@ -19,6 +19,7 @@ import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.events.SelectionAdapter; @@ -26,6 +27,7 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; @@ -45,7 +47,7 @@ public class AgendaWeek extends BaseView { private ProportionalSheet sheet; private ColumnHeader header; - + private boolean isFirstTime = true; public AgendaWeek() { } @@ -98,11 +100,18 @@ protected void refresh() { showCalendarAction.setText(sb.toString()); sheet.refresh(); - + } @Override public void setFocus() { + if (isFirstTime) { + MessageDialog.openInformation(Display.getDefault().getActiveShell(), (Messages.OUTDATED_VIEW), + (Messages.THE_VIEW) + + getTitle() + " " + + (Messages.OUTDATED_USE_OTHER_VIEW)); + isFirstTime = false; + } refresh(); } From 8c9aa421b199265ec6647c6641293a15a997b9e0 Mon Sep 17 00:00:00 2001 From: Victoria Date: Thu, 1 Feb 2024 16:20:32 +0100 Subject: [PATCH 2/4] [26141] added message dialog for outdated views --- .../ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java | 1 + .../src/ch/elexis/agenda/ui/week/AgendaWeek.java | 1 + 2 files changed, 2 insertions(+) diff --git a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java index d771156d69..0224186192 100644 --- a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java +++ b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java @@ -96,6 +96,7 @@ public void setFocus() { + " ist veraltet und wird nicht mehr unterstützt. Bitte verwenden Sie die Agenda Web Ansicht."); isFirstTime = false; } + sheet.setFocus(); } diff --git a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/week/AgendaWeek.java b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/week/AgendaWeek.java index 807e20398e..b60fa34fc0 100644 --- a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/week/AgendaWeek.java +++ b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/week/AgendaWeek.java @@ -112,6 +112,7 @@ public void setFocus() { + (Messages.OUTDATED_USE_OTHER_VIEW)); isFirstTime = false; } + refresh(); } From 8cf974b52e19d77b3455357202d3a281d3d67a50 Mon Sep 17 00:00:00 2001 From: Victoria Date: Thu, 1 Feb 2024 16:21:43 +0100 Subject: [PATCH 3/4] [26141] adjusted code --- .../ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java | 1 - .../src/ch/elexis/agenda/ui/week/AgendaWeek.java | 1 - 2 files changed, 2 deletions(-) diff --git a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java index 0224186192..d771156d69 100644 --- a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java +++ b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java @@ -96,7 +96,6 @@ public void setFocus() { + " ist veraltet und wird nicht mehr unterstützt. Bitte verwenden Sie die Agenda Web Ansicht."); isFirstTime = false; } - sheet.setFocus(); } diff --git a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/week/AgendaWeek.java b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/week/AgendaWeek.java index b60fa34fc0..807e20398e 100644 --- a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/week/AgendaWeek.java +++ b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/week/AgendaWeek.java @@ -112,7 +112,6 @@ public void setFocus() { + (Messages.OUTDATED_USE_OTHER_VIEW)); isFirstTime = false; } - refresh(); } From 33b1c8f76073f61e18c74750163e134112330ebc Mon Sep 17 00:00:00 2001 From: Victoria Date: Thu, 1 Feb 2024 16:22:55 +0100 Subject: [PATCH 4/4] [26141] adjusted code --- .../src/ch/elexis/agenda/ui/AgendaParallel.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java index d771156d69..e4a63c50c6 100644 --- a/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java +++ b/bundles/ch.elexis.agenda/src/ch/elexis/agenda/ui/AgendaParallel.java @@ -194,19 +194,16 @@ public void run() { setImageDescriptor(Activator.getImageDescriptor("icons/zoom.png")); //$NON-NLS-1$ setMenuCreator(new IMenuCreator() { - @Override public void dispose() { mine.dispose(); } - @Override public Menu getMenu(Control parent) { mine = new Menu(parent); fillMenu(); return mine; } - @Override public Menu getMenu(Menu parent) { mine = new Menu(parent); fillMenu();