/* Clean up passwd resources */
static void
free_passwd_resources (PasswordDialog *pdialog)
{
	GError	*error = NULL;

	/* Remove the child watcher */
	if (pdialog->backend_child_watch_id != 0) {

		g_source_remove (pdialog->backend_child_watch_id);

		pdialog->backend_child_watch_id = 0;
	}


	/* Close IO channels (internal file descriptors are automatically closed) */
	if (pdialog->backend_stdin != NULL) {

		if (g_io_channel_shutdown (pdialog->backend_stdin, TRUE, &error) != G_IO_STATUS_NORMAL) {
			g_warning (_("Could not shutdown backend_stdin IO channel: %s"), error->message);
			g_error_free (error);
			error = NULL;
		}

		g_io_channel_unref (pdialog->backend_stdin);

		pdialog->backend_stdin = NULL;
	}

	if (pdialog->backend_stdout != NULL) {

		if (g_io_channel_shutdown (pdialog->backend_stdout, TRUE, &error) != G_IO_STATUS_NORMAL) {
			g_warning (_("Could not shutdown backend_stdout IO channel: %s"), error->message);
			g_error_free (error);
			error = NULL;
		}

		g_io_channel_unref (pdialog->backend_stdout);

		pdialog->backend_stdout = NULL;
	}

	/* Remove IO watcher */
	if (pdialog->backend_stdout_watch_id != 0) {

		g_source_remove (pdialog->backend_stdout_watch_id);

		pdialog->backend_stdout_watch_id = 0;
	}

	/* Close PID */
	if (pdialog->backend_pid != -1) {

		g_spawn_close_pid (pdialog->backend_pid);

		pdialog->backend_pid = -1;
	}

	/* Clear backend state */
	pdialog->backend_state = PASSWD_STATE_NONE;
}
Example #2
0
/**
 * Create export LDIF dialog.
 */
