I get an error (Gtk-WARNING **: 18:33:56.632: Attempting to add a widget with type GtkBox to a GtkDialog, but as a GtkBin subclass a GtkDialog can only contain one widget at a time; it already contains a widget of type GtkBox)
when executing this code:
def switchfile(self, widget):
self.cd = None
self.cd = {
'win' : Gtk.Dialog(),
'entry' : Gtk.Entry(),
'btnok' : Gtk.Button.new_from_icon_name("document-open-symbolic", Gtk.IconSize.MENU),
'label' : Gtk.Label(),
'vbox' : Gtk.Box(orientation=Gtk.Orientation.VERTICAL),
'hbox' : Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
}
self.cd['entry'].set_placeholder_text('Notebook Name')
self.cd['btnok'].connect('clicked', self.switch_yes)
self.cd['hbox'].pack_start(self.cd['entry'], True, True, 0)
self.cd['hbox'].pack_start(self.cd['btnok'], True, True, 0)
self.cd['vbox'].pack_start(self.cd['label'], True, True, 0)
self.cd['vbox'].pack_start(self.cd['hbox'], True, True, 0)
self.cd['vbox'].show_all()
self.cd['win'].add(self.cd['vbox'])
self.cd['win'].show_all()
self.cd['win'].run()
But, if there already is a Gtk.Box in the Gtk.Dialog, how can I access it?
In another Question on Stackoverflow, there was a Dialog.get_vbox()function, but it was C/C++ and when i use bpython3 to list the functions in Gtk.Dialog, it has nothing, no get_vbox(), an also nothing else like get_vbox: no get_box()' and no get_container()`.
How can I access the Gtk.Box in Gtk.Dialog
Information:
I am using Version 3.0 of gi.repository.Gtk
Now I found out how to do it.
def switchfile(self, widget):
self.cd = None
self.cd = {
'win' : Gtk.Dialog(),
'entry' : Gtk.Entry(),
'btnok' : Gtk.Button.new_from_icon_name("document-open-symbolic", Gtk.IconSize.MENU),
'label' : Gtk.Label(),
'vbox' : None,
'hbox' : Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
}
self.cd['win'].add_buttons(
Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OK, Gtk.ResponseType.OK
)
self.cd['vbox'] = self.cd['win'].get_content_area()
self.cd['entry'].set_placeholder_text('Notebook Name')
self.cd['btnok'].connect('clicked', self.switch_yes)
self.cd['hbox'].pack_start(self.cd['entry'], True, True, 0)
self.cd['hbox'].pack_start(self.cd['btnok'], True, True, 0)
self.cd['vbox'].pack_start(self.cd['label'], True, True, 0)
self.cd['vbox'].pack_start(self.cd['hbox'], True, True, 0)
self.cd['vbox'].show_all()
self.cd['win'].show_all()
self.cd['win'].run()
Important is this line:
self.cd['vbox'] = self.cd['win'].get_content_area()
I didn't know about that function, but this is how to access the Gtk.Box in Gtk.Dialog objects.
Related
I'm trying to add new option like invite more people not by link but with a call notification.
anyone solved this issue ?? please help.
you can use feature flages like below
Map<FeatureFlag, Object> featureFlags = {
FeatureFlag.isMeetingNameEnabled: false,
FeatureFlag.isServerUrlChangeEnabled: true,
FeatureFlag.isChatEnabled: false,
FeatureFlag.isAddPeopleEnabled: false,
FeatureFlag.areSecurityOptionsEnabled: false,
FeatureFlag.isCalendarEnabled: false,
FeatureFlag.isCloseCaptionsEnabled: false,
FeatureFlag.isFilmstripEnabled: false,
FeatureFlag.isHelpButtonEnabled: false,
FeatureFlag.isInviteEnabled: false,
FeatureFlag.isLiveStreamingEnabled: false,
FeatureFlag.isLobbyModeEnabled: false,
FeatureFlag.isOverflowMenuEnabled: false,
FeatureFlag.isReactionsEnabled: false,
FeatureFlag.isRaiseHandEnabled: false,
FeatureFlag.isRecordingEnabled: false,
FeatureFlag.isReplaceParticipantEnabled: false,
};
var options = JitsiMeetingOptions(
isVideoMuted: true,
roomNameOrUrl: name,
userDisplayName: prefs.getString('username')!,
serverUrl: 'https://**********',
featureFlags: featureFlags,
);
I am creating a language server. Specifically, the issue is with completions. I'm returning a big list of completion items but whenever I test my language the completion provider simply will not suggest anything after I type a dot(.) when I'm expecting it to suggest, essentially, class members associated with the symbol left of said dot(.). Don't get me wrong, suggestions work until I type the dot(.) character and then it says, "No Suggestions".
Also, I'm trying to implement this server side and not client side.
EDIT:
Essentially, I'm assembling a big list and returning it.
connection.onInitialize((params: node.InitializeParams) => {
workspaceFolder = params.workspaceFolders![0].uri;
const capabilities = params.capabilities;
// Does the client support the `workspace/configuration` request?
// If not, we fall back using global settings.
hasConfigurationCapability = !!(
capabilities.workspace && !!capabilities.workspace.configuration
);
hasWorkspaceFolderCapability = !!(
capabilities.workspace && !!capabilities.workspace.workspaceFolders
);
hasDiagnosticRelatedInformationCapability = !!(
capabilities.textDocument &&
capabilities.textDocument.publishDiagnostics &&
capabilities.textDocument.publishDiagnostics.relatedInformation
);
capabilities.workspace!.workspaceEdit!.documentChanges = true;
const result: node.InitializeResult = {
capabilities: {
textDocumentSync: node.TextDocumentSyncKind.Incremental,
colorProvider: true,
hoverProvider: true,
definitionProvider: true,
typeDefinitionProvider: true,
referencesProvider: true,
documentHighlightProvider: true,
documentSymbolProvider: true,
workspaceSymbolProvider: true,
// codeActionProvider: true,
codeLensProvider: {
resolveProvider: true,
workDoneProgress: false
},
// Tell the client that this server supports code completion.
completionProvider: {
resolveProvider: true,
workDoneProgress: false,
triggerCharacters: ['.', '/'],
allCommitCharacters: ['.']
},
signatureHelpProvider: {
triggerCharacters: ['('],
retriggerCharacters: [','],
workDoneProgress: false
},
executeCommandProvider: {
commands: ["compile"],
workDoneProgress: false
},
semanticTokensProvider: {
documentSelector: [{ scheme: 'file', language: 'agc' }],
legend: {
tokenTypes: gTokenTypes,
tokenModifiers: gTokenModifiers
},
full: true,
workDoneProgress: false
}
}
};
if (hasWorkspaceFolderCapability) {
result.capabilities.workspace = {
workspaceFolders: {
supported: true
}
};
}
return result;
});
// This handler provides the initial list of the completion items.
connection.onCompletion(
async (params: node.TextDocumentPositionParams): Promise<node.CompletionItem[] | node.CompletionList | undefined> => {
console.log("completion");
let doc = documents.get(params.textDocument.uri);
let list:node.CompletionList = node.CompletionList.create([], true);
list.items = list.items.concat(comp.GetAGKKeywordCompletionItems(), comp.GetAGKCommandCompletionItems(), agkDocs.getALLCompletionItems());
list.items.push(sense.GetCommentSnippetCompletionItem(doc, params.position));
list.items.push(sense.GetCommentSnippetCompletionItem(doc, params.position, true));
console.log("END completion");
return list;
}
);
I am using conversejs as client for providing a multiuser chat embeded in an html page. User might be added to a lot of groups. When a user is chating in a group and gets invite to join another group a popup is shown to accept the invite, i do not want the user to see that invitation and rather user should stay in the same group that he has opened.
Given bellow is the initialization sample :
converse.initialize({
authentication: 'login',
credentials_url: 'https://myserver.primet.com/chatapi/apiserver/api/chat/autologin/auth?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWgydGlFcyJ9.eyJhdWQiOiI2YTE1NzNkMS03ZDZjLTRkZGItYjVlYS1hZGQyZWM1MDkzZjEiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vZmNlNTAxOTUtMjMxNS00N2FmLWE2ODQtZmY5M',
auto_login: 'true',
bosh_service_url: 'https://myserver.primet.com/chatserver/http-bind/',
jid: ‘james#qachatserver.primet.com',
keepalive: true,
trusted: false,
auto_reconnect: true,
muc_nickname_from_jid: true,
auto_join_rooms: ['deal_909090390898989090909#conference.qachatserver.primet.com'],
auto_focus: false,
locked_muc_nickname: true,
show_desktop_notifications: false,
send_chat_state_notifications: false,
blacklisted_plugins: [
'converse-notification'
],
singleton: true,
muc_show_join_leave: false,
visible_toolbar_buttons: {
call: false,
spoiler: false,
emoji: false,
toggle_occupants: true
},
notify_all_room_messages: false,
notification_delay: 3000,
allow_message_corrections: 'false',
view_mode: 'embedded'
}).then(() => { setTimeout(function(){ var toggleButton = document.getElementsByClassName('toggle-occupants fa fa-angle-double-right')[0]; if (toggleButton) { toggleButton.click(); toggleButton.style.display="none"}},500);})
You can set allow_muc_invitations to false.
I'm trying to stream data into Ignite via the following StreamVisitor:
val streamer = ignite.dataStreamer[ProductKey, Product]("products")
streamer.allowOverwrite(true)
streamer.autoFlushFrequency(100)
streamer.receiver(new StreamVisitor[ProductKey, Product] {
val atomic = ignite.atomicLong(s"version#${input.inventoryId}", 0L, true)
def apply(cache: IgniteCache[ProductKey, Product], entry: Entry[ProductKey, Product]): Unit = {
def updateProduct(key: ProductKey, product: Product): Unit = {
val version = atomic.incrementAndGet()
println(s"Updating product ${product.productId} to version $version")
cache.put(key, product.copy(version = version))
// versionChangeQueue.add(VersionChange(product.inventoryId, version))
}
val key = entry.getKey
val product = entry.getValue
val current = cache.get(key)
if (current == null) {
updateProduct(key, product)
} else {
if (attributesDiffer(product.attributes, current.attributes)) {
updateProduct(key, product)
} else {
println(s"Product ${product.productId} hasn't changed")
}
}
}
private def attributesDiffer(newAttributes: Map[UUID, String], oldAttributes: Map[UUID, String]): Boolean = {
newAttributes exists {
case (id, value) => oldAttributes.getOrElse(id, "") != value
}
}
})
I repeatedly addData and then flush. Even though I see this:
18:31:04.672 INFO o.a.i.i.m.d.GridDeploymentLocalStore - Class locally deployed: class io.livefeeds.api.pull.PullWorker$$anon$1
I often get a long stream of the following exceptions:
[18:41:07] (err) Failed to execute compound future reducer: GridCompoundFuture [rdc=null, initFlag=1, lsnrCalls=0, done=false, cancelled=false, err=null, futs=[true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]]class org.apache.ignite.IgniteCheckedException: DataStreamer request failed [node=a568919f-5f9a-4bdc-ae0a-3360a0179319]
at org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$Buffer.onResponse(DataStreamerImpl.java:1857)
at org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$3.onMessage(DataStreamerImpl.java:336)
at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1555)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1183)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:126)
at org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1090)
at org.apache.ignite.internal.util.StripedExecutor$Stripe.run(StripedExecutor.java:505)
at java.lang.Thread.run(Thread.java:745)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to get deployment for request [sndId=2e500b52-0416-46bd-bcd9-b72c57c77f4a, req=DataStreamerRequest [reqId=1, cacheName=products, ignoreDepOwnership=true, skipStore=false, keepBinary=false, depMode=SHARED, sampleClsName=io.livefeeds.api.pull.PullWorker$$anon$1, userVer=0, ldrParticipants=null, clsLdrId=75eaedb7161-2e500b52-0416-46bd-bcd9-b72c57c77f4a, forceLocDep=false, topVer=AffinityTopologyVersion [topVer=10, minorTopVer=0], partId=-2147483648]]
at org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor.processRequest(DataStreamProcessor.java:273)
at org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor.access$000(DataStreamProcessor.java:59)
at org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor$1.onMessage(DataStreamProcessor.java:89)
at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1555)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1183)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:126)
at org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1090)
at org.apache.ignite.internal.util.StripedExecutor$Stripe.run(StripedExecutor.java:505)
at java.lang.Thread.run(Thread.java:748)
[18:41:07] (err) Failed to execute compound future reducer: GridCompoundFuture [rdc=null, initFlag=1, lsnrCalls=0, done=false, cancelled=false, err=null, futs=[true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]]class org.apache.ignite.IgniteCheckedException: DataStreamer request failed [node=a568919f-5f9a-4bdc-ae0a-3360a0179319]
at org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$Buffer.onResponse(DataStreamerImpl.java:1857)
at org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl$3.onMessage(DataStreamerImpl.java:336)
at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1555)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1183)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:126)
at org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1090)
at org.apache.ignite.internal.util.StripedExecutor$Stripe.run(StripedExecutor.java:505)
at java.lang.Thread.run(Thread.java:745)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to get deployment for request [sndId=2e500b52-0416-46bd-bcd9-b72c57c77f4a, req=DataStreamerRequest [reqId=1, cacheName=products, ignoreDepOwnership=true, skipStore=false, keepBinary=false, depMode=SHARED, sampleClsName=io.livefeeds.api.pull.PullWorker$$anon$1, userVer=0, ldrParticipants=null, clsLdrId=75eaedb7161-2e500b52-0416-46bd-bcd9-b72c57c77f4a, forceLocDep=false, topVer=AffinityTopologyVersion [topVer=10, minorTopVer=0], partId=-2147483648]]
at org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor.processRequest(DataStreamProcessor.java:273)
at org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor.access$000(DataStreamProcessor.java:59)
at org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor$1.onMessage(DataStreamProcessor.java:89)
at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1555)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1183)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:126)
at org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1090)
at org.apache.ignite.internal.util.StripedExecutor$Stripe.run(StripedExecutor.java:505)
at java.lang.Thread.run(Thread.java:748)
And the server log says:
[13:38:02,507][WARNING][data-streamer-stripe-5-#14%livefeeds-dev%][GridDeploymentCommunication] Failed to receive peer response from node within duration [node=ee600e02-bf03-4793-8ca1-623b8b0faa52, duration=5005]
[13:38:02,508][WARNING][data-streamer-stripe-5-#14%livefeeds-dev%][GridDeploymentPerVersionStore] Failed to get resource from node (is node alive?) [nodeId=ee600e02-bf03-4793-8ca1-623b8b0faa52, clsLdrId=039dbdb7161-ee600e02-bf03-4793-8ca1-623b8b0faa52, resName=io/livefeeds/api/pull/PullWorker$$anon$1.class, parentClsLdr=sun.misc.Launcher$AppClassLoader#764c12b6]
What is actually going wrong here?
The problem here seemed to be closing over the Ignite instance. I created a standalone FeedVisitor class, with an #IgniteInstanceResource, in a JAR deployed to the server. The standalone class might also work with peer class loading, though.
sorry to bother anyone,but i really need help for this,i want to retrieve chat from database(which i already ask this question before),but i try to googling and read all the documentation,and i assumed that i have found the solution,i read the converse.js documentation about developer api,in the Archiving group section,and i got this :
require(['converse'], function (converse) {
converse.plugins.add('myplugin', {
initialize: function () {
this._converse.api.archive.query({'with': 'admin2#localhost'});
}
});
converse.initialize({
jid: 'admin3#localhost',
authentication: 'prebind',
prebind_url: 'bind/bind.php',
allow_logout: false,
debug : true,
whitelisted_plugins: ['converse-inverse','converese-mam','converse-singleton','converse-muc-embedded','myplugin'],
archived_messages_page_size : 20,
message_archiving : "always",
auto_list_rooms: false,
show_chatstate_notifications:true,
message_carbons : true,
sounds_path : "sounds/",
auto_reconnect : true,
use_vcard : true,
auto_subscribe: false,
keepalive : true,
show_send_button:true,
archived_messages_page_size : 20,
bosh_service_url: 'http://localhost:5280/http-bind',
hide_muc_server: false,
play_sounds : true,
show_controlbox_by_default: false,
xhr_user_search: false
});
});
i try it,but i got this error :
Cannot read property 'getUniqueId' of undefined
at Object._converse.queryForArchivedMessages (converse-mam.js:266)
at Object.initialize (dev.html:30)
at PluginSocket.initializePlugin (pluggable.js:196)
at arrayEach (lodash.js:537)
at Object.forEach (lodash.js:9359)
at PluginSocket.initializePlugins (pluggable.js:227)
at Object.initPlugins (converse-core.js:1854)
at Object._converse.initialize (converse-core.js:1875)
at Object.initialize (converse-core.js:2037)
at dev.html:36
i am sorry if this question's kinda simple or stupid,but i really new in using converse.js,and i really like to use and learn more about converse.js in the future because it full features and documentation.
The initialize method of a Converse.js plugin gets called when Converse.js itself gets initialized.
This happens before the user has been logged in (regardless whether that happens automatically or manually).
So you're calling this._converse.api.archive.query({'with': 'admin2#localhost'}); before the user has been logged and an XMPP connection and session has been established.
Instead, you should first listen for the connection event, and then do your query.
converse.plugins.add('myplugin', {
initialize: function () {
var _converse = this._converse;
_converse.on('connected', function () {
_converse.api.archive.query({'with': 'admin2#localhost'});
});
}
});