mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 21:21:31 +00:00
Merge #2088: Update Zenmap to Python 3 and PyGObject
Note: Ndiff build will be broken until subsequent changes are made. Deprecation warnings will need to be addressed in future changes. Closes #2088
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import gtk
|
||||
import gobject
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, GObject
|
||||
|
||||
from zenmapGUI.higwidgets.higboxes import HIGHBox
|
||||
from zenmapGUI.higwidgets.higlabels import HintWindow
|
||||
@@ -10,30 +12,30 @@ class FilterBar(HIGHBox):
|
||||
entering a string that restricts the set of visible hosts."""
|
||||
|
||||
__gsignals__ = {
|
||||
"changed": (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ())
|
||||
"changed": (GObject.SignalFlags.RUN_FIRST, GObject.TYPE_NONE, ())
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
HIGHBox.__init__(self)
|
||||
self.information_label = gtk.Label()
|
||||
self.entry = gtk.Entry()
|
||||
self.information_label = Gtk.Label()
|
||||
self.entry = Gtk.Entry()
|
||||
|
||||
self.pack_start(self.information_label, False)
|
||||
self.pack_start(self.information_label, False, True, 0)
|
||||
self.information_label.show()
|
||||
|
||||
label = gtk.Label(_("Host Filter:"))
|
||||
self.pack_start(label, False)
|
||||
label = Gtk.Label.new(_("Host Filter:"))
|
||||
self.pack_start(label, False, True, 0)
|
||||
label.show()
|
||||
|
||||
self.pack_start(self.entry, True, True)
|
||||
self.pack_start(self.entry, True, True, 0)
|
||||
self.entry.show()
|
||||
|
||||
help_button = gtk.Button()
|
||||
icon = gtk.Image()
|
||||
icon.set_from_stock(gtk.STOCK_INFO, gtk.ICON_SIZE_BUTTON)
|
||||
help_button = Gtk.Button()
|
||||
icon = Gtk.Image()
|
||||
icon.set_from_stock(Gtk.STOCK_INFO, Gtk.IconSize.BUTTON)
|
||||
help_button.add(icon)
|
||||
help_button.connect("clicked", self._help_button_clicked)
|
||||
self.pack_start(help_button, False)
|
||||
self.pack_start(help_button, False, True, 0)
|
||||
help_button.show_all()
|
||||
|
||||
self.entry.connect("changed", lambda x: self.emit("changed"))
|
||||
@@ -42,7 +44,7 @@ class FilterBar(HIGHBox):
|
||||
self.entry.grab_focus()
|
||||
|
||||
def get_filter_string(self):
|
||||
return self.entry.get_text().decode("UTF-8")
|
||||
return self.entry.get_text()
|
||||
|
||||
def set_filter_string(self, filter_string):
|
||||
return self.entry.set_text(filter_string)
|
||||
|
||||
Reference in New Issue
Block a user