static void export_ldif_create( void ) {
	export_ldif_dialog_create();
	export_ldif_page_file( PAGE_FILE_INFO, _( "File Info" ) );
	export_ldif_page_dn( PAGE_DN, _( "Distinguished Name" ) );
	export_ldif_page_finish( PAGE_FINISH, _( "Finish" ) );
	gtk_widget_show_all( expldif_dlg.window );
}
Example #3
0
static void load_payment_type_cells (GncEntryLedger *ledger)
{
    ComboCell *cell;
    const GncOwner *owner;
    GncEmployee *employee;

    cell = (ComboCell *) gnc_table_layout_get_cell (ledger->table->layout,
            ENTRY_PAYMENT_CELL);
    if (!cell) return;

    if (!ledger->invoice) return;

    owner = gncOwnerGetEndOwner (gncInvoiceGetOwner (ledger->invoice));
    if (gncOwnerGetType (owner) != GNC_OWNER_EMPLOYEE)
        return;

    employee = gncOwnerGetEmployee (owner);
    g_return_if_fail (employee);

    gnc_combo_cell_clear_menu (cell);
    gnc_combo_cell_add_menu_item (cell, _("Cash"));

    if (gncEmployeeGetCCard (employee))
        gnc_combo_cell_add_menu_item (cell, _("Charge"));
}
Example #4
0
SEXP attribute_hidden do_sysbrowser(SEXP call, SEXP op, SEXP args, SEXP rho)
{
    SEXP rval=R_NilValue;
    RCNTXT *cptr;
    int n;

    checkArity(op, args);
    n = asInteger(CAR(args));
    if(n < 1 ) error(_("number of contexts must be positive"));

    /* first find the closest  browser context */
    cptr = R_GlobalContext;
    while (cptr != R_ToplevelContext) {
        if (cptr->callflag == CTXT_BROWSER) {
            break;
        }
        cptr = cptr->nextcontext;
    }
    /* error if not a browser context */

    if( !(cptr->callflag == CTXT_BROWSER) )
        error(_("no browser context to query"));

    switch (PRIMVAL(op)) {
    case 1: /* text */
    case 2: /* condition */
        /* first rewind to the right place if needed */
        /* note we want n>1, as we have already      */
        /* rewound to the first context              */
        if( n > 1 ) {
            while (cptr != R_ToplevelContext && n > 0 ) {
                if (cptr->callflag == CTXT_BROWSER) {
                    n--;
                    break;
                }
                cptr = cptr->nextcontext;
            }
        }
        if( !(cptr->callflag == CTXT_BROWSER) )
            error(_("not that many calls to browser are active"));

        if( PRIMVAL(op) == 1 )
            rval = CAR(cptr->promargs);
        else
            rval = CADR(cptr->promargs);
        break;
    case 3: /* turn on debugging n levels up */
        while ( (cptr != R_ToplevelContext) && n > 0 ) {
            if (cptr->callflag & CTXT_FUNCTION)
                n--;
            cptr = cptr->nextcontext;
        }
        if( !(cptr->callflag & CTXT_FUNCTION) )
            error(_("not that many functions on the call stack"));
        else
            SET_RDEBUG(cptr->cloenv, 1);
        break;
    }
    return(rval);
}
Example #5
0
static void
gegl_op_class_init (GeglOpClass *klass)
{
  GeglOperationClass       *operation_class;
  GeglOperationFilterClass *filter_class;

  operation_class = GEGL_OPERATION_CLASS (klass);
  filter_class    = GEGL_OPERATION_FILTER_CLASS (klass);

  filter_class->process = reinhard05_process;

  operation_class->prepare                 = reinhard05_prepare;
  operation_class->get_required_for_output = reinhard05_get_required_for_output;
  operation_class->get_cached_region       = reinhard05_get_cached_region;
  operation_class->threaded                = FALSE;

  gegl_operation_class_set_keys (operation_class,
  "name",      "gegl:reinhard05",
  "title",      _("Reinhard 2005 Tone Mapping"),
  "categories" , "tonemapping",
  "reference-hash", "82d46893705823deabfe2511f0561b68",
  "description",
        _("Adapt an image, which may have a high dynamic range, for "
          "presentation using a low dynamic range. This is an efficient "
          "global operator derived from simple physiological observations, "
          "producing luminance within the range 0.0-1.0"),
        NULL);
}
Example #6
0
bool StarTrekEngine::showSaveMenu() {
	GUI::SaveLoadChooser *dialog;
	Common::String desc;
	int slot;

	dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);

	slot = dialog->runModalWithCurrentTarget();
	desc = dialog->getResultString();

	if (desc.empty()) {
		// create our own description for the saved game, the user didnt enter it
		desc = dialog->createDefaultSaveDescription(slot);
	}

	if (desc.size() > 28)
		desc = Common::String(desc.c_str(), 28);

	delete dialog;

	if (slot < 0)
		return true;

	return saveGame(slot, desc);
}
Example #7
0
/*
 * Update File Attributes in the catalog with data sent by the Storage daemon.
 */
