das script ist jetzt bis auf nicht gefundene bugs fertig.

This commit is contained in:
phear 2006-09-21 15:43:19 +00:00
parent 6b7ddc5955
commit c907a10b4c
3 changed files with 813 additions and 567 deletions

View file

@ -4,7 +4,7 @@
<glade-interface> <glade-interface>
<widget class="GtkWindow" id="mainwindow"> <widget class="GtkWindow" id="mainwindow">
<property name="height_request">216</property> <property name="height_request">316</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="title" translatable="yes">Invoice Number Generator</property> <property name="title" translatable="yes">Invoice Number Generator</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="type">GTK_WINDOW_TOPLEVEL</property>
@ -23,42 +23,75 @@
<signal name="destroy" handler="on_mainwindow_destroy" last_modification_time="Thu, 21 Sep 2006 10:49:34 GMT"/> <signal name="destroy" handler="on_mainwindow_destroy" last_modification_time="Thu, 21 Sep 2006 10:49:34 GMT"/>
<child> <child>
<widget class="GtkVBox" id="vbox1"> <widget class="GtkVBox" id="vbox6">
<property name="border_width">10</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkHBox" id="hbox5">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkVBox" id="HauptboxTab1">
<property name="height_request">322</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">15</property> <property name="spacing">15</property>
<child> <child>
<widget class="GtkScrolledWindow" id="scrolledwindow1"> <widget class="GtkAlignment" id="alignment5">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="xalign">0.5</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property> <property name="yalign">0.5</property>
<property name="vscrollbar_policy">GTK_POLICY_NEVER</property> <property name="xscale">1</property>
<property name="shadow_type">GTK_SHADOW_IN</property> <property name="yscale">1</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property> <property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child> <child>
<widget class="GtkTextView" id="Intro"> <widget class="GtkVBox" id="vbox6">
<property name="border_width">4</property>
<property name="height_request">24</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="homogeneous">False</property>
<property name="editable">False</property> <property name="spacing">0</property>
<property name="overwrite">False</property>
<property name="accepts_tab">False</property> <child>
<property name="justification">GTK_JUSTIFY_CENTER</property> <widget class="GtkLabel" id="label6">
<property name="wrap_mode">GTK_WRAP_NONE</property> <property name="visible">True</property>
<property name="cursor_visible">False</property> <property name="label" translatable="yes">please select an available invoice number system below.</property>
<property name="pixels_above_lines">0</property> <property name="use_underline">False</property>
<property name="pixels_below_lines">0</property> <property name="use_markup">False</property>
<property name="pixels_inside_wrap">0</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="left_margin">0</property> <property name="wrap">False</property>
<property name="right_margin">0</property> <property name="selectable">False</property>
<property name="indent">0</property> <property name="xalign">0.5</property>
<property name="text" translatable="yes">Generated Number:</property> <property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing>
<property name="padding">4</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child> </child>
<child>
<widget class="GtkComboBox" id="SectionComboBox">
<property name="visible">True</property>
<property name="has_focus">True</property>
<property name="items" translatable="yes" comments="the Text entry has to contain a whitespace for the script to work."> </property>
<property name="add_tearoffs">False</property>
<property name="focus_on_click">True</property>
<signal name="changed" handler="on_SectionComboBox_changed" last_modification_time="Thu, 21 Sep 2006 15:15:41 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -66,10 +99,19 @@
<property name="fill">False</property> <property name="fill">False</property>
</packing> </packing>
</child> </child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child> <child>
<widget class="GtkScrolledWindow" id="scrolledwindow2"> <widget class="GtkScrolledWindow" id="scrolledwindow2">
<property name="height_request">72</property> <property name="height_request">107</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property> <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
@ -78,22 +120,70 @@
<property name="window_placement">GTK_CORNER_TOP_LEFT</property> <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child> <child>
<widget class="GtkTextView" id="NumberDisplay"> <widget class="GtkViewport" id="viewport1">
<property name="visible">True</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="label" translatable="yes">Generated Number</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>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</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="NumberDisplay">
<property name="height_request">79</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="editable">False</property> <property name="label" translatable="yes">
<property name="overwrite">False</property> </property>
<property name="accepts_tab">False</property> <property name="use_underline">False</property>
<property name="justification">GTK_JUSTIFY_CENTER</property> <property name="use_markup">True</property>
<property name="wrap_mode">GTK_WRAP_NONE</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="cursor_visible">False</property> <property name="wrap">False</property>
<property name="pixels_above_lines">0</property> <property name="selectable">True</property>
<property name="pixels_below_lines">0</property> <property name="xalign">0.5</property>
<property name="pixels_inside_wrap">0</property> <property name="yalign">0.5</property>
<property name="left_margin">0</property> <property name="xpad">0</property>
<property name="right_margin">0</property> <property name="ypad">0</property>
<property name="indent">0</property> <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="text" translatable="yes"></property> <property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -106,49 +196,40 @@
<child> <child>
<widget class="GtkVBox" id="vbox2"> <widget class="GtkVBox" id="vbox2">
<property name="height_request">82</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
<child> <child>
<widget class="GtkScrolledWindow" id="scrolledwindow3"> <widget class="GtkLabel" id="label8">
<property name="height_request">21</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="label" translatable="yes">If you used the generated number, then click Yes below.</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property> <property name="use_underline">False</property>
<property name="vscrollbar_policy">GTK_POLICY_NEVER</property> <property name="use_markup">False</property>
<property name="shadow_type">GTK_SHADOW_IN</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property> <property name="wrap">False</property>
<property name="selectable">False</property>
<child> <property name="xalign">0.5</property>
<widget class="GtkTextView" id="ButtonExplanation"> <property name="yalign">0.5</property>
<property name="visible">True</property> <property name="xpad">0</property>
<property name="can_focus">True</property> <property name="ypad">0</property>
<property name="editable">False</property> <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="overwrite">False</property> <property name="width_chars">-1</property>
<property name="accepts_tab">True</property> <property name="single_line_mode">False</property>
<property name="justification">GTK_JUSTIFY_CENTER</property> <property name="angle">0</property>
<property name="wrap_mode">GTK_WRAP_WORD</property>
<property name="cursor_visible">False</property>
<property name="pixels_above_lines">0</property>
<property name="pixels_below_lines">0</property>
<property name="pixels_inside_wrap">0</property>
<property name="left_margin">0</property>
<property name="right_margin">0</property>
<property name="indent">0</property>
<property name="text" translatable="yes">If you used the generated number, then click Yes below.</property>
</widget>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">True</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox3"> <widget class="GtkHBox" id="hbox3">
<property name="border_width">9</property> <property name="border_width">7</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
<property name="spacing">37</property> <property name="spacing">37</property>
@ -235,7 +316,6 @@ has been used.</property>
<child> <child>
<widget class="GtkButton" id="CancelButton"> <widget class="GtkButton" id="CancelButton">
<property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property> <property name="focus_on_click">True</property>
@ -279,7 +359,7 @@ has been used.</property>
<child> <child>
<widget class="GtkLabel" id="label3"> <widget class="GtkLabel" id="label3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">No, this button <property name="label" translatable="yes">No, this number
has not been used.</property> has not been used.</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
@ -327,6 +407,32 @@ has not been used.</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkStatusbar" id="StatusBar">
<property name="visible">True</property>
<property name="has_resize_grip">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child> </child>
</widget> </widget>

