Moved Glade file and icon files to a new directory called 'res'.

pull/61/head
Christian T. Jacobs 2017-04-02 14:02:40 +01:00
rodzic 9e73b2abfa
commit 76b673475e
12 zmienionych plików z 19 dodań i 31 usunięć

Wyświetl plik

@ -30,11 +30,6 @@ import os
import os.path
import sys
import signal
# This will help Python find the PyQSO modules that need to be imported below.
pyqso_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir)
sys.path.insert(0, pyqso_path)
import logging
logging.basicConfig(level=logging.INFO)
logging.info("PyQSO version 1.0.0")
@ -59,7 +54,8 @@ class PyQSO:
"""
self.builder = Gtk.Builder()
self.builder.add_from_file(os.path.abspath(os.path.dirname(__file__)) + "/../pyqso/glade/pyqso.glade")
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
self.builder.add_from_file(glade_file_path)
self.window = self.builder.get_object("pyqso")
# Check that the directory for holding PyQSO configuration files exists. If it doesn't, create it now.
@ -76,14 +72,7 @@ class PyQSO:
# Check that the configuration file actually exists (and is readable)
# otherwise, we will resort to the defaults.
have_config = (config.read(os.path.expanduser("~/.config/pyqso/preferences.ini")) != [])
possible_icon_paths = [os.path.join(pyqso_path, "icons", "log_64x64.png")]
for icon_path in possible_icon_paths:
try:
self.window.set_icon_from_file(icon_path)
except Exception as e:
logging.error(e)
have_config = (config.read(config_directory + "/preferences.ini") != [])
# Kills the application if the close button is clicked on the main window itself.
self.window.connect("delete-event", Gtk.main_quit)
@ -130,20 +119,15 @@ class PyQSO:
def show_about(self, widget):
""" Show the About dialog, which includes license information. """
self.builder.add_objects_from_file(os.path.abspath(os.path.dirname(__file__)) + "/../pyqso/glade/pyqso.glade", ("about_dialog",))
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
self.builder.add_objects_from_file(glade_file_path, ("about_dialog",))
about = self.builder.get_object("about_dialog")
possible_icon_paths = [os.path.join(pyqso_path, "icons", "log_64x64.png")]
for icon_path in possible_icon_paths:
try:
about.set_logo(GdkPixbuf.Pixbuf.new_from_file_at_scale(icon_path, 64, 64, False))
except Exception as e:
logging.exception(e)
about.run()
about.destroy()
return
def show_preferences(self, widget):
""" Show the Preferences dialog. Any changes made by the user after clicking the 'Ok' button are saved in the .cfg file. """
""" Show the Preferences dialog. Any changes made by the user after clicking the 'Ok' button are saved in the configuration file. """
preferences = PreferencesDialog(self)
response = preferences.dialog.run()
if(response == Gtk.ResponseType.OK):

Wyświetl plik

@ -32,7 +32,8 @@ class CalendarDialog:
"""
logging.debug("Setting up the calendar dialog...")
self.builder = application.builder
self.builder.add_objects_from_file(os.path.abspath(os.path.dirname(__file__)) + "/glade/pyqso.glade", ("calendar_dialog",))
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
self.builder.add_objects_from_file(glade_file_path, ("calendar_dialog",))
self.dialog = self.builder.get_object("calendar_dialog")
# TODO: Make the dialog a parent of the RecordDialog.
self.calendar = self.builder.get_object("calendar")

Wyświetl plik

@ -84,7 +84,8 @@ class DXCluster:
# Build connection dialog
logging.debug("Setting up the Telnet connection dialog...")
self.builder.add_objects_from_file(os.path.abspath(os.path.dirname(__file__)) + "/glade/pyqso.glade", ("telnet_connection_dialog",))
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
self.builder.add_objects_from_file(glade_file_path, ("telnet_connection_dialog",))
dialog = self.builder.get_object("telnet_connection_dialog")
connection_info = {"HOST": self.builder.get_object("host_entry"),
"PORT": self.builder.get_object("port_entry"),

Wyświetl plik

@ -36,7 +36,8 @@ class LogNameDialog:
logging.debug("Building new log name dialog...")
self.builder = application.builder
self.builder.add_objects_from_file(os.path.abspath(os.path.dirname(__file__)) + "/glade/pyqso.glade", ("log_name_dialog",))
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
self.builder.add_objects_from_file(glade_file_path, ("log_name_dialog",))
self.dialog = self.builder.get_object("log_name_dialog")
if(title is None):

Wyświetl plik

@ -56,8 +56,8 @@ class PreferencesDialog:
self.application = application
self.builder = self.application.builder
self.builder.add_objects_from_file(os.path.abspath(os.path.dirname(__file__)) + "/glade/pyqso.glade", ("preferences_dialog",))
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
self.builder.add_objects_from_file(glade_file_path, ("preferences_dialog",))
self.dialog = self.builder.get_object("preferences_dialog")
self.general = GeneralPage(self.builder)

Wyświetl plik

@ -56,8 +56,8 @@ class RecordDialog:
self.application = application
self.builder = self.application.builder
self.builder.add_objects_from_file(os.path.abspath(os.path.dirname(__file__)) + "/glade/pyqso.glade", ("record_dialog",))
glade_file_path = os.path.join(os.path.realpath(os.path.dirname(__file__)), os.pardir, "res/pyqso.glade")
self.builder.add_objects_from_file(glade_file_path, ("record_dialog",))
self.dialog = self.builder.get_object("record_dialog")
self.builder.get_object("record_dialog").connect("key-release-event", self._on_key_release)

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 667 B

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 667 B

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 47 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 47 KiB

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 6.8 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 6.8 KiB

Wyświetl plik

@ -116,6 +116,7 @@
<property name="window_position">center</property>
<property name="default_width">800</property>
<property name="default_height">600</property>
<property name="icon">log_64x64.png</property>
<child>
<object class="GtkBox" id="vbox_outer">
<property name="visible">True</property>
@ -875,7 +876,7 @@ 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 &lt;http://www.gnu.org/licenses/&gt;.</property>
<property name="authors">Christian Thomas Jacobs, M0UOS</property>
<property name="logo_icon_name"/>
<property name="logo">log_64x64.png</property>
<property name="license_type">custom</property>
<child internal-child="vbox">
<object class="GtkBox" id="about_dialog_vbox">

Wyświetl plik

@ -28,7 +28,7 @@ setup(name="PyQSO",
packages=["pyqso"],
package_dir={"pyqso": "pyqso"},
scripts=["bin/pyqso"],
data_files=[("icons", ["icons/log_64x64.png"])],
data_files=[("res", ["res/pyqso.glade", "res/log_64x64.png"])],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: End Users/Desktop",