~noskcaj/ubuntu/vivid/gnome-system-monitor/titlebars

« back to all changes in this revision

Viewing changes to src/interface.cpp

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson
  • Date: 2014-02-17 22:12:59 UTC
  • mfrom: (1.4.12) (15 sid)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: package-import@ubuntu.com-20140217221259-khdbenb3wt1b81zw
Tags: 3.11.90-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 * GNU General Public License for more details.
14
14
 *
15
15
 * You should have received a copy of the GNU Library General Public
16
 
 * License along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 
16
 * License along with this program; if not, see <http://www.gnu.org/licenses/>.
18
17
 *
19
18
 */
20
19
 
512
511
    if (strcmp (current_page, "processes") == 0) {
513
512
        GAction *search_action = g_action_map_lookup_action (G_ACTION_MAP (app->main_window),
514
513
                                                             "search");
 
514
        proctable_update (app);
515
515
        proctable_thaw (app);
516
516
 
517
517
        gtk_widget_show (app->end_process_button);
568
568
    return TRUE;
569
569
}
570
570
 
 
571
static gboolean
 
572
cb_main_window_state_changed (GtkWidget *window, GdkEventWindowState *event, gpointer data)
 
573
{
 
574
    GsmApplication *app = (GsmApplication *) data;
 
575
    gchar * current_page = g_settings_get_string (app->settings, GSM_SETTING_CURRENT_TAB);
 
576
    if (event->new_window_state & GDK_WINDOW_STATE_BELOW ||
 
577
        event->new_window_state & GDK_WINDOW_STATE_ICONIFIED ||
 
578
        event->new_window_state & GDK_WINDOW_STATE_WITHDRAWN)
 
579
    {
 
580
        if (strcmp (current_page, "processes") == 0) {
 
581
            proctable_freeze (app);
 
582
        } else if (strcmp (current_page, "resources") == 0) {
 
583
            load_graph_stop (app->cpu_graph);
 
584
            load_graph_stop (app->mem_graph);
 
585
            load_graph_stop (app->net_graph);
 
586
        } else if (strcmp (current_page, "disks") == 0) {
 
587
            disks_freeze (app);
 
588
        }
 
589
    } else  {
 
590
        if (strcmp (current_page, "processes") == 0) {
 
591
            proctable_update (app);
 
592
            proctable_thaw (app);
 
593
        } else if (strcmp (current_page, "resources") == 0) {
 
594
            load_graph_start (app->cpu_graph);
 
595
            load_graph_start (app->mem_graph);
 
596
            load_graph_start (app->net_graph);
 
597
        } else if (strcmp (current_page, "disks") == 0) {
 
598
            disks_update (app);
 
599
            disks_thaw (app);
 
600
        }
 
601
    }
 
602
    return FALSE;
 
603
}
 
604
 
571
605
void
572
606
create_main_window (GsmApplication *app)
573
607
{
651
685
    g_signal_connect (G_OBJECT (main_window), "delete_event",
652
686
                      G_CALLBACK (cb_main_window_delete),
653
687
                      app);
 
688
    g_signal_connect (G_OBJECT (main_window), "window-state-event",
 
689
                      G_CALLBACK (cb_main_window_state_changed),
 
690
                      app);
654
691
 
655
692
    GAction *action;
656
693
    action = g_action_map_lookup_action (G_ACTION_MAP (main_window),