Ignore:
Timestamp:
04/21/24 14:16:47 (2 weeks ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

The tables on the payload page and the weight help are easier to extend (re #386).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/flight.py

    r1142 r1143  
    24342434        self.setMainWidget(alignment)
    24352435
     2436        row  = 0
     2437
    24362438        self._crewLabel = label = Gtk.Label(xstr("payload_crew"))
    24372439        label.set_use_underline(True)
    24382440        label.set_alignment(0.0, 0.5)
    2439         table.attach(label, 0, 1, 0, 1)
     2441        table.attach(label, 0, 1, row, row+1)
    24402442
    24412443        self._numCockpitCrew = Gtk.Label()
     
    24522454        crewBox.set_halign(Gtk.Align.END)
    24532455
    2454         table.attach(crewBox, 1, 2, 0, 1)
     2456        table.attach(crewBox, 1, 2, row, row+1)
    24552457        label.set_mnemonic_widget(self._numCabinCrew)
    24562458
    24572459        label = Gtk.Label(xstr("payload_crew_info"))
    24582460        label.set_halign(Gtk.Align.START)
    2459         table.attach(label, 2, 3, 0, 1)
     2461        table.attach(label, 2, 3, row, row+1)
     2462
     2463        row += 1
    24602464
    24612465        self._paxLabel = label = Gtk.Label(xstr("payload_pax"))
    24622466        label.set_use_underline(True)
    24632467        label.set_alignment(0.0, 0.5)
    2464         table.attach(label, 0, 1, 1, 2)
     2468        table.attach(label, 0, 1, row, row+1)
    24652469
    24662470        self._numPassengers = IntegerEntry(defaultValue = 0)
     
    24862490        paxBox.pack_start(self._numInfants, False, False, 0)
    24872491
    2488         table.attach(paxBox, 1, 2, 1, 2)
     2492        table.attach(paxBox, 1, 2, row, row+1)
    24892493        label.set_mnemonic_widget(self._numPassengers)
    24902494
    24912495        label = Gtk.Label(xstr("payload_pax_info"))
    24922496        label.set_halign(Gtk.Align.START)
    2493         table.attach(label, 2, 3, 1, 2)
     2497        table.attach(label, 2, 3, row, row+1)
     2498
     2499        row += 1
    24942500
    24952501        label = Gtk.Label(xstr("payload_bag"))
    24962502        label.set_use_underline(True)
    24972503        label.set_alignment(0.0, 0.5)
    2498         table.attach(label, 0, 1, 2, 3)
     2504        table.attach(label, 0, 1, row, row+1)
    24992505
    25002506        self._bagWeight = IntegerEntry(defaultValue = 0)
     
    25042510        self._bagWeight.set_hexpand(False)
    25052511        self._bagWeight.set_halign(Gtk.Align.END)
    2506         table.attach(self._bagWeight, 1, 2, 2, 3)
     2512        table.attach(self._bagWeight, 1, 2, row, row+1)
    25072513        label.set_mnemonic_widget(self._bagWeight)
    25082514
    25092515        label = Gtk.Label("kg")
    25102516        label.set_halign(Gtk.Align.START)
    2511         table.attach(label, 2, 3, 2, 3)
     2517        table.attach(label, 2, 3, row, row+1)
     2518
     2519        row += 1
    25122520
    25132521        label = Gtk.Label(xstr("payload_cargo"))
    25142522        label.set_use_underline(True)
    25152523        label.set_alignment(0.0, 0.5)
    2516         table.attach(label, 0, 1, 3, 4)
     2524        table.attach(label, 0, 1, row, row+1)
    25172525
    25182526        self._cargoWeight = IntegerEntry(defaultValue = 0)
     
    25222530        self._cargoWeight.set_hexpand(False)
    25232531        self._cargoWeight.set_halign(Gtk.Align.END)
    2524         table.attach(self._cargoWeight, 1, 2, 3, 4)
     2532        table.attach(self._cargoWeight, 1, 2, row, row+1)
    25252533        label.set_mnemonic_widget(self._cargoWeight)
    25262534
    25272535        label = Gtk.Label("kg")
    25282536        label.set_halign(Gtk.Align.START)
    2529         table.attach(label, 2, 3, 3, 4)
     2537        table.attach(label, 2, 3, row, row+1)
     2538
     2539        row += 1
    25302540
    25312541        label = Gtk.Label(xstr("payload_mail"))
    25322542        label.set_use_underline(True)
    25332543        label.set_alignment(0.0, 0.5)
    2534         table.attach(label, 0, 1, 4, 5)
     2544        table.attach(label, 0, 1, row, row+1)
    25352545
    25362546        self._mailWeight = IntegerEntry(defaultValue = 0)
     
    25402550        self._mailWeight.set_hexpand(False)
    25412551        self._mailWeight.set_halign(Gtk.Align.END)
    2542         table.attach(self._mailWeight, 1, 2, 4, 5)
     2552        table.attach(self._mailWeight, 1, 2, row, row+1)
    25432553        label.set_mnemonic_widget(self._mailWeight)
    25442554
    25452555        label = Gtk.Label("kg")
    25462556        label.set_halign(Gtk.Align.START)
    2547         table.attach(label, 2, 3, 4, 5)
     2557        table.attach(label, 2, 3, row, row+1)
     2558
     2559        row += 1
    25482560
    25492561        label = Gtk.Label("<b>" + xstr("payload_zfw") + "</b>")
    25502562        label.set_alignment(0.0, 0.5)
    25512563        label.set_use_markup(True)
    2552         table.attach(label, 0, 1, 5, 6)
     2564        table.attach(label, 0, 1, row, row+1)
    25532565
    25542566        self._calculatedZFW = Gtk.Label()
    25552567        self._calculatedZFW.set_width_chars(6)
    25562568        self._calculatedZFW.set_alignment(1.0, 0.5)
    2557         table.attach(self._calculatedZFW, 1, 2, 5, 6)
     2569        table.attach(self._calculatedZFW, 1, 2, row, row+1)
    25582570
    25592571        label = Gtk.Label("kg")
    25602572        label.set_halign(Gtk.Align.START)
    2561         table.attach(label, 2, 3, 5, 6)
     2573        table.attach(label, 2, 3, row, row+1)
     2574
     2575        row += 1
    25622576
    25632577        self._zfwButton = Gtk.Button(xstr("payload_fszfw"))
     
    25652579        self._zfwButton.connect("clicked", self._zfwRequested)
    25662580        self._zfwButton.set_tooltip_text(xstr("payload_fszfw_tooltip"))
    2567         table.attach(self._zfwButton, 0, 1, 6, 7)
     2581        table.attach(self._zfwButton, 0, 1, row, row+1)
    25682582
    25692583        self._simulatorZFW = Gtk.Label("-")
    25702584        self._simulatorZFW.set_width_chars(6)
    25712585        self._simulatorZFW.set_alignment(1.0, 0.5)
    2572         table.attach(self._simulatorZFW, 1, 2, 6, 7)
     2586        table.attach(self._simulatorZFW, 1, 2, row, row+1)
    25732587        self._simulatorZFWValue = None
    25742588
    25752589        label = Gtk.Label("kg")
    25762590        label.set_halign(Gtk.Align.START)
    2577         table.attach(label, 2, 3, 6, 7)
     2591        table.attach(label, 2, 3, row, row+1)
    25782592
    25792593        self.addCancelFlightButton()
Note: See TracChangeset for help on using the changeset viewer.