void catalog_update(JCR *jcr, BSOCK *bs)
{
   if (!jcr->res.pool->catalog_files) {
      return;                         /* user disabled cataloging */
   }

   if (jcr->is_job_canceled()) {
      goto bail_out;
   }

   if (!jcr->db) {
      POOLMEM *omsg = get_memory(bs->msglen+1);
      pm_strcpy(omsg, bs->msg);
      bs->fsend(_("1994 Invalid Catalog Update: %s"), omsg);
      Jmsg1(jcr, M_FATAL, 0, _("Invalid Catalog Update; DB not open: %s"), omsg);
      free_memory(omsg);
      goto bail_out;
   }

   update_attribute(jcr, bs->msg, bs->msglen);

bail_out:
   if (jcr->is_job_canceled()) {
      cancel_storage_daemon_job(jcr);
   }
}
Example #8
0
int module_init(moduleoption *opt)
{
    fitnessfunc *f;

    dummy=restype_find(RESTYPE);
    if(dummy==NULL) {
        error(_("Resource type '%s' not found"), RESTYPE);
        return -1;
    }

    fixed_tuples=malloc(sizeof(*fixed_tuples)*dat_tuplenum);
    fixed_num=0;

    if(fixed_tuples==NULL) {
        error(_("Can't allocate memory"));
        return -1;
    }

    if(handler_tup_new("fixed-" RESTYPE, handler)==NULL) return -1;

    f=fitness_new("fixed-" RESTYPE,
                  option_int(opt, "weight"),
                  option_int(opt, "mandatory"),
                  fitness);

    if(f==NULL) return -1;

    fitness_request_chromo(f, RESTYPE);

    return(0);
}
void mmAttachmentDialog::OnItemRightClick(wxDataViewEvent& event)
{
    wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, wxID_ANY) ;
    evt.SetEventObject( this );

    Model_Attachment::Data* attachment = Model_Attachment::instance().get(m_attachment_id);

    wxMenu* mainMenu = new wxMenu;
    if (attachment) mainMenu->SetTitle(attachment->DESCRIPTION);
    mainMenu->Append(new wxMenuItem(mainMenu, MENU_NEW_ATTACHMENT, _("&Add ")));
    mainMenu->AppendSeparator();
    mainMenu->Append(new wxMenuItem(mainMenu, MENU_OPEN_ATTACHMENT, _("&Open ")));
    mainMenu->Append(new wxMenuItem(mainMenu, MENU_EDIT_ATTACHMENT, _("&Edit ")));
    if (!attachment) mainMenu->Enable(MENU_EDIT_ATTACHMENT, false);
    mainMenu->Append(new wxMenuItem(mainMenu, MENU_DELETE_ATTACHMENT, _("&Remove ")));

    //Disable buttons
    wxString AttachmentsFolder = mmex::getPathAttachment(mmAttachmentManage::InfotablePathSetting());
    if (AttachmentsFolder == wxEmptyString || !wxDirExists(AttachmentsFolder))
        mainMenu->Enable(MENU_NEW_ATTACHMENT, false);

    if (!attachment)
    {
        mainMenu->Enable(MENU_OPEN_ATTACHMENT, false);
        mainMenu->Enable(MENU_EDIT_ATTACHMENT, false);
        mainMenu->Enable(MENU_DELETE_ATTACHMENT, false);
    }

    PopupMenu(mainMenu);
    delete mainMenu;
    event.Skip();
}
Example #10
0
/**
 * AutoGen specific wrapper function for gettext.  It relies on the macro _()
 * to convert from English to the target language, then strdup-duplicates the
 * result string.  It tries the "libopts" domain first, then whatever has been
 * set via the \a textdomain(3) call.
 *
 * @param[in] pz the input text used as a lookup key.
 * @returns the translated text (if there is one),
 *   or the original text (if not).
 */
