Skip to content

Commit

Permalink
backend/cocoa: Reimplement about dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
tseli0s committed Jan 17, 2024
1 parent 9e15e5d commit 1387dd3
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/backend/cocoa/nvdialog_about_dialog.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "nvdialog.h"
#include "nvdialog_cocoa.h"
#include <assert.h>
#include <stdlib.h>
#include <AppKit/AppKit.h>
#include <Foundation/Foundation.h>
/*
Expand All @@ -19,23 +21,24 @@
const char *desc,
const char *imgpath)
{
/*
NvdAboutDialog *dlg = malloc(sizeof(struct _NvdAboutDialog));
NvdAboutDialog* dlg = malloc(sizeof(struct _NvdAboutDialog));
NSMutableDictionary<NSAboutPanelOptionKey, id>* options;
assert(dlg != nil); // TODO: Use the NvDialog assertion macro

dlg->options = [NSMutableDictionary dictionary];
dlg->options[NSAboutPanelOptionApplicationName] = @(name);
dlg->options[NSAboutPanelOptionVersion] = @(desc);
options = [NSMutableDictionary dictionary];
options[NSAboutPanelOptionApplicationName] = @(name);
options[NSAboutPanelOptionVersion] = @(desc);

if (imgpath != nil)
dlg->options[NSAboutPanelOptionApplicationIcon] = [[NSImage alloc] initWithContentsOfFile: @(imgpath)];
options[NSAboutPanelOptionApplicationIcon] = [[NSImage alloc] initWithContentsOfFile: @(imgpath)];

dlg->raw = options;
return dlg;
*/
return NULL; /* To avoid memory corruption while >> */
}

void nvd_about_dialog_set_licence_link_cocoa(NvdAboutDialog *dialog, const char *license_link, const char *txt)
{
/* TODO: Fix this */
/*
(void)txt;
Expand All @@ -50,8 +53,6 @@ void nvd_about_dialog_set_licence_link_cocoa(NvdAboutDialog *dialog, const char

void nvd_show_about_dialog_cocoa(NvdAboutDialog *dialog)
{
/*
[NSApp orderFrontStandardAboutPanelWithOptions: dialog->options];
[dialog->options release];
*/
}

0 comments on commit 1387dd3

Please sign in to comment.