Exemple #1
0
    def menuprintblank_activate(self, widget):
        logger.debug(common.get_function_name())
        userinfo = common.get_own_address()

        PedigreeReport, PedigreeReportOptions = get_pedigree()
        psize = common.get_pagesize_from_opts()
        opts = PedigreeReportOptions(psize)
        report(PedigreeReport, opts, None, userinfo)
Exemple #2
0
 def on_btnPreview_clicked(self, widget):
     selected = self.widgets.cbLayout.get_active()
     userinfo = common.get_own_address()
     PedigreeReport, PedigreeReportOptions = get_pedigree(layout=selected)
     psize = common.get_pagesize_from_opts()
     opts = PedigreeReportOptions(psize,
                                  print_action=PRINT_ACTION_PREVIEW,
                                  parent=self.widgets.optionsdialog)
     report(PedigreeReport, opts, None, userinfo)
Exemple #3
0
    def menuprintpedigree_activate(self, widget):
        logger.debug(common.get_function_name())
        pigeon = self.widgets.treeview.get_selected_pigeon()
        if pigeon is None or isinstance(pigeon, list): return
        userinfo = common.get_own_address()

        PedigreeReport, PedigreeReportOptions = get_pedigree()
        psize = common.get_pagesize_from_opts()
        opts = PedigreeReportOptions(psize)
        report(PedigreeReport, opts, pigeon, userinfo)
Exemple #4
0
    def menuprintpigeons_activate(self, widget):
        logger.debug(common.get_function_name())

        userinfo = common.get_own_address()

        if not tools.check_user_info(self, userinfo["name"]):
            return

        pigeons = self.widgets.treeview.get_pigeons(True)
        psize = common.get_pagesize_from_opts()
        reportopts = PigeonsReportOptions(psize)
        report(PigeonsReport, reportopts, pigeons, userinfo)
    def on_printcalc_clicked(self, widget):
        data = [
            self.widgets.ls_velocity.get(row.iter, 0, 1, 2)
            for row in self.widgets.ls_velocity
        ]
        if data:
            date = datetime.datetime.now()
            distance = "%s %s" % (
                self.widgets.spinbutton_prognosis_distance.get_value_as_int(),
                self.widgets.combobox_prognosis_distance.get_active_text())
            release = "%s:%s:%s" % (
                self.widgets.spinbutton_prognosis_hours.get_text(),
                self.widgets.spinbutton_prognosis_minutes.get_text(),
                self.widgets.spinbutton_prognosis_seconds.get_text())
            info = [date.strftime("%Y-%m-%d"), release, distance]

            psize = common.get_pagesize_from_opts()
            reportopts = VelocityReportOptions(psize)
            report(VelocityReport, reportopts, data, info)
Exemple #6
0
    def _do_operation(self, print_action, save_path=None):
        userinfo = common.get_own_address()
        if not tools.check_user_info(self.widgets.resultwindow,
                                     userinfo["name"]):
            return

        data = self.widgets.resultview.get_report_data()

        psize = common.get_pagesize_from_opts()
        opts = ResultsReportOptions(psize,
                                    None,
                                    print_action,
                                    save_path,
                                    parent=self.widgets.resultwindow)
        try:
            report(ResultsReport, opts, data, userinfo)
        except ReportError as exc:
            ErrorDialog((
                exc.value.split("\n")[0],
                _("You probably don't have write permissions on this folder."),
                _("Error")))