Skip to content

Commit

Permalink
Added mimetype file for .xrl2 files. Also fixed so that the downloade…
Browse files Browse the repository at this point in the history
…d .xrl2 files are deleted when it's been loaded
  • Loading branch information
Pontus Östlund committed Apr 2, 2013
1 parent 886fe56 commit fcc0310
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 22 deletions.
2 changes: 1 addition & 1 deletion configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.64])
AC_INIT(roxenlauncher,
2.0.4,
2.0.5,
[pontus@poppa.se],
[roxenlauncher],
[https://github.com/poppa/Roxen-Application-Launcher])
Expand Down
13 changes: 13 additions & 0 deletions data/Makefile.am
Expand Up @@ -24,11 +24,24 @@ desktop_in_files=roxen-launcher.desktop.in
desktop_DATA=roxen-launcher.desktop
@INTLTOOL_DESKTOP_RULE@

mimedir = ${datadir}/mime/packages
mime_DATA = xrl2-mime.xml

EXTRA_DIST = \
$(roxenlauncherextra_DATA) \
$(roxenlauncherpixmaps_DATA) \
$(gsettings_SCHEMAS) \
$(desktop_in_files) \
$(mime_DATA) \
$(NULL)

install-data-local: install-mimeDATA
if which update-mime-database>/dev/null 2>&1; then \
update-mime-database $(DESTDIR)$(datadir)/mime; \
fi

uninstall-local:
if which update-mime-database>/dev/null 2>&1; then \
update-mime-database $(DESTDIR)$(datadir)/mime; \
fi

36 changes: 27 additions & 9 deletions data/mainwindow.ui
Expand Up @@ -75,9 +75,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem" id="menuitem1">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_File</property>
<property name="use_underline">True</property>
<child type="submenu">
Expand All @@ -87,9 +87,9 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<child>
<object class="GtkImageMenuItem" id="im_quit">
<property name="label">gtk-quit</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
Expand All @@ -100,9 +100,9 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
</child>
<child>
<object class="GtkMenuItem" id="menuitem4">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_Help</property>
<property name="use_underline">True</property>
<child type="submenu">
Expand All @@ -112,9 +112,9 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<child>
<object class="GtkImageMenuItem" id="im_about">
<property name="label">gtk-about</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
Expand Down Expand Up @@ -191,6 +191,7 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<child>
<object class="GtkButton" id="btn_edit_file">
<property name="label">gtk-edit</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
Expand All @@ -207,6 +208,7 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<child>
<object class="GtkButton" id="btn_finish_file">
<property name="label">gtk-remove</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
Expand All @@ -223,6 +225,7 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<child>
<object class="GtkButton" id="btn_finish_all">
<property name="label">gtk-clear</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
Expand Down Expand Up @@ -309,6 +312,7 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<child>
<object class="GtkButton" id="btn_edit_app">
<property name="label">gtk-edit</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
Expand All @@ -325,6 +329,7 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<child>
<object class="GtkButton" id="btn_add_app">
<property name="label">gtk-add</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
Expand All @@ -340,6 +345,7 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<child>
<object class="GtkButton" id="btn_remove_app">
<property name="label">gtk-remove</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
Expand Down Expand Up @@ -404,10 +410,12 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<child>
<object class="GtkCheckButton" id="cb_notify">
<property name="label" translatable="yes">Enable notifications</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
Expand All @@ -419,11 +427,13 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<child>
<object class="GtkCheckButton" id="cb_minimize">
<property name="label" translatable="yes">Minimize to tray</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Window close button minimizes the application to the tray</property>
<property name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
Expand All @@ -449,13 +459,16 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
Expand Down Expand Up @@ -532,6 +545,7 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<child>
<object class="GtkButton" id="btn_clear_log">
<property name="label" translatable="yes">Clear log</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
Expand Down Expand Up @@ -581,6 +595,7 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<child>
<object class="GtkCheckButton" id="cb_logging">
<property name="label" translatable="yes">Enable logging</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
Expand Down Expand Up @@ -649,23 +664,26 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
</packing>
</child>
</object>
<object class="GtkTextBuffer" id="textbuffer1">
<property name="text" translatable="yes">Add the mimetype for Roxen Launcher files (.xrl2) to your mimetype database</property>
</object>
<object class="GtkMenu" id="tv_files_rclick_menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem" id="sb_view">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_View in Sitebuilder</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="sb_view_dir">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">V_iew directory in Sitebuilder</property>
<property name="use_underline">True</property>
</object>
Expand All @@ -678,18 +696,18 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
</child>
<child>
<object class="GtkMenuItem" id="ctx_menu_edit">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_Edit</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="ctx_menu_delete">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_Delete</property>
<property name="use_underline">True</property>
</object>
Expand Down
3 changes: 1 addition & 2 deletions src/launcherfile.vala
Expand Up @@ -556,7 +556,6 @@ public class Roxenlauncher.LauncherFile : Object
var app = ContentType.get_by_ct (content_type);

if (app == null) {

application = window.ct_new (content_type);

if (application == null)
Expand Down Expand Up @@ -754,7 +753,7 @@ public class Roxenlauncher.LauncherFile : Object
yield;
}
catch (GLib.Error e) {
log_warning (_("Unable to upload file: %s").printf(e.message));
log_warning (_("Unable to upload file: %s").printf (e.message));
win_set_status (Statuses.NOT_UPLOADED);
window.show_notification (NotifyType.ERROR,
_("Upload failed"),
Expand Down
22 changes: 14 additions & 8 deletions src/main.vala
Expand Up @@ -57,11 +57,6 @@ class Roxenlauncher.Main : Gtk.Application
window = new MainWindow ();
window.set_application (this);

/*
tray = new Tray ();
tray.hookup ();
*/

if (window.setup_ui ()) {
window.show_all ();
log_message (_("Application launcher started"));
Expand Down Expand Up @@ -95,9 +90,10 @@ class Roxenlauncher.Main : Gtk.Application
if (d != null) {
LauncherFile lf;

try { if (LauncherFile.handle_file (d, out lf)) { if
(App.do_debug) message ("Incomming file is new...%s", lf.get_uri
());
try {
if (LauncherFile.handle_file (d, out lf)) {
if (App.do_debug)
message ("Incomming file is new...%s", lf.get_uri ());

lf.download.begin ();
}
Expand All @@ -108,6 +104,16 @@ class Roxenlauncher.Main : Gtk.Application
window.set_file_selection (lf);
lf.download.begin ();
}

if (App.do_debug)
message ("Delete incomming file \"%s\"", args[i]);

try {
File.new_for_path (args[i]).delete (null);
}
catch (GLib.Error ex) {
message ("Unable to delete incomming file!");
}
}
catch (GLib.Error e) {
log_warning (_("Failed to handle incomming file: %s")
Expand Down
8 changes: 6 additions & 2 deletions src/mainwindow.vala
Expand Up @@ -418,7 +418,9 @@ public class Roxenlauncher.MainWindow : Gtk.Window
*/
public void on_cb_notify_toggled (Object cb)
{
message ("notify toggled");
if (App.do_debug)
message ("notify toggled");

App.do_notifications = !App.do_notifications;
}

Expand All @@ -429,7 +431,9 @@ public class Roxenlauncher.MainWindow : Gtk.Window
*/
public void on_cb_minimize_toggled (Object cb)
{
message ("notify toggled");
if (App.do_debug)
message ("notify toggled");

App.do_minimize = !App.do_minimize;
}

Expand Down

0 comments on commit fcc0310

Please sign in to comment.