static char *
AO_gettext(char const * pz)
{
    char * res;
    if (pz == NULL)
        return NULL;
#ifdef HAVE_DCGETTEXT
    /*
     * While processing the option_xlateable_txt data, try to use the
     * "libopts" domain.  Once we switch to the option descriptor data,
     * do *not* use that domain.
     */
    if (option_xlateable_txt.field_ct != 0) {
        res = dgettext("libopts", pz);
        if (res == pz)
            res = (char *)VOIDP(_(pz));
    } else
        res = (char *)VOIDP(_(pz));
#else
    res = (char *)VOIDP(_(pz));
#endif
    if (res == pz)
        return res;
    res = strdup(res);
    if (res == NULL) {
        fputs(_("No memory for duping translated strings\n"), stderr);
        exit(NTPQ_EXIT_FAILURE);
    }
    return res;
}
Example #11
0
static void datasource_osm_my_traces_add_setup_widgets ( GtkWidget *dialog, VikViewport *vvp, gpointer user_data )
{
    datasource_osm_my_traces_t *data = (datasource_osm_my_traces_t *)user_data;

    GtkWidget *user_label;
    GtkWidget *password_label;
    user_label = gtk_label_new(_("Username:"));
    data->user_entry = gtk_entry_new();

    gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), user_label, FALSE, FALSE, 0 );
    gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), data->user_entry, FALSE, FALSE, 0 );
    gtk_widget_set_tooltip_markup ( GTK_WIDGET(data->user_entry), _("The email or username used to login to OSM") );

    password_label = gtk_label_new ( _("Password:") );
    data->password_entry = gtk_entry_new ();

    gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), password_label, FALSE, FALSE, 0 );
    gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), data->password_entry, FALSE, FALSE, 0 );
    gtk_widget_set_tooltip_markup ( GTK_WIDGET(data->password_entry), _("The password used to login to OSM") );

    osm_login_widgets (data->user_entry, data->password_entry);
    gtk_widget_show_all ( dialog );

    /* Keep reference to viewport */
    data->vvp = vvp;
}
Example #12
0
static void
log_handler(const gchar * log_domain,
	    GLogLevelFlags log_level,
	    const gchar * message, gpointer user_data)
{
    if (!params.gui_running) {
	/* No GUI running: spit the message to the terminal */
	g_print("\n\n*** %s: %s\n\n",
		(log_level & G_LOG_FLAG_FATAL) ? _("Error") : _("Warning"),
		message);
    } else {
	/* Hooray! We have a GUI running! */
	GtkWidget *dialog;

	dialog = gtk_message_dialog_new_with_markup(NULL, GTK_DIALOG_MODAL,
						    (log_level &
						     G_LOG_FLAG_FATAL) ?
						    GTK_MESSAGE_ERROR :
						    GTK_MESSAGE_WARNING,
						    GTK_BUTTONS_CLOSE,
						    "<big><b>%s</b></big>\n\n%s",
						    (log_level &
						     G_LOG_FLAG_FATAL) ?
						    _("Fatal Error") :
						    _("Warning"), message);

	gtk_dialog_run(GTK_DIALOG(dialog));
	gtk_widget_destroy(dialog);
    }
}
/* Called whenever any of the new password fields have changed */
static void
passdlg_check_password (GtkEntry *entry, PasswordDialog *pdialog)
{
	guint	ret;

	ret = passdlg_refresh_password_state (pdialog);

	switch (ret) {
		case PASSDLG_ERROR_NONE:
			passdlg_set_status (pdialog, _("Click <b>Change password</b> to change your password."));
			break;
		case PASSDLG_ERROR_NEW_PASSWORD_EMPTY:
			passdlg_set_status (pdialog, _("Please type your password in the <b>New password</b> field."));
			break;
		case PASSDLG_ERROR_RETYPED_PASSWORD_EMPTY:
			passdlg_set_status (pdialog, _("Please type your password again in the <b>Retype new password</b> field."));
			break;
		case PASSDLG_ERROR_PASSWORDS_NOT_EQUAL:
			passdlg_set_status (pdialog, _("The two passwords are not equal."));
			break;
		default:
			g_warning ("Unknown passdlg_check_password error: %d", ret);
			break;
	}
}
/* Start backend and handle errors
 * If backend is already running, stop it
 * If an error occurs, show error dialog */
