static void renice_dialog_button_pressed (GtkDialog *dialog, gint id, gpointer data) { GsmApplication *app = static_cast<GsmApplication *>(data); if (id == 100) { if (new_nice_value == -100) return; renice(app, new_nice_value); } gtk_widget_destroy (GTK_WIDGET (dialog)); renice_dialog = NULL; }
static void renice_dialog_button_pressed (GtkDialog *dialog, gint id, gpointer data) { ProcData *procdata = static_cast<ProcData*>(data); if (id == 100) { if (new_nice_value == -100) return; renice(procdata, new_nice_value); } gtk_widget_destroy (GTK_WIDGET (dialog)); renice_dialog = NULL; }
static void on_activate_priority (GSimpleAction *action, GVariant *parameter, gpointer data) { GsmApplication *app = (GsmApplication *) data; g_action_change_state (G_ACTION (action), parameter); const gint32 priority = g_variant_get_int32 (parameter); switch (priority) { case 32: procdialog_create_renice_dialog (app); break; default: renice (app, priority); break; } }
void cb_renice (GtkAction *action, GtkRadioAction *current, gpointer data) { ProcData * const procdata = static_cast<ProcData*>(data); gint selected = gtk_radio_action_get_current_value(current); if (selected == CUSTOM_PRIORITY) { procdialog_create_renice_dialog (procdata); } else { gint new_nice_value = 0; switch (selected) { case VERY_HIGH_PRIORITY: new_nice_value = -20; break; case HIGH_PRIORITY: new_nice_value = -5; break; case NORMAL_PRIORITY: new_nice_value = 0; break; case LOW_PRIORITY: new_nice_value = 5; break; case VERY_LOW_PRIORITY: new_nice_value = 19; break; } renice(procdata, new_nice_value); } }