attempt to fix gtk import
This commit is contained in:
parent
e0a9a3994d
commit
90abed89c1
@ -24,7 +24,7 @@ import time
|
||||
import re
|
||||
import copy
|
||||
import collections
|
||||
import gtk
|
||||
from gi.repository import Gtk
|
||||
import subprocess
|
||||
import time
|
||||
import sys
|
||||
|
@ -20,7 +20,7 @@
|
||||
###############################################################################
|
||||
|
||||
import sys
|
||||
import gtk
|
||||
from gi.repository import Gtk
|
||||
import traceback
|
||||
import re
|
||||
|
||||
|
@ -29,7 +29,7 @@ import request
|
||||
import urllib.parse
|
||||
import urllib.error
|
||||
|
||||
import gtk
|
||||
from gi.repository import Gtk
|
||||
import glib
|
||||
import pygtk
|
||||
import pango
|
||||
|
@ -19,7 +19,7 @@
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
import gtk
|
||||
from gi.repository import Gtk
|
||||
|
||||
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 copy
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
import gtk
|
||||
from gi.repository import Gtk
|
||||
|
||||
|
||||
class WidgetMap(dict):
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
from UserDict import DictMixin
|
||||
|
||||
|
||||
class OrderedDict(dict, DictMixin):
|
||||
|
||||
def __init__(self, *args, **kwds):
|
||||
|
@ -1,34 +1,37 @@
|
||||
################################################################################
|
||||
# #
|
||||
# Folding@Home Client Control (FAHControl) #
|
||||
# Copyright (C) 2016-2020 foldingathome.org #
|
||||
# Copyright (C) 2010-2016 Stanford University #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation, either version 3 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
################################################################################
|
||||
###############################################################################
|
||||
# #
|
||||
# Folding@Home Client Control (FAHControl) #
|
||||
# Copyright (C) 2016-2020 foldingathome.org #
|
||||
# Copyright (C) 2010-2016 Stanford University #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation, either version 3 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# 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
|
||||
|
||||
|
||||
class PasswordValidator(EntryValidator):
|
||||
def __init__(self, app, password_entry, reenter_entry, valid_image,
|
||||
valid_text, pattern = r'^.*$', description = ''):
|
||||
EntryValidator.__init__(self, app, password_entry, pattern, description)
|
||||
valid_text, pattern=r'^.*$', description=''):
|
||||
EntryValidator.__init__(self,
|
||||
app,
|
||||
password_entry,
|
||||
pattern,
|
||||
description)
|
||||
|
||||
self.password_entry = password_entry
|
||||
self.reenter_entry = reenter_entry
|
||||
@ -40,39 +43,38 @@ class PasswordValidator(EntryValidator):
|
||||
password_entry.connect('changed', self.on_changed)
|
||||
reenter_entry.connect('changed', self.on_changed)
|
||||
|
||||
|
||||
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()
|
||||
self.reenter_entry.set_text(password)
|
||||
|
||||
|
||||
def is_good(self):
|
||||
return self.entries_match() and self.is_valid()
|
||||
|
||||
|
||||
def entries_match(self):
|
||||
password = self.password_entry.get_text()
|
||||
reenter = self.reenter_entry.get_text()
|
||||
return password == reenter
|
||||
|
||||
|
||||
def update(self):
|
||||
valid = False
|
||||
if self.is_valid():
|
||||
if self.entries_match(): valid = True
|
||||
if self.entries_match():
|
||||
valid = True
|
||||
else:
|
||||
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:
|
||||
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')
|
||||
else:
|
||||
self.valid_image.set_from_stock(gtk.STOCK_DIALOG_ERROR,
|
||||
gtk.ICON_SIZE_BUTTON)
|
||||
self.valid_image.set_from_stock(Gtk.STOCK_DIALOG_ERROR,
|
||||
Gtk.ICON_SIZE_BUTTON)
|
||||
|
||||
|
||||
def on_changed(self, widget, data = None):
|
||||
def on_changed(self, widget, data=None):
|
||||
self.update()
|
||||
return False # Let the signal propagate
|
||||
return False # Let the signal propagate
|
||||
|
@ -24,7 +24,7 @@ import socket
|
||||
import threading
|
||||
import socketserver
|
||||
|
||||
import gtk
|
||||
from gi.repository import Gtk
|
||||
|
||||
from fah.Icon import get_icon
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
# fah.util
|
||||
import sys
|
||||
import os
|
||||
import gtk
|
||||
from gi.repository import Gtk
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
try:
|
||||
|
@ -19,7 +19,7 @@
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
import gtk
|
||||
from gi.repository import Gtk
|
||||
import gobject
|
||||
import pango
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user