00001 #include <qlayout.h>
00002 #include <opie2/oresource.h>
00003 #include <qpe/qpeapplication.h>
00004
00005 #include "mainwindow.h"
00006 #include "linphoneconfig.h"
00007
00008 MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
00009 : QMainWindow( parent, name, flags ) {
00010
00011 setCaption( tr( "Sip Phone" ) );
00012 setToolBarsMovable( false );
00013
00014 toolBar = new QToolBar( this );
00015 toolBar->setHorizontalStretchable( true );
00016 menuBar = new QMenuBar( toolBar );
00017 prefMenu = new QPopupMenu( menuBar );
00018 menuBar->insertItem( tr( "Connection" ), prefMenu );
00019
00020 settings = new QAction( tr("Settings"), Opie::Core::OResource::loadPixmap("SettingsIcon", Opie::Core::OResource::SmallIcon) ), 0, 0, this);
00021 settings->addTo( prefMenu );
00022 connect( settings, SIGNAL( activated() ),
00023 SLOT( slotSettings() ) );
00024
00025 mainWidget = new QLinphoneMainWidget( this, "qlinphone", WStyle_ContextHelp );
00026 setCentralWidget( mainWidget );
00027 }
00028
00029
00030 MainWindow::~MainWindow() {}
00031
00032 void MainWindow::slotSettings() {
00033 LinPhoneConfig settings( this, 0, true, WStyle_ContextHelp );
00034 QPEApplication::execDialog( &settings );
00035
00036 mainWidget->createLinphoneCore();
00037 }