Changeset 08cf1be in subsurface


Ignore:
Timestamp:
Dec 4, 2013, 5:13:40 AM (4 years ago)
Author:
Lubomir I. Ivanov <neolit123@…>
Branches:
Mtest, android_test, dcDownload, foratdotde, gitMerge, gitdebug, gitpictures, ios, master, mergeKirigamiPort, pictimeshift, resolutionIndependence, spinner, testTomaz, testing, v4.0-branch, v4.0.3-branch, v4.2-branch, v4.4-branch, v4.5-branch
Children:
ac7126b
Parents:
ecf483db
Message:

PrintLayout?: add estimateTotalDives()

estimateTotalDives() is used to calculate the total dives
to be printed, it requires a 'struct dive' pointer
and a couple of 'int' pointers for the iterator 'i' and
'total' return.

Signed-off-by: Lubomir I. Ivanov <neolit123@…>

Location:
qt-ui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • qt-ui/printlayout.cpp

    rd4766a8 r08cf1be  
    9292}
    9393
     94// go trought the dive table and find how many dives we are a going to print
     95void PrintLayout::estimateTotalDives(struct dive *dive, int *i, int *total) const
     96{
     97        *total = 0;
     98        for_each_dive(*i, dive) {
     99                if (!dive->selected && printOptions->print_selected)
     100                        continue;
     101                (*total)++;
     102        }
     103}
     104
    94105/* the used formula here is:
    95106 * s = (S - (n - 1) * p) / n
  • qt-ui/printlayout.h

    r2ec6303 r08cf1be  
    3535
    3636        void setup();
     37        void estimateTotalDives(struct dive *dive, int *i, int *total) const;
    3738        void printProfileDives(int divesPerRow, int divesPerColumn);
    3839        QTableView *createProfileTable(ProfilePrintModel *model, const int tableW);
     
    4041        void addTablePrintDataRow(TablePrintModel *model, int row, struct dive *dive) const;
    4142        void addTablePrintHeadingRow(TablePrintModel *model, int row) const;
     43
     44signals:
     45    void signalProgress(int);
    4246};
    4347
Note: See TracChangeset for help on using the changeset viewer.