From f4a99fc9a5bac76c6bfd10212a80d5ece3b41aac Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 21 Nov 2010 11:04:42 +0100 Subject: Implemented mark as seen Added new action to mark files as seen. Marked files have the foreground color red. For this the database connection is needed quite early, so I had to call SmGlobals::instance() in the constructor of SheMov without using it. --- shemov.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index 1b3aca3..8821a7b 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -50,6 +50,9 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla //application icon qApp->setWindowIcon(QIcon(":/shemov.png")); + //init database as early as possible + (void) SmGlobals::instance(); + //FileSystemWidget + TabWidget mFSWidget = new FilesystemWidget; setWindowTitle(mFSWidget->windowTitle()); @@ -336,6 +339,8 @@ void SheMov::createActions(){ mMountDvdA = new QAction(QIcon(":/diaper.png"), tr("(Un)mount DVD drive"), this); mMountDvdA->setCheckable(true); connect(mMountDvdA, SIGNAL(triggered()), mFSWidget, SLOT(dvdMount())); + mMarkA = new QAction(tr("Mark as (un)seen"), this); + connect(mMarkA, SIGNAL(triggered()), mFSWidget, SLOT(markSeen())); mConfigA = new QAction(QIcon(":/chastity_belt.png"), tr("Configure..."), this); connect(mConfigA, SIGNAL(triggered()), this, SLOT(configure())); @@ -481,6 +486,8 @@ void SheMov::createMenus(){ mEditFSMenu->addSeparator(); mEditFSMenu->addAction(mMountDvdA); mEditFSMenu->addSeparator(); + mEditFSMenu->addAction(mMarkA); + mEditFSMenu->addSeparator(); mEditFSMenu->addAction(mConfigA); mEditFSMenuA = menuBar()->addMenu(mEditFSMenu); @@ -527,6 +534,10 @@ void SheMov::createMenus(){ QAction *sep10 = new QAction(this); sep10->setSeparator(true); mFSWidget->fileView()->addAction(sep10); + mFSWidget->fileView()->addAction(mMarkA); + QAction *sep11 = new QAction(this); + sep11->setSeparator(true); + mFSWidget->fileView()->addAction(sep11); mFSWidget->fileView()->addAction(mArchiveSelectedA); //ArchiveTreeView context menu -- cgit v1.2.3-70-g09d2