summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
Diffstat (limited to 'portato')
-rw-r--r--portato/constants.py72
-rw-r--r--portato/gui/gtk/basic.py4
-rw-r--r--portato/gui/gtk/windows.py7
-rw-r--r--portato/gui/templates/portato.glade150
4 files changed, 184 insertions, 49 deletions
diff --git a/portato/constants.py b/portato/constants.py
index 3aea05d..c76b737 100644
--- a/portato/constants.py
+++ b/portato/constants.py
@@ -14,62 +14,72 @@
Constants used through out the program. Mainly different pathes.
These should be set during the installation.
+@var APP: the application name
+@type APP: string
@var VERSION: the current version
@type VERSION: string
+@var HOME: shortcut to $HOME
+@type HOME: string
+@var SU_COMMAND: command to execute to "su"
+@type SU_COMMAND: string
+@var USE_CATAPULT: use the catapult backend or the normal ones
+@type USE_CATAPULT: boolean
+
+@var FRONTENDS: the list of frontends which are installed
+@type FRONTENDS: string[]
+@var STD_FRONTEND: the frontend uses as the default, i.e. if no other one is given on the cmdline
+@type STD_FRONTEND: string
+
@var CONFIG_DIR: The configuration directory.
@type CONFIG_DIR: string
@var CONFIG_LOCATION: L{CONFIG_DIR} plus name of the config file.
@type CONFIG_LOCATION: string
-@var DATA_DIR: Directory which contains several data files (e.g. ui-files).
-@type DATA_DIR: string
-@var PLUGIN_DIR: Directory containing the plugin xmls.
-@type PLUGIN_DIR: string
-@var XSD_DIR: Directory containing the plugin-xml schema.
-@type XSD_DIR: string
-@var XSD_LOCATION: Path of the plugin schema.
-@type XSD_LOCATION: string
+
@var ICON_DIR: directory containing the icons
@type ICON_DIR: string
@var APP_ICON: the path of the application icon
@type APP_ICON: string
+
+@var DATA_DIR: Directory which contains all shared files.
+@type DATA_DIR: string
@var LOCALE_DIR: the path to the directory where the locale files (*.mo) are stored.
@type LOCALE_DIR: string
-@var FRONTENDS: the list of frontends which are installed
-@type FRONTENDS: string[]
-@var STD_FRONTEND: the frontend uses as the default, i.e. if no other one is given on the cmdline
-@type STD_FRONTEND: string
-@var SU_COMMAND: command to execute to "su"
-@type SU_COMMAND: string
+@var PLUGIN_DIR: Directory containing the plugin xmls.
+@type PLUGIN_DIR: string
+@var SETTINGS_DIR: Directory containing the user specific settings.
+@type SETTINGS_DIR: string
+@var TEMPLATE_DIR: Directory containing the UI template files.
+@type TEMPLATE_DIR: string
+@var XSD_LOCATION: Path of the plugin schema.
+@type XSD_LOCATION: string
"""
import os
from os.path import join as pjoin
-HOME = os.environ["HOME"]
-
+# general
APP = "portato"
VERSION = "9999"
+HOME = os.environ["HOME"]
+SU_COMMAND = "gksu -D 'Portato'"
+USE_CATAPULT = True
-SETTINGS_DIR = pjoin(HOME, "."+APP)
+# frontends
+FRONTENDS = ["gtk"]
+STD_FRONTEND = "gtk"
+# config
CONFIG_DIR = "/etc/portato/"
CONFIG_LOCATION = pjoin(CONFIG_DIR, "portato.cfg")
-VAR_DIR = "/var/portato/"
-
-DATA_DIR = "portato/gui/templates/"
-PLUGIN_DIR = "plugins/"
-
-XSD_DIR = "./"
-XSD_LOCATION = pjoin(XSD_DIR, "plugin.xsd")
-
+# icons
ICON_DIR = "icons/"
APP_ICON = pjoin(ICON_DIR, "portato-icon.png")
+# misc dirs
+DATA_DIR = "./"
LOCALE_DIR = "i18n/"
+PLUGIN_DIR = pjoin(DATA_DIR, "plugins/")
+SETTINGS_DIR = pjoin(HOME, "."+APP)
+TEMPLATE_DIR = "portato/gui/templates/"
-FRONTENDS = ["gtk"]
-STD_FRONTEND = "gtk"
-
-SU_COMMAND = "gksu -D 'Portato'"
-
-USE_CATAPULT = True
+XSD_LOCATION = pjoin(DATA_DIR, "plugin.xsd")
diff --git a/portato/gui/gtk/basic.py b/portato/gui/gtk/basic.py
index 3737607..02caaf5 100644
--- a/portato/gui/gtk/basic.py
+++ b/portato/gui/gtk/basic.py
@@ -19,11 +19,11 @@ import gobject
from functools import wraps
-from ...constants import DATA_DIR, APP_ICON, APP, LOCALE_DIR
+from ...constants import TEMPLATE_DIR, APP_ICON, APP, LOCALE_DIR
gtk.glade.bindtextdomain (APP, LOCALE_DIR)
gtk.glade.textdomain (APP)
-GLADE_FILE = DATA_DIR+"portato.glade"
+GLADE_FILE = TEMPLATE_DIR+"portato.glade"
class Window (object):
def __init__ (self):
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py
index dc3dc35..456d962 100644
--- a/portato/gui/gtk/windows.py
+++ b/portato/gui/gtk/windows.py
@@ -28,7 +28,7 @@ from gettext import lgettext as _
# our backend stuff
from ... import listener, plugin
from ...helper import debug, warning, error, unique_array
-from ...constants import CONFIG_LOCATION, VERSION, APP_ICON
+from ...constants import CONFIG_LOCATION, VERSION, APP_ICON, DATA_DIR
from ...backend import flags, system
from ...backend.exceptions import PackageNotFoundException, BlockedException
@@ -390,10 +390,11 @@ class EbuildWindow (AbstractDialog):
self.view = gtk.TextView(self.buf)
else:
man = gtksourceview2.LanguageManager()
+ man.set_search_path(man.get_search_path()+[DATA_DIR])
language = man.get_language("ebuild")
if language is None:
- info(_("No ebuild language file installed. Falling back to shell."))
+ warning(_("No ebuild language file installed. Falling back to shell."))
language = man.get_language("sh")
# set buffer and view
@@ -713,10 +714,8 @@ class PackageTable:
if self.doEmerge:
# set emerge-button-label
if not self.actual_package().is_installed():
- self.emergeBtn.set_label(_("E_merge"))
self.unmergeBtn.set_sensitive(False)
else:
- self.emergeBtn.set_label(_("Re_merge"))
self.unmergeBtn.set_sensitive(True)
self.table.show_all()
diff --git a/portato/gui/templates/portato.glade b/portato/gui/templates/portato.glade
index 76d437c..a42bc25 100644
--- a/portato/gui/templates/portato.glade
+++ b/portato/gui/templates/portato.glade
@@ -93,7 +93,7 @@
<widget class="GtkImage" id="menu-item-image9">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK</property>
- <property name="stock">gtk-go-forward</property>
+ <property name="stock">gtk-add</property>
</widget>
</child>
</widget>
@@ -107,7 +107,7 @@
<widget class="GtkImage" id="menu-item-image10">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK</property>
- <property name="stock">gtk-go-back</property>
+ <property name="stock">gtk-remove</property>
</widget>
</child>
</widget>
@@ -513,19 +513,69 @@
<child>
<widget class="GtkButton" id="pkgEmergeBtn">
<property name="visible">True</property>
- <property name="label" translatable="yes">E_merge</property>
- <property name="use_underline">True</property>
+ <property name="tooltip" translatable="yes">Mark package for installation</property>
<property name="response_id">0</property>
<signal name="clicked" handler="cb_package_emerge_clicked"/>
+ <child>
+ <widget class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-add</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="emergeBtnLabel">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Add to E_merge Queue</property>
+ <property name="use_underline">True</property>
+ <property name="single_line_mode">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
</widget>
</child>
<child>
<widget class="GtkButton" id="pkgUnmergeBtn">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Unmerge</property>
- <property name="use_underline">True</property>
+ <property name="tooltip" translatable="yes">Mark package for deinstallation</property>
<property name="response_id">0</property>
<signal name="clicked" handler="cb_package_unmerge_clicked"/>
+ <child>
+ <widget class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-remove</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Add to _Unmerge Queue</property>
+ <property name="use_underline">True</property>
+ <property name="single_line_mode">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="position">1</property>
@@ -534,10 +584,33 @@
<child>
<widget class="GtkButton" id="pkgRevertBtn">
<property name="visible">True</property>
- <property name="label" translatable="yes">Re_vert</property>
- <property name="use_underline">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="cb_package_revert_clicked"/>
+ <child>
+ <widget class="GtkHBox" id="hbox6">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-undo</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Re_vert</property>
+ <property name="use_underline">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="position">2</property>
@@ -546,6 +619,7 @@
<child>
<widget class="GtkButton" id="pkgEbuildBtn">
<property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Show the ebuild for this package</property>
<property name="label" translatable="yes">E_build</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
@@ -718,19 +792,69 @@
<child>
<widget class="GtkButton" id="emergeBtn">
<property name="visible">True</property>
- <property name="label" translatable="yes">E_merge</property>
- <property name="use_underline">True</property>
+ <property name="tooltip" translatable="yes">Install all packages in the "Emerge Queue"</property>
<property name="response_id">0</property>
<signal name="clicked" handler="cb_emerge_clicked"/>
+ <child>
+ <widget class="GtkHBox" id="hbox7">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkImage" id="image6">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-add</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label12">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">E_merge</property>
+ <property name="use_underline">True</property>
+ <property name="single_line_mode">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
</widget>
</child>
<child>
<widget class="GtkButton" id="unmergeBtn">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Unmerge</property>
- <property name="use_underline">True</property>
+ <property name="tooltip" translatable="yes">Deinstall all packages in the "Unmerge Queue"</property>
<property name="response_id">0</property>
<signal name="clicked" handler="cb_unmerge_clicked"/>
+ <child>
+ <widget class="GtkHBox" id="hbox8">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkImage" id="image7">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-remove</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label13">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Unmerge</property>
+ <property name="use_underline">True</property>
+ <property name="single_line_mode">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="position">1</property>
@@ -739,6 +863,7 @@
<child>
<widget class="GtkButton" id="updateBtn">
<property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Calculate the packages which will be installed during an "update world"</property>
<property name="label" translatable="yes">Update _World</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
@@ -751,6 +876,7 @@
<child>
<widget class="GtkButton" id="removeBtn">
<property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Remove the selected package from the queue</property>
<property name="label" translatable="yes">_Remove</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>