gint prefs_ok( GtkWidget *widget, GdkEvent *event, gpointer data )
{
	prefs_apply( NULL, NULL, NULL );
	delete_prefs( NULL, NULL, NULL );

	return FALSE;
}
示例#2
0
static void on_document_open(G_GNUC_UNUSED GObject *obj, GeanyDocument *doc,
	G_GNUC_UNUSED gpointer gdata)
{
	prefs_apply(doc);
	breaks_mark(doc);

	if (debug_state() != DS_INACTIVE)
		threads_mark(doc);
}
void ProtocolPreferencesMenu::enumPreferenceTriggered()
{
    EnumPreferenceAction *epa = static_cast<EnumPreferenceAction *>(QObject::sender());
    if (!epa) return;

    if (epa->setEnumValue()) { // Changed
        prefs_apply(module_);
        if (!prefs.gui_use_pref_save) {
            prefs_main_write();
        }

        wsApp->emitAppSignal(WiresharkApplication::PacketDissectionChanged);
    }
}
void PreferenceEditorFrame::on_okButton_clicked()
{
    bool apply = false;
    switch(pref_->type) {
    case PREF_UINT:
        if (pref_->stashed_val.uint != new_uint_) {
            pref_->stashed_val.uint = new_uint_;
            apply = true;
        }
        break;
    case PREF_STRING:
        if (new_str_.compare(pref_->stashed_val.string) != 0) {
            g_free(pref_->stashed_val.string);
            pref_->stashed_val.string = qstring_strdup(new_str_);
            apply = true;
        }
        break;
    case PREF_RANGE:
        if (!ranges_are_equal(pref_->stashed_val.range, new_range_)) {
            g_free(pref_->stashed_val.range);
            pref_->stashed_val.range = range_copy(new_range_);
            apply = true;
        }
        break;
    default:
        break;
    }

    if (apply && module_) {
        pref_unstash(pref_, &module_->prefs_changed);
        prefs_apply(module_);
        if (!prefs.gui_use_pref_save) {
            prefs_main_write();
        }
    }
    on_cancelButton_clicked();
    // Emit signals once UI is hidden
    if (apply) {
        wsApp->emitAppSignal(WiresharkApplication::PacketDissectionChanged);
        wsApp->emitAppSignal(WiresharkApplication::PreferencesChanged);
    }
}
示例#5
0
文件: prefs.c 项目: BYC/geany-plugins
static void prefs_configure(void)
{
	static const char *const view_source_items[] =
	{
		"thread_view_source",
		"break_view_source",
		"stack_separator1",
		"stack_view_source",
		NULL
	};

	const char *const *p;
	guint i;

	for (p = view_source_items; *p; p++)
		gtk_widget_set_visible(get_widget(*p), !pref_auto_view_source);

	foreach_document(i)
		prefs_apply(documents[i]);
}
示例#6
0
文件: workspace.c 项目: hioreanu/ahwm
void move_with_transients(client_t *client, unsigned int ws)
{
    client_t *transient;

    if (client->keep_transients_on_top) {
        for (transient = client->transients;
             transient != NULL;
             transient = transient->next_transient) {
            if (transient->workspace == client->workspace) {
                move_with_transients(transient, ws);
            }
        }
    }
    debug(("\tMoving %s to workspace %d\n", client_dbg(client), ws));
    
    focus_remove(client, event_timestamp);
    debug(("\tUnmapping %s in workspace move\n", client_dbg(client)));
    XUnmapWindow(dpy, client->frame);
    client->workspace = ws;
    ewmh_desktop_update(client);
    prefs_apply(client);
    focus_add(client, event_timestamp);
}
示例#7
0
static void on_document_new(G_GNUC_UNUSED GObject *obj, GeanyDocument *doc,
	G_GNUC_UNUSED gpointer gdata)
{
	prefs_apply(doc);
}