Skip to content

Commit

Permalink
Some GUI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielGausi committed May 21, 2020
1 parent 2f48a83 commit f9a2338
Show file tree
Hide file tree
Showing 12 changed files with 148 additions and 107 deletions.
Binary file modified bin/Languages/de/LC_MESSAGES/default.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion src-help/nemp-help-de.tex
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ \subsubsection*{USB-Modus}

\subsubsection*{Cloud-Modus}

Für den zweiten Fall - die Cloud-Laufwerke - speichert Nemp nur relative Pfade in der Medienbibliothek. Diese werden beim Start bzw. beim Laden der Medienbibliothek passend ergänzt. Das funktioniert aber nur, solange nur ein Laufwerk für die Medienbibliothek genutzt wird. Sobald mehrere Laufwerke oder Partitionen im Spiel sind, nutze relative Pfade nichts mehr.
Für den zweiten Fall - die Cloud-Laufwerke - speichert Nemp nur relative Pfade in der Medienbibliothek. Diese werden beim Start bzw. beim Laden der Medienbibliothek passend ergänzt. Das funktioniert aber nur, solange nur ein Laufwerk für die Medienbibliothek genutzt wird. Sobald mehrere Laufwerke oder Partitionen im Spiel sind, nutzen relative Pfade nichts mehr.

Beide Varianten funktionieren in der Regel sehr gut, und stören sich auch nicht gegenseitig. In Einzelfällen können diese automatischen Korrekturverfahren aber auch unerwünschte Nebenwirkungen haben. Im ersten Fall werden z.B. zwei identische Backups der Musiksammlung auf zwei unterschiedlichen Laufwerken als \gf{verschieden} erkannt. Und bei relativen Pfaden kann die Datei mit der Medienbibliothek nicht beliebig verschoben werden. Ihre Position relativ zu den Musikdateien muss gleich bleiben.

Expand Down
16 changes: 14 additions & 2 deletions src/MainFormHelper.pas
Original file line number Diff line number Diff line change
Expand Up @@ -509,13 +509,25 @@ procedure SetTabStopsTabs;
begin
with Nemp_MainForm do
begin
// the 3 menu buttons
TabBtn_Preselection .TabStop := NempOptions.TabStopAtTabs;
TabBtn_Playlist .TabStop := NempOptions.TabStopAtTabs;
TabBtn_Medialib .TabStop := NempOptions.TabStopAtTabs;
// browse-section
TabBtn_Browse .TabStop := NempOptions.TabStopAtTabs;
TabBtn_CoverFlow.TabStop := NempOptions.TabStopAtTabs;
TabBtn_TagCloud .TabStop := NempOptions.TabStopAtTabs;
// playlist
TabBtn_Favorites.TabStop := NempOptions.TabStopAtTabs;
// media list
TabBtn_Marker .TabStop := NempOptions.TabStopAtTabs;
// file details
TabBtn_Cover .TabStop := NempOptions.TabStopAtTabs;
TabBtn_Lyrics .TabStop := NempOptions.TabStopAtTabs;
TabBtn_Equalizer.TabStop := NempOptions.TabStopAtTabs;
TabBtn_MainPlayerControl .TabStop := NempOptions.TabStopAtTabs;
// player
TabBtn_Equalizer .TabStop := NempOptions.TabStopAtTabs;
TabBtn_Headset .TabStop := NempOptions.TabStopAtTabs;
TabBtn_MainPlayerControl.TabStop := NempOptions.TabStopAtTabs;
end;
end;

