Core: Refactor handling of "window state" actions out of MainWindow

Currently the actions for fullscreen, minimize and zoom only apply to
the main window, even if a different window is active.
Refactor the handling of these actions into a WindowSupport class, and
use that instead for the main window. In a second step, this will be
used to add the functionality to the corresponding external windows
(e.g. help and editor windows)

Change-Id: Ief2c880f40948c3bb724196d6e0cfe888b8ece89
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Eike Ziller
2014-07-17 17:04:02 +02:00
parent 60d7b23d88
commit fe5b3a39e8
7 changed files with 222 additions and 56 deletions

View File

@@ -28,6 +28,7 @@
****************************************************************************/
#include "icore.h"
#include "windowsupport.h"
#include <app/app_version.h>
#include <extensionsystem/pluginmanager.h>
@@ -523,6 +524,11 @@ void ICore::removeContextObject(IContext *context)
m_mainwindow->removeContextObject(context);
}
void ICore::registerWindow(QWidget *window, const Context &context)
{
new WindowSupport(window, context); // deletes itself when widget is destroyed
}
void ICore::openFiles(const QStringList &arguments, ICore::OpenFilesFlags flags)
{
m_mainwindow->openFiles(arguments, flags);