Ejemplo n.º 1
0
def main():

    #args = sys.argv
    parser = OptionParser()
    parser.set_usage(_("Usage:  billreminder [OPTIONS...]"))
    parser.add_option('-v','--version', action='store_true', dest='app_version', default=False, help=_('Displays the version number for this application.'))
    parser.add_option('--about', action='store_true', dest='app_about', default=False, help=_('About this application.'))
    parser.add_option('--add', action='store_true', dest='app_add', default=False, help=_('Adds a new bill to the database.'))
    parser.add_option('--standalone', action='store_true', dest='app_standalone', default=False, help=_('Access database directly, without daemon.'))

    # Verify arguments
    options, args = parser.parse_args()
    if options.app_about:
        dialogs.about_dialog()
    elif options.app_add:
        print dialogs.add_dialog()
    elif options.app_standalone:
        print _("This option is not implemented yet.")
    elif options.app_version:
        print _("This is %(appname)s - Version: %(version)s") % \
                         {'appname': common.APPNAME,
                          'version': common.APPVERSION}
    else:
        gtk.gdk.threads_init()
        app = BillReminder()
        gtk.main()
Ejemplo n.º 2
0
def main():

    #args = sys.argv
    parser = OptionParser()
    parser.set_usage(_("Usage:  billreminder [OPTIONS...]"))
    parser.add_option(
        '-v',
        '--version',
        action='store_true',
        dest='app_version',
        default=False,
        help=_('Displays the version number for this application.'))
    parser.add_option('--about',
                      action='store_true',
                      dest='app_about',
                      default=False,
                      help=_('About this application.'))
    parser.add_option('--add',
                      action='store_true',
                      dest='app_add',
                      default=False,
                      help=_('Adds a new bill to the database.'))
    parser.add_option('--standalone',
                      action='store_true',
                      dest='app_standalone',
                      default=False,
                      help=_('Access database directly, without daemon.'))

    # Verify arguments
    options, args = parser.parse_args()
    if options.app_about:
        dialogs.about_dialog()
    elif options.app_add:
        print dialogs.add_dialog()
    elif options.app_standalone:
        print _("This option is not implemented yet.")
    elif options.app_version:
        print _("This is %(appname)s - Version: %(version)s") % \
                         {'appname': common.APPNAME,
                          'version': common.APPVERSION}
    else:
        gtk.gdk.threads_init()
        app = BillReminder()
        gtk.main()
Ejemplo n.º 3
0
    def add_bill(self):
        selectedDate = self.timeline.value
        records = dialogs.add_dialog(parent=self.window, selectedDate=selectedDate)

        # Checks if the user did not cancel the action
        if records:
            # Add new bill to database
            for rec in records:
                bill_id = self.actions.add(rec)
                bill = self.actions.get_bills(id=bill_id)[0]
                if bill:
                    self.list.add(self.format_row(bill))
            self.update_statusbar()
            # Reload records tree (something changed)
            self.reloadTreeView()
            self.reloadTimeline()
Ejemplo n.º 4
0
    def add_bill(self):
        selectedDate = self.timeline.value
        records = dialogs.add_dialog(parent=self.window,
                                     selectedDate=selectedDate)

        # Checks if the user did not cancel the action
        if records:
            # Add new bill to database
            for rec in records:
                bill_id = self.actions.add(rec)
                bill = self.actions.get_bills(id=bill_id)[0]
                if bill:
                    self.list.add(self.format_row(bill))
            self.update_statusbar()
            # Reload records tree (something changed)
            self.reloadTreeView()
            self.reloadTimeline()