attempt to fix gtk import

This commit is contained in:
Tux 2023-07-19 22:56:47 +02:00
parent e0a9a3994d
commit 90abed89c1
11 changed files with 49 additions and 46 deletions

View File

@ -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

View File

@ -20,7 +20,7 @@
############################################################################### ###############################################################################
import sys import sys
import gtk from gi.repository import Gtk
import traceback import traceback
import re import re

View File

@ -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

View File

@ -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}

View File

@ -19,7 +19,7 @@
# # # #
############################################################################### ###############################################################################
import gtk from gi.repository import Gtk
import gobject import gobject
import copy import copy

View File

@ -19,7 +19,7 @@
# # # #
############################################################################### ###############################################################################
import gtk from gi.repository import Gtk
class WidgetMap(dict): class WidgetMap(dict):

View File

@ -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):

View File

@ -1,34 +1,37 @@
################################################################################ ###############################################################################
# # # #
# Folding@Home Client Control (FAHControl) # # Folding@Home Client Control (FAHControl) #
# Copyright (C) 2016-2020 foldingathome.org # # Copyright (C) 2016-2020 foldingathome.org #
# Copyright (C) 2010-2016 Stanford University # # Copyright (C) 2010-2016 Stanford University #
# # # #
# This program is free software: you can redistribute it and/or modify # # 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 # # it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or # # the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. # # (at your option) any later version. #
# # # #
# This program is distributed in the hope that it will be useful, # # This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of # # but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. # # GNU General Public License for more details. #
# # # #
# 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

View File

@ -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

View File

@ -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:

View File

@ -19,7 +19,7 @@
# # # #
############################################################################### ###############################################################################
import gtk from gi.repository import Gtk
import gobject import gobject
import pango import pango