Esempio n. 1
0
    def __init__(self):
        page.Page.__init__(self)
        self.builder = get_avernus_builder()
        self.treestore = self.builder.get_object("pf_transactions_treestore")
        self.tree = self.builder.get_object("pf_transactions_tree")
        self.tree.connect('map', self.update_page)

        # date format
        cell = self.builder.get_object("cellrenderertext24")
        column = self.builder.get_object("treeviewcolumn24")
        column.set_cell_data_func(cell, gui_utils.date_to_string, self.DATE)
        self.treestore.set_sort_func(self.DATE, gui_utils.sort_by_datetime, self.DATE)
        # shares
        cell = self.builder.get_object("cellrenderertext27")
        column = self.builder.get_object("treeviewcolumn27")
        column.set_cell_data_func(cell, gui_utils.float_format, self.SHARES)
        # price
        cell = self.builder.get_object("cellrenderertext28")
        column = self.builder.get_object("treeviewcolumn28")
        column.set_cell_data_func(cell, gui_utils.currency_format, self.PRICE)
        # transaction costs
        cell = self.builder.get_object("cellrenderertext29")
        column = self.builder.get_object("treeviewcolumn29")
        column.set_cell_data_func(cell, gui_utils.currency_format, self.TA_COSTS)
        # total
        cell = self.builder.get_object("cellrenderertext30")
        column = self.builder.get_object("treeviewcolumn30")
        column.set_cell_data_func(cell, gui_utils.float_to_red_green_string_currency, self.TOTAL)
Esempio n. 2
0
    def __init__(self):
        page.Page.__init__(self)
        self.builder = get_avernus_builder()
        self.actiongroup = self.builder.get_object("dividend_actiongroup")
        self.treestore = self.builder.get_object("dividend_treestore")
        self.tree = self.builder.get_object("dividend_tree")
        self.tree.connect("map", self.update_page)

        # date format
        cell = self.builder.get_object("cellrenderertext32")
        column = self.builder.get_object("treeviewcolumn32")
        column.set_cell_data_func(cell, gui_utils.date_to_string, self.DATE)
        self.treestore.set_sort_func(self.DATE, gui_utils.sort_by_datetime, self.DATE)
        # amount
        cell = self.builder.get_object("cellrenderertext33")
        column = self.builder.get_object("treeviewcolumn33")
        column.set_cell_data_func(cell, gui_utils.currency_format, self.AMOUNT)
        # transaction costs
        cell = self.builder.get_object("cellrenderertext34")
        column = self.builder.get_object("treeviewcolumn34")
        column.set_cell_data_func(cell, gui_utils.currency_format, self.TA_COSTS)
        # total
        cell = self.builder.get_object("cellrenderertext35")
        column = self.builder.get_object("treeviewcolumn35")
        column.set_cell_data_func(cell, gui_utils.currency_format, self.TOTAL)
        # dividend yield
        cell = self.builder.get_object("cellrenderertext36")
        column = self.builder.get_object("treeviewcolumn36")
        column.set_cell_data_func(cell, gui_utils.percent_format, self.DIVIDEND_YIELD)
    def __init__(self):
        page.Page.__init__(self)
        self.config = config.avernusConfig()

        self.searchstring = ''
        self.b_show_transfer = True
        self.b_show_uncategorized = True
        self.single_category = None
        self.range_start = None
        self.range_end = None
        self.context_menu_setup = False
        self.builder = get_avernus_builder()
        self.charts_notebook = None

        self.widget = self.builder.get_object("account_vbox")
        self.hpaned = self.builder.get_object("account_hpaned")
        self.category_tree = self.builder.get_object("category_tree")
        self.start_entry = self.builder.get_object("start_entry")
        self.end_entry = self.builder.get_object("end_entry")
        self.search_entry = self.builder.get_object("search_entry")
        self.category_actiongroup = self.builder.get_object("category_actiongroup")
        self.category_context_menu = self.builder.get_object("category_context_menu")

        pre = self.config.get_option('account hpaned position', 'Gui')
        pos = pre or 600
        self.hpaned.set_position(int(pos))

        self._init_categories_tree()
        self._init_transactions_tree()
    def __init__(self):
        page.Page.__init__(self)
        self.builder = get_avernus_builder()
        self.widget = self.builder.get_object("watchlist_box")
        self.treestore = self.builder.get_object("wl_positions_treestore")
        self.actiongroup = self.builder.get_object("wl_position_actiongroup")
        self.watchlist = None

        # start price
        cell = self.builder.get_object("cellrenderertext39")
        column = self.builder.get_object("treeviewcolumn39")
        column.set_cell_data_func(cell, positions_tab.start_price_markup, self.START)
        # last price
        cell = self.builder.get_object("cellrenderertext40")
        column = self.builder.get_object("treeviewcolumn40")
        column.set_cell_data_func(cell, positions_tab.current_price_markup, self.LAST_PRICE)
        # change
        cell = self.builder.get_object("cellrenderertext41")
        column = self.builder.get_object("treeviewcolumn41")
        column.set_cell_data_func(cell, gui_utils.float_to_red_green_string_currency, self.CHANGE)
        # change %
        cell = self.builder.get_object("cellrenderertext42")
        column = self.builder.get_object("treeviewcolumn42")
        column.set_cell_data_func(cell, gui_utils.float_to_red_green_string_percent, self.CHANGE_PERCENT)
        # gain
        cell = self.builder.get_object("cellrenderertext43")
        column = self.builder.get_object("treeviewcolumn43")
        column.set_cell_data_func(cell, gui_utils.float_to_red_green_string_currency, self.GAIN)
        # gain %
        cell = self.builder.get_object("cellrenderertext44")
        column = self.builder.get_object("treeviewcolumn44")
        column.set_cell_data_func(cell, gui_utils.float_to_red_green_string_percent, self.GAIN_PERCENT)
 def __init__(self):
     page.Page.__init__(self)
     builder = get_avernus_builder()
     sw = builder.get_object("closed_positions_sw")
     sw.connect('map', self.update_page)
     self.closed_positions_tree = ClosedPositionsTree()
     sw.add(self.closed_positions_tree)
     sw.show_all()
