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

« back to all changes in this revision

Viewing changes to frontend/linux/linux_utilities/notebook_dockingpoint.cpp

  • 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:
1
1
/* 
2
 
 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
 
2
 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or
5
5
 * modify it under the terms of the GNU General Public License as
21
21
#include "active_label.h"
22
22
#include "gtk/lf_mforms.h"
23
23
#include "gtk/lf_view.h"
 
24
#include "base/log.h"
 
25
DEFAULT_LOG_DOMAIN("notebook_dockingpoint")
24
26
 
25
27
void NotebookDockingPoint::close_appview_page(mforms::AppView *view)
26
28
{
165
167
  Gtk::Widget *w = mforms::widget_for_view(view);
166
168
  if (w)
167
169
  {
168
 
   // int idx = _notebook->page_num(*w);
169
 
    for (int i = 0; i < _notebook->get_n_pages(); i++)
 
170
    int idx = _notebook->page_num(*w);
 
171
    if (idx >=0)
170
172
    {
171
 
        Gtk::Widget *page = _notebook->get_nth_page(i);
 
173
      Gtk::Widget *page = _notebook->get_nth_page(idx);
 
174
      if (page)
 
175
      {
172
176
        ActiveLabel *label = reinterpret_cast<ActiveLabel*>(page->get_data("ActionAreaNotebookDockingPoint:label"));
173
177
        if (label)
174
 
            label->set_text(title);
 
178
          label->set_text(title);
 
179
      }
175
180
    }
 
181
    else
 
182
      log_warning("Can't set title of unknown view to %s\n", title.c_str());
176
183
  }
177
184
}
178
185