summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/checkbook/qcheckbook.cpp4
-rw-r--r--noncore/apps/checkbook/qcheckview.cpp0
2 files changed, 1 insertions, 3 deletions
diff --git a/noncore/apps/checkbook/qcheckbook.cpp b/noncore/apps/checkbook/qcheckbook.cpp
index 797127e..bb7a5ac 100644
--- a/noncore/apps/checkbook/qcheckbook.cpp
+++ b/noncore/apps/checkbook/qcheckbook.cpp
@@ -22,77 +22,75 @@ QCheckBook::QCheckBook()
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();
diff --git a/noncore/apps/checkbook/qcheckview.cpp b/noncore/apps/checkbook/qcheckview.cpp
index 6f103e2..ddc3fa9 100644
--- a/noncore/apps/checkbook/qcheckview.cpp
+++ b/noncore/apps/checkbook/qcheckview.cpp