kde KDE How to get network status in QML?
Jump
  • fkfd fkfd 1 year ago 100%

    It seems networkStatus doesn't provide a connectivity attribute and PlasmaNM.NetworkManager doesn't have a Full either:

    console.log(Object.keys(networkStatus))
    qml: [objectName,activeConnections,networkStatus,objectNameChanged,activeConnectionsChanged,networkStatusChanged]
    
    networkStatus.connectivity !== PlasmaNM.NetworkManager.Full
    .../contents/ui/main.qml:150: TypeError: Cannot read property 'Full' of undefined
    
    1
  • kde KDE How to get network status in QML?
    Jump
  • fkfd fkfd 1 year ago 100%

    that would be ideal! but I can't seem to find a way to do it natively without some C++ library like this one?

    1
  • kde
    KDE fkfd 1 year ago 100%
    How to get network status in QML?

    I wrote an applet that makes an API call every 10 minutes, but I want it to show a message if the computer is offline. This means I need to get the network status within QML. I thought a DataEngine might be available, but there isn't. I read the code for [plasma-nm](https://invent.kde.org/plasma/plasma-nm/-/blob/master/libs/declarative/networkstatus.h) and found this ~~solution~~ hack: ``` import org.kde.plasma.networkmanagement 0.2 as PlasmaNM PlasmaNM.NetworkStatus { id: networkStatus } PlasmaComponents3.Label { visible: networkStatus.networkStatus != "Connected" text: i18n("Network disconnected") } ``` But I think comparing strings is a terrible way because I don't know what will happen in other locales. Is there a better way? [Link to my code](https://invent.kde.org/fakefred/kanvas/-/blob/master/contents/ui/main.qml#L150)

    9
    6
    programmerhumor Programmer Humor Object oriented programming
    Jump
  • fkfd fkfd 1 year ago 100%

    ocaml: the socdem of programming languages

    3
  • nonpolitical_memes Non-Political Memes Put your hands up!
    Jump
  • fkfd fkfd 2 years ago 100%

    resistance is frutile

    2
  • memes Memes When you realize you're the idiot bird
    Jump
  • fkfd fkfd 2 years ago 100%

    somebody should cross stitch this meme

    4
  • opensource Open Source Nokia forces a small open-source project named Notkia to change name.
    Jump
  • fkfd fkfd 2 years ago 100%

    clears throat
    Knockia

    16
  • memes Memes edited xkcd #2168
    Jump
  • fkfd fkfd 2 years ago 100%

    every day you learn something you don't want to

    3
  • memes
    Memes fkfd 2 years ago 100%
    edited xkcd #2168
    14
    9
    china China, 中国 A Visionary Principal Fought China’s Education System. He Lost.
    Jump
  • fkfd fkfd 2 years ago 100%

    I graduated from one of Shanghai's better-known high schools after taking gaokao last year. Wang's vision at AHSPU is a lot like university, especially the original readings part. I wish I had these instead of exercise books full of fill-in-the-blanks but admittedly, without them I won't be in the university I'm in today. Big cynical moment.

    But I won't call it a bottom-up movement. Wang is an NPC member, the high school is affiliated to PKU; this all sounds pretty privileged. As such I find it more like a middle-up thing. And yeah, bummer that it failed.

    Also imagine how I feel when I chewed through an article in my second language when I realized the piece was a translation

    2
  • biologyhumor
    Biology Humor fkfd 2 years ago 100%
    Stop
    7
    0
    asklemmy Asklemmy If you could choose to move to another country permanently, would you? Which country would you choose?
    Jump
  • fkfd fkfd 4 years ago 100%

    The Netherlands

    Since this question is hypothetical, I can just assume what I read on Wikipedia and other sources are correct and it indeed is a free country.

    3
  • python Python Mastobot - Create cheap Mastodon bots in a Flask-like syntax
    Jump
  • fkfd fkfd 4 years ago 100%

    It's all about beginner friendliness, actually, that's all.

    2
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
    Python fkfd 4 years ago 100%
    Mastobot - Create cheap Mastodon bots in a Flask-like syntax https://git.sr.ht/~fkfd/mastobot

    I'm here to promote a python library I wrote, named Mastobot. Evidently, it enables developers to make cheap bots. Let's all read the [README](https://git.sr.ht/~fkfd/mastobot/tree/master/README.md) to find out how it really feels like, shall we?

    5
    2
    opensource
    Open Source fkfd 4 years ago 100%
    Socialism’s DIY Computer: Yugoslavian engineers' OSHW microcomputers tribunemag.co.uk

    Edit: Whoops, didn't realize this community is for open source software. Any suggestions as to where this belongs?

    11
    1
    browsing the art of (surviving) browsing utab: New Tab, but better
    Jump
  • fkfd fkfd 4 years ago 100%

    Not yet, since I'm not using one. Check out the KDE wiki, perhaps?

    3
  • browsing the art of (surviving) browsing utab: New Tab, but better
    Jump
  • fkfd fkfd 4 years ago 100%

    Afaik Google is hardly involved in KDE's development. KDE is right now pretty much entirely community-driven, the people are nice, and I've submitted a patch that's merged into upstream. Let's hope your concern will never come true.

    3
  • browsing the art of (surviving) browsing utab: New Tab, but better
    Jump
  • fkfd fkfd 4 years ago 100%

    Wait, seriously or ironically (the favicons aren't right)?

    2
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearBR
    the art of (surviving) browsing fkfd 4 years ago 100%
    utab: New Tab, but better https://git.sr.ht/~fkfd/utab

    I started this project a few weeks ago for my transition from Firefox to Falkon, and I've been using it ever since. It's a daemon running on a local port for all web browsers to access. It now provides two features: Top Sites, inspired by Firefox's new tab, and a search bar with customizable engines, inspired by DDG's bangs (but it's a slash instead of a bang, to save you a shift press). Check out the source code (0BSD): [utab](https://git.sr.ht/~fkfd/utab) utab is almost definitely *not* what you exactly wanted, given its intentionally limited config options and features, but given the power of free software anyone can build upon it themselves. Also, it is 100% JavaScript-free.

    5
    6
    "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearCR
    Creepy fkfd 4 years ago 100%
    Zuckerberg is Watching You
    12
    1
    china China, 中国 Do Chinese Eat Dog (2020)? Truth About Dog Meat + The Yulin Festival
    Jump
  • fkfd fkfd 4 years ago 100%

    Fact check: mostly true.

    the belief that dog meat is tasty and good for health is etched into Chinese culture.

    Not in my culture, I suppose?

    5
  • china China, 中国 [meme] Porsche go brrrrr
    Jump
  • fkfd fkfd 4 years ago 100%

    Sure, why don't we learn some context first?

    The gov was, allegedly, working on a proposal that will legalize 地摊 (individual businesses in the form of stalls on a patch of ground, usually selling fresh produce, small utilities, etc.), in hope of helping low-income families to find a new source. Some areas have opened designated "markets" to accommodate the stalls. Little limit being imposed on who is or is not allowed to kickstart a business, some rich people drove their luxurious automobile to the market, selling products above. This meme particularly pokes fun at this phenomenon.

    So, translation: Nooo!!! You can't just open your stall here with your tens of millions yuan of wealth!! The Stall Economy isn't for you to have fun with! Haha check out my Porsches buy two get one free don't miss the chance

    2
  • announcements Announcements I made /c/biologyhumor!
    Jump
  • fkfd fkfd 4 years ago 100%

    Funny how I just took my likely last biology exam in my entire life this afternoon, i.e. 8 hours ago. That's around the time when we discussed the /c/china rules. Anyways, I'm glad it's over, but I'm not letting go of all these meme-able biology gimmicks. It's finally time to pipe all my biology-related atrocities here.

    4
  • announcements Announcements I made /c/china!
    Jump
  • fkfd fkfd 4 years ago 100%

    Thank you!

    1
  • announcements Announcements I made /c/china!
    Jump
  • fkfd fkfd 4 years ago 100%

    Ooh alright, right away

    1
  • announcements Announcements I made /c/china!
    Jump
  • fkfd fkfd 4 years ago 100%

    I'm a Chinese native so I don't see why not. I sure hope something new gets posted here more often than I visit it. I also do hope (a lot) that I could receive reports via email. It's gonna be a busy school year so I can't do this alone; we can co-moderate.

    Thank you for this community, ~fkfd

    5
  • fkfd fkfd 4 years ago 100%
  • fkfd fkfd 4 years ago 100%

    Fun fact: in Chinese pinyin, dàbiàn is 大便, which means poop.

    1
  • biologyhumor
    Biology Humor fkfd 4 years ago 96%
    Degree-off
    73
    2