ClientEnvironment.__init__(self)
self.startupNotices = []
- def setup(self, bindir):
+ def setup(self, bindir, isDebug=False, configFileLocation=None,
+ shelfLocation=None):
try:
- ClientEnvironment.setup(self)
+ ClientEnvironment.setup(self, configFileLocation, shelfLocation)
except ClientEnvironmentError, e:
self.startupNotices += [e[0]]
return False
- # TODO: Make it possible for the user to specify configuration file on the command line.
+ self.isDebug = isDebug
self.thumbnailSize = self.config.getcoordlist(
"gkofoto", "thumbnail_size_limit")[0]
self.defaultTableViewColumns = re.findall(
self.widgets = WidgetsWrapper()
- self.isDebug = False # TODO get as a command line parameter
return True
def _writeInfo(self, infoString):
</child>
</widget>
+<widget class="GtkDialog" id="aboutDialog">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">About Kofoto</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="has_separator">True</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox5">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area5">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="okbutton3">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox13">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="nameAndVersionLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><span size="xx-large">Kofoto development version</span></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">10</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label37">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">An image categorization tool.</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.46</property>
+ <property name="xpad">0</property>
+ <property name="ypad">5</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label38">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><span size="small">Copyright © 2002-2004 Joel Rosdahl and Ulrik Svensson</span></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
</glade-interface>
import sys
+from kofoto.clientenvironment import DEFAULT_CONFIGFILE_LOCATION
from gkofoto.environment import env
from gkofoto.controller import Controller
+from optparse import OptionParser
def main(bindir, argv):
- setupOk = env.setup(bindir)
+ parser = OptionParser(version=env.version)
+ parser.add_option(
+ "--configfile",
+ type="string",
+ dest="configfile",
+ help="use configuration file CONFIGFILE instead of the default (%s)" % (
+ DEFAULT_CONFIGFILE_LOCATION),
+ default=None)
+ parser.add_option(
+ "--debug",
+ action="store_true",
+ help="print debug messages to stdout",
+ default=False)
+ parser.add_option(
+ "--shelf",
+ type="string",
+ dest="shelf",
+ help="use shelf SHELF instead of the default (specified in the configuration file)",
+ default=None)
+ options, args = parser.parse_args(argv[1:])
+
+ if len(args) != 0:
+ parser.error("incorrect number of arguments")
+
+ setupOk = env.setup(
+ bindir, options.debug, options.configfile, options.shelf)
env.controller = Controller()
env.controller.start(setupOk)