Skip to content

Commit

Permalink
[bugfix] app icon
Browse files Browse the repository at this point in the history
  • Loading branch information
klesh committed Feb 15, 2017
1 parent 72f7a8d commit 210f156
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 28 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,30 @@ The plan was to make a CrossPlatform app for (Windows/MacOS/Linux), and it can a

## Linux

download the .tar.gz file, extract, make and make install:
download the .tar.gz file, extract, make and make install.
should be able to work on most distro, let me know if any problem.

### Ubuntu
```bash
```bash
sudo apt install libwxgtk3.0-dev libcurl4-openssl-dev ibssh2-1-dev libboost1.61-dev libappindicator3-dev
tar zxvf fu-vxxx.tar.gz
./configure
make
```
sudo make install
```

# Build Dependencies

* wxWidgets 3.0
* wxWidgets 3.0.2
* libcurl
* libssh2
* boost

# FAQ

Q: How to add imgur.com?
A: go to http://api.imgur.com/ register an application, you will receive a Client-ID, put it to Client

# Like it ?

* Star this respository right away!
Expand Down
2 changes: 1 addition & 1 deletion fu/resources/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ autostartdir = $(sysconfdir)/xdg/autostart
autostart_DATA = fu_startup.desktop

pixmapsdir = $(datarootdir)/icons/hicolor/48x48/apps
pixmaps_DATA = fu.png
pixmaps_DATA = fu.png fu_uploading.png

EXTRA_DIST = \
$(desktop_DATA) \
Expand Down
Binary file added fu/resources/fu_uploading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions fu/src/core/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class Config
child = child->GetNext();
}

_appIcon.LoadFile(GetIconPath("128x128", "icon.png"), wxBITMAP_TYPE_PNG);
//_appIcon.LoadFile(GetIconPath("128x128", "icon.png"), wxBITMAP_TYPE_PNG);
}

~Config()
Expand Down Expand Up @@ -202,18 +202,18 @@ class Config
_listeners.push_back(listener);
}

wxString GetIconPath(const wxString &subfolder, const wxString &iconName)
{
wxFileName tmp(_executeDir, iconName);
tmp.AppendDir("resources");
tmp.AppendDir(subfolder);
return tmp.GetFullPath();
}

wxIcon &GetAppIcon()
{
return _appIcon;
}
//wxString GetIconPath(const wxString &subfolder, const wxString &iconName)
//{
//wxFileName tmp(_executeDir, iconName);
//tmp.AppendDir("resources");
//tmp.AppendDir(subfolder);
//return tmp.GetFullPath();
//}

//wxIcon &GetAppIcon()
//{
//return _appIcon;
//}

void AddSite(Site *site)
{
Expand Down
Binary file added fu/src/fu
Binary file not shown.
2 changes: 1 addition & 1 deletion fu/src/ui/browseform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class BrowseForm : public wxDialog
public:
BrowseForm(wxPoint &pos, wxSize &size) : wxDialog(NULL, wxID_ANY, "History", pos, size, wxCAPTION | wxMAXIMIZE_BOX | wxRESIZE_BORDER | wxCLOSE_BOX)
{
SetIcon(TheConfig.GetAppIcon());
//SetIcon(TheConfig.GetAppIcon());
_chcSite = new wxChoice(this, ctlID_SITE);
_txtKeyword = new wxTextCtrl(this, wxID_ANY);
_txtKeyword->SetHint("Keyword");
Expand Down
2 changes: 1 addition & 1 deletion fu/src/ui/prefform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PrefForm : public wxDialog
public:
PrefForm(wxPoint &pos, wxSize &size) : wxDialog(NULL, wxID_ANY, "Preferences", pos, size, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
SetIcon(TheConfig.GetAppIcon());
//SetIcon(TheConfig.GetAppIcon());
_tabs = new wxNotebook(this, wxID_ANY);
_pnlSites = new SitesPanel(_tabs);
_pnlPreproc = new PreProcPanel(_tabs);
Expand Down
14 changes: 6 additions & 8 deletions fu/src/ui/tray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "../core/site.cpp"
#include "../core/uploader.cpp"
#include "../core/format.cpp"
#include "../core/converter.cpp"
#include "../core/history.cpp"
#include "../os/os.h"
#include "prefform.cpp"
Expand Down Expand Up @@ -52,8 +51,6 @@ class Tray : public wxTaskBarIcon

vector<File*> _pending, _uploading, _uploaded;
int uploadingCount = 0;
wxString _iconPath;
wxString _iconUploadingPath;

#ifdef HAVE_APPINDICATOR
AppIndicator* _indicator;
Expand All @@ -72,6 +69,8 @@ class Tray : public wxTaskBarIcon
g_signal_connect((GObject*)item->GetMenuItem(), "activate", G_CALLBACK(gtk_menu_item_selected), GINT_TO_POINTER(item->GetId()));
}
#else
wxString _iconPath;
wxString _iconUploadingPath;
wxIcon _icon;
wxIcon _iconUploading;
#endif
Expand All @@ -80,8 +79,6 @@ class Tray : public wxTaskBarIcon
{
wxLogDebug("tray icon ready");

_iconPath = TheConfig.GetIconPath("16x16", "icon.png");
_iconUploadingPath = TheConfig.GetIconPath("16x16", "icon_uploading.png");


_pref = new PrefForm(TheConfig.Position, TheConfig.Size);
Expand All @@ -98,6 +95,8 @@ class Tray : public wxTaskBarIcon
CreateIndicatorMenu();
Bind(wxEVT_UPDATE_UI, &Tray::OnUpdateMenu, this);
#else
_iconPath = TheConfig.GetIconPath("16x16", "icon.png");
_iconUploadingPath = TheConfig.GetIconPath("16x16", "icon_uploading.png");
_icon.LoadFile(_iconPath, wxBITMAP_TYPE_PNG);
_iconUploading.LoadFile(_iconUploadingPath, wxBITMAP_TYPE_PNG);
#endif
Expand All @@ -124,13 +123,12 @@ class Tray : public wxTaskBarIcon

void NormalIcon()
{
wxLogDebug("_iconPath: %s", _iconPath);
app_indicator_set_icon(_indicator, _iconPath.c_str());
app_indicator_set_icon(_indicator, "fu");
}

void UploadingIcon()
{
app_indicator_set_icon(_indicator, _iconUploadingPath.c_str());
app_indicator_set_icon(_indicator, "fu_uploading");
}
#else

Expand Down

0 comments on commit 210f156

Please sign in to comment.