~ubuntu-branches/ubuntu/utopic/mysql-workbench/utopic

« back to all changes in this revision

Viewing changes to plugins/wb.admin/frontend/wb_admin_performance_dashboard.py

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2014-05-31 12:03:58 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20140531120358-cjik5ofkmj0fxsn8
Tags: 6.1.6+dfsg-1
* New upstream release [May 2014].
* Dropped "prtcl.patch".
* "debian/clean": better clean-up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from workbench.graphics.cairo_utils import Context
23
23
 
24
24
from wb_admin_utils import WbAdminBaseTab
25
 
 
26
25
import re
27
26
from workbench.log import log_error
28
27
 
118
117
        self.offset = xoffs, yoffs
119
118
 
120
119
        c = Context(cr)
121
 
 
122
 
        c.translate(xoffs, yoffs)
123
 
 
124
120
        try:
125
 
            self.canvas.repaint(c, x, y, w, h)
 
121
            self.canvas.repaint(c, xoffs, yoffs, w, h)
126
122
        except Exception:
127
123
            import traceback
128
124
            log_error("Exception rendering dashboard: %s\n" % traceback.format_exc())
159
155
        if self.tooltip:
160
156
            self.tooltip.close()
161
157
            self.tooltip = None
162
 
                
 
158
 
 
159
        if not mforms.Form.main_form().is_active():
 
160
            return
 
161
 
163
162
        if fig and getattr(fig, 'hover_text_template', None):
164
163
            text = self.make_tooltip_text(fig, fig.hover_text_template)
165
164
            if text:
511
510
    
512
511
    _refresh_tm = None
513
512
    drawbox = None
 
513
    _form_deactivated_conn = None
514
514
    
515
515
    @classmethod
516
516
    def wba_register(cls, admin_context):
526
526
    def create_ui(self):
527
527
        #self.create_basic_ui("title_dashboard.png", "Dashboard")
528
528
 
 
529
 
 
530
        self._form_deactivated_conn = mforms.Form.main_form().add_deactivated_callback(self.form_deactivated)
 
531
 
 
532
 
529
533
        self.content = mforms.newScrollPanel(0)
530
534
 
531
535
        self.drawbox = RenderBox(self)
578
582
 
579
583
 
580
584
    def shutdown(self):
 
585
        if self._form_deactivated_conn:
 
586
            self._form_deactivated_conn.disconnect()
 
587
            self._form_deactivated_conn = None
 
588
 
581
589
        if self._refresh_tm:
582
590
            mforms.Utilities.cancel_timeout(self._refresh_tm)
583
591
            self._refresh_tm = None
597
605
        return True
598
606
 
599
607
 
 
608
    def form_deactivated(self):
 
609
        if self.drawbox:
 
610
            self.drawbox.close_tooltip()
 
611
 
600
612
 
601
613
    def page_deactivated(self):
602
614
        if self.drawbox:
603
615
            self.drawbox.close_tooltip()
604
616
 
605
 
 
606
617
    def relayout(self):
607
618
        full_width = max(1024, self.content.get_width())
608
619
        full_height = max(700, self.content.get_height())