Esempio n. 6
0
 def __init__(self):
     page.Page.__init__(self)
     self.builder = get_avernus_builder()
     self.widget = self.builder.get_object("asset_allocation_widget")
     self.treestore = self.builder.get_object("asset_allocation_store")
     self.tree = self.builder.get_object("asset_allocation_tree")
     self.tree.connect("map", self.update_page)
     self.init_widgets()
Esempio n. 7
0
    def __init__(self):
        builder = get_avernus_builder()
        self.window = builder.get_object("main_window")

        self.config = config.avernusConfig()
        self.window.set_title(avernus.__appname__)

        sb = sidebar.Sidebar()
        self.hpaned = builder.get_object("hpaned")
        self.account_page = AccountTransactionTab()
        self.portfolio_notebook = builder.get_object("portfolio_notebook")
        self.portfolio_pages = [PortfolioPositionsTab(),
                                TransactionsTab(),
                                DividendsTab(),
                                ClosedPositionsTab(),
                                ChartTab()
                                ]
        self.watchlist_page = watchlist_positions_page.WatchlistPositionsPage()
        self.asset_allocation_page = asset_allocation.AssetAllocation()
        sb.insert_report('asset allocation', _("Asset allocation"))
        sb.tree.expand_all()

        sb.connect("unselect", self.on_sidebar_unselect)
        sb.connect("select", self.on_sidebar_select)

        # connect signals
        handlers = [self, self.account_page, sb, self.watchlist_page, self.asset_allocation_page]
        handlers.extend(self.portfolio_pages)
        builder.connect_signals(HandlerFinder(handlers))

        # set min size
        screen = self.window.get_screen()
        width = int(screen.get_width() * 0.66)
        height = int(screen.get_height() * 0.66)
        self.window.set_size_request(width, height)

        size = self.config.get_option('size', section='Gui')
        if size is not None:
            width, height = eval(size)
            self.window.resize(width, height)

        pos = self.config.get_option('hpaned position', 'Gui') or width * 0.25
        self.hpaned.set_position(int(pos))

        # config entries are strings...
        if self.config.get_option('maximize', section='Gui') == 'True':
            self.window.maximize()
            self.maximized = True
        else:
            self.maximized = False

        # display everything
        self.window.show_all()