static gboolean
passdlg_spawn_passwd (PasswordDialog *pdialog)
{
	GError	*error = NULL;
	gchar	*details;

	/* If backend is running, stop it */
	stop_passwd (pdialog);

	/* Spawn backend */
	if (!spawn_passwd (pdialog, &error)) {
		GtkWidget *parent = GTK_WIDGET (gtk_builder_get_object (pdialog->ui, "change-password"));

		/* translators: Unable to launch <program>: <error message> */
		details = g_strdup_printf (_("Unable to launch %s: %s"),
					   "/usr/bin/passwd", error->message);

		passdlg_error_dialog (GTK_WINDOW (parent),
				      _("Unable to launch backend"),
				      _("A system error has occurred"),
				      details);

		g_free (details);
		g_error_free (error);

		return FALSE;
	}

	return TRUE;
}
static void
ppscm_print_exception_unless_memory_error (SCM exception,
					   struct ui_file *stream)
{
  if (gdbscm_memory_error_p (gdbscm_exception_key (exception)))
    {
      char *msg = gdbscm_exception_message_to_string (exception);
      struct cleanup *cleanup = make_cleanup (xfree, msg);

      /* This "shouldn't happen", but play it safe.  */
      if (msg == NULL || *msg == '\0')
	fprintf_filtered (stream, _("<error reading variable>"));
      else
	{
	  /* Remove the trailing newline.  We could instead call a special
	     routine for printing memory error messages, but this is easy
	     enough for now.  */
	  size_t len = strlen (msg);

	  if (msg[len - 1] == '\n')
	    msg[len - 1] = '\0';
	  fprintf_filtered (stream, _("<error reading variable: %s>"), msg);
	}

      do_cleanups (cleanup);
    }
  else
    gdbscm_print_gdb_exception (SCM_BOOL_F, exception);
}
void mmAttachmentDialog::CreateControls()
{
    wxBoxSizer* mainBoxSizer = new wxBoxSizer(wxVERTICAL);

    attachmentListBox_ = new wxDataViewListCtrl( this
        , wxID_ANY, wxDefaultPosition, wxSize(460, 500)/*, wxDV_HORIZ_RULES*/);

    if (debug_) attachmentListBox_->AppendTextColumn(ColName_[ATTACHMENT_ID], wxDATAVIEW_CELL_INERT, 30);
    attachmentListBox_->AppendTextColumn(ColName_[ATTACHMENT_DESCRIPTION], wxDATAVIEW_CELL_INERT, 150);
    attachmentListBox_->AppendTextColumn(ColName_[ATTACHMENT_FILENAME], wxDATAVIEW_CELL_INERT, 300);
    mainBoxSizer->Add(attachmentListBox_, wxSizerFlags(g_flagsExpand).Border(wxALL, 10));

    wxPanel* buttons_panel = new wxPanel(this, wxID_ANY);
    mainBoxSizer->Add(buttons_panel, wxSizerFlags(g_flagsV).Center());
    wxStdDialogButtonSizer* buttons_sizer = new wxStdDialogButtonSizer;
    buttons_panel->SetSizer(buttons_sizer);

    wxButton* buttonOK = new wxButton(buttons_panel, wxID_OK, _("&OK "));
    wxButton* btnCancel = new wxButton(buttons_panel, wxID_CANCEL, wxGetTranslation(g_CancelLabel));
    buttons_sizer->Add(buttonOK, g_flagsH);
    buttons_sizer->Add(btnCancel, g_flagsH);

    wxBitmapButton* magicButton = new wxBitmapButton(buttons_panel
        , wxID_APPLY, mmBitmap(png::RUN));
    magicButton->SetToolTip(_("Other tools"));
    buttons_sizer->Add(magicButton, g_flagsH);

    Center();
    this->SetSizer(mainBoxSizer);
}
Example #17
0
/* Show command.  Display a warning if the language set
   does not match the frame.  */
static void
show_language_command (struct ui_file *file, int from_tty,
		       struct cmd_list_element *c, const char *value)
{
  enum language flang;		/* The language of the frame.  */

  if (language_mode == language_mode_auto)
    fprintf_filtered (gdb_stdout,
		      _("The current source language is "
			"\"auto; currently %s\".\n"),
		      current_language->la_name);
  else
    fprintf_filtered (gdb_stdout,
		      _("The current source language is \"%s\".\n"),
		      current_language->la_name);

