1.0.6 candidate
[qtmeetings] / src / UserInterface / WindowManager.cpp
index af006f1..aa90587 100644 (file)
@@ -2,17 +2,26 @@
 
 #include <QEvent>
 #include <QDialog>
+#include <QMenuBar>
 #include "ViewBase.h"
 #include "PopUpMessageBox.h"
 
 #include <QtDebug>
 
 WindowManager::WindowManager( QWidget *aParent ) :
-               QWidget( aParent ),
+       QMainWindow( aParent ),
                iApplicationName( tr( "Qt Meetings" ) ),
                iCurrentView( 0 )
 {
        this->setWindowTitle( iApplicationName );
+        settingsAction = new QAction(tr("&Settings"), this);
+        closeAction = new QAction(tr("&Close"), this);
+        connect(settingsAction, SIGNAL(triggered()), this, SIGNAL(showSettingsClicked()));
+        connect(closeAction, SIGNAL(triggered()), this, SIGNAL(closeClicked()));
+     editMenu = menuBar()->addMenu(tr("&Edit"));
+     editMenu->addAction(settingsAction);
+        menuBar()->addMenu(editMenu);
+        menuBar()->addAction(closeAction);
 }
 
 WindowManager::~WindowManager()
@@ -44,8 +53,12 @@ void WindowManager::showView( ViewBase *view )
        iCurrentView = view;
        connect( iCurrentView, SIGNAL( eventDetected() ), this, SLOT( viewEventDetected() ) );
        connect( this, SIGNAL( viewResized(const QSize &, const QSize &) ), iCurrentView, SLOT( viewResized( const QSize &, const QSize & ) ) );
-       view->resize( this->size() );
-       
+       if (((QWidget*)view) != this)
+       {
+               this->adjustSize();
+       }
+       view->resize(this->size());
+       //view->adjustSize();
        view->show();
        
        // Disconnect old connections and hide the view