Skip to content

Commit 47973c8

Browse files
committed
Remove deprecated Gtk objects
1 parent 6520a93 commit 47973c8

7 files changed

Lines changed: 68 additions & 74 deletions

File tree

NEWS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1.5.10b1 changes
1+
1.5.10 changes
22
--------------
33

44
- printer couldn't be add ( https://bugzilla.redhat.com/show_bug.cgi?id=1419175 )
@@ -26,3 +26,4 @@
2626
- removed some deprecated parts of gui
2727
- updated translations by files from Zanata
2828
- s-c-p doesn't react on ALREADY_ENABLED exception from firewalld
29+
- removed deprecated Gtk objects

authconn.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,27 @@ def __init__ (self, title=None, parent=None,
6767
vbox.pack_start (self.prompt_label, False, False, 0)
6868

6969
num_fields = len (auth_info_required)
70-
table = Gtk.Table (n_rows=num_fields, n_columns=2)
71-
table.set_row_spacings (6)
72-
table.set_col_spacings (6)
70+
grid = Gtk.Grid()
71+
grid.insert_row(num_fields)
72+
grid.insert_column(2)
73+
grid.set_row_spacing (6)
74+
grid.set_column_spacing (6)
7375

7476
self.field_entry = []
7577
for i in range (num_fields):
7678
field = auth_info_required[i]
7779
label = Gtk.Label (label=_(self.AUTH_FIELD.get (field, field)))
7880
label.set_alignment (0, 0.5)
79-
table.attach (label, 0, 1, i, i + 1)
81+
grid.attach (label, 0, 1, i, i + 1)
82+
grid.attach (label, 0, i, 1, 1)
8083
entry = Gtk.Entry ()
8184
entry.set_visibility (field != 'password')
82-
table.attach (entry, 1, 2, i, i + 1, 0, 0)
85+
grid.attach (entry, 1, 2, i, i + 1, 0, 0)
86+
grid.attach (entry, 1, i, 1, 1)
8387
self.field_entry.append (entry)
8488

8589
self.field_entry[num_fields - 1].set_activates_default (True)
86-
vbox.pack_start (table, False, False, 0)
90+
vbox.pack_start (grid, False, False, 0)
8791
hbox.pack_start (vbox, False, False, 0)
8892
self.vbox.pack_start (hbox, False, False, 0)
8993

newprinter.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4262,29 +4262,28 @@ def fillNPInstallableOptions(self):
42624262
if group.name != "InstallableOptions":
42634263
continue
42644264
self.installable_options = True
4265-
table = Gtk.Table(n_rows=1, n_columns=3, homogeneous=False)
4266-
table.set_col_spacings(6)
4267-
table.set_row_spacings(6)
4268-
container.add(table)
4265+
grid = Gtk.Grid()
4266+
grid.set_column_spacing(6)
4267+
grid.set_row_spacing(6)
4268+
container.add(grid)
42694269
rows = 0
42704270

42714271
for nr, option in enumerate(group.options):
42724272
if option.keyword == "PageRegion":
42734273
continue
42744274
rows += 1
4275-
table.resize (rows, 3)
42764275
o = OptionWidget(option, self.ppd, self)
4277-
table.attach(o.conflictIcon, 0, 1, nr, nr+1, 0, 0, 0, 0)
4276+
grid.attach(o.conflictIcon, 0, nr, 1, 1)
42784277

4279-
hbox = Gtk.HBox()
4278+
hbox = Gtk.Box()
42804279
if o.label:
42814280
a = Gtk.Alignment.new (0.5, 0.5, 1.0, 1.0)
42824281
a.set_padding (0, 0, 0, 6)
42834282
a.add (o.label)
4284-
table.attach(a, 1, 2, nr, nr+1, Gtk.AttachOptions.FILL, 0, 0, 0)
4285-
table.attach(hbox, 2, 3, nr, nr+1, Gtk.AttachOptions.FILL, 0, 0, 0)
4283+
grid.attach(a, 1, nr, 1, 1)
4284+
grid.attach(hbox, 2, nr, 1, 1)
42864285
else:
4287-
table.attach(hbox, 1, 3, nr, nr+1, Gtk.AttachOptions.FILL, 0, 0, 0)
4286+
grid.attach(hbox, 1, nr, 2, 1)
42884287
hbox.pack_start(o.selector, False, False, 0)
42894288
self.options[option.keyword] = o
42904289
if not self.installable_options:

printerproperties.py

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -809,29 +809,22 @@ def draw_other_job_options (self, editable=True):
809809
self.tblJOOther.hide()
810810
return
811811

812-
self.tblJOOther.resize (n, 3)
813812
children = self.tblJOOther.get_children ()
814813
for child in children:
815814
self.tblJOOther.remove (child)
816815
i = 0
817816
for opt in self.other_job_options:
818-
self.tblJOOther.attach (opt.label, 0, 1, i, i + 1,
819-
xoptions=Gtk.AttachOptions.FILL,
820-
yoptions=Gtk.AttachOptions.FILL)
817+
self.tblJOOther.attach (opt.label, 0, i, 1, 1)
821818
opt.label.set_alignment (0.0, 0.5)
822-
self.tblJOOther.attach (opt.selector, 1, 2, i, i + 1,
823-
xoptions=Gtk.AttachOptions.FILL,
824-
yoptions=0)
819+
self.tblJOOther.attach (opt.selector, 1, i, 1, 1)
825820
opt.selector.set_sensitive (editable)
826821

827822
btn = Gtk.Button.new_from_icon_name (Gtk.STOCK_REMOVE,
828823
Gtk.IconSize.BUTTON)
829824
btn.connect("clicked", self.on_btnJOOtherRemove_clicked)
830825
btn.pyobject = opt
831826
btn.set_sensitive (editable)
832-
self.tblJOOther.attach(btn, 2, 3, i, i + 1,
833-
xoptions=0,
834-
yoptions=0)
827+
self.tblJOOther.attach(btn, 2, i, 1, 1)
835828
i += 1
836829

837830
self.tblJOOther.show_all ()
@@ -1567,12 +1560,12 @@ def updateMarkerLevels (self):
15671560
rows = 1 + (cols - 1) / 4
15681561
if cols > 4:
15691562
cols = 4
1570-
table = Gtk.Table (n_rows=round(rows),
1571-
n_columns=cols,
1572-
homogeneous=True)
1573-
table.set_col_spacings (6)
1574-
table.set_row_spacings (12)
1575-
self.vboxMarkerLevels.pack_start (table, False, False, 0)
1563+
grid = Gtk.Grid()
1564+
grid.set_column_homogeneous(True)
1565+
grid.set_row_homogeneous(True)
1566+
grid.set_column_spacing (6)
1567+
grid.set_row_spacing (12)
1568+
self.vboxMarkerLevels.pack_start (grid, False, False, 0)
15761569
for color, name, marker_type, level in markers:
15771570
if name is None:
15781571
name = ''
@@ -1584,8 +1577,8 @@ def updateMarkerLevels (self):
15841577
row = num_markers / 4
15851578
col = num_markers % 4
15861579

1587-
vbox = Gtk.VBox (spacing=6)
1588-
subhbox = Gtk.HBox ()
1580+
vbox = Gtk.Box (spacing=6)
1581+
subhbox = Gtk.Box ()
15891582
inklevel = gtkinklevel.GtkInkLevel (color, level)
15901583
inklevel.set_tooltip_text ("%d%%" % level)
15911584
subhbox.pack_start (inklevel, True, False, 0)
@@ -1594,7 +1587,7 @@ def updateMarkerLevels (self):
15941587
label.set_width_chars (10)
15951588
label.set_line_wrap (True)
15961589
vbox.pack_start (label, False, False, 0)
1597-
table.attach (vbox, col, col + 1, row, row + 1)
1590+
grid.attach (vbox, col, row, 1, 1)
15981591
num_markers += 1
15991592

16001593
self.vboxMarkerLevels.show_all ()
@@ -1747,10 +1740,10 @@ def fillPrinterOptions(self, name, editable):
17471740
frame.add (container)
17481741
tab_label = self.lblPOptions
17491742

1750-
table = Gtk.Table(n_rows=1, n_columns=3, homogeneous=False)
1751-
table.set_col_spacings(6)
1752-
table.set_row_spacings(6)
1753-
container.add(table)
1743+
grid = Gtk.Grid()
1744+
grid.set_column_spacing(6)
1745+
grid.set_row_spacing(6)
1746+
container.add(grid)
17541747

17551748
rows = 0
17561749

@@ -1765,19 +1758,18 @@ def fillPrinterOptions(self, name, editable):
17651758
if option.keyword == "PageRegion":
17661759
continue
17671760
rows += 1
1768-
table.resize (rows, 3)
17691761
o = OptionWidget(option, ppd, self, tab_label=tab_label)
1770-
table.attach(o.conflictIcon, 0, 1, nr, nr+1, 0, 0, 0, 0)
1762+
grid.attach(o.conflictIcon, 0, nr, 1, 1)
17711763

1772-
hbox = Gtk.HBox()
1764+
hbox = Gtk.Box()
17731765
if o.label:
17741766
a = Gtk.Alignment.new(0.5, 0.5, 1.0, 1.0)
17751767
a.set_padding (0, 0, 0, 6)
17761768
a.add (o.label)
1777-
table.attach(a, 1, 2, nr, nr+1, Gtk.AttachOptions.FILL, 0, 0, 0)
1778-
table.attach(hbox, 2, 3, nr, nr+1, Gtk.AttachOptions.FILL, 0, 0, 0)
1769+
grid.attach(a, 1, nr, 1, 1)
1770+
grid.attach(hbox, 2, nr, 1, 1)
17791771
else:
1780-
table.attach(hbox, 1, 3, nr, nr+1, Gtk.AttachOptions.FILL, 0, 0, 0)
1772+
grid.attach(hbox, 1, nr, 2, 1)
17811773
hbox.pack_start(o.selector, False, False, 0)
17821774
self.options[option.keyword] = o
17831775
o.selector.set_sensitive(editable)

pysmb.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,21 @@ def perform_authentication (self):
119119
label.set_line_wrap (True)
120120
vbox.pack_start (label, False, False, 0)
121121

122-
table = Gtk.Table (n_rows=3, n_columns=2)
123-
table.set_row_spacings (6)
124-
table.set_col_spacings (6)
125-
table.attach (Gtk.Label(label=_("Username:")), 0, 1, 0, 1, 0, 0)
122+
grid = Gtk.Grid()
123+
grid.set_row_spacing (6)
124+
grid.set_column_spacing (6)
125+
grid.attach (Gtk.Label(label=_("Username:")), 0, 0, 1, 1)
126126
username_entry = Gtk.Entry ()
127-
table.attach (username_entry, 1, 2, 0, 1, 0, 0)
128-
table.attach (Gtk.Label(label=_("Domain:")), 0, 1, 1, 2, 0, 0)
127+
grid.attach (username_entry, 1, 0, 1, 1)
128+
grid.attach (Gtk.Label(label=_("Domain:")), 0, 1, 1, 1)
129129
domain_entry = Gtk.Entry ()
130-
table.attach (domain_entry, 1, 2, 1, 2, 0, 0)
131-
table.attach (Gtk.Label(label=_("Password:")), 0, 1, 2, 3, 0, 0)
130+
grid.attach (domain_entry, 1, 1, 1, 1)
131+
grid.attach (Gtk.Label(label=_("Password:")), 0, 2, 1, 1)
132132
password_entry = Gtk.Entry ()
133133
password_entry.set_activates_default (True)
134134
password_entry.set_visibility (False)
135-
table.attach (password_entry, 1, 2, 2, 3, 0, 0)
136-
vbox.pack_start (table, False, False, 0)
135+
grid.attach (password_entry, 1, 2, 1, 1)
136+
vbox.pack_start (grid, False, False, 0)
137137
hbox.pack_start (vbox, False, False, 0)
138138
d.vbox.pack_start (hbox, False, False, 0)
139139
self.dialog_shown = True

troubleshoot/Locale.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,22 @@ def __init__ (self, troubleshooter):
3333
"not the printer's default page size. "
3434
"If this is not intentional it may cause "
3535
"alignment problems."))
36-
table = Gtk.Table (n_rows=2, n_columns=2)
37-
table.set_row_spacings (6)
38-
table.set_col_spacings (6)
39-
page.pack_start (table, False, False, 0)
36+
grid = Gtk.Grid()
37+
grid.set_row_spacing (6)
38+
grid.set_column_spacing (6)
39+
page.pack_start (grid, False, False, 0)
4040
self.printer_page_size = Gtk.Label ()
4141
self.printer_page_size.set_alignment (0, 0)
4242
self.job_page_size = Gtk.Label ()
4343
self.job_page_size.set_alignment (0, 0)
4444
label = Gtk.Label(label=_("Print job page size:"))
4545
label.set_alignment (0, 0)
46-
table.attach (label, 0, 1, 0, 1, xoptions=Gtk.AttachOptions.FILL, yoptions=0)
47-
table.attach (self.job_page_size, 1, 2, 0, 1,
48-
xoptions=Gtk.AttachOptions.FILL, yoptions=0)
46+
grid.attach (label, 0, 0, 1, 1)
47+
grid.attach (self.job_page_size, 1, 0, 1, 1)
4948
label = Gtk.Label(label=_("Printer page size:"))
5049
label.set_alignment (0, 0)
51-
table.attach (label, 0, 1, 1, 2, xoptions=Gtk.AttachOptions.FILL, yoptions=0)
52-
table.attach (self.printer_page_size, 1, 2, 1, 2,
53-
xoptions=Gtk.AttachOptions.FILL, yoptions=0)
50+
grid.attach (label, 0, 1, 1, 1)
51+
grid.attach (self.printer_page_size, 1, 1, 1, 1)
5452
troubleshooter.new_page (page, self)
5553