  if (has_stack_frames ())
    {
      struct frame_info *frame;

      frame = get_selected_frame (NULL);
      flang = get_frame_language (frame);
      if (flang != language_unknown
	  && language_mode == language_mode_manual
	  && current_language->la_language != flang)
	printf_filtered ("%s\n", lang_frame_mismatch_warn);
    }
}
Example #18
0
static bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)
{
    bool fSecure = style & CClientUIInterface::SECURE;
    style &= ~CClientUIInterface::SECURE;

    std::string strCaption;
    // Check for usage of predefined caption
    switch (style) {
    case CClientUIInterface::MSG_ERROR:
        strCaption += _("Error");
        break;
    case CClientUIInterface::MSG_WARNING:
        strCaption += _("Warning");
        break;
    case CClientUIInterface::MSG_INFORMATION:
        strCaption += _("Information");
        break;
    default:
        strCaption += caption; // Use supplied caption (can be empty)
    }

    if (!fSecure)
        LogPrintf("%s: %s\n", strCaption, message);
    fprintf(stderr, "%s: %s\n", strCaption.c_str(), message.c_str());
    return false;
}
Example #19
0
/*
============
Cvar_Command

Handles variable inspection and changing from the console
============
*/
qboolean Cvar_Command( void )
{
    cvar_t *v;

    // check variables
    v = Cvar_FindVar( Cmd_Argv( 0 ) );

    if ( !v )
    {
        return qfalse;
    }

    // perform a variable print or set
    if ( Cmd_Argc() == 1 )
    {
        Com_Printf( _("\"%s\" is \"%s^7\" default: \"%s^7\"\n"), v->name, v->string, v->resetString );

        if ( v->latchedString )
        {
            Com_Printf( _("latched: \"%s\"\n"), v->latchedString );
        }

        return qtrue;
    }

    // set the value if forcing isn't required
    Cvar_Set2( v->name, Cmd_UnquoteString( Cmd_Args() ), qfalse );
    return qtrue;
}
Example #20
0
/**
 * gda_report_engine_declare_object
 * @engine: a #GdaReportEngine object
 * @object: a #GObject to declare
 * @obj_name: the name to give to @object within @engine
 *
 * Declares an object which will be used in @engine, referenced by the @obj_name name.
 *
 * @object must be of a supported types, that it must be a #GdaConnection, #GdaStatement or #GdaHolder object.
 */
