From a7dc3fe0c963ef8f5f19c04c2806daeb91ba23c8 Mon Sep 17 00:00:00 2001 From: cniehaus Date: Sun, 15 Sep 2002 14:23:06 +0000 Subject: hehe --- (limited to 'noncore/apps/checkbook/qcheckbook.cpp') diff --git a/noncore/apps/checkbook/qcheckbook.cpp b/noncore/apps/checkbook/qcheckbook.cpp deleted file mode 100644 index bb7a5ac..0000000 --- a/noncore/apps/checkbook/qcheckbook.cpp +++ b/dev/null @@ -1,147 +0,0 @@ -#include "qcheckbook.h" - -#include -#include -#include -#include -#include -#include - -QCheckBook::QCheckBook() - : QMainWindow(), - m_view(), - m_view2(), - m_view3() -{ - initCheck = false; - initMM = false; - setCaption("Checking"); - statusBar()->hide(); - menuBar()->hide(); - - bar = new QToolBar(this); - bar->setHorizontalStretchable( TRUE ); - - addToolBar(bar); - - Config config("qcheckbook"); - config.setGroup("Global"); - QString lastCheck = config.readEntry("LastCheckBook", QString("")); - - QString checkdirname = QDir::homeDirPath(); - checkdirname.append("/.checkbooks/"); - checkdirname.append(lastCheck); - QFile f(checkdirname); - - - if (lastCheck.isEmpty() == false && lastCheck != "" && f.exists() == true) - { - newCheck(lastCheck); - } else { - initMainMenus(); - } - - setToolBarsMovable( FALSE ); -} - -void QCheckBook::newCheck(const QString &filename) -{ - if (filename.isEmpty() == false) - { - initCheck = true; - if (m_view != 0) - { - m_view=0; - delete m_view; - } - m_view = new QCheckView(this, filename); - m_view->hide(); - connect(m_view, SIGNAL(reload(const QString &)), this, SLOT(newCheck(const QString &))); - if (initMM == true) - { - delete nb1; - } - bar->clear(); - mbar = new QMenuBar(bar); - mbar->setMargin(0); - - QPixmap newIcon = Resource::loadPixmap( "new" ); - nb2 = new QToolButton( newIcon, "New", QString::null, m_view, SLOT(newClicked()), bar, "new item" ); - QPixmap pixmap = Resource::loadPixmap( "pixmap" ); - m_filename = filename; - nb3 = new QToolButton( pixmap, "Graph", QString::null, this, SLOT(newGraph()), bar, "new graph" ); - - QPixmap closeIcon = Resource::loadPixmap( "close" ); - nb4 = new QToolButton( closeIcon, "Close", QString::null, this, SLOT(initMainMenus()), bar, "close graph" ); - - popup = new QPopupMenu(m_view); - popup->insertItem("&New Entry", m_view, SLOT(newClicked())); - popup->insertItem("&Graph Checkbook", this, SLOT(newGraph())); - popup->insertItem("&Close Checkbook", this, SLOT(initMainMenus())); - popup->insertItem("&Exit", this, SLOT(close())); - mbar->insertItem("&File", popup); - - setCentralWidget(m_view); - m_view->show(); - - Config config("qcheckbook"); - config.setGroup("Global"); - config.writeEntry("LastCheckBook", filename); - initMM = false; - } -} - -void QCheckBook::close() -{ - QApplication::exit(); -} - -void QCheckBook::newGraph() -{ - if (m_filename.isEmpty() == false) - { - m_view2 = new QCheckGraph(m_filename); - m_view2->showMaximized(); - } -} - -void QCheckBook::initMainMenus() -{ - Config config("qcheckbook"); - config.setGroup("Global"); - config.writeEntry("LastCheckBook", QString("")); - initMM = true; - m_filename = ""; - if (m_view3 != 0) - { - delete m_view3; - } - m_view3 = new QCheckMainMenu(this); - m_view3->hide(); - - if (initCheck == true) - { - delete nb2; - delete nb3; - delete nb4; - } - - bar->clear(); - - mbar = new QMenuBar(bar); - mbar->setMargin(0); - - QPixmap newIcon = Resource::loadPixmap( "new" ); - nb1 = new QToolButton( newIcon, "New", QString::null, m_view3, SLOT(newClicked()), bar, "new book" ); - - popup = new QPopupMenu(); - popup->insertItem("&New", m_view3, SLOT(newClicked())); - popup->insertItem("&Exit", this, SLOT(close())); - mbar->insertItem("&File", popup); - - setCentralWidget(m_view3); - m_view3->show(); - - connect(m_view3, SIGNAL(itemSelected(const QString &)), this, SLOT(newCheck(const QString &))); - initCheck = false; -} -- cgit v0.9.0.2