Logo Search packages:      
Sourcecode: tellico version File versions

MainWindow::MainWindow ( QWidget *  parent = 0,
const char *  name = 0 
)

The main window constructor, calls all init functions to create the application.

Definition at line 94 of file mainwindow.cpp.

References Tellico::Kernel::init(), Tellico::Controller::init(), initActions(), initDocument(), initStatusBar(), initView(), readOptions(), and slotInit().

                                                                      : KMainWindow(parent_, name_),
    m_config(kapp->config()),
    m_progress(0),
    m_configDlg(0),
    m_findDlg(0),
    m_filterDlg(0),
    m_collFieldsDlg(0),
    m_stringMacroDlg(0),
    m_fetchDlg(0),
    m_currentStep(1),
    m_maxSteps(2),
    m_queuedFilters(0),
    m_initialized(false),
    m_newDocument(true) {

  // a little bit of paranoia
  // I use KRun a lot and I don't want the user to be able to
  // accidently execute some destructive action
  {
    KConfigGroupSaver saver(m_config, "KDE Action Restrictions");
    m_config->writeEntry("shell_access", false);
    m_config->writeEntry("run_desktop_files", false);
    m_config->sync();
  }

  Controller::init(this, "controller"); // the only time this is ever called!
  // has to be after controller init
  Kernel::init(this, "kernel"); // the only time this is ever called!

  setIcon(KGlobal::iconLoader()->loadIcon(QString::fromLatin1("tellico"), KIcon::Desktop));

  // initialize the status bar and progress bar
  initStatusBar();

  // create a document, which also creates an empty book collection
  // must be done before the different widgets are created
  initDocument();

  // set up all the actions, some connect to the document, so this must be after initDocument()
  initActions();

  // create the different widgets in the view, some widgets connect to actions, so must be after initActions()
  initView();

  // The edit dialog is not created until after the main window is initialized, so it can be a child.
  // So don't make any connections, don't read options for it until initFileOpen

  readOptions();

  QTimer::singleShot(0, this, SLOT(slotInit()));
}


Generated by  Doxygen 1.6.0   Back to index