本文整理汇总了C++中Q_函数的典型用法代码示例。如果您正苦于以下问题:C++ Q_函数的具体用法?C++ Q_怎么用?C++ Q_使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Q_函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: help_unknown_ref
void help_unknown_ref(const char *ref, const char *cmd, const char *error)
{
int i;
struct string_list suggested_refs = guess_refs(ref);
fprintf_ln(stderr, _("%s: %s - %s"), cmd, ref, error);
if (suggested_refs.nr > 0) {
fprintf_ln(stderr,
Q_("\nDid you mean this?",
"\nDid you mean one of these?",
suggested_refs.nr));
for (i = 0; i < suggested_refs.nr; i++)
fprintf(stderr, "\t%s\n", suggested_refs.items[i].string);
}
string_list_clear(&suggested_refs, 0);
exit(1);
}
开发者ID:GeertBosch,项目名称:git-stream,代码行数:19,代码来源:help.c
示例2: joy_iterator_next
JoyIterator *
joy_iterator_next(JoyIterator *self)
{
g_return_val_if_fail(JOY_IS_ITERATOR(self), NULL);
gpointer next = NULL;
JoyIteratorClass *klass = JOY_ITERATOR_GET_CLASS(self);
if (G_LIKELY(klass->next_item)) {
next = klass->next_item(self);
} else {
g_warning(Q_("%s: unsupported operation for type '%s'"),
G_STRFUNC, G_OBJECT_TYPE_NAME(self));
}
if (next) {
GET_PRIVATE(self)->item = next;
return self;
} else {
g_object_unref(self);
return NULL;
}
}
开发者ID:msteinert,项目名称:joybubbles,代码行数:20,代码来源:iterator.c
示例3: events_init
/****************************************************************************
Initialize events.
Now also initialise sorted_events[].
****************************************************************************/
void events_init(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(event_to_index); i++) {
event_to_index[i] = 0;
}
for (i = 0; events[i].enum_name; i++) {
int j;
if (E_S_XYZZY > events[i].esn) {
const char *event_format = Q_(event_sections[events[i].esn]);
int l = 1 + strlen(event_format) + strlen(_(events[i].descr_orig));
events[i].full_descr = fc_malloc(l);
fc_snprintf(events[i].full_descr, l, event_format,
_(events[i].descr_orig));
} else {
/* No section part */
events[i].full_descr = _(events[i].descr_orig);
}
event_to_index[events[i].event] = i;
events[i].tag_name = fc_strdup(events[i].enum_name);
for (j = 0; j < strlen(events[i].tag_name); j++) {
events[i].tag_name[j] = fc_tolower(events[i].tag_name[j]);
}
log_debug("event[%d]=%d: name='%s' / '%s'\n"
"\tdescr_orig='%s'\n"
"\tdescr='%s'",
i, events[i].event, events[i].enum_name, events[i].tag_name,
events[i].descr_orig, events[i].full_descr);
}
for (i = 0; i < E_LAST; i++) {
sorted_events[i] = i;
}
qsort(sorted_events, E_LAST, sizeof(*sorted_events),
compar_event_message_texts);
}
开发者ID:jheusala,项目名称:freeciv-extended,代码行数:45,代码来源:events.c
示例4: xmalloc
static void *get_data_from_pack(struct object_entry *obj)
{
off_t from = obj[0].idx.offset + obj[0].hdr_size;
unsigned long len = obj[1].idx.offset - from;
unsigned char *data, *inbuf;
git_zstream stream;
int status;
data = xmalloc(obj->size);
inbuf = xmalloc((len < 64*1024) ? len : 64*1024);
memset(&stream, 0, sizeof(stream));
git_inflate_init(&stream);
stream.next_out = data;
stream.avail_out = obj->size;
do {
ssize_t n = (len < 64*1024) ? len : 64*1024;
n = pread(pack_fd, inbuf, n, from);
if (n < 0)
die_errno(_("cannot pread pack file"));
if (!n)
die(Q_("premature end of pack file, %lu byte missing",
"premature end of pack file, %lu bytes missing",
len),
len);
from += n;
len -= n;
stream.next_in = inbuf;
stream.avail_in = n;
status = git_inflate(&stream, 0);
} while (len && status == Z_OK && !stream.avail_in);
/* This has been inflated OK when first encountered, so... */
if (status != Z_STREAM_END || stream.total_out != obj->size)
die(_("serious inflate inconsistency"));
git_inflate_end(&stream);
free(inbuf);
return data;
}
开发者ID:CCorreia,项目名称:git,代码行数:41,代码来源:index-pack.c
示例5: serial_read
static gboolean
serial_read(QahiraFormat *self, GInputStream *stream, GCancellable *cancel,
guchar *buffer, gsize size, GError **error)
{
while (size) {
gssize bytes = g_input_stream_read(stream, buffer, size,
cancel, error);
if (G_UNLIKELY(-1 == bytes)) {
return FALSE;
}
if (G_UNLIKELY(size && !bytes)) {
g_set_error(error, QAHIRA_ERROR,
QAHIRA_ERROR_CORRUPT_IMAGE,
Q_("serial: truncated format"));
return FALSE;
}
size -= bytes;
buffer += bytes;
}
return TRUE;
}
开发者ID:msteinert,项目名称:qahira,代码行数:21,代码来源:serial.c
示例6: date_pattern_converter_convert
static const gchar *
date_pattern_converter_convert(Log4gPatternConverter *base,
Log4gLoggingEvent *event)
{
struct DatePrivate *priv = GET_DATE_PRIVATE(base);
const GTimeVal *tv = log4g_logging_event_get_time_stamp(event);
if (!tv) {
return NULL;
}
struct tm tm;
time_t time = tv->tv_sec;
if (!localtime_r(&time, &tm)) {
log4g_log_error("localtime_r(): %s", g_strerror(errno));
return NULL;
}
if (!strftime(priv->buffer, sizeof priv->buffer, priv->format, &tm)) {
log4g_log_error(Q_("strftime() returned zero (0)"));
return NULL;
}
return priv->buffer;
}
开发者ID:msteinert,项目名称:log4g,代码行数:21,代码来源:pattern-converter.c
示例7: T_
void
FndbManager::ReadDirectory (/*[in]*/ const char * lpszPath,
/*[out]*/ vector<string> & subDirectoryNames,
/*[out]*/ vector<FILENAMEINFO> & fileNames)
{
if (! Directory::Exists(lpszPath))
{
traceStream->WriteFormattedLine ("core",
T_("the directory %s does not exist"),
Q_(lpszPath));
return;
}
vector<string> filesToBeIgnored;
GetIgnorableFiles (lpszPath, filesToBeIgnored);
auto_ptr<DirectoryLister> pLister (DirectoryLister::Open(lpszPath));
DirectoryEntry entry;
while (pLister->GetNext(entry))
{
if (binary_search(filesToBeIgnored.begin(),
filesToBeIgnored.end(),
entry.name.c_str(),
StringComparerIgnoringCase()))
{
continue;
}
if (entry.isDirectory)
{
subDirectoryNames.push_back (entry.name.c_str());
}
else
{
FILENAMEINFO filenameinfo;
filenameinfo.FileName = entry.name;
fileNames.push_back (filenameinfo);
}
}
pLister->Close ();
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:38,代码来源:makefndb.cpp
示例8: gq_display_clist_class_init
static void
gq_display_clist_class_init(GQDisplayCListClass* self_class) {
GQTypeDisplayClass* gtd_class = GQ_TYPE_DISPLAY_CLASS(self_class);
GQDisplayBinaryGenericClass* gdbg_class = GQ_DISPLAY_BINARY_GENERIC_CLASS(self_class);
gtd_class->name = Q_("displaytype|Column List");
gtd_class->selectable = FALSE;
gtd_class->show_in_search_result = FALSE;
gtd_class->get_widget = dt_clist_get_widget;
gtd_class->get_data = dt_clist_get_data;
gtd_class->set_data = dt_generic_binary_set_data; // reused from dt_generic_binary
gtd_class->buildLDAPMod = bervalLDAPMod;
gdbg_class->encode = NULL;
gdbg_class->decode = NULL;
gdbg_class->get_data_widget = dt_clist_get_data_widget;
gdbg_class->store_data = dt_clist_store_data;
gdbg_class->delete_data = dt_clist_delete_data;
gdbg_class->show_entries = dt_clist_show_entries;
self_class->fill_clist = NULL;
self_class->fill_details = NULL;
}
开发者ID:androdev4u,项目名称:GQ-LDAP-client,代码行数:23,代码来源:dt_clist.c
示例9: YapLog
DviDoc::DviFileStatus
DviDoc::GetDviFileStatus ()
{
if (fileStatus == DVIFILE_LOADED)
{
if (! File::Exists(PathName(GetPathName())))
{
fileStatus = DVIFILE_LOST;
}
else
{
time_t timeMod = modificationTime;
modificationTime = File::GetLastWriteTime(PathName(GetPathName()));
if (timeMod != modificationTime)
{
YapLog (T_("%s has been modified"), Q_(TU_(GetPathName())));
modificationTime = timeMod;
fileStatus = DVIFILE_MODIFIED;
}
}
}
return (fileStatus);
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:23,代码来源:DviDoc.cpp
示例10: T_
bool
Directory::Exists (/*[in]*/ const PathName & path)
{
struct stat statbuf;
if (stat(path.Get(), &statbuf) == 0)
{
if (S_ISDIR(statbuf.st_mode) == 0)
{
SessionImpl::theSession->trace_access->WriteFormattedLine
("core",
T_("%s is not a directory"),
Q_(path));
return (false);
}
return (true);
}
int error = errno;
if (error != ENOENT)
{
FATAL_CRT_ERROR ("stat", path.Get());
}
return (false);
}
开发者ID:bngabonziza,项目名称:miktex,代码行数:23,代码来源:unxFile.cpp
示例11: die
/*
* Make sure at least "min" bytes are available in the buffer, and
* return the pointer to the buffer.
*/
static void *fill(int min)
{
if (min <= input_len)
return input_buffer + input_offset;
if (min > sizeof(input_buffer))
die(Q_("cannot fill %d byte",
"cannot fill %d bytes",
min),
min);
flush();
do {
ssize_t ret = xread(input_fd, input_buffer + input_len,
sizeof(input_buffer) - input_len);
if (ret <= 0) {
if (!ret)
die(_("early EOF"));
die_errno(_("read error on input"));
}
input_len += ret;
if (from_stdin)
display_throughput(progress, consumed_bytes + input_len);
} while (input_len < min);
return input_buffer;
}
开发者ID:CCorreia,项目名称:git,代码行数:28,代码来源:index-pack.c
示例12: log4g_ttcc_layout_class_init
static void
log4g_ttcc_layout_class_init(Log4gTTCCLayoutClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
object_class->finalize = finalize;
object_class->set_property = set_property;
Log4gLayoutClass *layout_class = LOG4G_LAYOUT_CLASS(klass);
layout_class->format = format;
g_type_class_add_private(klass, sizeof(struct Private));
/* install properties */
g_object_class_install_property(object_class, PROP_THREAD_PRINTING,
g_param_spec_boolean("thread-printing", Q_("Thread Printing"),
Q_("Toggle thread printing"), TRUE, G_PARAM_WRITABLE));
g_object_class_install_property(object_class, PROP_CATEGORY_PREFIXING,
g_param_spec_boolean("category-prefixing",
Q_("Category Prefixing"),
Q_("Toggle category prefixing"),
TRUE, G_PARAM_WRITABLE));
g_object_class_install_property(object_class, PROP_CONTEXT_PRINTING,
g_param_spec_boolean("context-printing",
Q_("Context Printing"), Q_("Toggle context printing"),
TRUE, G_PARAM_WRITABLE));
}
开发者ID:msteinert,项目名称:log4g,代码行数:23,代码来源:ttcc-layout.c
示例13: log4g_level_range_filter_class_init
static void
log4g_level_range_filter_class_init(Log4gLevelRangeFilterClass *klass)
{
Log4gFilterClass *filter_class = LOG4G_FILTER_CLASS(klass);
GObjectClass *object_class = G_OBJECT_CLASS(klass);
object_class->dispose = dispose;
object_class->set_property = set_property;
filter_class->decide = decide;
g_type_class_add_private(klass, sizeof(struct Private));
/* install properties */
g_object_class_install_property(object_class, PROP_LEVEL_MIN,
g_param_spec_string("level-min", Q_("Minimum Level"),
Q_("Minimum log level to match"), NULL,
G_PARAM_WRITABLE));
g_object_class_install_property(object_class, PROP_LEVEL_MAX,
g_param_spec_string("level-max", Q_("Maximum Level"),
Q_("Maximum log level to match"), NULL,
G_PARAM_WRITABLE));
g_object_class_install_property(object_class, PROP_ACCEPT_ON_RANGE,
g_param_spec_boolean("accept-on-range", Q_("Accept on Range"),
Q_("Accept or deny on log level range match"),
TRUE, G_PARAM_WRITABLE));
}
开发者ID:msteinert,项目名称:log4g,代码行数:23,代码来源:level-range-filter.c
示例14: panel_place_menu_item_create_menu
static GtkWidget *
panel_place_menu_item_create_menu (PanelPlaceMenuItem *place_item)
{
GtkWidget *places_menu;
GtkWidget *item;
char *gconf_name;
char *name;
char *uri;
GFile *file;
places_menu = panel_create_menu ();
file = g_file_new_for_path (g_get_home_dir ());
uri = g_file_get_uri (file);
name = panel_util_get_label_for_uri (uri);
g_object_unref (file);
panel_menu_items_append_place_item (PANEL_ICON_HOME, NULL,
name,
_("Open your personal folder"),
places_menu,
G_CALLBACK (activate_home_uri),
uri);
g_free (name);
g_free (uri);
if (!gconf_client_get_bool (panel_gconf_get_client (),
DESKTOP_IS_HOME_DIR_KEY,
NULL)) {
file = g_file_new_for_path (g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP));
uri = g_file_get_uri (file);
g_object_unref (file);
panel_menu_items_append_place_item (
PANEL_ICON_DESKTOP, NULL,
/* Translators: Desktop is used here as in
* "Desktop Folder" (this is not the Desktop
* environment). Do not keep "Desktop Folder|"
* in the translation */
Q_("Desktop Folder|Desktop"),
_("Open the contents of your desktop in a folder"),
places_menu,
G_CALLBACK (activate_desktop_uri),
/* FIXME: if the dir changes, we'd need to update the drag data since the uri is not the same */
uri);
g_free (uri);
}
panel_place_menu_item_append_gtk_bookmarks (places_menu);
add_menu_separator (places_menu);
gconf_name = gconf_client_get_string (panel_gconf_get_client (),
COMPUTER_NAME_KEY,
NULL);
panel_menu_items_append_from_desktop (places_menu,
"nautilus-computer.desktop",
gconf_name);
if (gconf_name)
g_free (gconf_name);
panel_menu_items_append_from_desktop (places_menu,
"nautilus-cd-burner.desktop",
NULL);
panel_place_menu_item_append_local_gio (place_item, places_menu);
add_menu_separator (places_menu);
panel_menu_items_append_from_desktop (places_menu,
"network-scheme.desktop",
NULL);
panel_place_menu_item_append_remote_gio (place_item, places_menu);
if (panel_is_program_in_path ("nautilus-connect-server")) {
item = panel_menu_items_create_action_item (PANEL_ACTION_CONNECT_SERVER);
if (item != NULL)
gtk_menu_shell_append (GTK_MENU_SHELL (places_menu),
item);
}
add_menu_separator (places_menu);
panel_menu_items_append_from_desktop (places_menu,
"gnome-search-tool.desktop",
NULL);
panel_recent_append_documents_menu (places_menu,
place_item->priv->recent_manager);
return places_menu;
}
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:90,代码来源:panel-menu-items.c
示例15: panel_menu_items_append_lock_logout
void
panel_menu_items_append_lock_logout (GtkWidget *menu)
{
gboolean separator_inserted;
GList *children;
GList *last;
GtkWidget *item;
const char *translate;
char *label;
char *tooltip;
separator_inserted = FALSE;
children = gtk_container_get_children (GTK_CONTAINER (menu));
last = g_list_last (children);
if (last != NULL) {
separator_inserted = GTK_IS_SEPARATOR (GTK_WIDGET (last->data));
}
g_list_free (children);
if (panel_lock_screen_action_available ("lock")) {
item = panel_menu_items_create_action_item (PANEL_ACTION_LOCK);
if (item != NULL) {
if (!separator_inserted) {
add_menu_separator (menu);
separator_inserted = TRUE;
}
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
}
}
/* Translators: translate "panel:showusername|1" to anything
* but "1" if "Log Out %s" doesn't make any sense in your
* language (where %s is a username).
*/
translate = Q_("panel:showusername|1");
if (strcmp (translate, "1") == 0) {
const char *user_name;
user_name = g_get_real_name ();
if (!user_name || !user_name [0])
user_name = g_get_user_name ();
/* keep those strings in sync with the ones in
* panel-action-button.c */
/* Translators: this string is used ONLY if you translated
* "panel:showusername|1" to "1" */
label = g_strdup_printf (_("Log Out %s..."),
g_get_user_name ());
/* Translators: this string is used ONLY if you translated
* "panel:showusername|1" to "1" */
tooltip = g_strdup_printf (_("Log out %s of this session to "
"log in as a different user"),
user_name);
} else {
label = NULL;
tooltip = NULL;
}
item = panel_menu_items_create_action_item_full (PANEL_ACTION_LOGOUT,
label, tooltip);
g_free (label);
g_free (tooltip);
if (item != NULL) {
if (!separator_inserted)
add_menu_separator (menu);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
}
item = panel_menu_items_create_action_item (PANEL_ACTION_SHUTDOWN);
if (item != NULL) {
if (!separator_inserted)
add_menu_separator (menu);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
}
}
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:79,代码来源:panel-menu-items.c
示例16: gnc_stock_split_assistant_finish
void
gnc_stock_split_assistant_finish (GtkAssistant *assistant,
gpointer user_data)
{
StockSplitInfo *info = user_data;
GList *account_commits;
GList *node;
gnc_numeric amount;
Transaction *trans;
Account *account;
Split *split;
time64 date;
account = info->acct;
g_return_if_fail (account != NULL);
amount = gnc_amount_edit_get_amount
(GNC_AMOUNT_EDIT (info->distribution_edit));
g_return_if_fail (!gnc_numeric_zero_p (amount));
gnc_suspend_gui_refresh ();
trans = xaccMallocTransaction (gnc_get_current_book ());
xaccTransBeginEdit (trans);
xaccTransSetCurrency (trans, gnc_default_currency ());
date = gnc_date_edit_get_date (GNC_DATE_EDIT (info->date_edit));
xaccTransSetDatePostedSecsNormalized (trans, date);
{
const char *description;
description = gtk_entry_get_text (GTK_ENTRY (info->description_entry));
xaccTransSetDescription (trans, description);
}
split = xaccMallocSplit (gnc_get_current_book ());
xaccAccountBeginEdit (account);
account_commits = g_list_prepend (NULL, account);
xaccTransAppendSplit (trans, split);
xaccAccountInsertSplit (account, split);
xaccSplitSetAmount (split, amount);
xaccSplitMakeStockSplit (split);
/* Set split-action with gnc_set_num_action which is the same as
* xaccSplitSetAction with these arguments */
/* Translators: This string has a disambiguation prefix */
gnc_set_num_action (NULL, split, NULL, Q_("Action Column|Split"));
amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->price_edit));
if (gnc_numeric_positive_p (amount))
{
QofBook *book;
GNCPrice *price;
GNCPriceDB *pdb;
GNCCurrencyEdit *ce;
Timespec ts;
ce = GNC_CURRENCY_EDIT (info->price_currency_edit);
ts.tv_sec = date;
ts.tv_nsec = 0;
price = gnc_price_create (gnc_get_current_book ());
gnc_price_begin_edit (price);
gnc_price_set_commodity (price, xaccAccountGetCommodity (account));
gnc_price_set_currency (price, gnc_currency_edit_get_currency (ce));
gnc_price_set_time (price, ts);
gnc_price_set_source (price, PRICE_SOURCE_STOCK_SPLIT);
gnc_price_set_typestr (price, PRICE_TYPE_UNK);
gnc_price_set_value (price, amount);
gnc_price_commit_edit (price);
book = gnc_get_current_book ();
pdb = gnc_pricedb_get_db (book);
if (!gnc_pricedb_add_price (pdb, price))
gnc_error_dialog (info->window, "%s", _("Error adding price."));
}
amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->cash_edit));
if (gnc_numeric_positive_p (amount))
{
const char *memo;
memo = gtk_entry_get_text (GTK_ENTRY (info->memo_entry));
/* asset split */
account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(info->asset_tree));
split = xaccMallocSplit (gnc_get_current_book ());
//.........这里部分代码省略.........
开发者ID:carrot-garden,项目名称:money_gnucash,代码行数:101,代码来源:assistant-stock-split.c
示例17: Q_
double Qmatrix::operator()(int64_t a, int64_t b) const {
return Q_(f2s(f2s_maps_[0], a), f2s(f2s_maps_[1], b));
}
开发者ID:ValeevGroup,项目名称:mpqc,代码行数:3,代码来源:schwarz_screen.cpp
示例18: egg_find_bar_init
static void
egg_find_bar_init (EggFindBar *find_bar)
{
EggFindBarPrivate *priv;
GtkWidget *label;
GtkWidget *alignment;
GtkWidget *box;
GtkToolItem *item;
GtkWidget *arrow;
/* Data */
priv = EGG_FIND_BAR_GET_PRIVATE (find_bar);
find_bar->priv = priv;
priv->search_string = NULL;
gtk_toolbar_set_style (GTK_TOOLBAR (find_bar), GTK_TOOLBAR_BOTH_HORIZ);
/* Find: |_____| */
item = gtk_tool_item_new ();
box = gtk_hbox_new (FALSE, 12);
alignment = gtk_alignment_new (0.0, 0.5, 1.0, 0.0);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 2, 2);
label = gtk_label_new_with_mnemonic (_("Find:"));
priv->find_entry = gtk_entry_new ();
gtk_entry_set_width_chars (GTK_ENTRY (priv->find_entry), 32);
gtk_entry_set_max_length (GTK_ENTRY (priv->find_entry), 512);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->find_entry);
/* Prev */
arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE);
priv->previous_button = gtk_tool_button_new (arrow, Q_("Find Previous"));
gtk_tool_item_set_is_important (priv->previous_button, TRUE);
gtk_tool_item_set_tooltip (priv->previous_button, GTK_TOOLBAR (find_bar)->tooltips,
_("Find previous occurrence of the search string"),
NULL);
/* Next */
arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
priv->next_button = gtk_tool_button_new (arrow, Q_("Find Next"));
gtk_tool_item_set_is_important (priv->next_button, TRUE);
gtk_tool_item_set_tooltip (priv->next_button, GTK_TOOLBAR (find_bar)->tooltips,
_("Find next occurrence of the search string"),
NULL);
/* Separator*/
priv->status_separator = gtk_separator_tool_item_new();
/* Case button */
priv->case_button = gtk_toggle_tool_button_new ();
g_object_set (G_OBJECT (priv->case_button), "label", _("C_ase Sensitive"), NULL);
gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (priv->case_button), TRUE);
gtk_tool_item_set_is_important (priv->case_button, TRUE);
gtk_tool_item_set_tooltip (priv->case_button, GTK_TOOLBAR (find_bar)->tooltips,
_("Toggle case sensitive search"),
NULL);
/* Status */
priv->status_item = gtk_tool_item_new();
gtk_tool_item_set_expand (priv->status_item, TRUE);
priv->status_label = gtk_label_new (NULL);
gtk_label_set_ellipsize (GTK_LABEL (priv->status_label),
PANGO_ELLIPSIZE_END);
gtk_misc_set_alignment (GTK_MISC (priv->status_label), 0.0, 0.5);
g_signal_connect (priv->find_entry, "changed",
G_CALLBACK (entry_changed_callback),
find_bar);
g_signal_connect (priv->find_entry, "activate",
G_CALLBACK (entry_activate_callback),
find_bar);
g_signal_connect (priv->next_button, "clicked",
G_CALLBACK (next_clicked_callback),
find_bar);
g_signal_connect (priv->previous_button, "clicked",
G_CALLBACK (previous_clicked_callback),
find_bar);
g_signal_connect (priv->case_button, "toggled",
G_CALLBACK (case_sensitive_toggled_callback),
find_bar);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), priv->find_entry, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (alignment), box);
gtk_container_add (GTK_CONTAINER (item), alignment);
gtk_toolbar_insert (GTK_TOOLBAR (find_bar), item, -1);
gtk_toolbar_insert (GTK_TOOLBAR (find_bar), priv->previous_button, -1);
gtk_toolbar_insert (GTK_TOOLBAR (find_bar), priv->next_button, -1);
gtk_toolbar_insert (GTK_TOOLBAR (find_bar), priv->case_button, -1);
gtk_toolbar_insert (GTK_TOOLBAR (find_bar), priv->status_separator, -1);
gtk_container_add (GTK_CONTAINER (priv->status_item), priv->status_label);
gtk_toolbar_insert (GTK_TOOLBAR (find_bar), priv->status_item, -1);
/* don't show status separator/label until they are set */
gtk_widget_show_all (GTK_WIDGET (item));
gtk_widget_show_all (GTK_WIDGET (priv->next_button));
//.........这里部分代码省略.........
开发者ID:federicomenaquintero,项目名称:giggle,代码行数:101,代码来源:eggfindbar.c
示例19: listbox_execute_cmd
static cb_ret_t
listbox_execute_cmd (WListbox * l, unsigned long command)
{
cb_ret_t ret = MSG_HANDLED;
int i;
Widget *w = WIDGET (l);
int length;
if (l->list == NULL || g_queue_is_empty (l->list))
return MSG_NOT_HANDLED;
switch (command)
{
case CK_Up:
listbox_back (l);
break;
case CK_Down:
listbox_fwd (l);
break;
case CK_Top:
listbox_select_first (l);
break;
case CK_Bottom:
listbox_select_last (l);
break;
case CK_PageUp:
for (i = 0; (i < w->lines - 1) && (l->pos > 0); i++)
listbox_back (l);
break;
case CK_PageDown:
length = g_queue_get_length (l->list);
for (i = 0; i < w->lines - 1 && l->pos < length - 1; i++)
listbox_fwd (l);
break;
case CK_Delete:
if (l->deletable)
{
gboolean is_last, is_more;
length = g_queue_get_length (l->list);
is_last = (l->pos + 1 >= length);
is_more = (l->top + w->lines >= length);
listbox_remove_current (l);
if ((l->top > 0) && (is_last || is_more))
l->top--;
}
break;
case CK_Clear:
if (l->deletable && mc_global.widget.confirm_history_cleanup
/* TRANSLATORS: no need to translate 'DialogTitle', it's just a context prefix */
&& (query_dialog (Q_ ("DialogTitle|History cleanup"),
_("Do you want clean this history?"),
D_ERROR, 2, _("&Yes"), _("&No")) == 0))
listbox_remove_list (l);
break;
default:
ret = MSG_NOT_HANDLED;
}
return ret;
}
开发者ID:Distrotech,项目名称:mc,代码行数:63,代码来源:listbox.c
示例20: init_filter
//.........这里部分代码省略.........
Child, filter_remote_check = MakeCheck(NULL,FALSE),
Child, RectangleObject,MUIA_Weight,200,End,
Child, MakeLabel(_("On new mails")),
Child, filter_new_check = MakeCheck(NULL,FALSE),
End,
Child, RectangleObject,MUIA_Weight,25,End,
End,
Child, HorizLineTextObject(_("Rules")),
Child, VGroupV,
Child, filter_rule_group = ColGroup(2),
Child, HVSpace,
Child, HVSpace,
End,
End,
Child, HGroup,
Child, filter_add_rule_button = MakeButton(_("Add new rule")),
Child, filter_apply_now_button = MakeButton(_("Apply now")),
End,
Child, HorizLineTextObject(_("Action")),
Child, VGroup,
Child, ColGroup(3),
Child, MakeLabel(_("Move to Folder")),
Child, filter_move_check = MakeCheck(_("Move to Folder"),FALSE),
Child, filter_move_popobject = PopobjectObject,
MUIA_Disabled, TRUE,
MUIA_Popstring_Button, PopButton(MUII_PopUp),
MUIA_Popstring_String, filter_move_text = TextObject, TextFrame, MUIA_Background, MUII_TextBack, End,
MUIA_Popobject_ObjStrHook, &move_objstr_hook,
MUIA_Popobject_StrObjHook, &move_strobj_hook,
MUIA_Popobject_Object, NListviewObject,
MUIA_NListview_NList, filter_folder_list = FolderTreelistObject,
End,
End,
End,
Child, MakeLabel(_("Execute ARexx Script")),
Child, filter_arexx_check = MakeCheck(_("Execute ARexx Script"),FALSE),
Child, filter_arexx_popasl = PopaslObject,
MUIA_Disabled, TRUE,
MUIA_Popstring_Button, PopButton(MUII_PopFile),
MUIA_Popstring_String, filter_arexx_string = BetterStringObject,
StringFrame,
MUIA_CycleChain,1,
MUIA_String_Acknowledge, TRUE,
End,
End,
Child, MakeLabel(_("Play Sound")),
Child, filter_sound_check = MakeCheck(_("Play Sound"),FALSE),
Child, filter_sound_string = AudioSelectGroupObject, MUIA_Disabled, TRUE, End,
End,
End,
End,
End,
End,
Child, HorizLineObject,
Child, HGroup,
Child, save_button = MakeButton(Q_("?filter:_Save")),
Child, ok_button = MakeButton(_("_Use")),
Child, cancel_button = MakeButton(_("_Cancel")),
End,
End,
End;
if (filter_wnd)
{
char *short_help_txt = _("If activated the filter will be used remotly on POP3 servers\n"
"which support the TOP command. Mails which matches the filter\n"
"are presented to the user and automatically marked as to be ignored.");
set(filter_remote_label, MUIA_ShortHelp, short_help_txt);
set(filter_remote_check, MUIA_ShortHelp, short_help_txt);
DoMethod(App, OM_ADDMEMBER, (ULONG)filter_wnd);
DoMethod(filter_wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_cancel);
DoMethod(ok_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_ok);
DoMethod(save_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_ok);
DoMethod(save_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)save_filter);
DoMethod(cancel_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_cancel);
DoMethod(filter_new_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_new);
DoMethod(filter_remove_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_remove);
DoMethod(filter_moveup_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_list, 3, MUIM_NList_Move, MUIV_NList_Move_Active, MUIV_NList_Move_Previous);
DoMethod(filter_movedown_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_list, 3, MUIM_NList_Move, MUIV_NList_Move_Active, MUIV_NList_Move_Next);
set(filter_name_string, MUIA_String_AttachedList, (ULONG)filter_list);
DoMethod(filter_list, MUIM_Notify, MUIA_NList_Active, MUIV_EveryTime, (ULONG)filter_list, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_active);
DoMethod(filter_name_string, MUIM_Notify, MUIA_String_Contents, MUIV_EveryTime, (ULONG)filter_list, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_name);
DoMethod(filter_add_rule_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_add_rule_gui);
DoMethod(filter_apply_now_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_apply);
DoMethod(filter_move_check, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, (ULONG)filter_move_popobject, 3, MUIM_Set, MUIA_Disabled, MUIV_NotTriggerValue);
DoMethod(filter_sound_check, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, (ULONG)filter_sound_string, 3, MUIM_Set, MUIA_Disabled, MUIV_NotTriggerValue);
DoMethod(filter_arexx_check, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, (ULONG)filter_arexx_popasl, 3, MUIM_Set, MUIA_Disabled, MUIV_NotTriggerValue);
DoMethod(filter_folder_list, MUIM_Notify, MUIA_NList_DoubleClick, TRUE, (ULONG)filter_move_popobject, 2, MUIM_Popstring_Close, 1);
filter_update_folder_list();
}
}
开发者ID:weechatter,项目名称:simplemail,代码行数:101,代码来源:filterwnd.c
注:本文中的Q_函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论