* loglevel Spinbutton eingebaut

* Zeiten korrigiert und eine dazu
This commit is contained in:
age 2006-06-15 22:00:11 +00:00
parent f598cb33e4
commit 4c316c7874
2 changed files with 62 additions and 6 deletions

View file

@ -12,8 +12,6 @@ class WknGUI:
configs = {} configs = {}
wkns = "" wkns = ""
log = "" log = ""
maxloglevel = 3
'''0:no logging; 1:errors; 2:status messages; 3:debug '''
def __init__(self, gtk): def __init__(self, gtk):
self.gladefile = "wkncharts.glade" self.gladefile = "wkncharts.glade"
@ -38,7 +36,7 @@ class WknGUI:
that's why, we let it read in the wkn file''' that's why, we let it read in the wkn file'''
charts = getWKNcharts.WKNCharts() charts = getWKNcharts.WKNCharts()
charts.readwkndictfromstring(self.wkns) charts.readwkndictfromstring(self.wkns)
#charts.set_times([30, 300]) ## configure getWKNcharts
charts.set_times(self.configs["times"]) charts.set_times(self.configs["times"])
charts.set_dstdir(self.configs["tf_dstdir"]) charts.set_dstdir(self.configs["tf_dstdir"])
## downlaoding in threads, so the gui won't hang ## downlaoding in threads, so the gui won't hang
@ -49,6 +47,7 @@ class WknGUI:
def clicked_read_settings(self, widget): def clicked_read_settings(self, widget):
configs = self.configs configs = self.configs
self.configs["maxloglevel"] = 3 ## 0:no logging; 1:errors; 2:status messages; 3:debug
## textfield values are stored in 'configs' ## textfield values are stored in 'configs'
textfieldnames = ["tf_srcfile", "tf_dstdir"] textfieldnames = ["tf_srcfile", "tf_dstdir"]
for name in textfieldnames: for name in textfieldnames:
@ -140,7 +139,7 @@ class WknGUI:
self.add_log("Verzeichnis nicht gefunden",1) self.add_log("Verzeichnis nicht gefunden",1)
def add_log(self, text, loglevel=2): def add_log(self, text, loglevel=2):
if loglevel <= self.maxloglevel: if int(loglevel) <= int(self.configs["maxloglevel"]):
self.logbuch = self.wkngui.get_widget("tf_logbook") self.logbuch = self.wkngui.get_widget("tf_logbook")
self.buffer = self.logbuch.get_buffer() self.buffer = self.logbuch.get_buffer()
self.log += "\n"+self.time.strftime('%H:%M:%S')+" " self.log += "\n"+self.time.strftime('%H:%M:%S')+" "

View file

@ -88,7 +88,7 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="editable">False</property> <property name="editable">False</property>
<property name="overwrite">False</property> <property name="overwrite">False</property>
<property name="accepts_tab">True</property> <property name="accepts_tab">False</property>
<property name="justification">GTK_JUSTIFY_CENTER</property> <property name="justification">GTK_JUSTIFY_CENTER</property>
<property name="wrap_mode">GTK_WRAP_NONE</property> <property name="wrap_mode">GTK_WRAP_NONE</property>
<property name="cursor_visible">True</property> <property name="cursor_visible">True</property>
@ -452,7 +452,6 @@
<widget class="GtkTextView" id="tf_srcfile"> <widget class="GtkTextView" id="tf_srcfile">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="extension_events">GDK_EXTENSION_EVENTS_ALL</property> <property name="extension_events">GDK_EXTENSION_EVENTS_ALL</property>
<property name="editable">True</property> <property name="editable">True</property>
<property name="overwrite">False</property> <property name="overwrite">False</property>
@ -804,6 +803,64 @@
</packing> </packing>
</child> </child>
<child>
<widget class="GtkHBox" id="hbox14">
<property name="border_width">2</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">3</property>
<child>
<widget class="GtkLabel" id="label17">
<property name="visible">True</property>
<property name="label" translatable="yes">Loglevel: </property>
<property name="use_underline">False</property>
<property name="use_markup">False</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>
<child>
<widget class="GtkSpinButton" id="sb_loglevel">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="climb_rate">1</property>
<property name="digits">0</property>
<property name="numeric">True</property>
<property name="update_policy">GTK_UPDATE_IF_VALID</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
<property name="adjustment">3 0 3 1 10 10</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child> <child>
<widget class="GtkHSeparator" id="hseparator1"> <widget class="GtkHSeparator" id="hseparator1">
<property name="visible">True</property> <property name="visible">True</property>