New upstream 1.3.0 release.

parent 3f0aaeb3
COPYRIGHT
Pere Constans (C) 2004-2008. All rights reserved.
The cb2Bib. Copyright (C) 2004-2009 by Pere Constans
The cb2Bib includes third party GPL and LGPL code that is copyrighted by others:
- Class clipboardPoll is based on work by Lubos Lunak, 2003
- Function citeToLyXPipe is adapted from work by Robby Stephenson, 2005
- Function updateUserTimestamp from KDE libraries, by Matthias K. Dalheimer, 1997
- Class EQRegExp is based on work by Trolltech ASA, 2008
- Class QtSingleApplication by Nokia Corporation, 2009
- Icons come from the Oxygen, Crystal SVG, and Noia icon sets, published by the
KDE Desktop Environment.
[Desktop Entry]
Comment=Bibliographic Reference Citation Tool
Comment[ca]=Eina bibliogràfica per escriure citacions
Exec=cb2bib --citer %F
GenericName=Reference Citation Tool
GenericName[ca]=Eina per citacions bibliogràfiques
Icon=cb2bib
MimeType=text/x-bibtex;
Name=c2bCiter
Path=/usr/bin
StartupNotify=false
Terminal=false
Categories=Office;
Type=Application
[Desktop Entry]
Comment=Donwload Reference to cb2Bib
Comment[ca]=Exporta referències a cb2Bib
Exec=dl_cb2bib %F
Comment=Donwload reference to cb2Bib
Comment[ca]=Exporta referències al cb2Bib
Exec=cb2bib --import %f
GenericName=Reference Extracting Tool
GenericName[ca]=Eina per extreure referències
Icon=cb2bib
MimeType=text/x-bibtex;application/x-download;application/bibtex;
Name=cb2Bib
Name=c2bImport
Path=/usr/bin
NoDisplay=true
NoDisplay=false
StartupNotify=false
Terminal=false
Categories=Office;
......
......@@ -2,36 +2,87 @@
#-------------------------------------------------------------------------------
# bib2pdf -- Script to convert BibTeX files to PDF
# cb2Bib Tools
# Copyright (C) 2005-2008 by Pere Constans
#
# Copyright (C) 2005-2009 by Pere Constans
# constans@molspaces.com
# Improvements and modifications:
# Copyright (C) 2009 by Filippo Rusconi
# rusconi@mnhn.fr
# See LICENSE file that comes with this distribution
#
# Usage: bib2pdf input.bib output.bib
# Usage: bib2pdf input_bib output_pdf
#-------------------------------------------------------------------------------
# Init variables (Modify accordingly)
tmp_dir=/tmp/bib2pdf
latex=/usr/bin/latex
latex_flags="-interaction=nonstopmode"
bibtex=/usr/bin/bibtex
dvi2pdf=/usr/bin/dvipdfm
#-------------------------------------------------------------------------------
# Init variables
#-------------------------------------------------------------------------------
# Modify accordingly, by choosing either pdflatex or latex+dvipdfm
#latexCmd=pdflatex
latexCmd=latex ; dvi2pdfCmd=dvipdfm
bibtexCmd=bibtex
#-------------------------------------------------------------------------------
# Immediately check that the needed programs are there:
${latexCmd} --version > /dev/null 2>&1
if [ "$?" != "0" ]
then
echo "Program ${latexCmd} (LaTeX software) is required."
echo "Ending processing."
exit 1
fi
${bibtexCmd} --version > /dev/null 2>&1
if [ "$?" != "0" ]
then
echo "Program ${bibtexCmd} (BibTeX software) is required."
echo "Ending processing."
exit 1
fi
# Special case with dvi2pdf:
if [ "x${dvi2pdfCmd}" != "x" ]
then
${dvi2pdfCmd} --version | head -n2 | grep dvipdfm > /dev/null 2>&1
if [ "$?" != "0" ]
then
echo "Program ${dvi2pdfCmd} (LaTeX software) is required."
echo "Ending processing."
exit 1
fi
fi
# Make sure we trap errors (we put that after the tests above because
# we need the tests to fail, in case, without exiting immediately).
set -e
# Getting filenames from command line
echo "cb2Bib Tools: Script to convert BibTeX to PDF"
if test "$#" != 2; then
cat <<EOF
Usage: $0 file_name.bib file_name.pdf
Usage: $0 input_bib output_pdf
EOF
exit 2
fi
# Init some other variables (Modify accordingly) and create temporary
# directory.
latex_flags="-interaction=nonstopmode"
# Note that we use the mktemp utility that ensures that
# we do not overwrite any preexisting directory
tmp_dir=$(mktemp -d -p /tmp c2b_tools_tmp.XXXXXXXX)
# Setting files
bib=$1
pdf=$2
work_dir=$PWD
rm -rf $tmp_dir
mkdir $tmp_dir
cat > $tmp_dir/c2b_tmp.tex <<EOF
\documentclass[a4paper,10pt]{article}
%\documentclass[letterpaper,10pt]{article}
......@@ -57,11 +108,19 @@ cp "$bib" $tmp_dir/c2b_tmp.bib
# LaTeX procedure (Modify accordingly)
cd $tmp_dir
$latex $latex_flags c2b_tmp >& /dev/null
$bibtex c2b_tmp
$latex $latex_flags c2b_tmp >& /dev/null
$latex $latex_flags c2b_tmp
$dvi2pdf c2b_tmp >& /dev/null
# There might be bibliography errors, do not stop.
set +e
${latexCmd} $latex_flags c2b_tmp >& /dev/null
${bibtexCmd} c2b_tmp
${latexCmd} $latex_flags c2b_tmp >& /dev/null
${latexCmd} $latex_flags c2b_tmp
if [ "x${dvi2pdfCmd}" != "x" ]
then
${dvi2pdfCmd} c2b_tmp >& /dev/null
fi
# Make sure we trap errors.
set -e
# Clean up
cd $work_dir
......
#!/bin/sh
#-------------------------------------------------------------------------------
# c2bciter -- Wrapper for calling cb2Bib Citer
# cb2Bib Tools
# Copyright (C) 2004-2009 by Pere Constans
# constans@molspaces.com
# See the LICENSE file that comes with this distribution
#
# Usage: c2bciter [BibTeX file or directory]
#-------------------------------------------------------------------------------
cb2bib --citer $1
#!/bin/sh
#-------------------------------------------------------------------------------
# dl_cb2bib -- Script for calling cb2Bib in "Download Reference to cb2Bib" mode
# c2bimport -- Script for calling cb2Bib in "Download Reference to cb2Bib" mode
# cb2Bib Tools
# Copyright (C) 2004-2008 by Pere Constans
# Copyright (C) 2004-2009 by Pere Constans
# constans@molspaces.com
# See the LICENSE file that comes with this distribution
#
# Usage: dl_cb2bib tmp_imported_reference_file
# Usage: c2bimport tmp_imported_reference_file
#-------------------------------------------------------------------------------
if test "$#" != 1; then
......@@ -17,4 +17,4 @@ EOF
exit 2
fi
cb2bib $1
cb2bib --import $1
......@@ -2,21 +2,56 @@
#-------------------------------------------------------------------------------
# isi2bib -- Script to convert ISI format to BibTeX
# cb2Bib Tools
# Copyright (C) 2004-2008 by Pere Constans
#
# Copyright (C) 2005-2009 by Pere Constans
# constans@molspaces.com
# Improvements and modifications:
# Copyright (C) 2009 by Filippo Rusconi
# rusconi@mnhn.fr
# See LICENSE file that comes with this distribution
#
# Usage: isi2bib input.isi output.bib
#
# Using bib2xml and xml2end utilities from:
# Usage: isi2bib input_isi output_bib
#-------------------------------------------------------------------------------
# Using isi2xml and xml2bib utilities from:
# http://www.scripps.edu/~cdputnam/software/bibutils/bibutils.html
#-------------------------------------------------------------------------------
# Init variables (Modify accordingly)
tmp_dir=/tmp/cb2bib.tmp
bibutils_bin_dir=/usr/local/bin
#-------------------------------------------------------------------------------
# Init variables
#-------------------------------------------------------------------------------
# Modify accordingly
#isi2xml=/usr/local/bin/isi2xml
#xml2bib=/usr/local/bin/xml2bib
isi2xml=isi2xml
xml2bib=xml2bib
isi2xml_flags="-u"
xml2bib_flags="-sd -b"
#-------------------------------------------------------------------------------
# Immediately check that the needed programs are there:
$isi2xml --version > /dev/null 2>&1
if [ "$?" != "0" ]
then
echo "Program ris2xml (suite bibutils) is required."
echo "Set it in your path, and/or modify $0 accordingly."
echo "Ending processing."
exit 1
fi
$xml2bib --version > /dev/null 2>&1
if [ "$?" != "0" ]
then
echo "Program xml2bib (suite bibutils) is required."
echo "Set it in your path, and/or modify $0 accordingly."
echo "Ending processing."
exit 1
fi
# Make sure we trap errors (we put that after the tests above because
# we need the tests to fail, in case, without exiting immediately).
set -e
# Getting filenames from command line
echo "cb2Bib Tools: Script to convert ISI format to BibTeX"
......@@ -25,27 +60,30 @@ echo "It uses external package bibutils from"
echo "http://www.scripps.edu/~cdputnam/software/bibutils/bibutils.html"
echo ""
if test "$#" != 2; then
cat <<EOF
Usage: $0 file_name.isi file_name.bib
cat <<EOF
Usage: $0 input_isi output_bib
EOF
exit 2
exit 2
fi
# Create temporary directory
# Note that we use the mktemp utility that ensures that
# we do not overwrite any preexisting directory
tmp_dir=$(mktemp -d -p /tmp c2b_tools_tmp.XXXXXXXX)
# Setting files
isi=$1
bib=$2
work_dir=$PWD
# Preparing temporary files
rm -rf $tmp_dir
mkdir $tmp_dir
cp "$isi" $tmp_dir/c2b_tmp.isi
cp "$isi" $tmp_dir/c2b_tmp.bib
# bibutils procedure
cd $tmp_dir
$bibutils_bin_dir/isi2xml $isi2xml_flags c2b_tmp.isi > c2b_tmp.xml
$bibutils_bin_dir/xml2bib $xml2bib_flags c2b_tmp.xml | sed 's%^ISSUE=%NUMBER=%g' > c2b_tmp.bib
$isi2xml $isi2xml_flags c2b_tmp.isi > c2b_tmp.xml
$xml2bib $xml2bib_flags c2b_tmp.xml | sed 's%^ISSUE=%NUMBER=%g' > c2b_tmp.bib
# Clean up
cd $work_dir
......
#!/bin/sh
#-------------------------------------------------------------------------------
# med2bib -- Script to convert PUBMED format to BibTeX
# cb2Bib Tools
#
# Copyright (C) 2009 by Filippo Rusconi
# rusconi@mnhn.fr
# Based on previous work by
# Pere Constans
# constans@molspaces.com
# See LICENSE file that comes with this distribution
#
# Usage: med2bib input_med output_bib
#-------------------------------------------------------------------------------
# Using med2xml and xml2bib utilities from:
# http://www.scripps.edu/~cdputnam/software/bibutils/bibutils.html
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Init variables
#-------------------------------------------------------------------------------
# Modify accordingly
#med2xml=/usr/local/bin/med2xml
#xml2bib=/usr/local/bin/xml2bib
med2xml=med2xml
xml2bib=xml2bib
med2xml_flags="-u"
xml2bib_flags="-sd -b"
#-------------------------------------------------------------------------------
# Immediately check that the needed programs are there:
$med2xml --version > /dev/null 2>&1
if [ "$?" != "0" ]
then
echo "Program med2xml (suite bibutils) is required."
echo "Set it in your path, and/or modify $0 accordingly."
echo "Ending processing."
exit 1
fi
$xml2bib --version > /dev/null 2>&1
if [ "$?" != "0" ]
then
echo "Program xml2bib (suite bibutils) is required."
echo "Set it in your path, and/or modify $0 accordingly."
echo "Ending processing."
exit 1
fi
# Make sure we trap errors (we put that after the tests above because
# we need the tests to fail, in case, without exiting immediately).
set -e
# Getting filenames from command line
echo "cb2Bib Tools: Script to convert PUBMED-XML format to BibTeX"
echo ""
echo "It uses external package bibutils from"
echo "http://www.scripps.edu/~cdputnam/software/bibutils/bibutils.html"
echo ""
if test "$#" != 2; then
cat <<EOF
Usage: $0 input_med output_bib
EOF
exit 2
fi
# Create temporary directory
# Note that we use the mktemp utility that ensures that
# we do not overwrite any preexisting directory
tmp_dir=$(mktemp -d -p /tmp c2b_tools_tmp.XXXXXXXX)
# Setting files
med=$1
bib=$2
work_dir=$PWD
# Preparing temporary files
cp "$med" $tmp_dir/c2b_tmp.med
cp "$med" $tmp_dir/c2b_tmp.bib
# bibutils procedure
cd $tmp_dir
$med2xml $med2xml_flags c2b_tmp.med > c2b_tmp.xml
$xml2bib $xml2bib_flags c2b_tmp.xml | sed 's%^ISSUE=%NUMBER=%g' > c2b_tmp.bib
# Clean up
cd $work_dir
cp $tmp_dir/c2b_tmp.bib "$bib"
rm -rf $tmp_dir
echo ""
echo "$0 ended."
......@@ -2,21 +2,56 @@
#-------------------------------------------------------------------------------
# ris2bib -- Script to convert RIS format to BibTeX
# cb2Bib Tools
# Copyright (C) 2004-2008 by Pere Constans
#
# Copyright (C) 2005-2009 by Pere Constans
# constans@molspaces.com
# Improvements and modifications:
# Copyright (C) 2009 by Filippo Rusconi
# rusconi@mnhn.fr
# See LICENSE file that comes with this distribution
#
# Usage: ris2bib input.ris output.bib
#
# Using bib2xml and xml2end utilities from:
# Usage: ris2bib input_ris output_bib
#-------------------------------------------------------------------------------
# Using ris2xml and xml2bib utilities from:
# http://www.scripps.edu/~cdputnam/software/bibutils/bibutils.html
#-------------------------------------------------------------------------------
# Init variables (Modify accordingly)
tmp_dir=/tmp/cb2bib.tmp
bibutils_bin_dir=/usr/local/bin
#-------------------------------------------------------------------------------
# Init variables
#-------------------------------------------------------------------------------
# Modify accordingly
#ris2xml=/usr/local/bin/ris2xml
#xml2bib=/usr/local/bin/xml2bib
ris2xml=ris2xml
xml2bib=xml2bib
ris2xml_flags="-u"
xml2bib_flags="-sd -b"
#-------------------------------------------------------------------------------
# Immediately check that the needed programs are there:
$ris2xml --version > /dev/null 2>&1
if [ "$?" != "0" ]
then
echo "Program ris2xml (suite bibutils) is required."
echo "Set it in your path, and/or modify $0 accordingly."
echo "Ending processing."
exit 1
fi
$xml2bib --version > /dev/null 2>&1
if [ "$?" != "0" ]
then
echo "Program xml2bib (suite bibutils) is required."
echo "Set it in your path, and/or modify $0 accordingly."
echo "Ending processing."
exit 1
fi
# Make sure we trap errors (we put that after the tests above because
# we need the tests to fail, in case, without exiting immediately).
set -e
# Getting filenames from command line
echo "cb2Bib Tools: Script to convert RIS format to BibTeX"
......@@ -25,27 +60,30 @@ echo "It uses external package bibutils from"
echo "http://www.scripps.edu/~cdputnam/software/bibutils/bibutils.html"
echo ""
if test "$#" != 2; then
cat <<EOF
Usage: $0 file_name.ris file_name.bib
cat <<EOF
Usage: $0 input_ris output_bib
EOF
exit 2
exit 2
fi
# Create temporary directory
# Note that we use the mktemp utility that ensures that
# we do not overwrite any preexisting directory
tmp_dir=$(mktemp -d -p /tmp c2b_tools_tmp.XXXXXXXX)
# Setting files
ris=$1
bib=$2
work_dir=$PWD
# Preparing temporary files
rm -rf $tmp_dir
mkdir $tmp_dir
cp "$ris" $tmp_dir/c2b_tmp.ris
cp "$ris" $tmp_dir/c2b_tmp.bib
# bibutils procedure
cd $tmp_dir
$bibutils_bin_dir/ris2xml $ris2xml_flags c2b_tmp.ris > c2b_tmp.xml
$bibutils_bin_dir/xml2bib $xml2bib_flags c2b_tmp.xml | sed 's%^ISSUE=%NUMBER=%g' > c2b_tmp.bib
$ris2xml $ris2xml_flags c2b_tmp.ris > c2b_tmp.xml
$xml2bib $xml2bib_flags c2b_tmp.xml | sed 's%^ISSUE=%NUMBER=%g' > c2b_tmp.bib
# Clean up
cd $work_dir
......
SUBDIRS += src/c2b/c2blib.pro src
win32 {
SUBDIRS += src/win
}
TEMPLATE = subdirs
CONFIG += warn_on qt thread
......@@ -303,9 +303,16 @@ fi
sed 's%^const QString C2B_DATA_DIR .*$%const QString C2B_DATA_DIR = "'$f_datadir'/";%g' src/c2b/cb2bib_parameters.h > tmp.par
mv -f tmp.par src/c2b/cb2bib_parameters.h
if test "$f_kfmclient" != NO; then
sed 's%BIN = "kfmclient"%BIN = "'$f_kfmclient'"%g' src/c2b/cb2bib_parameters.h > tmp.par
sed 's%C2B_FM_CLIENT_COPY_BIN = "kfmclient".*$%C2B_FM_CLIENT_COPY_BIN = "'$f_kfmclient'";%g' src/c2b/cb2bib_parameters.h > tmp.par
else
sed 's%BIN = "kfmclient"%BIN = "kfmclient"%g' src/c2b/cb2bib_parameters.h > tmp.par
sed 's%C2B_FM_CLIENT_COPY_BIN = "kfmclient".*$%C2B_FM_CLIENT_COPY_BIN = "kfmclient";%g' src/c2b/cb2bib_parameters.h > tmp.par
fi
mv -f tmp.par src/c2b/cb2bib_parameters.h
if test "$f_kfmclient" != NO; then
sed 's%C2B_FM_CLIENT_MOVE_BIN = "kfmclient".*$%C2B_FM_CLIENT_MOVE_BIN = "'$f_kfmclient'";%g' src/c2b/cb2bib_parameters.h > tmp.par
else
sed 's%C2B_FM_CLIENT_MOVE_BIN = "kfmclient".*$%C2B_FM_CLIENT_MOVE_BIN = "kfmclient";%g' src/c2b/cb2bib_parameters.h > tmp.par
fi
mv -f tmp.par src/c2b/cb2bib_parameters.h
if test "$f_pdftotext" != NO; then
......@@ -315,9 +322,9 @@ else
fi
mv -f tmp.par src/c2b/cb2bib_parameters.h
if test "$f_exiftool" != NO; then
sed 's%C2B_METAPREPARSER_EXIFTOOL_BIN = "exiftool".*$%C2B_METAPREPARSER_EXIFTOOL_BIN = "'$f_exiftool'";%g' src/c2b/cb2bib_parameters.h > tmp.par
sed 's%C2B_METADATAPARSER_EXIFTOOL_BIN = "exiftool".*$%C2B_METADATAPARSER_EXIFTOOL_BIN = "'$f_exiftool'";%g' src/c2b/cb2bib_parameters.h > tmp.par
else
sed 's%C2B_METAPREPARSER_EXIFTOOL_BIN = "exiftool".*$%C2B_METAPREPARSER_EXIFTOOL_BIN = "exiftool";%g' src/c2b/cb2bib_parameters.h > tmp.par
sed 's%C2B_METADATAPARSER_EXIFTOOL_BIN = "exiftool".*$%C2B_METADATAPARSER_EXIFTOOL_BIN = "exiftool";%g' src/c2b/cb2bib_parameters.h > tmp.par
fi
mv -f tmp.par src/c2b/cb2bib_parameters.h
......
......@@ -184,7 +184,7 @@ BG|Biochem. Genet.|Biochemical Genetics
BH|Biotech. Histochem.|Biotechnic and Histochemistry
BHC|Bull. Hist. Chem.|Bulletin for the History of Chemistry
BJ|Biochem. J|Biochemical Journal
BJ|Biophys. J .|Biophysical Journal
BJ|Biophys. J.|Biophysical Journal
BJ|Biorem. J.|Bioremediation Journal
BJP|Br. J. Pharmacol.|British Jornal of Pharmacology
BK|Bioorg. Khim|Bioorganicheskaya Khimiya (Russian Journal of Bioorganic Chemistry)
......@@ -1008,7 +1008,7 @@ MTOM|Metalloved. Term. Obrab. Met.|Metallovedenie i Termicheskaya Obrabotka Meta
MTS|Macromol. Theory Simul.|Macromolecular Theory and Simulations
MWE|Mine Water Environ.|Mine Water and the Environment
MW|Materialwiss. Werkstofftech.|Materialwissenschaft und Werkstofftechnik
NAR|Nucl. Acids Res.|Nucleic Acids Research
NAR|Nucleic Acids Res.|Nucleic Acids Research
NATOASISSA|NATO ASI Ser., Ser. A|NATO ASI Series, Series A Life Sciences
NATOASISSB|NATO ASI Ser., Ser. B|NATO ASI Series, Series B Physics
NATOASISSC|NATO ASI Ser., Ser. C|NATO ASI Series, Series C Mathematical and Physical Sciences
......
......@@ -201,6 +201,18 @@ pdfurl_prefix=
pdfurl_sufix=
action=
# QUERY INFO FOR PubMed
# Exemple using HTML to text conversion
# Requests XML PubMed, use med2bib to convert
#journal=
#query=http://www.ncbi.nlm.nih.gov/sites/entrez?orig_db=PubMed&db=PubMed&cmd=Search&term=<<doi>>[doi]
#capture_from_query=\bPMID: (\d+)\D
#referenceurl_prefix=http://www.ncbi.nlm.nih.gov/pubmed/
#referenceurl_sufix=?report=xml&format=text
#pdfurl_prefix=
#pdfurl_sufix=
#action=htm2txt_referenceurl
# QUERY INFO FOR PROLA
# Extracts BibTeX reference
journal=
......
/***************************************************************************
* Copyright (C) 2004-2009 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.2.3. Licensed under the GNU GPL version 3.
* cb2Bib version 1.3.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#include "bookmarkPlugin.h"
......@@ -18,8 +18,8 @@ bookmarkPlugin::bookmarkPlugin(QWidget* parentw) : QMenu(parentw)
setObjectName(QString::fromUtf8("menuBookmarks"));
setTitle(QApplication::translate("c2bEditor", "&Bookmarks", 0, QApplication::UnicodeUTF8));
connect(c2bSettingsP, SIGNAL(newSettings()), this, SLOT(init()));
fsw = new QFileSystemWatcher(this);
connect(fsw, SIGNAL(fileChanged(const QString&)), this, SLOT(parseBookmarks()));
_fsw = new QFileSystemWatcher(this);
connect(_fsw, SIGNAL(fileChanged(const QString&)), this, SLOT(parseBookmarks()));
init();
}
......@@ -30,14 +30,14 @@ bookmarkPlugin::~bookmarkPlugin()
void bookmarkPlugin::init()
{
QString nfn = c2bSettingsP->fileName("cb2Bib/NetworkFile");
if (nfn == bookmark_file)
if (nfn == _bookmark_file)
return;
if (QFileInfo(nfn).exists())
{
if (!bookmark_file.isEmpty())
fsw->removePath(bookmark_file);
bookmark_file = nfn;
fsw->addPath(bookmark_file);
if (!_bookmark_file.isEmpty())
_fsw->removePath(_bookmark_file);
_bookmark_file = nfn;
_fsw->addPath(_bookmark_file);
}
parseBookmarks();
}
......@@ -45,7 +45,7 @@ void bookmarkPlugin::init()
void bookmarkPlugin::parseBookmarks()
{
clear();
const QString bmf = c2bUtils::fileToString(bookmark_file);
const QString bmf = c2bUtils::fileToString(_bookmark_file);
QStringList bookmarks = bmf.split("\n", QString::KeepEmptyParts);
const QRegExp _bookmark("^editorbookmark=");
const QRegExp _separator("^editorbookmark=\\s*$");
......
/***************************************************************************
* Copyright (C) 2004-2009 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.2.3. Licensed under the GNU GPL version 3.
* cb2Bib version 1.3.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#ifndef BOOKMARKPLUGIN_H
......@@ -28,8 +28,8 @@ signals:
private:
QFileSystemWatcher* fsw;
QString bookmark_file;
QFileSystemWatcher* _fsw;
QString _bookmark_file;
QString iconProvider(const QString& fn, const QString& iconFile);
......
/***************************************************************************
* Copyright (C) 2004-2009 by Pere Constans
* constans@molspaces.com
* cb2Bib version 1.2.3. Licensed under the GNU GPL version 3.
* cb2Bib version 1.3.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution.
***************************************************************************/
#include "c2b.h"
......@@ -55,7 +55,9 @@ c2b::c2b(QWidget* main, QObject* parento) : QObject(parento)
}
c2b::~c2b()
{}
{
c2b_single_instance = 0;
}
c2b* c2b::c2b_single_instance = 0;
......@@ -78,6 +80,29 @@ void c2b::configure(int index)
delete c;
}
void c2b::exitRequested()
{
foreach(QWidget* w, QApplication::topLevelWidgets())
{
// So far only editors grant user exit cancellation
// Avoid closing other visible widgets until exit is granted
if (w->isVisible())
if (w->inherits("c2bEditor"))
w->close();
}
qApp->processEvents();
foreach(QWidget* widget, QApplication::topLevelWidgets())
{