View file

@ -4,7 +4,7 @@
<glade-interface> <glade-interface>
<widget class="GtkWindow" id="mainwindow"> <widget class="GtkWindow" id="mainwindow">
<property name="height_request">216</property> <property name="height_request">316</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="title" translatable="yes">Invoice Number Generator</property> <property name="title" translatable="yes">Invoice Number Generator</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="type">GTK_WINDOW_TOPLEVEL</property>
@ -20,44 +20,78 @@
<property name="focus_on_map">True</property> <property name="focus_on_map">True</property>
<property name="urgency_hint">False</property> <property name="urgency_hint">False</property>
<signal name="destroy_event" handler="on_mainwindow_destroy_event" last_modification_time="Thu, 21 Sep 2006 10:17:44 GMT"/> <signal name="destroy_event" handler="on_mainwindow_destroy_event" last_modification_time="Thu, 21 Sep 2006 10:17:44 GMT"/>
<signal name="destroy" handler="on_mainwindow_destroy" last_modification_time="Thu, 21 Sep 2006 10:49:34 GMT"/>
<child> <child>
<widget class="GtkVBox" id="vbox1"> <widget class="GtkVBox" id="vbox6">
<property name="border_width">10</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkHBox" id="hbox5">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkVBox" id="HauptboxTab1">
<property name="height_request">322</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">15</property> <property name="spacing">15</property>
<child> <child>
<widget class="GtkScrolledWindow" id="scrolledwindow1"> <widget class="GtkAlignment" id="alignment5">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="xalign">0.5</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property> <property name="yalign">0.5</property>
<property name="vscrollbar_policy">GTK_POLICY_NEVER</property> <property name="xscale">1</property>
<property name="shadow_type">GTK_SHADOW_IN</property> <property name="yscale">1</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property> <property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child> <child>
<widget class="GtkTextView" id="Intro"> <widget class="GtkVBox" id="vbox6">
<property name="border_width">4</property>
<property name="height_request">24</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="homogeneous">False</property>
<property name="editable">False</property> <property name="spacing">0</property>
<property name="overwrite">False</property>
<property name="accepts_tab">False</property> <child>
<property name="justification">GTK_JUSTIFY_CENTER</property> <widget class="GtkLabel" id="label6">
<property name="wrap_mode">GTK_WRAP_NONE</property> <property name="visible">True</property>
<property name="cursor_visible">False</property> <property name="label" translatable="yes">please select an available invoice number system below.</property>
<property name="pixels_above_lines">0</property> <property name="use_underline">False</property>
<property name="pixels_below_lines">0</property> <property name="use_markup">False</property>
<property name="pixels_inside_wrap">0</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="left_margin">0</property> <property name="wrap">False</property>
<property name="right_margin">0</property> <property name="selectable">False</property>
<property name="indent">0</property> <property name="xalign">0.5</property>
<property name="text" translatable="yes">Generated Number:</property> <property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing>
<property name="padding">4</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child> </child>
<child>
<widget class="GtkComboBox" id="SectionComboBox">
<property name="visible">True</property>
<property name="has_focus">True</property>
<property name="items" translatable="yes" comments="the Text entry has to contain a whitespace for the script to work."> </property>
<property name="add_tearoffs">False</property>
<property name="focus_on_click">True</property>
<signal name="changed" handler="on_SectionComboBox_changed" last_modification_time="Thu, 21 Sep 2006 15:15:41 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -65,10 +99,19 @@
<property name="fill">False</property> <property name="fill">False</property>
</packing> </packing>
</child> </child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child> <child>
<widget class="GtkScrolledWindow" id="scrolledwindow2"> <widget class="GtkScrolledWindow" id="scrolledwindow2">
<property name="height_request">72</property> <property name="height_request">107</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property> <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
@ -77,22 +120,70 @@
<property name="window_placement">GTK_CORNER_TOP_LEFT</property> <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child> <child>
<widget class="GtkTextView" id="NumberDisplay"> <widget class="GtkViewport" id="viewport1">
<property name="visible">True</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="label" translatable="yes">Generated Number</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>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</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="NumberDisplay">
<property name="height_request">79</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="editable">False</property> <property name="label" translatable="yes">
<property name="overwrite">False</property> </property>
<property name="accepts_tab">False</property> <property name="use_underline">False</property>
<property name="justification">GTK_JUSTIFY_CENTER</property> <property name="use_markup">True</property>
<property name="wrap_mode">GTK_WRAP_NONE</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="cursor_visible">False</property> <property name="wrap">False</property>
<property name="pixels_above_lines">0</property> <property name="selectable">True</property>
<property name="pixels_below_lines">0</property> <property name="xalign">0.5</property>
<property name="pixels_inside_wrap">0</property> <property name="yalign">0.5</property>
<property name="left_margin">0</property> <property name="xpad">0</property>
<property name="right_margin">0</property> <property name="ypad">0</property>
<property name="indent">0</property> <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="text" translatable="yes"></property> <property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -105,49 +196,40 @@
<child> <child>
<widget class="GtkVBox" id="vbox2"> <widget class="GtkVBox" id="vbox2">
<property name="height_request">82</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
<child> <child>
<widget class="GtkScrolledWindow" id="scrolledwindow3"> <widget class="GtkLabel" id="label8">
<property name="height_request">21</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="label" translatable="yes">If you used the generated number, then click Yes below.</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property> <property name="use_underline">False</property>
<property name="vscrollbar_policy">GTK_POLICY_NEVER</property> <property name="use_markup">False</property>
<property name="shadow_type">GTK_SHADOW_IN</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property> <property name="wrap">False</property>
<property name="selectable">False</property>
<child> <property name="xalign">0.5</property>
<widget class="GtkTextView" id="ButtonExplanation"> <property name="yalign">0.5</property>
<property name="visible">True</property> <property name="xpad">0</property>
<property name="can_focus">True</property> <property name="ypad">0</property>
<property name="editable">False</property> <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="overwrite">False</property> <property name="width_chars">-1</property>
<property name="accepts_tab">True</property> <property name="single_line_mode">False</property>
<property name="justification">GTK_JUSTIFY_CENTER</property> <property name="angle">0</property>
<property name="wrap_mode">GTK_WRAP_WORD</property>
<property name="cursor_visible">False</property>
<property name="pixels_above_lines">0</property>
<property name="pixels_below_lines">0</property>
<property name="pixels_inside_wrap">0</property>
<property name="left_margin">0</property>
<property name="right_margin">0</property>
<property name="indent">0</property>
<property name="text" translatable="yes">If you used the generated number, then click Yes below.</property>
</widget>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">True</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox3"> <widget class="GtkHBox" id="hbox3">
<property name="border_width">9</property> <property name="border_width">7</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
<property name="spacing">37</property> <property name="spacing">37</property>
@ -234,7 +316,6 @@ has been used.</property>
<child> <child>
<widget class="GtkButton" id="CancelButton"> <widget class="GtkButton" id="CancelButton">
<property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property> <property name="focus_on_click">True</property>
@ -278,7 +359,7 @@ has been used.</property>
<child> <child>
<widget class="GtkLabel" id="label3"> <widget class="GtkLabel" id="label3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">No, this button <property name="label" translatable="yes">No, this number
has not been used.</property> has not been used.</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
@ -326,6 +407,32 @@ has not been used.</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkStatusbar" id="StatusBar">
<property name="visible">True</property>
<property name="has_resize_grip">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child> </child>
</widget> </widget>