void
gda_report_engine_declare_object (GdaReportEngine *engine, GObject *object, const gchar *obj_name)
{
	gchar prefix, *real_name;
	GObject *current_obj;
	g_return_if_fail (GDA_IS_REPORT_ENGINE (engine));
	g_return_if_fail (engine->priv);
	g_return_if_fail (G_IS_OBJECT (object));
	g_return_if_fail (obj_name);

	if (GDA_IS_STATEMENT (object))
		prefix = 'S';
	else if (GDA_IS_CONNECTION (object))
		prefix = 'C';
	else if (GDA_IS_HOLDER (object))
		prefix = 'H';
	else {
		g_warning (_("Object type '%s' cannot be declared in this context"), G_OBJECT_TYPE_NAME (object));
		return;
	}
	
	real_name = g_strdup_printf ("%c%s", prefix, obj_name);
	current_obj = g_hash_table_lookup (engine->priv->objects, real_name);
	if (current_obj) {
		if (current_obj != object) 
			g_warning (_("An object with the '%s' name has already been declared"), obj_name);
	}
	else {
		/*g_print ("%s(): declared %p as %s\n", __FUNCTION__, object, real_name);*/
		g_hash_table_insert (engine->priv->objects, real_name, object);
		g_object_ref (object);
	}
}
Example #21
0
SEXP attribute_hidden R_sysframe(int n, RCNTXT *cptr)
{
    if (n == 0)
        return(R_GlobalEnv);

    if (n > 0)
        n = framedepth(cptr) - n;
    else
        n = -n;

    if(n < 0)
        errorcall(R_GlobalContext->call,
                  _("not that many frames on the stack"));

    while (cptr->nextcontext != NULL) {
        if (cptr->callflag & CTXT_FUNCTION ) {
            if (n == 0) {  /* we need to detach the enclosing env */
                return cptr->cloenv;
            }
            else
                n--;
        }
        cptr = cptr->nextcontext;
    }
    if(n == 0 && cptr->nextcontext == NULL)
        return R_GlobalEnv;
    else
        errorcall(R_GlobalContext->call,
                  _("not that many frames on the stack"));
    return R_NilValue;	   /* just for -Wall */
}
Example #22
0
wxString GuideCamera::GetSettingsSummary()
{
    int darkDur;

    { // lock scope
        wxCriticalSectionLocker lck(DarkFrameLock);
        darkDur = CurrentDarkFrame ? CurrentDarkFrame->ImgExpDur : 0;
    } // lock scope

    // return a loggable summary of current camera settings
    wxString pixelSizeStr;
    if (m_pixelSize == DefaultPixelSize)
        pixelSizeStr = _("unspecified");
    else
        pixelSizeStr = wxString::Format(_("%0.1f um"), m_pixelSize);

    return wxString::Format("Camera = %s, gain = %d%s%s, full size = %d x %d, %s, %s, pixel size = %s\n",
                            Name, GuideCameraGain,
                            HasDelayParam ? wxString::Format(", delay = %d", ReadDelay) : "",
                            HasPortNum ? wxString::Format(", port = 0x%hx", Port) : "",
                            FullSize.GetWidth(), FullSize.GetHeight(),
                            darkDur ? wxString::Format("have dark, dark dur = %d", darkDur) : "no dark",
                            (CurrentDefectMap) ? "defect map in use" : "no defect map",
                            pixelSizeStr);
}
void mmCustomFieldListDialog::OnItemRightClick(wxDataViewEvent& event)
{
    wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, wxID_ANY) ;
    evt.SetEventObject( this );

    Model_CustomField::Data *field = Model_CustomField::instance().get(m_field_id);

    wxMenu* mainMenu = new wxMenu;
    if (field) mainMenu->SetTitle(field->DESCRIPTION);
    mainMenu->Append(new wxMenuItem(mainMenu, MENU_NEW_FIELD, _("&Add ")));
    mainMenu->AppendSeparator();
    mainMenu->Append(new wxMenuItem(mainMenu, MENU_EDIT_FIELD, _("&Edit ")));
    mainMenu->Append(new wxMenuItem(mainMenu, MENU_DELETE_FIELD, _("&Remove ")));
    mainMenu->Append(new wxMenuItem(mainMenu, MENU_UPDATE_FIELD, _("&Massive content update ")));
    if (!field)
    {
        mainMenu->Enable(MENU_EDIT_FIELD, false);
        mainMenu->Enable(MENU_DELETE_FIELD, false);
        mainMenu->Enable(MENU_UPDATE_FIELD, false);
    }

    PopupMenu(mainMenu);
    delete mainMenu;
    event.Skip();
}
i2c_tunable::i2c_tunable(const char *path, const char *name, bool is_adapter) : tunable("", 0.9, _("Good"), _("Bad"), _("Unknown"))
{
	ifstream file;
	char filename[4096];
	string devname;

	sprintf(filename, "%s/name", path);
	file.open(filename, ios::in);
	if (file) {
		getline(file, devname);
		file.close();
	}

	if (is_adapter) {
		sprintf(i2c_path, "%s/device/power/control", path);
		sprintf(filename, "%s/device", path);
	} else {
		sprintf(i2c_path, "%s/power/control", path);
		sprintf(filename, "%s/device", path);
	}

	if (device_has_runtime_pm(filename))
		sprintf(desc, _("Runtime PM for I2C %s %s (%s)"), (is_adapter ? _("Adapter") : _("Device")), name, (devname.empty() ? "" : devname.c_str()));
	else
		sprintf(desc, _("I2C %s %s has no runtime power management"), (is_adapter ? _("Adapter") : _("Device")), name);

	sprintf(toggle_good, "echo 'auto' > '%s';", i2c_path);
	sprintf(toggle_bad, "echo 'on' > '%s';", i2c_path);
}
Example #25
0
static void export_ldif_relative_dn_changed(GtkWidget *widget, gpointer data)
{
	gint relativeDN = combobox_get_active_data(GTK_COMBO_BOX(widget));
	GtkLabel *label = GTK_LABEL(data);

	switch(relativeDN) {
	case EXPORT_LDIF_ID_UID:
		gtk_label_set_text(label,
		_("The address book Unique ID is used to create a DN that is " \
		"formatted similar to:\n" \
		"  uid=102376,ou=people,dc=claws-mail,dc=org"));
		break;
	case EXPORT_LDIF_ID_DNAME:
		gtk_label_set_text(label,
		_("The address book Display Name is used to create a DN that " \
		"is formatted similar to:\n" \
		"  cn=John Doe,ou=people,dc=claws-mail,dc=org"));	
		break;
	case EXPORT_LDIF_ID_EMAIL:
		gtk_label_set_text(label, 
		_("The first Email Address belonging to a person is used to " \
		"create a DN that is formatted similar to:\n" \
		"  mail=john.doe@domain.com,ou=people,dc=claws-mail,dc=org"));	
		break;
	}
	
}
Example #26
0
extern const char *conf_get_fitname(t_conf_fit fit)
{
	switch (fit) {
		case conf_fit_none:
			return _("原始大小");
			break;
		case conf_fit_width:
			return _("适应宽度");
			break;
		case conf_fit_dblwidth:
			return _("适应两倍宽度");
			break;
		case conf_fit_height:
			return _("适应高度");
			break;
		case conf_fit_dblheight:
			return _("适应两倍高度");
			break;
		case conf_fit_custom:
			return "";
			break;
		default:
			return "";
			break;
	}
}
Example #27
0
GtkWidget *create_tray_menu(MITEM *mitems)
{
  GtkWidget *menu = gtk_menu_new ();

  int i;
  for(i=0; mitems[i].cb; i++) {
    GtkWidget *item;

    if (!mitems[i].name)
      continue;

    if (mitems[i].stock_id) {
      item = gtk_image_menu_item_new_with_label (_(mitems[i].name));
      gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), gtk_image_new_from_stock(mitems[i].stock_id, GTK_ICON_SIZE_MENU));
    }
    else
    if (mitems[i].check_dat) {
      item = gtk_check_menu_item_new_with_label (_(mitems[i].name));
      gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), *mitems[i].check_dat);
    } else
      item = gtk_menu_item_new_with_label (_(mitems[i].name));

    mitems[i].handler = g_signal_connect (G_OBJECT (item), "activate",
                      G_CALLBACK (mitems[i].cb), NULL);

    gtk_widget_show(item);
    mitems[i].item = item;

    gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
  }

  return menu;
}
Example #28
0
wxString wxFileData::GetHint() const
{
    wxString s = m_filePath;
    s += wxT("  ");

    if (IsDir())
        s += _("<DIR>");
    else if (IsLink())
        s += _("<LINK>");
    else if (IsDrive())
        s += _("<DRIVE>");
    else // plain file
        s += wxString::Format( _("%ld bytes"), m_size );

    s += wxT(' ');

    if ( !IsDrive() )
    {
        s << GetModificationTime()
          << wxT("  ")
          << m_permissions;
    }

    return s;
};
Example #29
0
gboolean
rb_plugins_engine_activate_plugin (RBPluginInfo *info)
{
	gboolean ret;

	g_return_val_if_fail (info != NULL, FALSE);

	if (info->active)
		return TRUE;

	ret = rb_plugins_engine_activate_plugin_real (info, rb_plugins_shell);

	if (info->visible != FALSE || ret != FALSE) {
		char *key_name;

		key_name = g_strdup_printf (CONF_PLUGIN_ACTIVE_KEY, info->location);
		eel_gconf_set_boolean (key_name, ret);
		g_free (key_name);
	}
        info->active = ret;

        if (ret != FALSE)
                return TRUE;


	rb_error_dialog (NULL, _("Plugin Error"), _("Unable to activate plugin %s"), info->name);

	return FALSE;
}
Example #30
0
bool CQuickconnectBar::Create(CMainFrame* pParent)
{
	m_pMainFrame = pParent;
	if (!wxXmlResource::Get()->LoadPanel(this, pParent, _T("ID_QUICKCONNECTBAR")))
	{
		wxLogError(_("Cannot load Quickconnect bar from resource file"));
		return false;
	}

#ifdef __WXMAC__
	// Under OS X default buttons are toplevel window wide, where under Windows / GTK they stop at the parent panel.
	wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(pParent), wxTopLevelWindow);
	if (tlw)
		tlw->SetDefaultItem(0);
#endif

	m_pHost = XRCCTRL(*this, "ID_QUICKCONNECT_HOST", wxTextCtrl);
	m_pUser = XRCCTRL(*this, "ID_QUICKCONNECT_USER", wxTextCtrl);
	m_pPass = XRCCTRL(*this, "ID_QUICKCONNECT_PASS", wxTextCtrl);
	m_pPort = XRCCTRL(*this, "ID_QUICKCONNECT_PORT", wxTextCtrl);

	if (!m_pHost || !m_pUser || !m_pPass || !m_pPort)
	{
		wxLogError(_("Cannot load Quickconnect bar from resource file"));
		return false;
	}

	return true;
}