From 95bd97d4f5dc4d0ee91cfeeff89b88ff3d8f26df Mon Sep 17 00:00:00 2001 From: am Date: Wed, 15 Jul 2009 19:16:26 +0000 Subject: -finished calling extractor -QProcess doesn't work as promised in the docs, dunno how to do it yet, but we need a thread to keep the GUI responsive... -fixed some bugs with the extractionpaths git-svn-id: file:///var/svn/repos2/shemov/trunk@387 f440f766-f032-0410-8965-dc7d17de2ca0 --- shemov.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index 2ec0d7a..dfb16bd 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -71,6 +71,7 @@ void SheMov::setTemplate(const QString &newTemplate){ void SheMov::configure(){ ConfigurationDialog dlg(this); dlg.exec(); + createExtractMenu(); } void SheMov::createStatusbar(){ @@ -162,6 +163,7 @@ void SheMov::createActions(){ //Edit menu extract submenu mExtractMapper = new QSignalMapper(this); + connect(mExtractMapper, SIGNAL(mapped(const QString &)), mFSWidget, SLOT(extract(const QString &))); mExtractMenu = new QMenu(tr("E&xtract to..."), this); createExtractMenu(); } @@ -188,6 +190,8 @@ void SheMov::createMenus(){ renameMenu->addAction(mRenameCoverCA); editMenu->addMenu(renameMenu); editMenu->addSeparator(); + editMenu->addMenu(mExtractMenu); + editMenu->addSeparator(); editMenu->addAction(mRefreshA); editMenu->addSeparator(); editMenu->addAction(mConfigA); @@ -197,5 +201,22 @@ void SheMov::createMenus(){ } void SheMov::createExtractMenu(){ - + foreach(QAction *a, mExtractToA){ + mFSWidget->fileView()->removeAction(a); + delete a; + } + mExtractToA.clear(); + mExtractMenu->clear(); + QSettings s; + QStringList locations = s.value("paths/extractpaths").toStringList(); + foreach(QString p, locations){ + QAction *a = new QAction(p, this); + a->setData("ExtractMenu"); + mFSWidget->fileView()->addAction(a); + mExtractMenu->addAction(a); + mExtractMapper->setMapping(a, p); + connect(a, SIGNAL(triggered()), mExtractMapper, SLOT(map())); + mExtractToA << a; + } } + -- cgit v1.2.3-70-g09d2