Logo Search packages:      
Sourcecode: valknut version File versions  Download package

DCGuiApp::DCGuiApp (  ) 

construtor

Definition at line 66 of file dcgui.cpp.

References fileToolbar, initActions(), initMenuBar(), initStatusBar(), initToolBar(), initTray(), initView(), m_ApplicationEvents, m_bTransferViewDockVisible, m_bWasMaximized, m_pTimer, pTransferViewDock, pWorkspace, SetTheme(), slotTimeout(), viewStatusBar, viewTabBar, viewToolBar, and windowsTabBar.

{
      StringMap * map;
      StringMap * tabBarMap;
      int width,height;
      bool b;

      g_pTransferView      = 0;
      g_pHubListManager    = 0;
      g_pConnectionManager = 0;
      g_pHubSearch         = 0;
      g_pSpy               = 0;
      g_pUsersList         = 0;

      setCaption( tr("Valknut " VERSION ) );

      // set default icon
      setIcon( g_pIconLoader->GetPixmap(eiICON_22x22) );

      SetTheme();

      ///////////////////////////////////////////////////////////////////
      // call inits to invoke all other construction parts
      initView();
      initActions();
      initMenuBar();
      initToolBar();
      initStatusBar();
      initTray();

      if ( g_pConfig->GetBackgroundPixmap() != "" )
      {
            QPixmap bp;
            if ( bp.load(g_pConfig->GetBackgroundPixmap().Data()) )
                  pWorkspace->setPaletteBackgroundPixmap(bp);
      }

      g_pConfig->GetAppGeometry( width, height );
      resize( width, height );

      b = TRUE;

      // init transferview
      if ( g_pConfig->GetMap("TRANSFERVIEW",map) == TRUE )
      {
            if ( (*map)["DOCKED"].toInt() == 0 )
            {
                  b = FALSE;
            }
      }

      if ( b )
      {
            pTransferViewDock->dock();

            if ( ((*map)["HEIGHT"].toInt() != 0) &&
                 ((*map)["WIDTH"].toInt() != 0) )
            {
                  pTransferViewDock->setFixedExtentHeight((*map)["HEIGHT"].toInt());
                  pTransferViewDock->setFixedExtentWidth((*map)["WIDTH"].toInt());
            }
            
            bool nl = TRUE;
            if ( (*map)["NL"] == "FALSE" )
            {
                  nl = FALSE;
            }
            moveDockWindow( pTransferViewDock, Qt::Dock((*map)["DOCK"].toInt()), nl, (*map)["INDEX"].toInt(), (*map)["EXTRAOFFSET"].toInt() );
      }
      else
      {
            pTransferViewDock->undock();

            if ( ((*map)["HEIGHT"].toInt() != 0) &&
                 ((*map)["WIDTH"].toInt() != 0) )
            {
                  pTransferViewDock->resize( (*map)["WIDTH"].toInt(), (*map)["HEIGHT"].toInt() );
            }
      }

      viewTabBar->setOn(true);
      viewToolBar->setOn(true);
      viewStatusBar->setOn(true);
      
      m_bWasMaximized = FALSE;

      // init main window
      if ( g_pConfig->GetMap("MAINVIEW",map) == TRUE )
      {
            if ( (*map)["MAXIMIZED"].toInt() == 1 )
            {
                  showMaximized();
                  m_bWasMaximized = TRUE;
            }
            else
            {
                  show();
                  m_bWasMaximized = FALSE;
            }

            if ( (*map)["DOCKED"].toInt() == 0 )
            {
                  fileToolbar->undock();
            }
            else
            {
                  fileToolbar->dock();

                  moveDockWindow( fileToolbar, Qt::Dock((*map)["DOCK"].toInt()) );
            }
      }

      if ( g_pConfig->GetTabBar() == FALSE )
            viewTabBar->toggle();
      if ( g_pConfig->GetToolBar() == FALSE )
            viewToolBar->toggle();
      if ( g_pConfig->GetStatusBar() == FALSE )
            viewStatusBar->toggle();
      if ( g_pConfig->GetShowTransferWin() == TRUE )
      {
            pTransferViewDock->show();
            m_bTransferViewDockVisible = TRUE;
      }
      else
      {
            pTransferViewDock->hide();
            pTransferViewDock->setEnabled(FALSE);
            m_bTransferViewDockVisible = FALSE;
      }

      // restore tabbar position and state
      if ( g_pConfig->GetMap("TABBAR",tabBarMap) == TRUE )
      {
            int x = (*tabBarMap)["X"].toInt();
            int y = (*tabBarMap)["Y"].toInt();
            int w = (*tabBarMap)["WIDTH"].toInt();
            int h = (*tabBarMap)["HEIGHT"].toInt();
            
            if ( (*tabBarMap)["DOCKED"].toInt() == 0 )
            {
                  windowsTabBar->undock();
                  
                  if ( (w != 0) && (h != 0) )
                  {
                        windowsTabBar->resize(w,h);
                  }
            
                  windowsTabBar->move(x,y);
            }
            else
            {
                  windowsTabBar->dock();
                  
                  bool nl = TRUE;
                  if ( (*tabBarMap)["NL"] == "FALSE" )
                  {
                        nl = FALSE;
                  }
                  
                  moveDockWindow( windowsTabBar, Qt::Dock((*tabBarMap)["DOCK"].toInt()), nl, (*tabBarMap)["INDEX"].toInt(), (*tabBarMap)["EXTRAOFFSET"].toInt() );
                  
                  /* if ( (w != 0) && (h != 0) )
                  {
                        windowsTabBar->setFixedExtentWidth(w);
                        windowsTabBar->setFixedExtentHeight(h);
                  } */
            }
      }

      g_pTranslator = new DCTranslator();

      // install event filter on qApp ;-)
      qApp->installEventFilter(&m_ApplicationEvents);

      // init timer
      m_pTimer = new QTimer();

      connect( m_pTimer, SIGNAL(timeout()), this, SLOT(slotTimeout()) );

      // start timer
      m_pTimer->start( 1000 );
}


Generated by  Doxygen 1.6.0   Back to index