diff -Nru dspdfviewer-1.8~oneiric1/CMakeLists.txt dspdfviewer-1.9~oneiric1/CMakeLists.txt --- dspdfviewer-1.8~oneiric1/CMakeLists.txt 2012-12-11 13:32:54.000000000 +0000 +++ dspdfviewer-1.9~oneiric1/CMakeLists.txt 2013-01-23 14:57:35.000000000 +0000 @@ -63,6 +63,38 @@ add_definitions(-DQT_NO_DEBUG_OUTPUT) endif() +if( NOT "${DSPDFVIEWER_VERSION}" MATCHES "^$" ) + # Not-Empty version given on the command line + message(STATUS "Using the version number ${DSPDFVIEWER_VERSION} specified on the command line.") +else() + # We dont have a version number given by the build system. + # Try to figure it out first by asking git (only works for in-tree source builds) + execute_process(COMMAND git describe + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_DESCRIBE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) + if( NOT "${GIT_DESCRIBE_VERSION}" MATCHES "^$" ) + message(STATUS "Using version number ${GIT_DESCRIBE_VERSION} as defined by git-describe.") + set(DSPDFVIEWER_VERSION ${GIT_DESCRIBE_VERSION}) + else() + # get the first changelog line (containing a version number in parentheses) into DEBIANVERSION + file(STRINGS debian/changelog DEBIANVERSION LIMIT_COUNT 1 REGEX "\\(([0-9.])*\\)") + # reduce the variable to only the first "version-number-ish" thing + string(REGEX MATCH "([0-9.])+" DEBIANVERSION ${DEBIANVERSION} ) + if ( NOT ${DEBIANVERSION} MATCHES "^$" ) + message(STATUS "Using version number ${DEBIANVERSION} as parsed from debian/changelog's first entry.") + set(DSPDFVIEWER_VERSION ${DEBIANVERSION}) + else() + # Try to infer the version number from the debian/changelog source file + message(WARNING "Could not determine the version number of the program. Please pass -DDSPDFVIEWER_VERSION=1.2.3.4.5 to the cmake command.") + endif() + endif() +endif() + +if( NOT "${DSPDFVIEWER_VERSION}" MATCHES "^$" ) + add_definitions(-DDSPDFVIEWER_VERSION="${DSPDFVIEWER_VERSION}") +endif() + + set(dspdfviewer_SRCS runtimeconfiguration.cpp renderutils.cpp renderthread.cpp renderingidentifier.cpp pagepart.cpp renderedpage.cpp pdfrenderfactory.cpp pdfviewerwindow.cpp dspdfviewer.cpp main.cpp) qt4_wrap_ui(dspdfviewer_UIS_H pdfviewerwindow.ui) include_directories(${CMAKE_CURRENT_BINARY_DIR}) @@ -72,3 +104,6 @@ install(TARGETS dspdfviewer RUNTIME DESTINATION bin) + +install(FILES docs/dspdfviewer.1 + DESTINATION share/man/man1) diff -Nru dspdfviewer-1.8~oneiric1/README.md dspdfviewer-1.9~oneiric1/README.md --- dspdfviewer-1.8~oneiric1/README.md 2012-12-11 13:32:54.000000000 +0000 +++ dspdfviewer-1.9~oneiric1/README.md 2013-01-23 14:57:35.000000000 +0000 @@ -78,5 +78,3 @@ 6. (install) make install (optional) - -Notes: CMake doesn't yet install the manpage. \ No newline at end of file diff -Nru dspdfviewer-1.8~oneiric1/debian/bzr-builder.manifest dspdfviewer-1.9~oneiric1/debian/bzr-builder.manifest --- dspdfviewer-1.8~oneiric1/debian/bzr-builder.manifest 2012-12-11 13:32:55.000000000 +0000 +++ dspdfviewer-1.9~oneiric1/debian/bzr-builder.manifest 2013-01-23 14:57:35.000000000 +0000 @@ -1,2 +1,2 @@ # bzr-builder format 0.3 deb-version {debupstream} -lp:dspdfviewer revid:git-v1:c2b19c864502cc72a6653ff67e2e39fd94a0d313 +lp:dspdfviewer revid:git-v1:54b62fa7cd28007df6baea3deb9af08d49432892 diff -Nru dspdfviewer-1.8~oneiric1/debian/changelog dspdfviewer-1.9~oneiric1/debian/changelog --- dspdfviewer-1.8~oneiric1/debian/changelog 2012-12-11 13:32:55.000000000 +0000 +++ dspdfviewer-1.9~oneiric1/debian/changelog 2013-01-23 14:57:35.000000000 +0000 @@ -1,8 +1,21 @@ -dspdfviewer (1.8~oneiric1) oneiric; urgency=low +dspdfviewer (1.9~oneiric1) oneiric; urgency=low * Auto build. - -- Danny Edel Tue, 11 Dec 2012 13:32:55 +0000 + -- Danny Edel Wed, 23 Jan 2013 14:57:35 +0000 + +dspdfviewer (1.9) testing; urgency=low + + * The software can print its own version number when called with --version + * The manpage is now installed by cmake + * README changed + * rewrote dependencies for compiling under ubuntu + * The "goto" dialog (G Button) now displays the range + * RuntimeConfigurations parse moved to constructor + * Simplified the "make window fullscreen" method, fixing it under openbox + * Removed unnecessary window flag manipulation + + -- Danny Edel Wed, 23 Jan 2013 12:36:10 +0100 dspdfviewer (1.8) testing; urgency=low diff -Nru dspdfviewer-1.8~oneiric1/debian/control dspdfviewer-1.9~oneiric1/debian/control --- dspdfviewer-1.8~oneiric1/debian/control 2012-12-11 13:32:54.000000000 +0000 +++ dspdfviewer-1.9~oneiric1/debian/control 2013-01-23 14:57:35.000000000 +0000 @@ -2,26 +2,39 @@ Section: text Priority: extra Maintainer: Danny Edel -Build-Depends: +Build-Depends: g++ (>= 4:4.6), + debhelper (>= 7.3.0), cmake, + libpoppler-qt4-dev, + libboost-program-options-dev, + hardening-wrapper, + lsb-release # The project needs a c++11 compiler. -# Its known to work with g++-4.6 +# Its known to work with g++ 4.6 and up # # FIXME if there's a better, cleaner way to express # "This project needs a c++11 compiler" then specify it here - g++-4.6 | g++ (>= 4:4.6), +# This probably is not an issue until Debian switches away from +# the GNU Compiler collection... # # Rest of deps: +# - debhelper 7.3.0 # A Debhelper with cmake support # (otherwise it will not see the CMakeLists.txt and just build # a package with a manpage... - debhelper (>= 7.3.0), cmake, +# +# - libpoppler-qt4-dev # the poppler-library for PDF decoding - libpoppler-qt4-dev, +# +# - libboost-program-options-dev # the boost program options to parse command line parameters - libboost-program-options-dev, +# +# - hardening-wrapper # And the hardening-wrapper because lintian told me to make the build # safer. - hardening-wrapper +# +# - lsb-release +# This is needed for the switch in the debian/rules file checking +# against lucid Standards-Version: 3.9.3 Vcs-Git: git://github.com/dannyedel/dspdfviewer.git Vcs-Browser: https://github.com/dannyedel/dspdfviewer diff -Nru dspdfviewer-1.8~oneiric1/debian/manpages dspdfviewer-1.9~oneiric1/debian/manpages --- dspdfviewer-1.8~oneiric1/debian/manpages 2012-12-11 13:32:54.000000000 +0000 +++ dspdfviewer-1.9~oneiric1/debian/manpages 2013-01-23 14:57:35.000000000 +0000 @@ -1 +0,0 @@ -docs/dspdfviewer.1 diff -Nru dspdfviewer-1.8~oneiric1/debian/rules dspdfviewer-1.9~oneiric1/debian/rules --- dspdfviewer-1.8~oneiric1/debian/rules 2012-12-11 13:32:54.000000000 +0000 +++ dspdfviewer-1.9~oneiric1/debian/rules 2013-01-23 14:57:35.000000000 +0000 @@ -28,7 +28,6 @@ export CC=gcc-4.6 export CXX=g++-4.6 export LD=ld-4.6 -# CXXFLAGS:=$(CXXFLAGS) -DHACKS_FOR_LUCID endif %: diff -Nru dspdfviewer-1.8~oneiric1/main.cpp dspdfviewer-1.9~oneiric1/main.cpp --- dspdfviewer-1.8~oneiric1/main.cpp 2012-12-11 13:32:54.000000000 +0000 +++ dspdfviewer-1.9~oneiric1/main.cpp 2013-01-23 14:57:35.000000000 +0000 @@ -27,7 +27,6 @@ int main(int argc, char** argv) { - RuntimeConfiguration rc; QApplication app(argc, argv); /* If anything goes wrong, try to display the exception to the user. * Its the least i can do. @@ -37,8 +36,7 @@ * using Qt's event/callback system */ qRegisterMetaType< QSharedPointer >("QSharedPointer"); - - rc.parse(argc, argv); + RuntimeConfiguration rc(argc, argv); DSPDFViewer foo( rc ); diff -Nru dspdfviewer-1.8~oneiric1/pdfviewerwindow.cpp dspdfviewer-1.9~oneiric1/pdfviewerwindow.cpp --- dspdfviewer-1.8~oneiric1/pdfviewerwindow.cpp 2012-12-11 13:32:54.000000000 +0000 +++ dspdfviewer-1.9~oneiric1/pdfviewerwindow.cpp 2013-01-23 14:57:35.000000000 +0000 @@ -76,14 +76,8 @@ { if ( ! m_enabled ) return; - this->setWindowFlags(windowFlags() & ~Qt::FramelessWindowHint); - this->showNormal(); QRect rect = QApplication::desktop()->screenGeometry(getMonitor()); move(rect.topLeft()); - setFixedSize(rect.size()); - this->setWindowFlags( windowFlags() - | Qt::FramelessWindowHint - ); this->showFullScreen(); /* Note: The focus should be on the primary window, because at least * Gnome draws the primary window's border onto the secondary. @@ -346,20 +340,27 @@ void PDFViewerWindow::changePageNumberDialog() { bool ok; + /* While PDF counts zero-based, users probably think that the first + * page is called "1". + */ + uint displayMinNumber = minimumPageNumber+1; + uint displayMaxNumber = maximumPageNumber+1; + uint displayCurNumber = currentPageNumber+1; int targetPageNumber = QInputDialog::getInt(this, /* Window Caption */ tr("Select page"), - /* Input field */ tr("Jump to page number:"), - /* Starting number. Note the +1 because internally, we count zero-based. */ - currentPageNumber+1, + /* Input field caption */ + QString(tr("Jump to page number (%1-%2):")).arg(displayMinNumber).arg(displayMaxNumber), + /* Starting number. */ + displayCurNumber, /* minimum value */ - minimumPageNumber+1, + displayMinNumber, /* maximum value */ - maximumPageNumber+1, + displayMaxNumber, /* Step */ 1, /* Did the user accept? */ &ok); - targetPageNumber-=1; // Convert to internal numbering scheme + targetPageNumber-=1; // Convert back to zero-based numbering scheme if ( ok ) { emit pageRequested(targetPageNumber); diff -Nru dspdfviewer-1.8~oneiric1/runtimeconfiguration.cpp dspdfviewer-1.9~oneiric1/runtimeconfiguration.cpp --- dspdfviewer-1.8~oneiric1/runtimeconfiguration.cpp 2012-12-11 13:32:54.000000000 +0000 +++ dspdfviewer-1.9~oneiric1/runtimeconfiguration.cpp 2013-01-23 14:57:35.000000000 +0000 @@ -23,15 +23,21 @@ #include #include +#ifndef DSPDFVIEWER_VERSION +#warning DSPDFVIEWER_VERSION was not set by the build system! +#define DSPDFVIEWER_VERSION "UNKNOWN" +#endif + using namespace std; using namespace boost::program_options; -void RuntimeConfiguration::parse(int argc, char** argv) +RuntimeConfiguration::RuntimeConfiguration(int argc, char** argv) { options_description generic("Generic options"); generic.add_options() ("help,h", "Print help message") + ("version,v", "Print version statement") ; options_description global("Options affecting program behaviour"); @@ -101,9 +107,18 @@ store( command_line_parser(argc,argv).options(commandLineOptions).positional(p).run(), vm); notify(vm); - if ( vm.count("help")) { - cout << "Usage: " << argv[0] << " [options] pdf-file" << endl; - cout << help << endl; + if ( vm.count("version") || vm.count("help") ) { + cout << "dspdfviewer version " << DSPDFVIEWER_VERSION << endl; + cout << "Written by Danny Edel" << endl; + cout << endl; + cout << "Copyright (C) 2012 Danny Edel." << endl + << "This is free software; see the source for copying conditions. There is NO" << endl + << "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." << endl; + if ( vm.count("help")) { + cout << endl; + cout << "Usage: " << argv[0] << " [options] pdf-file" << endl; + cout << help << endl; + } exit(1); } diff -Nru dspdfviewer-1.8~oneiric1/runtimeconfiguration.h dspdfviewer-1.9~oneiric1/runtimeconfiguration.h --- dspdfviewer-1.8~oneiric1/runtimeconfiguration.h 2012-12-11 13:32:54.000000000 +0000 +++ dspdfviewer-1.9~oneiric1/runtimeconfiguration.h 2013-01-23 14:57:35.000000000 +0000 @@ -79,7 +79,7 @@ * * Note: Might throw exceptions if not parsable. */ - void parse(int argc, char** argv); + RuntimeConfiguration(int argc, char** argv); bool useFullPage() const;