attempt to fix gtk import
This commit is contained in:
parent
e0a9a3994d
commit
90abed89c1
@ -24,7 +24,7 @@ import time
|
|||||||
import re
|
import re
|
||||||
import copy
|
import copy
|
||||||
import collections
|
import collections
|
||||||
import gtk
|
from gi.repository import Gtk
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import gtk
|
from gi.repository import Gtk
|
||||||
import traceback
|
import traceback
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ import request
|
|||||||
import urllib.parse
|
import urllib.parse
|
||||||
import urllib.error
|
import urllib.error
|
||||||
|
|
||||||
import gtk
|
from gi.repository import Gtk
|
||||||
import glib
|
import glib
|
||||||
import pygtk
|
import pygtk
|
||||||
import pango
|
import pango
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
# #
|
# #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import gtk
|
from gi.repository import Gtk
|
||||||
|
|
||||||
icons = {'tiny': None, 'small': None, 'medium': None, 'large': None}
|
icons = {'tiny': None, 'small': None, 'medium': None, 'large': None}
|
||||||
viewer_icons = {'tiny': None, 'small': None, 'medium': None, 'large': None}
|
viewer_icons = {'tiny': None, 'small': None, 'medium': None, 'large': None}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
# #
|
# #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import gtk
|
from gi.repository import Gtk
|
||||||
import gobject
|
import gobject
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
# #
|
# #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import gtk
|
from gi.repository import Gtk
|
||||||
|
|
||||||
|
|
||||||
class WidgetMap(dict):
|
class WidgetMap(dict):
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
from UserDict import DictMixin
|
from UserDict import DictMixin
|
||||||
|
|
||||||
|
|
||||||
class OrderedDict(dict, DictMixin):
|
class OrderedDict(dict, DictMixin):
|
||||||
|
|
||||||
def __init__(self, *args, **kwds):
|
def __init__(self, *args, **kwds):
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
################################################################################
|
###############################################################################
|
||||||
# #
|
# #
|
||||||
# Folding@Home Client Control (FAHControl) #
|
# Folding@Home Client Control (FAHControl) #
|
||||||
# Copyright (C) 2016-2020 foldingathome.org #
|
# Copyright (C) 2016-2020 foldingathome.org #
|
||||||
@ -17,18 +17,21 @@
|
|||||||
# You should have received a copy of the GNU General Public License #
|
# You should have received a copy of the GNU General Public License #
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
||||||
# #
|
# #
|
||||||
################################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
import gtk
|
from gi.repository import Gtk
|
||||||
|
|
||||||
from fah.util.EntryValidator import EntryValidator
|
from fah.util.EntryValidator import EntryValidator
|
||||||
|
|
||||||
|
|
||||||
class PasswordValidator(EntryValidator):
|
class PasswordValidator(EntryValidator):
|
||||||
def __init__(self, app, password_entry, reenter_entry, valid_image,
|
def __init__(self, app, password_entry, reenter_entry, valid_image,
|
||||||
valid_text, pattern = r'^.*$', description = ''):
|
valid_text, pattern=r'^.*$', description=''):
|
||||||
EntryValidator.__init__(self, app, password_entry, pattern, description)
|
EntryValidator.__init__(self,
|
||||||
|
app,
|
||||||
|
password_entry,
|
||||||
|
pattern,
|
||||||
|
description)
|
||||||
|
|
||||||
self.password_entry = password_entry
|
self.password_entry = password_entry
|
||||||
self.reenter_entry = reenter_entry
|
self.reenter_entry = reenter_entry
|
||||||
@ -40,39 +43,38 @@ class PasswordValidator(EntryValidator):
|
|||||||
password_entry.connect('changed', self.on_changed)
|
password_entry.connect('changed', self.on_changed)
|
||||||
reenter_entry.connect('changed', self.on_changed)
|
reenter_entry.connect('changed', self.on_changed)
|
||||||
|
|
||||||
|
|
||||||
def set_good(self):
|
def set_good(self):
|
||||||
if not self.is_valid(): self.password_entry.set_text('')
|
if not self.is_valid():
|
||||||
|
self.password_entry.set_text('')
|
||||||
password = self.password_entry.get_text()
|
password = self.password_entry.get_text()
|
||||||
self.reenter_entry.set_text(password)
|
self.reenter_entry.set_text(password)
|
||||||
|
|
||||||
|
|
||||||
def is_good(self):
|
def is_good(self):
|
||||||
return self.entries_match() and self.is_valid()
|
return self.entries_match() and self.is_valid()
|
||||||
|
|
||||||
|
|
||||||
def entries_match(self):
|
def entries_match(self):
|
||||||
password = self.password_entry.get_text()
|
password = self.password_entry.get_text()
|
||||||
reenter = self.reenter_entry.get_text()
|
reenter = self.reenter_entry.get_text()
|
||||||
return password == reenter
|
return password == reenter
|
||||||
|
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
valid = False
|
valid = False
|
||||||
if self.is_valid():
|
if self.is_valid():
|
||||||
if self.entries_match(): valid = True
|
if self.entries_match():
|
||||||
|
valid = True
|
||||||
else:
|
else:
|
||||||
self.valid_text.set_text('Entries do not match')
|
self.valid_text.set_text('Entries do not match')
|
||||||
else: self.valid_text.set_text('Entry is invalid')
|
else:
|
||||||
|
self.valid_text.set_text('Entry is invalid')
|
||||||
|
|
||||||
if valid:
|
if valid:
|
||||||
self.valid_image.set_from_stock(gtk.STOCK_YES, gtk.ICON_SIZE_BUTTON)
|
self.valid_image.set_from_stock(Gtk.STOCK_YES,
|
||||||
|
Gtk.ICON_SIZE_BUTTON)
|
||||||
self.valid_text.set_text('Entries match')
|
self.valid_text.set_text('Entries match')
|
||||||
else:
|
else:
|
||||||
self.valid_image.set_from_stock(gtk.STOCK_DIALOG_ERROR,
|
self.valid_image.set_from_stock(Gtk.STOCK_DIALOG_ERROR,
|
||||||
gtk.ICON_SIZE_BUTTON)
|
Gtk.ICON_SIZE_BUTTON)
|
||||||
|
|
||||||
|
def on_changed(self, widget, data=None):
|
||||||
def on_changed(self, widget, data = None):
|
|
||||||
self.update()
|
self.update()
|
||||||
return False # Let the signal propagate
|
return False # Let the signal propagate
|
||||||
|
@ -24,7 +24,7 @@ import socket
|
|||||||
import threading
|
import threading
|
||||||
import socketserver
|
import socketserver
|
||||||
|
|
||||||
import gtk
|
from gi.repository import Gtk
|
||||||
|
|
||||||
from fah.Icon import get_icon
|
from fah.Icon import get_icon
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
# fah.util
|
# fah.util
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import gtk
|
from gi.repository import Gtk
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
try:
|
try:
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
# #
|
# #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import gtk
|
from gi.repository import Gtk
|
||||||
import gobject
|
import gobject
|
||||||
import pango
|
import pango
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user