5654
def display (self):

troubleshoot/RemoteAddress.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,24 @@ def __init__ (self, troubleshooter):
2929
_("Please enter as many details as you "
3030
"can about the network address of this "
3131
"printer."))
32-
table = Gtk.Table (n_rows=2, n_columns=2)
33-
table.set_row_spacings (6)
34-
table.set_col_spacings (6)
35-
page.pack_start (table, False, False, 0)
32+
grid = Gtk.Grid()
33+
grid.set_row_spacing (6)
34+
grid.set_column_spacing (6)
35+
page.pack_start (grid, False, False, 0)
3636

3737
label = Gtk.Label(label=_("Server name:"))
3838
label.set_alignment (0, 0)
39-
table.attach (label, 0, 1, 0, 1)
39+
grid.attach (label, 0, 0, 1, 1)
4040
self.server_name = Gtk.Entry ()
4141
self.server_name.set_activates_default (True)
42-
table.attach (self.server_name, 1, 2, 0, 1)
42+
grid.attach (self.server_name, 1, 0, 1, 1)
4343

4444
label = Gtk.Label(label=_("Server IP address:"))
4545
label.set_alignment (0, 0)
46-
table.attach (label, 0, 1, 1, 2)
46+
grid.attach (label, 0, 1, 1, 1)
4747
self.server_ipaddr = Gtk.Entry ()
4848
self.server_ipaddr.set_activates_default (True)
49-
table.attach (self.server_ipaddr, 1, 2, 1, 2)
49+
grid.attach (self.server_ipaddr, 1, 1, 1, 1)
5050

5151
troubleshooter.new_page (page, self)
5252

0 commit comments

Comments
 (0)