Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checks when testing the items #38

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions po/com.github.devalien.workspaces.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: com.github.devalien.workspaces\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-23 22:51+0200\n"
"POT-Creation-Date: 2020-09-14 22:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -48,7 +48,7 @@ msgid "Dark mode"
msgstr ""

#. Window properties
#: src/PreferencesWindow.vala:247 src/QuickLaunchWindow.vala:108
#: src/PreferencesWindow.vala:247 src/QuickLaunchWindow.vala:112
#: src/Dialogs/Preferences.vala:32
msgid "Preferences"
msgstr ""
Expand All @@ -69,11 +69,11 @@ msgstr ""
msgid "Search Workspaces…"
msgstr ""

#: src/QuickLaunchWindow.vala:82
#: src/QuickLaunchWindow.vala:86
msgid "No Workspaces or Items Found"
msgstr ""

#: src/QuickLaunchWindow.vala:193
#: src/QuickLaunchWindow.vala:205
msgid "Try changing search terms."
msgstr ""

Expand Down
12 changes: 6 additions & 6 deletions po/nl.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ msgid ""
msgstr ""
"Project-Id-Version: com.github.devalien.workspaces\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-23 22:51+0200\n"
"POT-Creation-Date: 2020-09-14 22:22+0100\n"
"PO-Revision-Date: 2020-09-01 14:06+0200\n"
"Last-Translator: Heimen Stoffels <[email protected]>\n"
"Language-Team: \n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.4.1\n"
"Last-Translator: Heimen Stoffels <[email protected]>\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: nl\n"

#: src/PreferencesWindow.vala:49 src/QuickLaunchWindow.vala:38
msgid "Workspaces"
Expand Down Expand Up @@ -49,7 +49,7 @@ msgid "Dark mode"
msgstr "Donker thema"

#. Window properties
#: src/PreferencesWindow.vala:247 src/QuickLaunchWindow.vala:108
#: src/PreferencesWindow.vala:247 src/QuickLaunchWindow.vala:112
#: src/Dialogs/Preferences.vala:32
msgid "Preferences"
msgstr "Voorkeuren"
Expand All @@ -70,11 +70,11 @@ msgstr "Maak een werkblad en voeg een item toe."
msgid "Search Workspaces…"
msgstr "Werkbladen doorzoeken…"

#: src/QuickLaunchWindow.vala:82
#: src/QuickLaunchWindow.vala:86
msgid "No Workspaces or Items Found"
msgstr "Geen werkblad of item gevonden"

#: src/QuickLaunchWindow.vala:193
#: src/QuickLaunchWindow.vala:205
msgid "Try changing search terms."
msgstr "Probeer een andere zoekopdracht."

Expand Down
20 changes: 17 additions & 3 deletions src/Models/Item.vala
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,26 @@ public class Workspaces.Models.Item : Object {
switch (item_type) {
case "URL" :
if (url != null && url.length > 0) {
c = "xdg-open " + url;
if (url.contains("http://") || url.contains("https://")) {
c = "xdg-open " + url;
} else {
info(_("Not valid link"));
var dialog_error = new Gtk.MessageDialog(null,Gtk.DialogFlags.MODAL,Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, _("Not a valid link, must have http or https"));
dialog_error.run();
dialog_error.destroy();
}
}
break;
case "Directory" :
if (directory != null && directory.length > 0) {
c = "xdg-open " + directory;
if (directory != null && directory.length > 0) {
if (GLib.FileUtils.test(directory, GLib.FileTest.IS_DIR)) {
c = "xdg-open " + directory;
} else {
info(_ ("Folder not found"));
var dialog_error = new Gtk.MessageDialog(null,Gtk.DialogFlags.MODAL,Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, _("Folder not found"));
dialog_error.run();
dialog_error.destroy();
}
}
break;
case "Application" :
Expand Down