Esempio n. 8
0
    def __init__(self):
        GObject.GObject.__init__(self)
        self.builder = get_avernus_builder()
        self.tree = self.builder.get_object("sidebar_tree")
        column = self.builder.get_object("sidebar_column1")
        # I don't know how to do this in glade
        column.set_expand(True)
        self.infobox = InfoBox(self.builder.get_object("infobox"))
        progress_manager.box = self.builder.get_object("progress_box")

        self.selected_item = None

        self.insert_categories()
        self._load_items()
Esempio n. 9
0
    def __init__(self):
        page.Page.__init__(self)
        self.builder = get_avernus_builder()
        self.treestore = self.builder.get_object("positions_treestore")
        self.widget = self.builder.get_object("positions_box")
        self.widget.connect("map", self.update_page)
        self.actiongroup = self.builder.get_object("position_actiongroup")
        self.portfolio = None

        # quantity
        cell = self.builder.get_object("cellrenderertext8")
        column = self.builder.get_object("treeviewcolumn7")
        column.set_cell_data_func(cell, quantity_markup, self.QUANTITY)
        # pf percent format
        cell = self.builder.get_object("cellrenderertext11")
        column = self.builder.get_object("treeviewcolumn11")
        column.set_cell_data_func(cell, gui_utils.percent_format, self.PF_PERCENT)
        # start price
        cell = self.builder.get_object("cellrenderertext12")
        column = self.builder.get_object("treeviewcolumn12")
        column.set_cell_data_func(cell, start_price_markup, self.START)
        # buy value
        cell = self.builder.get_object("cellrenderertext13")
        column = self.builder.get_object("treeviewcolumn13")
        column.set_cell_data_func(cell, gui_utils.currency_format, self.BUY_VALUE)
        # last price
        cell = self.builder.get_object("cellrenderertext14")
        column = self.builder.get_object("treeviewcolumn14")
        column.set_cell_data_func(cell, current_price_markup, self.LAST_PRICE)
        # change
        cell = self.builder.get_object("cellrenderertext15")
        column = self.builder.get_object("treeviewcolumn15")
        column.set_cell_data_func(cell, gui_utils.float_to_red_green_string_currency, self.CHANGE)
        # change %
        cell = self.builder.get_object("cellrenderertext16")
        column = self.builder.get_object("treeviewcolumn16")
        column.set_cell_data_func(cell, gui_utils.float_to_red_green_string_percent, self.CHANGE_PERCENT)
        # market value
        cell = self.builder.get_object("cellrenderertext17")
        column = self.builder.get_object("treeviewcolumn17")
        column.set_cell_data_func(cell, gui_utils.currency_format, self.MKT_VALUE)
        # gain
        cell = self.builder.get_object("cellrenderertext18")
        column = self.builder.get_object("treeviewcolumn18")
        column.set_cell_data_func(cell, gui_utils.float_to_red_green_string_currency, self.GAIN)
        # gain %
        cell = self.builder.get_object("cellrenderertext19")
        column = self.builder.get_object("treeviewcolumn19")
        column.set_cell_data_func(cell, gui_utils.float_to_red_green_string_percent, self.GAIN_PERCENT)
        # today
        cell = self.builder.get_object("cellrenderertext20")
        column = self.builder.get_object("treeviewcolumn20")
        column.set_cell_data_func(cell, gui_utils.float_to_red_green_string_currency, self.DAYS_GAIN)
        # gain incl dividends
        cell = self.builder.get_object("cellrenderertext21")
        column = self.builder.get_object("treeviewcolumn21")
        column.set_cell_data_func(cell, gui_utils.float_to_red_green_string_currency, self.GAIN_DIV)
        # gain incl dividends percent
        cell = self.builder.get_object("cellrenderertext22")
        column = self.builder.get_object("treeviewcolumn22")
        column.set_cell_data_func(cell, gui_utils.float_to_red_green_string_percent, self.GAIN_DIV_PERCENT)
        # annual return
        cell = self.builder.get_object("cellrenderertext23")
        column = self.builder.get_object("treeviewcolumn23")
        column.set_cell_data_func(cell, gui_utils.percent_format, self.ANNUAL_RETURN)
Esempio n. 10
0
 def __init__(self):
     page.Page.__init__(self)
     builder = get_avernus_builder()
     self.sw = builder.get_object("charts_sw")
     self.sw.connect("map", self.show)