Logo Search packages:      
Sourcecode: nagstamon version File versions  Download package

def Nagstamon::nagstamonGUI::GUI::CreateOutputVisuals (   self  ) 

    create output visuals

Definition at line 112 of file nagstamonGUI.py.

00112                                  :
        """
            create output visuals
        """

        # decide if the platform can handle SVG if not (Windows) use PNG - do not know
        # why but in Windows there occurs an error like "svg_loader.dll could not be found"
        if platform.system() == "Windows":
            self.BitmapSuffix = ".png"
        else:
            self.BitmapSuffix = ".svg"
            
        # set app icon for all app windows
        gtk.window_set_default_icon_from_file(self.Resources + "/nagstamon" + self.BitmapSuffix)
        
        # Icon in systray and statusbar both get created but
        # only one of them depending on the settings will
        # be shown
        self.statusbar = StatusBar(conf=self.conf, output=self)
        
        # Popup is a WINDOW_POPUP without border etc.
        self.popwin = Popwin(conf=self.conf, output=self)
        # Windows workaround for faulty behavior in case the statusbar label shrinks - 
        # it does not in Windows, maybe a Gtk bug
        # do this only if statusbar is enabled
        if str(self.conf.statusbar_systray) == "True" or str(self.conf.statusbar_systray) == "True":
            x,y = self.statusbar.HBox.size_request()
            self.statusbar.StatusBar.resize(x, y)
            
        # connect events to actions
        # when talking about "systray" the Windows variant of upper left desktop corner
        # statusbar is meant synonymical
        # if pointer on systray do popup the long-summary-status-window aka popwin
        self.statusbar.SysTray.connect("activate", self.statusbar.SysTrayClicked)
        self.statusbar.SysTray.connect("popup-menu", self.statusbar.MenuPopup, self.statusbar.Menu)

        # if pointer clicks on logo move stautsbar
        self.statusbar.LogoEventbox.connect("motion-notify-event", self.statusbar.Move)
        self.statusbar.LogoEventbox.connect("button-press-event", self.statusbar.LogoClicked)
        self.statusbar.LogoEventbox.connect("button-release-event", self.popwin.setShowable)
    
        # if pointer hovers or clicks statusbar show details
        self.statusbar.EventBoxLabel.connect("enter-notify-event", self.statusbar.Hovered)
        self.statusbar.EventBoxLabel.connect("button-press-event", self.statusbar.Clicked)

        # Workaround for behavorial differences of GTK in Windows and Linux
        # in Linux it is enough to check for the pointer leaving the whole popwin,
        # in Windows it is not, here every widget on popwin has to be heard
        # the intended effect is that popwin closes when the pointer leaves it
        self.popwin.ButtonRefresh.connect("leave-notify-event", self.popwin.PopDown)
        self.popwin.ButtonSettings.connect("leave-notify-event", self.popwin.PopDown)
        self.popwin.ButtonClose.connect("leave-notify-event", self.popwin.PopDown)
        self.popwin.connect("leave-notify-event", self.popwin.PopDown)

        # close popwin when its close button is pressed
        self.popwin.ButtonClose.connect("clicked", self.popwin.Close)
        # threaded refresh status information when refresh is clicked
        self.popwin.ButtonRefresh.connect("clicked", lambda r: nagstamonActions.RefreshAllServers(servers=self.servers, output=self, conf=self.conf))
        # open settings dialog when settings is clicked
        self.popwin.ButtonSettings.connect("clicked", lambda s: Settings(servers=self.servers, output=self, conf=self.conf))        
        
        # nagios server combobox 
        self.popwin.ComboboxNagios.connect("changed", self.popwin.ComboboxClicked)


    def RefreshDisplayStatus(self):


Generated by  Doxygen 1.6.0   Back to index