Merge remote branch 'remotes/git-svn' master
authorJoachim Breitner <mail@joachim-breitner.de>
Thu, 24 Jun 2010 10:13:25 +0000 (12:13 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Thu, 24 Jun 2010 10:13:25 +0000 (12:13 +0200)
Conflicts:
Nagstamon/nagstamon
Nagstamon/nagstamonGUI.py

1  2 
Nagstamon/nagstamon
Nagstamon/nagstamonGUI.py
Nagstamon/resources/settings_dialog.glade

index 575083a,a45fd22..3eb5b44
mode 100755,100644..100755
@@@ -7,9 -7,6 +7,8 @@@ import g
  gc.enable()
  #gc.set_debug(gc.DEBUG_LEAK)
  
 +import sys
 +import signal
  try:
      import pygtk
      pygtk.require("2.0")
@@@ -932,30 -927,19 +937,23 @@@ class StatusBar(object)
          """
              Shows error message in statusbar
          """
 -        try:
 -            # set flag to locked
 -            self.isShowingError = True
 -            self.Label.set_markup('<span size="%s"> %s </span>' % (self.output.fontsize, message)) 
 -            # Windows workaround for non-shrinking desktop statusbar
 -            self.Resize()
 -            # change systray icon to error
 -            self.SysTray.set_from_file(self.output.Resources + "/nagstamon_error" + self.output.BitmapSuffix)
 -            # Windows workaround for non-shrinking desktop statusbar
 -            self.Resize()
 -        except:
 -            pass
 -            
 +        
 +        # us a flag to prevent all threads at once to write to statusbar label in case
 +        # of lost network connectivity - this leads to a mysterious pango crash
 +        if self.isShowingError == False:
 +            try:
 +                # set flag to locked
 +                self.isShowingError = True
-                 # save old label
-                 label = self.Label.get_label()
 +                self.Label.set_markup('<span size="%s"> ERROR: Check settings/network </span>' % (self.output.fontsize)) 
 +                # Windows workaround for non-shrinking desktop statusbar
 +                self.Resize()
++                # Windows workaround for non-shrinking desktop statusbar
++                self.Resize()
 +                # change systray icon to error
 +                self.statusbar.show()
 +                self.SysTray.set_from_file(self.output.Resources + "/nagstamon_error" + self.output.BitmapSuffix)
-                 # delay thread a little bit to give the others time to recognize the set flag
-                 time.sleep(5)
-                 # set flag back
-                 self.isShowingError = False
-                 # restore label
-                 self.Label.set_markup(label)
-                 self.Resize()
 +            except:
 +                pass
  
      def Flash(self):
          """
@@@ -1660,12 -1645,7 +1659,11 @@@ class Settings(object)
          # in case nagstamon runs the first time it should display a new server dialog
          if str(self.conf.unconfigured) == "True":
              NewServer(servers=self.servers, output=self.output, settingsdialog=self, conf=self.conf)
 -           
 +
 +        # Only show hide_on_ok on windows
 +        if sys.platform == 'win32':
 +            self.glade.get_widget("input_checkbutton_hide_if_ok").hide()
 +
          # show filled settings dialog and wait thanks to gtk.run()
          self.dialog.run()
          self.dialog.destroy()