Refresh button

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
Makemies
Posts: 23
Joined: 2004-03-21 06:06

Refresh button

Post by Makemies » 2004-07-24 14:57

I'm pretty lazy so it would be great to have a button to refresh filelist etc.
Tell me exactly how to do that. All I know that I have to add an icon to toolbar. But hopefully you can tell me what else to do :lol:.
Oh, and I'm using Microsoft Visual Studio .NET 2003 and DC++ 0.403 source now...
So it would be something like "EasyDC++" :D :D

TheParanoidOne
Forum Moderator
Posts: 1420
Joined: 2003-04-22 14:37

Post by TheParanoidOne » 2004-07-24 15:19

A typed command exists (/refresh).
A menu item exists (File --> Refresh File List)

Are these both not sufficient? If not, trace the execution of either of these to see what is called when.
The world is coming to an end. Please log off.

DC++ Guide | Words

Makemies
Posts: 23
Joined: 2004-03-21 06:06

Post by Makemies » 2004-07-24 15:36

Well, its not just the refresh button, but i'd like to add some other buttons, too.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Re: Refresh button

Post by GargoyleMT » 2004-07-24 20:45

Makemies wrote:I'm pretty lazy so it would be great to have a button to refresh filelist etc.
Tell me exactly how to do that.
Toolbar modifications were one of the first bits I did to DC++. It's not easy, but if you try to figure it out, you should be able to.

Coming back with specific questions, instead of asking us to learn for you, will garner you much friendlier help. :P

Makemies
Posts: 23
Joined: 2004-03-21 06:06

Post by Makemies » 2004-07-25 04:27

I downloaded some other clients source codes from internet that have some extra buttons. Then i tried to copy code from those and this is what i did:
Well, first I added the icon to toolbar .bmp files.
Then I added text TOOLBAR_REFRESH, // "Refresh filelist" to StringDefs.h.
Then i added this to the MainFrm.cpp:

Code: Select all

		
if(ShareManager::getInstance()->refresh() && !anyMF->ctrlToolbar.IsButtonChecked(IDC_TOOLBAR_REFRESH)) {
anyMF->ctrlToolbar.CheckButton(IDC_TOOLBAR_REFRESH,true);

What next? Did I do everything wrong? :?

EDIT: I did something else and now i get these errors:

Code: Select all

fatal error C1075: end of file found before the left brace '{' at 'windows\MainFrm.cpp(512)' was matched
fatal error C1004: unexpected end of file found
error C2601: 'MainFrame::updateTray' : local function definitions are illegal
error C2601: 'MainFrame::updateShutdown' : local function definitions are illegal
error C2601: 'MainFrame::UpdateLayout' : local function definitions are illegal
error C2601: 'MainFrame::setNormalTrayIcon' : local function definitions are illegal
error C2601: 'MainFrame::OnViewTransferView' : local function definitions are illegal
error C2601: 'MainFrame::OnViewToolBar' : local function definitions are illegal
error C2601: 'MainFrame::OnViewStatusBar' : local function definitions are illegal
error C2601: 'MainFrame::onUploadQueue' : local function definitions are illegal
error C2601: 'MainFrame::onTrayIcon' : local function definitions are illegal
error C2601: 'MainFrame::onToolbarAway' : local function definitions are illegal
error C2601: 'MainFrame::onSize' : local function definitions are illegal
error C2601: 'MainFrame::onServerSocket' : local function definitions are illegal
error C2601: 'MainFrame::onRefreshFileList' : local function definitions are illegal
error C2601: 'MainFrame::onRecents' : local function definitions are illegal
error C2601: 'MainFrame::onOpenFileList' : local function definitions are illegal
error C2601: 'MainFrame::onLink' : local function definitions are illegal
error C2601: 'MainFrame::onImport' : local function definitions are illegal
error C2601: 'MainFrame::onGetToolTip' : local function definitions are illegal
error C2601: 'MainFrame::onFinishedUploads' : local function definitions are illegal
error C2601: 'MainFrame::onFinished' : local function definitions are illegal
error C2601: 'MainFrame::onEndSession' : local function definitions are illegal
error C2601: 'MainFrame::onCloseDisconnected' : local function definitions are illegal
error C2601: 'MainFrame::OnClose' : local function definitions are illegal
error C2601: 'MainFrame::onAppCommand' : local function definitions are illegal
error C2601: 'MainFrame::onActivateApp' : local function definitions are illegal
error C2601: 'MainFrame::on' : local function definitions are illegal
error C2601: 'MainFrame::on' : local function definitions are illegal
error C2601: 'MainFrame::on' : local function definitions are illegal
error C2601: 'MainFrame::on' : local function definitions are illegal
error C2601: 'MainFrame::autoConnect' : local function definitions are illegal
error C2447: '{' : missing function header (old-style formal list?)
error C2296: '&&' : illegal, left operand has type 'void'
error C2180: controlling expression has type 'void'
error C2143: syntax error : missing ';' before '{'
error C2059: syntax error : 'if'
error C2059: syntax error : 'else'

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2004-07-25 09:10

Makemies wrote:What next? Did I do everything wrong? :?

EDIT: I did something else and now i get these errors:

Code: Select all

fatal error C1075: end of file found before the left brace '{' at 'windows\MainFrm.cpp(512)' was matched
fatal error C1004: unexpected end of file found
What you did wrong is you failed to read the error message. :)

The code snippet has no closing brace.

Also, you never added a COMMAND_ID_HANDLER to the MainFrm message map (unnecessary if you're reusing the refresh command's ID), and you never added the ID to the toolbar. If you do a simple search for "toolbar", in MainFrm, you (almost) cannot miss it.

Makemies
Posts: 23
Joined: 2004-03-21 06:06

Post by Makemies » 2004-07-26 13:52

I give up this refresh button thing, but i still have one question... My english isn't very good so this will be hard to explain, but i'll give it a try: When i open my DC++, userlist is ordered by nickname (OP:s first, then other users in alphabetical order), but i like it when its ordered by share... So is there some point in source where i can change the default order thing? If someone knows, please tell me, because this is important... I have about 50 hubs in favorites and its not fun to change the user order every time i boot DC++ :wink: I hope you understand what i'm saying :?

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2004-07-26 15:35

HubFrame.cpp

Code: Select all

ctrlUsers.setSortColumn(COLUMN_NICK);

Makemies
Posts: 23
Joined: 2004-03-21 06:06

Post by Makemies » 2004-07-26 16:31

Thanks, GargoyleMT :D... Well, that didn't quite work as i hoped, because it orders it that way that users with 0b shared comes first and i want it to be that biggest share comes first... Is there any way to do that?

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2004-07-27 20:56

No, there's no easy way. You can see that ExListViewCtrl has some members relating to sorting, but the TypedListView that the queue uses does not.

Locked