mirror of
https://github.com/gryf/pygtktalog.git
synced 2025-12-17 19:40:21 +01:00
* Added params for window dimensions.
* Removed comments and something with code blocks.
This commit is contained in:
52
mainwin.py
52
mainwin.py
@@ -418,13 +418,15 @@ class PyGTKtalog:
|
|||||||
|
|
||||||
def storeSettings(self):
|
def storeSettings(self):
|
||||||
"""Store window size and pane position in config file (using config object)"""
|
"""Store window size and pane position in config file (using config object)"""
|
||||||
|
if self.conf.confd['savewin']:
|
||||||
|
self.conf.confd['wx'], self.conf.confd['wy'] = self.window.get_size()
|
||||||
|
|
||||||
|
if self.conf.confd['savepan']:
|
||||||
hpan = self.pygtkcat.get_widget('hpaned1')
|
hpan = self.pygtkcat.get_widget('hpaned1')
|
||||||
vpan = self.pygtkcat.get_widget('vpaned1')
|
vpan = self.pygtkcat.get_widget('vpaned1')
|
||||||
|
|
||||||
self.conf.confd['wx'], self.conf.confd['wy'] = self.window.get_size()
|
|
||||||
self.conf.confd['h'],self.conf.confd['v'] = hpan.get_position(), vpan.get_position()
|
self.conf.confd['h'],self.conf.confd['v'] = hpan.get_position(), vpan.get_position()
|
||||||
self.conf.save()
|
|
||||||
|
|
||||||
|
self.conf.save()
|
||||||
return
|
return
|
||||||
|
|
||||||
def preferences(self,widget):
|
def preferences(self,widget):
|
||||||
@@ -439,16 +441,13 @@ class PyGTKtalog:
|
|||||||
# check if any unsaved project is on go.
|
# check if any unsaved project is on go.
|
||||||
try:
|
try:
|
||||||
if self.active_project and self.unsaved_project:
|
if self.active_project and self.unsaved_project:
|
||||||
# True, if user want to abandon changes/db
|
if self.conf.confd['confirmunsaved']:
|
||||||
# NOTE: uncomment this!
|
obj = dialogs.Qst('Quit application - pyGTKtalog','There is not saved database\nDo you really want to quit?')
|
||||||
#obj = dialogs.Qst('Quit application - pyGTKtalog','There is not saved database\nDo you really want to quit?')
|
if not obj.run():
|
||||||
#if not obj.run():
|
|
||||||
if False:
|
|
||||||
return
|
return
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
# NOTE: uncomment this!
|
self.storeSettings()
|
||||||
#self.storeSettings()
|
|
||||||
gtk.main_quit()
|
gtk.main_quit()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -483,16 +482,13 @@ class PyGTKtalog:
|
|||||||
# check if any unsaved project is on go.
|
# check if any unsaved project is on go.
|
||||||
try:
|
try:
|
||||||
if self.active_project and self.unsaved_project:
|
if self.active_project and self.unsaved_project:
|
||||||
# True, if user want to abandon changes/db
|
if self.conf.confd['confirmunsaved']:
|
||||||
# NOTE: uncomment this!
|
obj = dialogs.Qst('Quit application - pyGTKtalog','There is not saved database\nDo you really want to quit?')
|
||||||
#obj = dialogs.Qst('Quit application - pyGTKtalog','There is not saved database\nDo you really want to quit?')
|
if not obj.run():
|
||||||
#if not obj.run():
|
|
||||||
if False:
|
|
||||||
return True
|
return True
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
# NOTE: uncomment this!
|
self.storeSettings()
|
||||||
#self.storeSettings()
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
@@ -500,18 +496,18 @@ class PyGTKtalog:
|
|||||||
gtk.main()
|
gtk.main()
|
||||||
|
|
||||||
def addCD(self,widget):
|
def addCD(self,widget):
|
||||||
# NOTE: uncomment this!
|
mount = deviceHelper.volmount(self.conf.confd['cd'])
|
||||||
#mount = deviceHelper.volmount(self.conf.confd['cd'])
|
if mount == 'ok':
|
||||||
#if mount == 'ok':
|
guessed_label = deviceHelper.volname(self.conf.confd['cd'])
|
||||||
if True:
|
obj = dialogs.InputDiskLabel(guessed_label)
|
||||||
# NOTE: uncomment this!
|
if obj.run() != None:
|
||||||
#guessed_label = deviceHelper.volname(self.conf.confd['cd'])
|
|
||||||
#obj = dialogs.InputDiskLabel(guessed_label)
|
|
||||||
#if obj.run() != None:
|
|
||||||
if True:
|
|
||||||
self.scan(self.conf.confd['cd'])
|
self.scan(self.conf.confd['cd'])
|
||||||
# NOTE: uncomment this!
|
deviceHelper.mountpoint_to_dev(self.conf.confd['cd'])
|
||||||
#deviceHelper.eject_cd()
|
if self.conf.confd['eject']:
|
||||||
|
deviceHelper.eject_cd()
|
||||||
|
else:
|
||||||
|
if deviceHelper.volmount(self.conf.confd['cd'])!= 'ok':
|
||||||
|
dialogs.Wrn("error unmounting device - pyGTKtalog","Cannot unmount device pointed to %s.\nLast umount message:\n<tt>%s</tt>" % (self.conf.confd['cd'],mount))
|
||||||
else:
|
else:
|
||||||
dialogs.Wrn("error mounting device - pyGTKtalog","Cannot mount device pointed to %s.\nLast mount message:\n<tt>%s</tt>" % (self.conf.confd['cd'],mount))
|
dialogs.Wrn("error mounting device - pyGTKtalog","Cannot mount device pointed to %s.\nLast mount message:\n<tt>%s</tt>" % (self.conf.confd['cd'],mount))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user