View file

@ -98,26 +98,49 @@ class gtkgui:
self.gui = gtk.glade.XML(gladefile) self.gui = gtk.glade.XML(gladefile)
# set button handlers # set button handlers
actions = { "on_OkButton_clicked": self.clicked_ok, actions = { "on_OkButton_clicked": self.clicked_ok,
"on_mainwindow_destroy": self.exit } "on_mainwindow_destroy": self.exit,
"on_SectionComboBox_changed": self.combobox_changed
}
# connect the actions to the events # connect the actions to the events
self.gui.signal_autoconnect (actions) self.gui.signal_autoconnect (actions)
#load config #load config
self.config = SettingsClass() self.config = SettingsClass()
#display all number systems for selection
self.display_number_systems()
#default section
self.section = ""
#display an unused invoice number #display an unused invoice number
self.display_new_number() #self.display_new_number()
############################3
def display_number_systems(self):
"""get all available number systems from configfile, display in combobox."""
#get all sections
itemlist = self.config.prefs.items()
#remove Main section (not a number system)
if itemlist[0][0] == "Main":
itemlist = itemlist[1:]
#filter section names
sections = []
for item in itemlist:
sections.append(item[0])
#now fill widget data
self.cbox = self.gui.get_widget("SectionComboBox")
self.cbox.remove_text(0)
for section in sections:
self.cbox.append_text(section)
#### functions which get executed on startup
def display_new_number(self): def display_new_number(self):
#get relevant variables #get relevant variables
prefix = self.config[section]["prefix"] prefix = self.config[self.section]["prefix"]
lastnumber = self.config[section]["lastnumber"] lastnumber = self.config[self.section]["lastnumber"]
suffix = self.config[section]["suffix"] suffix = self.config[self.section]["suffix"]
newnumber = create_number(prefix, lastnumber, suffix) newnumber = create_number(prefix, lastnumber, suffix)
#display new number in GUI #display new number in GUI
self.outputfield = self.gui.get_widget("NumberDisplay") self.outputfield = self.gui.get_widget("NumberDisplay")
self.textbuffer = self.outputfield.get_buffer() self.outputfield.set_markup('<span size="xx-large">'+newnumber+'</span>')
self.textbuffer.set_text(newnumber)
#### implementation of actions #### implementation of actions
@ -125,15 +148,27 @@ class gtkgui:
def clicked_ok(self, widget): def clicked_ok(self, widget):
"""save last generated number in config file""" """save last generated number in config file"""
#update "lastnumber" entry in config #update "lastnumber" entry in config
self.config[section]["lastnumber"] = int(self.config[section]["lastnumber"]) + 1 self.config[self.section]["lastnumber"] = int(self.config[self.section]["lastnumber"]) + 1
#write config to filesystem #write config to filesystem
self.config.safe() self.config.safe()
#notify user #notify user
number = self.config[self.section]["prefix"] + str(self.config[self.section]["lastnumber"]) + self.config[self.section]["suffix"]
self.outputfield = self.gui.get_widget("StatusBar")
self.outputfield.push(0,"Saved %s as last number." % number)
#display new number in GUI
self.outputfield = self.gui.get_widget("NumberDisplay") self.outputfield = self.gui.get_widget("NumberDisplay")
self.textbuffer = self.outputfield.get_buffer() self.outputfield.set_markup("")
self.textbuffer.set_text("Saved number has been updated.")
def combobox_changed(self,widget):
"""display new number if the user has selected a section"""
self.set_section(widget)
self.display_new_number()
def set_section(self, widget):
"""sets current section according to selection in combobox"""
model = widget.get_model()
section = model[widget.get_active()][0]
self.section = section
def exit(self, widget): def exit(self, widget):
gtk.main_quit() gtk.main_quit()
@ -153,8 +188,6 @@ def create_number(prefix, lastnumber, suffix):
#section = str(sys.argv[1])
section = "Handrechnung"
app = gtkgui(gtk) app = gtkgui(gtk)
gtk.main() gtk.main()