Expand Down
43 changes: 24 additions & 19 deletions src/NempMainUnit.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ object Nemp_MainForm: TNemp_MainForm
BevelInner = bvRaised
BevelOuter = bvLowered
PopupMenu = PlayListPOPUP
TabOrder = 1
TabOrder = 3
OnPaint = TABPanelPaint
OwnerDraw = False
DesignSize = (
Expand All @@ -655,7 +655,7 @@ object Nemp_MainForm: TNemp_MainForm
Hint = 'Show context menu'
ParentShowHint = False
ShowHint = True
TabOrder = 2
TabOrder = 0
TabStop = False
OnClick = TabPanelPlaylistClick
DrawMode = dm_Skin
Expand All @@ -679,7 +679,7 @@ object Nemp_MainForm: TNemp_MainForm
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 0
TabOrder = 2
Text = 'Search'
OnEnter = EditPlaylistSearchEnter
OnExit = EditPlaylistSearchExit
Expand All @@ -692,7 +692,8 @@ object Nemp_MainForm: TNemp_MainForm
Width = 24
Height = 24
Hint = 'Favorite playlists'
TabOrder = 3
TabOrder = 1
TabStop = False
OnClick = TabBtn_FavoritesClick
DrawMode = dm_Skin
NumGlyphsX = 5
Expand Down Expand Up @@ -770,7 +771,7 @@ object Nemp_MainForm: TNemp_MainForm
Font.Style = []
ParentFont = False
PopupMenu = QuickSearchHistory_PopupMenu
TabOrder = 0
TabOrder = 2
OnEnter = EDITFastSearchEnter
OnExit = EDITFastSearchExit
OnKeyPress = EDITFastSearchKeyPress
Expand All @@ -785,7 +786,7 @@ object Nemp_MainForm: TNemp_MainForm
BevelInner = bvRaised
BevelOuter = bvLowered
PopupMenu = Medialist_View_PopupMenu
TabOrder = 1
TabOrder = 3
OnPaint = TABPanelPaint
OwnerDraw = False
DesignSize = (
Expand All @@ -812,7 +813,7 @@ object Nemp_MainForm: TNemp_MainForm
Hint = 'Show context menu'
ParentShowHint = False
ShowHint = True
TabOrder = 2
TabOrder = 0
TabStop = False
OnClick = TabPanelMedienlisteClick
DrawMode = dm_Skin
Expand All @@ -831,7 +832,7 @@ object Nemp_MainForm: TNemp_MainForm
Height = 24
ParentShowHint = False
ShowHint = True
TabOrder = 3
TabOrder = 1
TabStop = False
OnClick = TabBtn_MarkerClick
OnKeyPress = TabBtn_MarkerKeyPress
Expand Down Expand Up @@ -1269,7 +1270,7 @@ object Nemp_MainForm: TNemp_MainForm
BevelInner = bvRaised
BevelOuter = bvLowered
PopupMenu = Medialist_View_PopupMenu
TabOrder = 0
TabOrder = 2
StyleElements = [seClient, seBorder]
OnPaint = TABPanelPaint
OwnerDraw = False
Expand All @@ -1292,7 +1293,7 @@ object Nemp_MainForm: TNemp_MainForm
ParentShowHint = False
PopupMenu = Player_PopupMenu
ShowHint = True
TabOrder = 1
TabOrder = 0
OnClick = PlayerTabsClick
OnMouseMove = TabBtn_CoverMouseMove
DrawMode = dm_Skin
Expand All @@ -1314,7 +1315,7 @@ object Nemp_MainForm: TNemp_MainForm
ParentShowHint = False
PopupMenu = Player_PopupMenu
ShowHint = True
TabOrder = 2
TabOrder = 1
OnClick = PlayerTabsClick
OnMouseMove = TabBtn_CoverMouseMove
DrawMode = dm_Windows
Expand Down Expand Up @@ -1797,7 +1798,7 @@ object Nemp_MainForm: TNemp_MainForm
Align = alLeft
BevelInner = bvRaised
BevelOuter = bvLowered
TabOrder = 0
TabOrder = 1
OnPaint = ControlPanelPaint
OwnerDraw = False
object CoverImage: TImage
Expand All @@ -1824,9 +1825,10 @@ object Nemp_MainForm: TNemp_MainForm
BevelInner = bvRaised
BevelOuter = bvLowered
PopupMenu = PlayListPOPUP
TabOrder = 2
TabOrder = 0
OnPaint = ControlPanelPaint
OwnerDraw = False
ExplicitTop = 4
object TabBtn_MainPlayerControl: TSkinButton
Tag = 4
Left = 8
Expand Down Expand Up @@ -1903,7 +1905,7 @@ object Nemp_MainForm: TNemp_MainForm
Align = alLeft
BevelInner = bvRaised
BevelOuter = bvLowered
TabOrder = 1
TabOrder = 2
OnClick = PlayerControlPanelClick
OnDragOver = GRPBOXControlDragOver
OnPaint = ControlPanelPaint
Expand Down Expand Up @@ -3385,8 +3387,8 @@ object Nemp_MainForm: TNemp_MainForm
end
object MenuImages: TImageList
ShareImages = True
Left = 32
Top = 248
Left = 24
Top = 280
Bitmap = {
494C01012A00300B040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
000000000000360000002800000040000000B0000000010020000000000000B0
Expand Down Expand Up @@ -6749,27 +6751,30 @@ object Nemp_MainForm: TNemp_MainForm
RadioItem = True
OnClick = PM_PLM_SwitchToDefaultPlaylistClick
end
object N28: TMenuItem
Caption = '-'
end
object N19: TMenuItem
Tag = -1
Caption = '-'
end
object PM_PLM_SaveAsExistingFavorite: TMenuItem
Tag = -1
Caption = 'Save playlist ""'
OnClick = PM_PLM_SaveAsExistingFavoriteClick
end
object PM_PLM_SaveAsNewFavorite: TMenuItem
Tag = -1
Caption = 'Save current playlist as new favorite'
OnClick = PM_PLM_SaveAsNewFavoriteClick
end
object N10: TMenuItem
Tag = -1
Caption = '-'
end
object PM_PLM_RecentPlaylists: TMenuItem
Tag = -1
Caption = 'Recent playlists'
end
object PM_PLM_EditFavourites: TMenuItem
Tag = -1
Caption = 'Edit favorites'
OnClick = PM_PLM_EditFavouritesClick
end
Expand Down
102 changes: 47 additions & 55 deletions src/NempMainUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,6 @@ TNemp_MainForm = class(TNempForm)
N19: TMenuItem;
PM_PLM_EditFavourites: TMenuItem;
PM_PLM_Default: TMenuItem;
N28: TMenuItem;
PM_PL_SaveAsPlaylist: TMenuItem;
MM_PL_SaveAsPlaylist: TMenuItem;

Expand Down Expand Up @@ -10286,36 +10285,25 @@ procedure TNemp_MainForm.LoadARecentPlaylist(Sender: TObject);
var idx: integer;
restart: Boolean;
begin
idx := (Sender as TMenuItem).Tag;

if NempPlaylist.PlaylistManager.PreparePlaylistLoading(
idx,
NempPlaylist.Playlist,
NempPlaylist.PlayingIndex,
Round(NempPlaylist.PlayingTrackPos) )
then
begin
if (idx >= 0) and (idx < NempPlaylist.PlaylistManager.RecentPlaylists.Count) then
begin
idx := (Sender as TMenuItem).Tag;

if FileExists(NempPlaylist.PlaylistManager.RecentPlaylists[idx]) then
begin
restart := NempPlayer.Status = Player_ISPLAYING;
NempPlaylist.ClearPlaylist;
NempPlaylist.PlaylistManager.Reset;
NempPlaylist.LoadFromFile(NempPlaylist.PlaylistManager.RecentPlaylists[idx]);
If restart then
begin
NempPlayer.LastUserWish := USER_WANT_PLAY;
NempPlaylist.Play(0,0, True);
end
end else
begin
if TranslateMessageDLG((Playlist_FileNotFound), mtWarning, [MBYES, MBNO, MBABORT], 0) = mrYes then
NempPlaylist.PlaylistManager.DeleteRecentPlaylist(idx);
end;
end;
end;
if NempPlaylist.PlaylistManager.PrepareRecentPlaylistLoading(
idx,
NempPlaylist.Playlist,
NempPlaylist.PlayingIndex,
Round(NempPlaylist.PlayingTrackPos) )
then
begin
restart := NempPlayer.Status = Player_ISPLAYING;
NempPlaylist.ClearPlaylist;
NempPlaylist.PlaylistManager.Reset;
NempPlaylist.LoadFromFile(NempPlaylist.PlaylistManager.RecentPlaylists[idx]);
if restart then
begin
NempPlayer.LastUserWish := USER_WANT_PLAY;
NempPlaylist.Play(0,0, True);
end
end;
end;


Expand Down Expand Up @@ -10349,24 +10337,24 @@ procedure TNemp_MainForm.LoadARecentPlaylist(Sender: TObject);
aMenuItem.Caption := IntToStr(i) + ' - ' + FileList[i];
aMenuItem.Tag := i;
PM_PLM_RecentPlaylists.Add(aMenuItem);
end;

if PM_PL_RecentPlaylists.Count = 0 then
begin
aMenuItem := TMenuItem.Create(Nemp_MainForm);
aMenuItem.Caption := (Playlist_NoRecentlists);
aMenuItem.Enabled := False;
MM_PL_RecentPlaylists.Add(aMenuItem);

aMenuItem := TMenuItem.Create(Nemp_MainForm);
aMenuItem.Caption := (Playlist_NoRecentlists);
aMenuItem.Enabled := False;
PM_PL_RecentPlaylists.Add(aMenuItem);

aMenuItem := TMenuItem.Create(Nemp_MainForm);
aMenuItem.Caption := (Playlist_NoRecentlists);
aMenuItem.Enabled := False;
PM_PLM_RecentPlaylists.Add(aMenuItem);
end;
if PM_PL_RecentPlaylists.Count = 0 then
begin
aMenuItem := TMenuItem.Create(Nemp_MainForm);
aMenuItem.Caption := (Playlist_NoRecentlists);
aMenuItem.Enabled := False;
MM_PL_RecentPlaylists.Add(aMenuItem);

aMenuItem := TMenuItem.Create(Nemp_MainForm);
aMenuItem.Caption := (Playlist_NoRecentlists);
aMenuItem.Enabled := False;
PM_PL_RecentPlaylists.Add(aMenuItem);

aMenuItem := TMenuItem.Create(Nemp_MainForm);
aMenuItem.Caption := (Playlist_NoRecentlists);
aMenuItem.Enabled := False;
PM_PLM_RecentPlaylists.Add(aMenuItem);
end;
end;

Expand All @@ -10378,8 +10366,11 @@ procedure TNemp_MainForm.OnFavouritePlaylistsChange(Sender: TObject);
/// Do not use PlaylistManagerPopup.Items.Clear; here,
/// as we want some of the menu items to be fixed
/// It's maybe not the fastest way, but we don't have THAT many Items anyway
while PlaylistManagerPopup.Items.Count > 8 do
PlaylistManagerPopup.Items.Delete(2);
for i := PlaylistManagerPopup.Items.Count - 1 downto 0 do
begin
if PlaylistManagerPopup.Items[i].Tag <> -1 then
PlaylistManagerPopup.Items.Delete(i);
end;

aList := NempPlaylist.PlaylistManager.QuickLoadPlaylists;

Expand All @@ -10390,12 +10381,12 @@ procedure TNemp_MainForm.OnFavouritePlaylistsChange(Sender: TObject);
aMenuItem.Tag := i;
aMenuItem.RadioItem := True;
aMenuItem.OnClick := PM_PLM_LoadFavoritePlaylistClick;
PlaylistManagerPopup.Items.Insert(i+1, aMenuItem);
if NempPlaylist.PlaylistManager.CurrentIndex = i then
begin
aMenuItem.Default := True;
aMenuItem.Checked := True;
end;
PlaylistManagerPopup.Items.Insert(i+2, aMenuItem);
end;

if NempPlaylist.PlaylistManager.CurrentIndex = -1 then
Expand All @@ -10412,19 +10403,19 @@ procedure TNemp_MainForm.PlaylistManagerPopupPopup(Sender: TObject);
var i: Integer;
EnableElements: Boolean;
begin
EnableElements := Not NempSkin.NempPartyMode.Active;
for i := 0 to PlaylistManagerPopup.Items.Count - 1 do
PlaylistManagerPopup.Items[i].Enabled := EnableElements;

if NempPlaylist.PlaylistManager.CurrentIndex >= 0 then
begin
PM_PLM_SaveAsExistingFavorite.Caption := Format(MainForm_SavePlaylistAsExistingFavorite, [NempPlaylist.PlaylistManager.CurrentPlaylistDescription]);
PM_PLM_SaveAsExistingFavorite.Enabled := True;
PM_PLM_SaveAsExistingFavorite.Enabled := EnableElements;
end else
begin
PM_PLM_SaveAsExistingFavorite.Caption := MainForm_SavePlaylistNotAvailable;
PM_PLM_SaveAsExistingFavorite.Enabled := False;
end;

EnableElements := Not NempSkin.NempPartyMode.Active;
for i := 0 to PlaylistManagerPopup.Items.Count - 1 do
PlaylistManagerPopup.Items[i].Enabled := EnableElements;
end;

procedure TNemp_MainForm.PM_PLM_SaveAsExistingFavoriteClick(Sender: TObject);
Expand Down Expand Up @@ -10455,6 +10446,7 @@ procedure TNemp_MainForm.PM_PLM_SaveAsNewFavoriteClick(Sender: TObject);
NewFavoritePlaylistForm.edit_PlaylistDescription.Text,
NewFavoritePlaylistForm.edit_PlaylistFilename.Text,
NempPlaylist.Playlist, False);

NempPlaylist.PlaylistManager.SwitchToPlaylist(newFav);

// Refresh the Header - show a new Playlist Description in it
Expand Down
2 changes: 1 addition & 1 deletion src/Nemp_ConstantsAndTypes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2569,7 +2569,7 @@ procedure ReadNempOptions(ini: TMemIniFile; var Options: TNempOptions; var FormB
RegisterMediaHotkeys := ini.ReadBool('Allgemein', 'RegisterMediaHotkeys', True);
IgnoreVolumeUpDownKeys := ini.ReadBool('Allgemein', 'IgnoreVolumeUpDownKeys', True);
TabStopAtPlayerControls := ini.ReadBool('Allgemein', 'TabStopAtPlayerControls', True);
TabStopAtTabs := ini.ReadBool('Allgemein', 'TabStopAtTabs', False);
TabStopAtTabs := ini.ReadBool('Allgemein', 'TabStopAtTabs', True);

DisplayApp := Ini.ReadString('Allgemein', 'DisplayApp', 'NempG15App.exe');
UseDisplayApp := Ini.ReadBool('Allgemein', 'UseDisplayApp', false);
Expand Down
2 changes: 1 addition & 1 deletion src/Nemp_RessourceStrings.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ interface
//PlaylistManager_SwitchToDefaultPlaylist = 'The current playlist "%s" has been changed since it has been saved. ' +#13#10 + #13#10
// + 'Do you want to save it now and switch to the default playlist?';

PlaylistManager_PlaylistNoFound = 'The playlist file does not exist.';
PlaylistManager_PlaylistNoFound = 'The playlist file could not be found.';

PlaylistManager_DeleteFavorite = 'This will delete the playlist "%s" from your favorites. This cannot be undone.' +#13#10 + #13#10
+ 'Are you sure you want to delete the list?';
Expand Down
Loading

0 comments on commit f9a2338

Please sign in to comment.