コード例 #1
0
ファイル: actions.c プロジェクト: dot-Sean/telephony
callable_obj_t *
sflphone_new_call(SFLPhoneClient *client)
{
    // Disable screensaver if the list is empty call
    guint nbcall = calllist_get_size(current_calls_tab);
    if(nbcall == 0)
        dbus_screensaver_inhibit();

    callable_obj_t *selected_call = calllist_empty(current_calls_tab) ? NULL :
        calltab_get_selected_call(current_calls_tab);

    if (selected_call != NULL && selected_call->_callID) {
        gchar *confID = dbus_get_conference_id(selected_call->_callID);
        if (g_strcmp0(confID, "") != 0)
            sflphone_on_hold();
        g_free(confID);
    }

    // Play a tone when creating a new call
    if (calllist_empty(current_calls_tab))
        dbus_start_tone(TRUE , (current_account_has_new_message()  > 0) ? TONE_WITH_MESSAGE : TONE_WITHOUT_MESSAGE) ;

    callable_obj_t *c = create_new_call(CALL, CALL_STATE_DIALING, "", "", "", "");

    c->_history_state = g_strdup(OUTGOING_STRING);

    calllist_add_call(current_calls_tab, c);
    calltree_add_call(current_calls_tab, c, NULL);
    update_actions(client);

    return c;
}
コード例 #2
0
ファイル: actions.c プロジェクト: dot-Sean/telephony
void
sflphone_incoming_call(callable_obj_t * c, SFLPhoneClient *client)
{
    c->_history_state = g_strdup(MISSED_STRING);
    calllist_add_call(current_calls_tab, c);
    calltree_add_call(current_calls_tab, c, NULL);

    update_actions(client);
    calltree_display(current_calls_tab, client);

    // Change the status bar if we are dealing with a direct SIP call
    if (is_direct_call(c)) {
        gchar *msg = g_markup_printf_escaped(_("Direct SIP call"));
        statusbar_pop_message(__MSG_ACCOUNT_DEFAULT);
        statusbar_push_message(msg , NULL, __MSG_ACCOUNT_DEFAULT);
        g_free(msg);
    }
    account_t *account = account_list_get_by_id(c->_accountID);
    if (!account) {
        g_warning("Account is NULL");
    } else if (account_has_autoanswer_on(account)) {
        calltab_select_call(active_calltree_tab, c);
        sflphone_pick_up(client);
    }
}
コード例 #3
0
void STMainWindow::slot_compile() {
	if (!currentSequenceView()) return;
	currentSequenceView()->clearCompileLog();
	statusBar()->showMessage(tr("Compiling sequence..."),MSG_DELAY);
	currentSequenceView()->slot_compile();
	update_actions();
}
コード例 #4
0
void show_account_list_config_dialog(SFLPhoneClient *client)
{
    account_list_dialog = GTK_DIALOG(gtk_dialog_new_with_buttons(_("Accounts"),
                                     GTK_WINDOW(client->win),
                                     GTK_DIALOG_DESTROY_WITH_PARENT, NULL,
                                     NULL));

    /* Set window properties */
    gtk_container_set_border_width(GTK_CONTAINER(account_list_dialog), 0);
    gtk_window_set_resizable(GTK_WINDOW(account_list_dialog), FALSE);

    GtkWidget *accountFrame = gnome_main_section_new(_("Configured Accounts"));
    gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(account_list_dialog)),
                       accountFrame, TRUE, TRUE, 0);
    gtk_widget_show(accountFrame);
    g_signal_connect(G_OBJECT(account_list_dialog), "destroy",
                     G_CALLBACK(dialog_destroy_cb), NULL);

    /* Accounts tab */
    GtkWidget *tab = create_account_list(client);
    gtk_widget_show(tab);
    gtk_container_add(GTK_CONTAINER(accountFrame), tab);

    /* Status bar for the account list */
    account_list_status_bar = gtk_statusbar_new();
    gtk_widget_show(account_list_status_bar);
    gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(account_list_dialog)), account_list_status_bar, TRUE, TRUE, 0);

    const gint num_accounts = account_list_get_registered_accounts();

    if (num_accounts) {
        gchar * message = g_strdup_printf(n_("There is %d active account",
                                             "There are %d active accounts",
                                             num_accounts), num_accounts);
        gtk_statusbar_push(GTK_STATUSBAR(account_list_status_bar), CONTEXT_ID_REGISTRATION,
                           message);
        g_free(message);
    } else {
        gtk_statusbar_push(GTK_STATUSBAR(account_list_status_bar), CONTEXT_ID_REGISTRATION,
                           _("You have no active accounts"));
    }

    gtk_dialog_run(account_list_dialog);

    status_bar_display_account();

    gtk_widget_destroy(GTK_WIDGET(account_list_dialog));

    /* Invalidate static pointers */
    account_list_dialog = NULL;
    account_list_status_bar = NULL;
    edit_button = NULL;
    delete_button = NULL;
    move_down_button = NULL;
    move_up_button = NULL;
    account_store = NULL;

    update_actions(client);
}
コード例 #5
0
void STMainWindow::slot_open_recent_file() {
	QString fname=sender()->property("recent_file_name").toString();
	if (fname.isEmpty()) return;
	statusBar()->showMessage(tr("Opening sequence: %1").arg(fname),MSG_DELAY);
	openSequence(fname);
	statusBar()->showMessage(tr("Sequence opened: %1").arg(fname),MSG_DELAY);
	update_actions();
}
コード例 #6
0
ファイル: window.cpp プロジェクト: cnr-isti-vclab/piccante
void Window::zoom_fit()
{
    bool fitToWindow = zoom_fit_action->isChecked();
    scroll_area->setWidgetResizable(fitToWindow);
    if (!fitToWindow) {
        zoom_original();
    }
    update_actions();
}
コード例 #7
0
void
rb_media_player_source_sync (RBMediaPlayerSource *source)
{
	RBMediaPlayerSourcePrivate *priv = MEDIA_PLAYER_SOURCE_GET_PRIVATE (source);

	priv->syncing = TRUE;
	update_actions (source);

	/* ref the source for the duration of the sync operation */
	g_idle_add ((GSourceFunc)sync_idle_cb_update_sync, g_object_ref (source));
}
コード例 #8
0
void STMainWindow::slot_open_sequence() {
	QSettings settings("Magland","SequenceTree4");
	QString holddir=settings.value("sequence_directory").toString();
	QString fname=QFileDialog::getOpenFileName(this,"Open sequence",holddir,"*.sts");
	if (fname.isEmpty()) return;
	settings.setValue("sequence_directory",QFileInfo(fname).path());
	statusBar()->showMessage(tr("Opening sequence: %1").arg(fname),MSG_DELAY);
	openSequence(fname);
	statusBar()->showMessage(tr("Sequence opened: %1").arg(fname),MSG_DELAY);
	update_actions();
}
コード例 #9
0
ファイル: dialog.c プロジェクト: AjayRamanathan/gimp
static void
load_finished (GtkWidget      *view,
               WebKitWebFrame *frame)
{
  GtkAction *action = gtk_ui_manager_get_action (ui_manager,
                                                 "/ui/help-browser-popup/stop");
  gtk_action_set_sensitive (action, FALSE);

  update_actions ();

  select_index (webkit_web_frame_get_uri (frame));
}
コード例 #10
0
void STMainWindow::slot_save_sequence() {
	if (!currentSequence()) return;
	QString fname=currentSequenceView()->fileName();
	if ((fname.isEmpty())||(fname.mid(0,4)=="web:")) {
		slot_save_sequence_as();
		return;
	}	
	statusBar()->showMessage(tr("Saving sequence: %1").arg(currentSequenceView()->fileName()),MSG_DELAY);
	currentSequenceView()->updateBeforeSave();
	currentSequence()->write(currentSequenceView()->fileName());
	statusBar()->showMessage(tr("Sequence saved: %1").arg(currentSequenceView()->fileName()),MSG_DELAY);
	currentSequenceView()->setModified(false);
	update_actions();
}
コード例 #11
0
ファイル: actions.c プロジェクト: dot-Sean/telephony
void
sflphone_unset_transfer(SFLPhoneClient *client)
{
    callable_obj_t * c = calltab_get_selected_call(current_calls_tab);

    if (c) {
        c->_state = CALL_STATE_CURRENT;
        g_free(c->_trsft_to);
        c->_trsft_to = g_strdup("");
        calltree_update_call(current_calls_tab, c, client);
    } else {
        update_actions(client);
    }
}
コード例 #12
0
ファイル: actions.c プロジェクト: dot-Sean/telephony
void
sflphone_hung_up(callable_obj_t * c, SFLPhoneClient *client)
{
    disable_messaging_tab(c->_callID);
    calllist_remove_call(current_calls_tab, c->_callID, client);
    calltree_remove_call(current_calls_tab, c->_callID);
    c->_state = CALL_STATE_DIALING;
    call_remove_all_errors(c);
    update_actions(client);

    status_tray_icon_blink(FALSE);

    statusbar_update_clock("");
}
コード例 #13
0
static gboolean
sync_idle_cb_cleanup (RBMediaPlayerSource *source)
{
	RBMediaPlayerSourcePrivate *priv = MEDIA_PLAYER_SOURCE_GET_PRIVATE (source);

	rb_debug ("cleaning up after sync process");

	priv->syncing = FALSE;
	update_actions (source);

	/* release the ref taken at the start of the sync */
	g_object_unref (source);

	return FALSE;
}
コード例 #14
0
ファイル: window.cpp プロジェクト: cnr-isti-vclab/piccante
void Window::open()
{
    QString fileName = QFileDialog::getOpenFileName(this,
                                                    tr("Open File"),
                                                    QDir::currentPath());
    if(fileName.isEmpty()) {
        return;
    }

    pic::Image *pic_im = new pic::Image;
    ImageRead(fileName.toStdString(), pic_im);

    if(!pic_im->isValid()) {
        QMessageBox::information(this, tr("Simple QT"),
                                 tr("Cannot load %1.").arg(fileName));
        delete pic_im;
        save_as_action->setEnabled(false);
        zoom_fit_action->setEnabled(false);
        zoom_in_action->setEnabled(false);
        zoom_out_action->setEnabled(false);
        zoom_original_action->setEnabled(false);
        gaussian_blur_action->setEnabled(false);
        scale_factor = 1.0;
        return;
    }

    if(last_filename != NULL) {
        delete last_filename;
    }

    last_filename = new QString(fileName);
    if(image != NULL) {
        delete image;
    }
    image = pic_im;

    update_pixmap();

    save_as_action->setEnabled(true);
    zoom_fit_action->setEnabled(true);
    gaussian_blur_action->setEnabled(true);
    scale_factor = 1.0;
    update_actions();

    if (!zoom_fit_action->isChecked())
        image_label->adjustSize();
}
コード例 #15
0
ファイル: dialog.c プロジェクト: AjayRamanathan/gimp
static void
title_changed (GtkWidget      *view,
               WebKitWebFrame *frame,
               const gchar    *title,
               GtkWidget      *window)
{
  gchar *full_title;

  full_title = g_strdup_printf ("%s - %s",
                                title ? title : _("Untitled"),
                                _("GIMP Help Browser"));

  gtk_window_set_title (GTK_WINDOW (window), full_title);
  g_free (full_title);

  update_actions ();
}
コード例 #16
0
void STMainWindow::slot_new_sequence() {
	STSequenceView *SV=new STSequenceView;
	connect_sequence_view(SV);
	STMetaSequence *Seq=new STMetaSequence;
	STMetaClass *root_class=new STMetaClass;
	root_class->setClassName("STRoot");
	root_class->setCode(read_text_file(ST_TEMPLATES_DIR+"/stroot.h"),read_text_file(ST_TEMPLATES_DIR+"/stroot.cpp"));
	Seq->addMetaClass(root_class);
	Seq->loadFoundationClasses(ST_FOUNDATION_DIR,false);
	Seq->loadFoundationClasses(ST_USER_DIR,true);
	SV->setSequence(Seq);
	ui.tabWidget->addTab(SV,"[untitled]");
	ui.tabWidget->setCurrentWidget(SV);
	update_window_title();
	qApp->processEvents();
	SV->setPreferredSizes();
	update_actions();
}
コード例 #17
0
void STMainWindow::slot_save_sequence_as() {
	if (!currentSequence()) return;
	QSettings settings("Magland","SequenceTree4");
	QString holddir=settings.value("sequence_directory").toString();
	QString fname=QFileDialog::getSaveFileName(this,"Save sequence as",holddir,"*.sts");
	if (fname.isEmpty()) return;
	settings.setValue("sequence_directory",QFileInfo(fname).path());
	currentSequenceView()->setFileName(fname);
	currentSequence()->setFileName(fname);
	statusBar()->showMessage(tr("Saving sequence: %1").arg(fname),MSG_DELAY);
	currentSequenceView()->updateBeforeSave();
	currentSequence()->write(fname);
	statusBar()->showMessage(tr("Sequence saved: %1").arg(fname),MSG_DELAY);
	update_tab_labels();
	currentSequenceView()->setModified(false);
	add_to_recent_files(fname);
	update_actions();
}
コード例 #18
0
ファイル: actions.c プロジェクト: dot-Sean/telephony
gboolean
sflphone_rec_call(SFLPhoneClient *client)
{
    gboolean result = FALSE;
    callable_obj_t * selectedCall = calltab_get_selected_call(current_calls_tab);
    conference_obj_t * selectedConf = calltab_get_selected_conf(current_calls_tab);

    if (selectedCall) {
        result = dbus_toggle_recording(selectedCall->_callID);
        calltree_update_call(current_calls_tab, selectedCall, client);
    } else if (selectedConf) {
        result = dbus_toggle_recording(selectedConf->_confID);

        switch (selectedConf->_state) {
            case CONFERENCE_STATE_ACTIVE_ATTACHED:
                selectedConf->_state = CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD;
                break;
            case CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD:
                selectedConf->_state = CONFERENCE_STATE_ACTIVE_ATTACHED;
                break;
            case CONFERENCE_STATE_ACTIVE_DETACHED:
                selectedConf->_state = CONFERENCE_STATE_ACTIVE_DETACHED_RECORD;
                break;
            case CONFERENCE_STATE_ACTIVE_DETACHED_RECORD:
                selectedConf->_state = CONFERENCE_STATE_ACTIVE_DETACHED_RECORD;
                break;
            default:
                g_warning("Should not happen in sflphone_off_hold ()!");
                break;
        }

        g_debug("Remove and add conference %s", selectedConf->_confID);
        calltree_remove_conference(current_calls_tab, selectedConf, client);
        /* This calls update actions */
        calltree_add_conference_to_current_calls(selectedConf, client);
    } else {
        update_actions(client);
    }
    return result;
}
コード例 #19
0
void STMainWindow::openSequence(QString sequence_fname) {
	if (sequenceView(sequence_fname)) {
		ui.tabWidget->setCurrentWidget(sequenceView(sequence_fname));
	}
	else {
		STSequenceView *SV=new STSequenceView;
		connect_sequence_view(SV);
		STMetaSequence *Seq=new STMetaSequence;
		Seq->read(sequence_fname);
		SV->setSequence(Seq);
		SV->setFileName(sequence_fname);
		Seq->setFileName(sequence_fname);	
		ui.tabWidget->addTab(SV,"");
		ui.tabWidget->setCurrentWidget(SV);
		update_tab_labels();
		update_window_title();
		add_to_recent_files(sequence_fname);
		qApp->processEvents();
		SV->setPreferredSizes();
	}
	update_actions();
}
コード例 #20
0
static void
rb_media_player_source_constructed (GObject *object)
{
	RBMediaPlayerSourcePrivate *priv = MEDIA_PLAYER_SOURCE_GET_PRIVATE (object);
	RBShell *shell;
	GApplication *app;
	GActionEntry actions[] = {
		{ "media-player-sync", sync_action_cb },
		{ "media-player-properties", properties_action_cb }
	};

	RB_CHAIN_GOBJECT_METHOD (rb_media_player_source_parent_class, constructed, object);

	app = g_application_get_default ();
	g_object_get (object, "shell", &shell, NULL);
	_rb_add_display_page_actions (G_ACTION_MAP (app), G_OBJECT (shell), actions, G_N_ELEMENTS (actions));
	g_object_unref (shell);

	priv->sync_action = g_action_map_lookup_action (G_ACTION_MAP (app), "media-player-sync");
	priv->properties_action = g_action_map_lookup_action (G_ACTION_MAP (app), "media-player-properties");
	g_signal_connect (object, "notify::load-status", G_CALLBACK (load_status_changed_cb), NULL);
	update_actions (RB_MEDIA_PLAYER_SOURCE (object));
}
コード例 #21
0
bool STMainWindow::slot_close_sequence() {
	if (!currentSequenceView()) return false;
	QString fname=QFileInfo(currentSequenceView()->fileName()).fileName();
	if (currentSequenceView()->isModified()) {
		if (fname.isEmpty()) fname="[untitled]";
		QMessageBox::StandardButton ret=QMessageBox::question(this,"Save changes?",tr("Save changes to %1?").arg(fname),
				QMessageBox::Save|QMessageBox::Discard|QMessageBox::Cancel);
		if (ret==QMessageBox::Save) {
			slot_save_sequence();
			if (!currentSequenceView()->isModified()) {
				return slot_close_sequence();
			}
		}
		else if (ret==QMessageBox::Cancel) {
			return false;
		}
	}
	statusBar()->showMessage(tr("Closing sequence: %1").arg(fname),MSG_DELAY);
	delete currentSequenceView();
	statusBar()->showMessage(tr("Sequence closed: %1").arg(fname),MSG_DELAY);
	update_window_title();
	update_actions();
	return true;
}
コード例 #22
0
void STMainWindow::openSequenceFromText(const QString fname, const QString &txt) {
	if (sequenceView(fname)) {
		ui.tabWidget->setCurrentWidget(sequenceView(fname));
	}
	else {
		STSequenceView *SV=new STSequenceView;
		connect_sequence_view(SV);
		STMetaSequence *Seq=new STMetaSequence;
		QStringList text_lines=txt.split('\n');
		long index=0;
		Seq->loadFromText(text_lines,index);
		SV->setSequence(Seq);
		SV->setFileName(fname);
		Seq->setFileName(fname);	
		ui.tabWidget->addTab(SV,"");
		ui.tabWidget->setCurrentWidget(SV);
		update_tab_labels();
		update_window_title();
		//add_to_recent_files(sequence_fname);
		qApp->processEvents();
		SV->setPreferredSizes();
	}
	update_actions();
}
コード例 #23
0
ファイル: dialog.c プロジェクト: AjayRamanathan/gimp
void
browser_dialog_open (const gchar *plug_in_binary)
{
  GtkWidget   *window;
  GtkWidget   *main_vbox;
  GtkWidget   *vbox;
  GtkWidget   *toolbar;
  GtkWidget   *paned;
  GtkWidget   *scrolled;
  GtkToolItem *item;
  GtkAction   *action;
  DialogData   data = { 720, 560, 240, TRUE, 1.0 };

  gimp_ui_init (plug_in_binary, TRUE);

  gimp_get_data (GIMP_HELP_BROWSER_DIALOG_DATA, &data);

  /*  the dialog window  */
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (window), _("GIMP Help Browser"));
  gtk_window_set_role (GTK_WINDOW (window), plug_in_binary);

  gtk_window_set_default_size (GTK_WINDOW (window), data.width, data.height);

  g_signal_connect (window, "destroy",
                    G_CALLBACK (gtk_main_quit),
                    NULL);

  window_set_icons (window);

  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
  gtk_container_add (GTK_CONTAINER (window), vbox);
  gtk_widget_show (vbox);

  ui_manager = ui_manager_new (window);

  toolbar = gtk_ui_manager_get_widget (ui_manager, "/help-browser-toolbar");
  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
  gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, FALSE, 0);
  gtk_widget_show (toolbar);

  item = g_object_new (GTK_TYPE_MENU_TOOL_BUTTON, NULL);
  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, 0);
  gtk_widget_show (GTK_WIDGET (item));

  action = gtk_ui_manager_get_action (ui_manager,
                                      "/ui/help-browser-popup/forward");
  gtk_activatable_set_related_action (GTK_ACTIVATABLE (item), action);
  g_object_notify (G_OBJECT (action), "tooltip");
  button_next = GTK_WIDGET (item);

  item = g_object_new (GTK_TYPE_MENU_TOOL_BUTTON, NULL);
  gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, 0);
  gtk_widget_show (GTK_WIDGET (item));

  action = gtk_ui_manager_get_action (ui_manager,
                                      "/ui/help-browser-popup/back");
  gtk_activatable_set_related_action (GTK_ACTIVATABLE (item), action);
  g_object_notify (G_OBJECT (action), "tooltip");
  button_prev = GTK_WIDGET (item);

  item =
    GTK_TOOL_ITEM (gtk_ui_manager_get_widget (ui_manager,
                                              "/help-browser-toolbar/space"));
  gtk_separator_tool_item_set_draw (GTK_SEPARATOR_TOOL_ITEM (item), FALSE);
  gtk_tool_item_set_expand (item, TRUE);

  /*  the horizontal paned  */
  paned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
  gtk_box_pack_start (GTK_BOX (vbox), paned, TRUE, TRUE, 0);
  gtk_widget_show (paned);

  scrolled = gtk_scrolled_window_new (NULL, NULL);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
                                  GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_paned_add1 (GTK_PANED (paned), scrolled);
  gtk_paned_set_position (GTK_PANED (paned), data.paned_position);

  sidebar = scrolled;

  if (data.show_index)
    gtk_widget_show (sidebar);

  tree_view = gtk_tree_view_new ();
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), FALSE);
  gtk_container_add (GTK_CONTAINER (scrolled), tree_view);
  gtk_widget_show (tree_view);

  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view), -1,
                                               NULL,
                                               gtk_cell_renderer_text_new (),
                                               "text", 1,
                                               NULL);

  g_signal_connect (tree_view, "row-activated",
                    G_CALLBACK (row_activated),
                    NULL);

  /*  HTML view  */
  main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
  gtk_widget_show (main_vbox);
  gtk_paned_pack2 (GTK_PANED (paned), main_vbox, TRUE, TRUE);

  scrolled = gtk_scrolled_window_new (NULL, NULL);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
                                  GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  gtk_widget_set_size_request (scrolled, 300, 200);
  gtk_box_pack_start (GTK_BOX (main_vbox), scrolled, TRUE, TRUE, 0);
  gtk_widget_show (scrolled);

  view = webkit_web_view_new ();
  webkit_web_view_set_maintains_back_forward_list (WEBKIT_WEB_VIEW (view),
                                                   TRUE);
  gtk_container_add (GTK_CONTAINER (scrolled), view);
  gtk_widget_show (view);

  g_signal_connect (view, "realize",
                    G_CALLBACK (view_realize),
                    NULL);
  g_signal_connect (view, "unrealize",
                    G_CALLBACK (view_unrealize),
                    NULL);

  g_signal_connect (view, "popup-menu",
                    G_CALLBACK (view_popup_menu),
                    NULL);
  g_signal_connect (view, "button-press-event",
                    G_CALLBACK (view_button_press),
                    NULL);
  g_signal_connect (view, "key-press-event",
                    G_CALLBACK (view_key_press),
                    NULL);

  webkit_web_view_set_zoom_level (WEBKIT_WEB_VIEW (view), data.zoom);

  g_signal_connect (view, "title-changed",
                    G_CALLBACK (title_changed),
                    window);

  g_signal_connect (view, "load-started",
                    G_CALLBACK (load_started),
                    NULL);
  g_signal_connect (view, "load-finished",
                    G_CALLBACK (load_finished),
                    NULL);

  gtk_widget_grab_focus (view);

  g_signal_connect (window, "unmap",
                    G_CALLBACK (dialog_unmap),
                    paned);

  update_actions ();

  /* Searchbar */
  searchbar = build_searchbar ();
  gtk_box_pack_start (GTK_BOX (main_vbox), searchbar, FALSE, FALSE, 0);
}
コード例 #24
0
void STMainWindow::slot_modification_changed() {
	update_window_title();
	update_actions();
}
コード例 #25
0
void STMainWindow::slot_compiled_changed() {
	update_actions();
}
コード例 #26
0
static void
selected_changed_cb (GObject *object, GParamSpec *pspec, gpointer whatever)
{
	update_actions (RB_MEDIA_PLAYER_SOURCE (object));
}
コード例 #27
0
void STMainWindow::slot_current_changed() {
	update_window_title();
	update_actions();
}
コード例 #28
0
STMainWindow::STMainWindow(QWidget *parent) : QMainWindow(parent) {
	ui.setupUi(this);
	
	ui.tabWidget->clear();
	
	ui.actionExportToScanner->setEnabled(exports_are_enabled());
	
	//ui.actionOpenSequenceFromWeb->setEnabled(false);
	
	connect(ui.actionNewSequence,SIGNAL(triggered()),this,SLOT(slot_new_sequence()));
	connect(ui.actionOpenSequence,SIGNAL(triggered()),this,SLOT(slot_open_sequence()));
	//connect(ui.actionOpenSequenceFromWeb,SIGNAL(triggered()),this,SLOT(slot_open_sequence_from_web()));
	connect(ui.actionCloseSequence,SIGNAL(triggered()),this,SLOT(slot_close_sequence()));
	connect(ui.actionSaveSequence,SIGNAL(triggered()),this,SLOT(slot_save_sequence()));
	connect(ui.actionSaveSequenceAs,SIGNAL(triggered()),this,SLOT(slot_save_sequence_as()));
	connect(ui.actionUploadSequenceToWeb,SIGNAL(triggered()),this,SLOT(slot_upload_sequence_to_web()));
	
	connect(ui.actionCopyNode,SIGNAL(triggered()),this,SLOT(slot_copy_node()));
	connect(ui.actionPasteNode,SIGNAL(triggered()),this,SLOT(slot_paste_node()));
	
	connect(ui.actionCompile,SIGNAL(triggered()),this,SLOT(slot_compile()));
	
	connect(ui.actionAddResource,SIGNAL(triggered()),this,SLOT(slot_add_resource()));
	connect(ui.actionImportRFPulseWaveform,SIGNAL(triggered()),this,SLOT(slot_import_rf_pulse_waveform()));
	
	connect(ui.actionConfiguration,SIGNAL(triggered()),this,SLOT(slot_configuration()));
	connect(ui.actionExportToScanner,SIGNAL(triggered()),this,SLOT(slot_export_to_scanner()));
	connect(ui.actionUpdateExportToScanner,SIGNAL(triggered()),this,SLOT(slot_update_export_to_scanner()));
	connect(ui.actionExportToVirtualScanner,SIGNAL(triggered()),this,SLOT(slot_export_to_virtual_scanner()));
	connect(ui.actionReadRawData,SIGNAL(triggered()),this,SLOT(slot_read_raw_data()));
	connect(ui.actionCreateParameterFile,SIGNAL(triggered()),this,SLOT(slot_create_parameter_file()));
	//connect(ui.actionUpdateCodeFromWeb,SIGNAL(triggered()),this,SLOT(slot_update_code_from_web()));
	ui.actionUpdateCodeFromWeb->setEnabled(false);
	
	connect(ui.actionChainLink,SIGNAL(triggered()),this,SLOT(slot_chainlink()));
	connect(ui.actionRTST,SIGNAL(triggered()),this,SLOT(slot_rtst()));
	connect(ui.actionMRPulseTool,SIGNAL(triggered()),this,SLOT(slot_mr_pulse_tool()));
	
	connect(ui.actionPreferences,SIGNAL(triggered()),this,SLOT(slot_preferences()));
	
	connect(ui.actionAboutSequenceTree,SIGNAL(triggered()),this,SLOT(slot_about_sequencetree()));
	connect(ui.actionSequenceTreeWiki,SIGNAL(triggered()),this,SLOT(slot_sequencetree_wiki()));
	
	connect(ui.tabWidget,SIGNAL(currentChanged(int)),this,SLOT(slot_current_changed()));
	
	#ifndef QT_WEB_KIT
	ui.actionOpenSequenceFromWeb->setEnabled(false);
	#endif
	
	ui.actionNewSequence->setShortcut(tr("Ctrl+N"));
	ui.actionOpenSequence->setShortcut(tr("Ctrl+O"));
	ui.actionSaveSequence->setShortcut(tr("Ctrl+S"));
	
	ui.actionCopyNode->setShortcut(tr("Ctrl+C"));
	ui.actionPasteNode->setShortcut(tr("Ctrl+V"));
	
	ui.actionCompile->setShortcut(tr("F9"));
	
	QToolButton *close_button=new QToolButton;
	close_button->setIcon(QIcon(":/images/cross.png"));
	connect(close_button,SIGNAL(clicked()),this,SLOT(slot_close_sequence()));
	ui.tabWidget->setCornerWidget(close_button);
	
	update_recent_file_menu();
	update_actions();
	
}