Hi Miklos,

I finally found the time to take a look at your contribution and it looks great!

In order to have a nice git history, could you maybe squash your commits into one and push it into a new branch? You can do so by doing an "interactive rebase", "git rebase -i b2fbaaf907f7227810fe <https://github.com/espakm/MITK-ProjectTemplate/commit/b2fbaaf907f7227810fec425e234b1cfbab55429>" in your branch. I could do it for you, but this would create a new commit where your authorship information would be lost.

Could you maybe also include the following small changes?

- Move all files from src/ to src/internal in the my.awesomeproject.examplapp plug-in and remove the class export directives. - Set the default build option of my.awesomeproject.exampleapp in Plugins.cmake to OFF and adapt the comment in AwesomeApp.cpp. I think it would maybe be better to provide users with a "simple" template first.

Many thanks,
Sascha

On 08/26/2011 01:01 PM, Miklos Espak wrote:
I pushed the changes to my GitHub fork.

https://github.com/espakm/MITK-ProjectTemplate

If you look into the commits, you will see that I had a custom version
of the file menu actions as well, those I removed with the last commit
because probably it is not useful for others.

If you need them, just check out the last but one commit. I added only
one thing, the file save dialog opens the last directory used in the
file open dialog in default.

Best,
Miklos

On Fri, Aug 26, 2011 at 11:02 AM, Clarkson, Matt<[email protected]>  wrote:
Hi Sascha,
thanks. I went for the subclassing option. So, I
subclassed QmitkExtWorkbenchWindowAdvisor and wrote a PostWindowCreate
method to connect back to my own slot in that class, which meant my subclass
also extends QObject. It seems to trigger the method, so I think it should
be ok.
Thanks
Matt
PS. Also raised bug 9182.

QmitkMyAppWorkbenchWindowAdvisor::QmitkMyAppWorkbenchWindowAdvisor(
     berry::WorkbenchAdvisor* wbAdvisor,
     berry::IWorkbenchWindowConfigurer::Pointer configurer)
: QmitkExtWorkbenchWindowAdvisor(wbAdvisor, configurer)
{
}
void QmitkMyAppWorkbenchWindowAdvisor::PostWindowCreate()
{
   QmitkExtWorkbenchWindowAdvisor::PostWindowCreate();
   // All this to call our own About dialog box.
   // 1. Get hold of menu bar
   berry::IWorkbenchWindow::Pointer window =
    this->GetWindowConfigurer()->GetWindow();
   QMainWindow* mainWindow =
    static_cast<QMainWindow*>  (window->GetShell()->GetControl());
   QMenuBar* menuBar = mainWindow->menuBar();
   QList<QMenu *>  allMenus = menuBar->findChildren<QMenu *>();
   for (int i = 0; i<  allMenus.count(); i++)
   {
     QList<QAction*>  actionsForMenu =
allMenus.at(i)->findChildren<QAction*>();
     for (int j = 0; j<  actionsForMenu.count(); j++)
     {
       QAction *action = actionsForMenu.at(j);
       if (action != NULL&&  action->text() == "&About")
       {
         // 2. Disconnect existing slot
         action->disconnect();
         // 3. Reconnect slot to our method to call our About Dialog.
         QObject::connect(action, SIGNAL(triggered()), this,
SLOT(OnHelpAbout()));
       }
     }
   }
}
void QmitkMyAppWorkbenchWindowAdvisor::OnHelpAbout()
{
   std::cerr<<  "OnHelpAbout::Triggered()"<<  std::endl;
}

On 25 Aug 2011, at 19:48, Sascha Zelzer wrote:

Hi Matt,

Your are right that the QmitkExtWorkbenchWindowAdvisor contains a lot of
sub-optimal code due to the lack of a generic mechanism for plugins to
contribute menu items. However, even for a mid-term solution, I see only two
possibilities:

1.) Create your own QmitkExtWorkbenchWindowAdvisor, either by subclassing or
copying the code, as Miklos already suggested. You don't need a separate
plug-in, just put the code where your berry::IApplication implementation
lives.

2.) We could add a method in QmitkExtWorkbenchWindowAdvisor which would
allow you to inject a custom about dialog, or something similar. You would
then just use QmitkExtWorkbenchWindowAdvisor, similar as the
QmitkExtAppWorkbenchAdvisor class in org.mitk.gui.qt.extapplication does.

On 08/25/2011 06:07 PM, Clarkson, Matt wrote:


I also noticed that on a MAC, the About dialog box has no exit button, so I
have to kill the application to get rid of it.

Could you maybe enter a bug report?

Thanks,
Sascha



------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to